From 5abd4ddd76445d9163b121713fed6b0d92552980 Mon Sep 17 00:00:00 2001 From: directlx Date: Sat, 24 Jan 2026 19:01:24 -0500 Subject: [PATCH] Apply .gitignore to existing files --- __pycache__/config.cpython-312.pyc | Bin 1771 -> 0 bytes __pycache__/models.cpython-312.pyc | Bin 9066 -> 0 bytes node_modules/.bin/cssesc | 1 - node_modules/.bin/jiti | 1 - node_modules/.bin/nanoid | 1 - node_modules/.bin/resolve | 1 - node_modules/.bin/sucrase | 1 - node_modules/.bin/sucrase-node | 1 - node_modules/.bin/tailwind | 1 - node_modules/.bin/tailwindcss | 1 - node_modules/.package-lock.json | 998 - node_modules/@alloc/quick-lru/index.d.ts | 128 - node_modules/@alloc/quick-lru/index.js | 263 - node_modules/@alloc/quick-lru/license | 9 - node_modules/@alloc/quick-lru/package.json | 43 - node_modules/@alloc/quick-lru/readme.md | 139 - node_modules/@jridgewell/gen-mapping/LICENSE | 19 - .../@jridgewell/gen-mapping/README.md | 227 - .../gen-mapping/dist/gen-mapping.mjs | 292 - .../gen-mapping/dist/gen-mapping.mjs.map | 6 - .../gen-mapping/dist/gen-mapping.umd.js | 358 - .../gen-mapping/dist/gen-mapping.umd.js.map | 6 - .../gen-mapping/dist/types/gen-mapping.d.ts | 88 - .../gen-mapping/dist/types/set-array.d.ts | 32 - .../dist/types/sourcemap-segment.d.ts | 12 - .../gen-mapping/dist/types/types.d.ts | 43 - .../@jridgewell/gen-mapping/package.json | 67 - .../gen-mapping/src/gen-mapping.ts | 614 - .../@jridgewell/gen-mapping/src/set-array.ts | 82 - .../gen-mapping/src/sourcemap-segment.ts | 16 - .../@jridgewell/gen-mapping/src/types.ts | 61 - .../gen-mapping/types/gen-mapping.d.cts | 89 - .../gen-mapping/types/gen-mapping.d.cts.map | 1 - .../gen-mapping/types/gen-mapping.d.mts | 89 - .../gen-mapping/types/gen-mapping.d.mts.map | 1 - .../gen-mapping/types/set-array.d.cts | 33 - .../gen-mapping/types/set-array.d.cts.map | 1 - .../gen-mapping/types/set-array.d.mts | 33 - .../gen-mapping/types/set-array.d.mts.map | 1 - .../gen-mapping/types/sourcemap-segment.d.cts | 13 - .../types/sourcemap-segment.d.cts.map | 1 - .../gen-mapping/types/sourcemap-segment.d.mts | 13 - .../types/sourcemap-segment.d.mts.map | 1 - .../@jridgewell/gen-mapping/types/types.d.cts | 44 - .../gen-mapping/types/types.d.cts.map | 1 - .../@jridgewell/gen-mapping/types/types.d.mts | 44 - .../gen-mapping/types/types.d.mts.map | 1 - node_modules/@jridgewell/resolve-uri/LICENSE | 19 - .../@jridgewell/resolve-uri/README.md | 40 - .../resolve-uri/dist/resolve-uri.mjs | 232 - .../resolve-uri/dist/resolve-uri.mjs.map | 1 - .../resolve-uri/dist/resolve-uri.umd.js | 240 - .../resolve-uri/dist/resolve-uri.umd.js.map | 1 - .../resolve-uri/dist/types/resolve-uri.d.ts | 4 - .../@jridgewell/resolve-uri/package.json | 69 - .../@jridgewell/sourcemap-codec/LICENSE | 19 - .../@jridgewell/sourcemap-codec/README.md | 264 - .../sourcemap-codec/dist/sourcemap-codec.mjs | 423 - .../dist/sourcemap-codec.mjs.map | 6 - .../dist/sourcemap-codec.umd.js | 464 - .../dist/sourcemap-codec.umd.js.map | 6 - .../@jridgewell/sourcemap-codec/package.json | 63 - .../@jridgewell/sourcemap-codec/src/scopes.ts | 345 - .../sourcemap-codec/src/sourcemap-codec.ts | 111 - .../sourcemap-codec/src/strings.ts | 65 - .../@jridgewell/sourcemap-codec/src/vlq.ts | 55 - .../sourcemap-codec/types/scopes.d.cts | 50 - .../sourcemap-codec/types/scopes.d.cts.map | 1 - .../sourcemap-codec/types/scopes.d.mts | 50 - .../sourcemap-codec/types/scopes.d.mts.map | 1 - .../types/sourcemap-codec.d.cts | 9 - .../types/sourcemap-codec.d.cts.map | 1 - .../types/sourcemap-codec.d.mts | 9 - .../types/sourcemap-codec.d.mts.map | 1 - .../sourcemap-codec/types/strings.d.cts | 16 - .../sourcemap-codec/types/strings.d.cts.map | 1 - .../sourcemap-codec/types/strings.d.mts | 16 - .../sourcemap-codec/types/strings.d.mts.map | 1 - .../sourcemap-codec/types/vlq.d.cts | 7 - .../sourcemap-codec/types/vlq.d.cts.map | 1 - .../sourcemap-codec/types/vlq.d.mts | 7 - .../sourcemap-codec/types/vlq.d.mts.map | 1 - .../@jridgewell/trace-mapping/LICENSE | 19 - .../@jridgewell/trace-mapping/README.md | 348 - .../trace-mapping/dist/trace-mapping.mjs | 493 - .../trace-mapping/dist/trace-mapping.mjs.map | 6 - .../trace-mapping/dist/trace-mapping.umd.js | 559 - .../dist/trace-mapping.umd.js.map | 6 - .../@jridgewell/trace-mapping/package.json | 67 - .../trace-mapping/src/binary-search.ts | 115 - .../trace-mapping/src/by-source.ts | 41 - .../trace-mapping/src/flatten-map.ts | 192 - .../@jridgewell/trace-mapping/src/resolve.ts | 16 - .../@jridgewell/trace-mapping/src/sort.ts | 45 - .../trace-mapping/src/sourcemap-segment.ts | 23 - .../trace-mapping/src/strip-filename.ts | 8 - .../trace-mapping/src/trace-mapping.ts | 502 - .../@jridgewell/trace-mapping/src/types.ts | 114 - .../trace-mapping/types/binary-search.d.cts | 33 - .../types/binary-search.d.cts.map | 1 - .../trace-mapping/types/binary-search.d.mts | 33 - .../types/binary-search.d.mts.map | 1 - .../trace-mapping/types/by-source.d.cts | 4 - .../trace-mapping/types/by-source.d.cts.map | 1 - .../trace-mapping/types/by-source.d.mts | 4 - .../trace-mapping/types/by-source.d.mts.map | 1 - .../trace-mapping/types/flatten-map.d.cts | 9 - .../trace-mapping/types/flatten-map.d.cts.map | 1 - .../trace-mapping/types/flatten-map.d.mts | 9 - .../trace-mapping/types/flatten-map.d.mts.map | 1 - .../trace-mapping/types/resolve.d.cts | 4 - .../trace-mapping/types/resolve.d.cts.map | 1 - .../trace-mapping/types/resolve.d.mts | 4 - .../trace-mapping/types/resolve.d.mts.map | 1 - .../trace-mapping/types/sort.d.cts | 4 - .../trace-mapping/types/sort.d.cts.map | 1 - .../trace-mapping/types/sort.d.mts | 4 - .../trace-mapping/types/sort.d.mts.map | 1 - .../types/sourcemap-segment.d.cts | 17 - .../types/sourcemap-segment.d.cts.map | 1 - .../types/sourcemap-segment.d.mts | 17 - .../types/sourcemap-segment.d.mts.map | 1 - .../trace-mapping/types/strip-filename.d.cts | 5 - .../types/strip-filename.d.cts.map | 1 - .../trace-mapping/types/strip-filename.d.mts | 5 - .../types/strip-filename.d.mts.map | 1 - .../trace-mapping/types/trace-mapping.d.cts | 80 - .../types/trace-mapping.d.cts.map | 1 - .../trace-mapping/types/trace-mapping.d.mts | 80 - .../types/trace-mapping.d.mts.map | 1 - .../trace-mapping/types/types.d.cts | 107 - .../trace-mapping/types/types.d.cts.map | 1 - .../trace-mapping/types/types.d.mts | 107 - .../trace-mapping/types/types.d.mts.map | 1 - node_modules/@nodelib/fs.scandir/LICENSE | 21 - node_modules/@nodelib/fs.scandir/README.md | 171 - .../@nodelib/fs.scandir/out/adapters/fs.d.ts | 20 - .../@nodelib/fs.scandir/out/adapters/fs.js | 19 - .../@nodelib/fs.scandir/out/constants.d.ts | 4 - .../@nodelib/fs.scandir/out/constants.js | 17 - .../@nodelib/fs.scandir/out/index.d.ts | 12 - node_modules/@nodelib/fs.scandir/out/index.js | 26 - .../fs.scandir/out/providers/async.d.ts | 7 - .../fs.scandir/out/providers/async.js | 104 - .../fs.scandir/out/providers/common.d.ts | 1 - .../fs.scandir/out/providers/common.js | 13 - .../fs.scandir/out/providers/sync.d.ts | 5 - .../@nodelib/fs.scandir/out/providers/sync.js | 54 - .../@nodelib/fs.scandir/out/settings.d.ts | 20 - .../@nodelib/fs.scandir/out/settings.js | 24 - .../@nodelib/fs.scandir/out/types/index.d.ts | 20 - .../@nodelib/fs.scandir/out/types/index.js | 2 - .../@nodelib/fs.scandir/out/utils/fs.d.ts | 2 - .../@nodelib/fs.scandir/out/utils/fs.js | 19 - .../@nodelib/fs.scandir/out/utils/index.d.ts | 2 - .../@nodelib/fs.scandir/out/utils/index.js | 5 - node_modules/@nodelib/fs.scandir/package.json | 44 - node_modules/@nodelib/fs.stat/LICENSE | 21 - node_modules/@nodelib/fs.stat/README.md | 126 - .../@nodelib/fs.stat/out/adapters/fs.d.ts | 13 - .../@nodelib/fs.stat/out/adapters/fs.js | 17 - node_modules/@nodelib/fs.stat/out/index.d.ts | 12 - node_modules/@nodelib/fs.stat/out/index.js | 26 - .../@nodelib/fs.stat/out/providers/async.d.ts | 4 - .../@nodelib/fs.stat/out/providers/async.js | 36 - .../@nodelib/fs.stat/out/providers/sync.d.ts | 3 - .../@nodelib/fs.stat/out/providers/sync.js | 23 - .../@nodelib/fs.stat/out/settings.d.ts | 16 - node_modules/@nodelib/fs.stat/out/settings.js | 16 - .../@nodelib/fs.stat/out/types/index.d.ts | 4 - .../@nodelib/fs.stat/out/types/index.js | 2 - node_modules/@nodelib/fs.stat/package.json | 37 - node_modules/@nodelib/fs.walk/LICENSE | 21 - node_modules/@nodelib/fs.walk/README.md | 215 - node_modules/@nodelib/fs.walk/out/index.d.ts | 14 - node_modules/@nodelib/fs.walk/out/index.js | 34 - .../@nodelib/fs.walk/out/providers/async.d.ts | 12 - .../@nodelib/fs.walk/out/providers/async.js | 30 - .../@nodelib/fs.walk/out/providers/index.d.ts | 4 - .../@nodelib/fs.walk/out/providers/index.js | 9 - .../fs.walk/out/providers/stream.d.ts | 12 - .../@nodelib/fs.walk/out/providers/stream.js | 34 - .../@nodelib/fs.walk/out/providers/sync.d.ts | 10 - .../@nodelib/fs.walk/out/providers/sync.js | 14 - .../@nodelib/fs.walk/out/readers/async.d.ts | 30 - .../@nodelib/fs.walk/out/readers/async.js | 97 - .../@nodelib/fs.walk/out/readers/common.d.ts | 7 - .../@nodelib/fs.walk/out/readers/common.js | 31 - .../@nodelib/fs.walk/out/readers/reader.d.ts | 6 - .../@nodelib/fs.walk/out/readers/reader.js | 11 - .../@nodelib/fs.walk/out/readers/sync.d.ts | 15 - .../@nodelib/fs.walk/out/readers/sync.js | 59 - .../@nodelib/fs.walk/out/settings.d.ts | 30 - node_modules/@nodelib/fs.walk/out/settings.js | 26 - .../@nodelib/fs.walk/out/types/index.d.ts | 8 - .../@nodelib/fs.walk/out/types/index.js | 2 - node_modules/@nodelib/fs.walk/package.json | 44 - node_modules/any-promise/.jshintrc | 4 - node_modules/any-promise/.npmignore | 7 - node_modules/any-promise/LICENSE | 19 - node_modules/any-promise/README.md | 161 - node_modules/any-promise/implementation.d.ts | 3 - node_modules/any-promise/implementation.js | 1 - node_modules/any-promise/index.d.ts | 73 - node_modules/any-promise/index.js | 1 - node_modules/any-promise/loader.js | 78 - node_modules/any-promise/optional.js | 6 - node_modules/any-promise/package.json | 45 - node_modules/any-promise/register-shim.js | 18 - node_modules/any-promise/register.d.ts | 17 - node_modules/any-promise/register.js | 94 - .../any-promise/register/bluebird.d.ts | 1 - node_modules/any-promise/register/bluebird.js | 2 - .../any-promise/register/es6-promise.d.ts | 1 - .../any-promise/register/es6-promise.js | 2 - node_modules/any-promise/register/lie.d.ts | 1 - node_modules/any-promise/register/lie.js | 2 - .../register/native-promise-only.d.ts | 1 - .../register/native-promise-only.js | 2 - node_modules/any-promise/register/pinkie.d.ts | 1 - node_modules/any-promise/register/pinkie.js | 2 - .../any-promise/register/promise.d.ts | 1 - node_modules/any-promise/register/promise.js | 2 - node_modules/any-promise/register/q.d.ts | 1 - node_modules/any-promise/register/q.js | 2 - node_modules/any-promise/register/rsvp.d.ts | 1 - node_modules/any-promise/register/rsvp.js | 2 - node_modules/any-promise/register/vow.d.ts | 1 - node_modules/any-promise/register/vow.js | 2 - node_modules/any-promise/register/when.d.ts | 1 - node_modules/any-promise/register/when.js | 2 - node_modules/anymatch/LICENSE | 15 - node_modules/anymatch/README.md | 87 - node_modules/anymatch/index.d.ts | 20 - node_modules/anymatch/index.js | 104 - node_modules/anymatch/package.json | 48 - node_modules/arg/LICENSE.md | 21 - node_modules/arg/README.md | 317 - node_modules/arg/index.d.ts | 44 - node_modules/arg/index.js | 195 - node_modules/arg/package.json | 28 - .../binary-extensions/binary-extensions.json | 263 - .../binary-extensions.json.d.ts | 3 - node_modules/binary-extensions/index.d.ts | 14 - node_modules/binary-extensions/index.js | 1 - node_modules/binary-extensions/license | 10 - node_modules/binary-extensions/package.json | 40 - node_modules/binary-extensions/readme.md | 25 - node_modules/braces/LICENSE | 21 - node_modules/braces/README.md | 586 - node_modules/braces/index.js | 170 - node_modules/braces/lib/compile.js | 60 - node_modules/braces/lib/constants.js | 57 - node_modules/braces/lib/expand.js | 113 - node_modules/braces/lib/parse.js | 331 - node_modules/braces/lib/stringify.js | 32 - node_modules/braces/lib/utils.js | 122 - node_modules/braces/package.json | 77 - node_modules/camelcase-css/README.md | 27 - node_modules/camelcase-css/index-es5.js | 24 - node_modules/camelcase-css/index.js | 30 - node_modules/camelcase-css/license | 21 - node_modules/camelcase-css/package.json | 34 - node_modules/chokidar/LICENSE | 21 - node_modules/chokidar/README.md | 308 - node_modules/chokidar/index.js | 973 - node_modules/chokidar/lib/constants.js | 66 - node_modules/chokidar/lib/fsevents-handler.js | 526 - node_modules/chokidar/lib/nodefs-handler.js | 654 - .../node_modules/glob-parent/CHANGELOG.md | 110 - .../chokidar/node_modules/glob-parent/LICENSE | 15 - .../node_modules/glob-parent/README.md | 137 - .../node_modules/glob-parent/index.js | 42 - .../node_modules/glob-parent/package.json | 48 - node_modules/chokidar/package.json | 70 - node_modules/chokidar/types/index.d.ts | 192 - node_modules/commander/CHANGELOG.md | 436 - node_modules/commander/LICENSE | 22 - node_modules/commander/Readme.md | 713 - node_modules/commander/index.js | 1649 - node_modules/commander/package.json | 41 - node_modules/commander/typings/index.d.ts | 311 - node_modules/cssesc/LICENSE-MIT.txt | 20 - node_modules/cssesc/README.md | 201 - node_modules/cssesc/bin/cssesc | 116 - node_modules/cssesc/cssesc.js | 110 - node_modules/cssesc/man/cssesc.1 | 70 - node_modules/cssesc/package.json | 51 - node_modules/didyoumean/LICENSE | 14 - node_modules/didyoumean/README.md | 134 - node_modules/didyoumean/didYouMean-1.2.1.js | 274 - .../didyoumean/didYouMean-1.2.1.min.js | 17 - node_modules/didyoumean/package.json | 27 - node_modules/dlv/README.md | 76 - node_modules/dlv/dist/dlv.es.js | 2 - node_modules/dlv/dist/dlv.es.js.map | 1 - node_modules/dlv/dist/dlv.js | 2 - node_modules/dlv/dist/dlv.js.map | 1 - node_modules/dlv/dist/dlv.umd.js | 2 - node_modules/dlv/dist/dlv.umd.js.map | 1 - node_modules/dlv/index.js | 7 - node_modules/dlv/package.json | 30 - node_modules/fast-glob/LICENSE | 21 - node_modules/fast-glob/README.md | 830 - .../node_modules/glob-parent/CHANGELOG.md | 110 - .../node_modules/glob-parent/LICENSE | 15 - .../node_modules/glob-parent/README.md | 137 - .../node_modules/glob-parent/index.js | 42 - .../node_modules/glob-parent/package.json | 48 - node_modules/fast-glob/out/index.d.ts | 40 - node_modules/fast-glob/out/index.js | 102 - .../fast-glob/out/managers/tasks.d.ts | 22 - node_modules/fast-glob/out/managers/tasks.js | 110 - .../fast-glob/out/providers/async.d.ts | 9 - node_modules/fast-glob/out/providers/async.js | 23 - .../fast-glob/out/providers/filters/deep.d.ts | 16 - .../fast-glob/out/providers/filters/deep.js | 62 - .../out/providers/filters/entry.d.ts | 17 - .../fast-glob/out/providers/filters/entry.js | 85 - .../out/providers/filters/error.d.ts | 8 - .../fast-glob/out/providers/filters/error.js | 15 - .../out/providers/matchers/matcher.d.ts | 33 - .../out/providers/matchers/matcher.js | 45 - .../out/providers/matchers/partial.d.ts | 4 - .../out/providers/matchers/partial.js | 38 - .../fast-glob/out/providers/provider.d.ts | 19 - .../fast-glob/out/providers/provider.js | 48 - .../fast-glob/out/providers/stream.d.ts | 11 - .../fast-glob/out/providers/stream.js | 31 - .../fast-glob/out/providers/sync.d.ts | 9 - node_modules/fast-glob/out/providers/sync.js | 23 - .../out/providers/transformers/entry.d.ts | 8 - .../out/providers/transformers/entry.js | 26 - node_modules/fast-glob/out/readers/async.d.ts | 10 - node_modules/fast-glob/out/readers/async.js | 35 - .../fast-glob/out/readers/reader.d.ts | 15 - node_modules/fast-glob/out/readers/reader.js | 33 - .../fast-glob/out/readers/stream.d.ts | 14 - node_modules/fast-glob/out/readers/stream.js | 55 - node_modules/fast-glob/out/readers/sync.d.ts | 12 - node_modules/fast-glob/out/readers/sync.js | 43 - node_modules/fast-glob/out/settings.d.ts | 164 - node_modules/fast-glob/out/settings.js | 59 - node_modules/fast-glob/out/types/index.d.ts | 31 - node_modules/fast-glob/out/types/index.js | 2 - node_modules/fast-glob/out/utils/array.d.ts | 2 - node_modules/fast-glob/out/utils/array.js | 22 - node_modules/fast-glob/out/utils/errno.d.ts | 2 - node_modules/fast-glob/out/utils/errno.js | 7 - node_modules/fast-glob/out/utils/fs.d.ts | 4 - node_modules/fast-glob/out/utils/fs.js | 19 - node_modules/fast-glob/out/utils/index.d.ts | 8 - node_modules/fast-glob/out/utils/index.js | 17 - node_modules/fast-glob/out/utils/path.d.ts | 13 - node_modules/fast-glob/out/utils/path.js | 68 - node_modules/fast-glob/out/utils/pattern.d.ts | 49 - node_modules/fast-glob/out/utils/pattern.js | 206 - node_modules/fast-glob/out/utils/stream.d.ts | 4 - node_modules/fast-glob/out/utils/stream.js | 17 - node_modules/fast-glob/out/utils/string.d.ts | 2 - node_modules/fast-glob/out/utils/string.js | 11 - node_modules/fast-glob/package.json | 81 - node_modules/fastq/LICENSE | 13 - node_modules/fastq/README.md | 310 - node_modules/fastq/SECURITY.md | 15 - node_modules/fastq/bench.js | 66 - node_modules/fastq/eslint.config.js | 11 - node_modules/fastq/example.js | 14 - node_modules/fastq/example.mjs | 9 - node_modules/fastq/index.d.ts | 59 - node_modules/fastq/package.json | 49 - node_modules/fastq/queue.js | 346 - node_modules/fastq/test/example.ts | 83 - node_modules/fastq/test/promise.js | 325 - node_modules/fastq/test/test.js | 733 - node_modules/fastq/test/tsconfig.json | 11 - node_modules/fill-range/LICENSE | 21 - node_modules/fill-range/README.md | 237 - node_modules/fill-range/index.js | 248 - node_modules/fill-range/package.json | 74 - 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-parent/LICENSE | 15 - node_modules/glob-parent/README.md | 134 - node_modules/glob-parent/index.js | 75 - node_modules/glob-parent/package.json | 54 - node_modules/hasown/.eslintrc | 5 - node_modules/hasown/.github/FUNDING.yml | 12 - node_modules/hasown/.nycrc | 13 - node_modules/hasown/CHANGELOG.md | 40 - node_modules/hasown/LICENSE | 21 - node_modules/hasown/README.md | 40 - node_modules/hasown/index.d.ts | 3 - node_modules/hasown/index.js | 8 - node_modules/hasown/package.json | 92 - node_modules/hasown/tsconfig.json | 6 - node_modules/is-binary-path/index.d.ts | 17 - node_modules/is-binary-path/index.js | 7 - node_modules/is-binary-path/license | 9 - node_modules/is-binary-path/package.json | 40 - node_modules/is-binary-path/readme.md | 34 - node_modules/is-core-module/.eslintrc | 18 - node_modules/is-core-module/.nycrc | 9 - node_modules/is-core-module/CHANGELOG.md | 218 - node_modules/is-core-module/LICENSE | 20 - node_modules/is-core-module/README.md | 40 - node_modules/is-core-module/core.json | 162 - node_modules/is-core-module/index.js | 69 - node_modules/is-core-module/package.json | 76 - node_modules/is-core-module/test/index.js | 157 - node_modules/is-extglob/LICENSE | 21 - node_modules/is-extglob/README.md | 107 - node_modules/is-extglob/index.js | 20 - node_modules/is-extglob/package.json | 69 - node_modules/is-glob/LICENSE | 21 - node_modules/is-glob/README.md | 206 - node_modules/is-glob/index.js | 150 - node_modules/is-glob/package.json | 81 - node_modules/is-number/LICENSE | 21 - node_modules/is-number/README.md | 187 - node_modules/is-number/index.js | 18 - node_modules/is-number/package.json | 82 - node_modules/jiti/LICENSE | 21 - node_modules/jiti/README.md | 164 - node_modules/jiti/bin/jiti.js | 16 - node_modules/jiti/dist/babel.d.ts | 2 - node_modules/jiti/dist/babel.js | 227 - node_modules/jiti/dist/jiti.d.ts | 20 - node_modules/jiti/dist/jiti.js | 1 - .../babel-plugin-transform-import-meta.d.ts | 4 - .../jiti/dist/plugins/import-meta-env.d.ts | 5 - node_modules/jiti/dist/types.d.ts | 35 - node_modules/jiti/dist/utils.d.ts | 8 - node_modules/jiti/lib/index.js | 15 - node_modules/jiti/package.json | 81 - node_modules/jiti/register.js | 3 - node_modules/lilconfig/LICENSE | 21 - node_modules/lilconfig/package.json | 42 - node_modules/lilconfig/readme.md | 98 - node_modules/lilconfig/src/index.d.ts | 54 - node_modules/lilconfig/src/index.js | 460 - node_modules/lines-and-columns/LICENSE | 21 - node_modules/lines-and-columns/README.md | 33 - .../lines-and-columns/build/index.d.ts | 13 - node_modules/lines-and-columns/build/index.js | 62 - node_modules/lines-and-columns/package.json | 49 - node_modules/merge2/LICENSE | 21 - node_modules/merge2/README.md | 144 - node_modules/merge2/index.js | 144 - node_modules/merge2/package.json | 43 - node_modules/micromatch/LICENSE | 21 - node_modules/micromatch/README.md | 1024 - node_modules/micromatch/index.js | 474 - node_modules/micromatch/package.json | 119 - node_modules/mz/HISTORY.md | 66 - node_modules/mz/LICENSE | 22 - node_modules/mz/README.md | 106 - node_modules/mz/child_process.js | 8 - node_modules/mz/crypto.js | 9 - node_modules/mz/dns.js | 16 - node_modules/mz/fs.js | 62 - node_modules/mz/index.js | 8 - node_modules/mz/package.json | 44 - node_modules/mz/readline.js | 64 - node_modules/mz/zlib.js | 13 - node_modules/nanoid/LICENSE | 20 - node_modules/nanoid/README.md | 39 - node_modules/nanoid/async/index.browser.cjs | 69 - node_modules/nanoid/async/index.browser.js | 34 - node_modules/nanoid/async/index.cjs | 71 - node_modules/nanoid/async/index.d.ts | 56 - node_modules/nanoid/async/index.js | 35 - node_modules/nanoid/async/index.native.js | 26 - node_modules/nanoid/async/package.json | 12 - node_modules/nanoid/bin/nanoid.cjs | 55 - node_modules/nanoid/index.browser.cjs | 72 - node_modules/nanoid/index.browser.js | 34 - node_modules/nanoid/index.cjs | 85 - node_modules/nanoid/index.d.cts | 91 - node_modules/nanoid/index.d.ts | 91 - node_modules/nanoid/index.js | 45 - node_modules/nanoid/nanoid.js | 1 - node_modules/nanoid/non-secure/index.cjs | 34 - node_modules/nanoid/non-secure/index.d.ts | 33 - node_modules/nanoid/non-secure/index.js | 21 - node_modules/nanoid/non-secure/package.json | 6 - node_modules/nanoid/package.json | 89 - node_modules/nanoid/url-alphabet/index.cjs | 7 - node_modules/nanoid/url-alphabet/index.js | 3 - node_modules/nanoid/url-alphabet/package.json | 6 - node_modules/normalize-path/LICENSE | 21 - node_modules/normalize-path/README.md | 127 - node_modules/normalize-path/index.js | 35 - node_modules/normalize-path/package.json | 77 - node_modules/object-assign/index.js | 90 - node_modules/object-assign/license | 21 - node_modules/object-assign/package.json | 42 - node_modules/object-assign/readme.md | 61 - node_modules/object-hash/LICENSE | 22 - node_modules/object-hash/dist/object_hash.js | 1 - node_modules/object-hash/index.js | 453 - node_modules/object-hash/package.json | 53 - node_modules/object-hash/readme.markdown | 198 - 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 | 75 - node_modules/picocolors/types.d.ts | 51 - node_modules/picomatch/CHANGELOG.md | 136 - node_modules/picomatch/LICENSE | 21 - node_modules/picomatch/README.md | 708 - node_modules/picomatch/index.js | 3 - node_modules/picomatch/lib/constants.js | 179 - node_modules/picomatch/lib/parse.js | 1091 - node_modules/picomatch/lib/picomatch.js | 342 - node_modules/picomatch/lib/scan.js | 391 - node_modules/picomatch/lib/utils.js | 64 - node_modules/picomatch/package.json | 81 - node_modules/pify/index.js | 68 - node_modules/pify/license | 21 - node_modules/pify/package.json | 48 - node_modules/pify/readme.md | 119 - node_modules/pirates/LICENSE | 21 - node_modules/pirates/README.md | 73 - node_modules/pirates/index.d.ts | 82 - node_modules/pirates/lib/index.js | 155 - node_modules/pirates/package.json | 43 - node_modules/postcss-import/LICENSE | 20 - node_modules/postcss-import/README.md | 244 - node_modules/postcss-import/index.js | 420 - .../postcss-import/lib/assign-layer-names.js | 17 - node_modules/postcss-import/lib/data-url.js | 17 - node_modules/postcss-import/lib/join-layer.js | 9 - node_modules/postcss-import/lib/join-media.js | 28 - .../postcss-import/lib/load-content.js | 12 - .../postcss-import/lib/parse-statements.js | 172 - .../postcss-import/lib/process-content.js | 59 - node_modules/postcss-import/lib/resolve-id.js | 42 - node_modules/postcss-import/package.json | 65 - node_modules/postcss-js/LICENSE | 20 - node_modules/postcss-js/README.md | 22 - node_modules/postcss-js/async.js | 15 - node_modules/postcss-js/index.js | 11 - node_modules/postcss-js/index.mjs | 8 - node_modules/postcss-js/objectifier.js | 93 - node_modules/postcss-js/package.json | 48 - node_modules/postcss-js/parser.js | 104 - node_modules/postcss-js/process-result.js | 11 - node_modules/postcss-js/sync.js | 12 - node_modules/postcss-load-config/LICENSE | 20 - node_modules/postcss-load-config/README.md | 474 - node_modules/postcss-load-config/package.json | 61 - .../postcss-load-config/src/index.d.ts | 65 - node_modules/postcss-load-config/src/index.js | 178 - .../postcss-load-config/src/options.js | 48 - .../postcss-load-config/src/plugins.js | 89 - node_modules/postcss-load-config/src/req.js | 62 - node_modules/postcss-nested/LICENSE | 20 - node_modules/postcss-nested/README.md | 85 - node_modules/postcss-nested/index.d.ts | 41 - node_modules/postcss-nested/index.js | 361 - node_modules/postcss-nested/package.json | 34 - node_modules/postcss-selector-parser/API.md | 872 - .../postcss-selector-parser/CHANGELOG.md | 549 - .../postcss-selector-parser/LICENSE-MIT | 22 - .../postcss-selector-parser/README.md | 49 - .../postcss-selector-parser/dist/index.js | 17 - .../postcss-selector-parser/dist/parser.js | 1015 - .../postcss-selector-parser/dist/processor.js | 170 - .../dist/selectors/attribute.js | 448 - .../dist/selectors/className.js | 50 - .../dist/selectors/combinator.js | 21 - .../dist/selectors/comment.js | 21 - .../dist/selectors/constructors.js | 65 - .../dist/selectors/container.js | 308 - .../dist/selectors/guards.js | 58 - .../dist/selectors/id.js | 25 - .../dist/selectors/index.js | 21 - .../dist/selectors/namespace.js | 80 - .../dist/selectors/nesting.js | 22 - .../dist/selectors/node.js | 192 - .../dist/selectors/pseudo.js | 26 - .../dist/selectors/root.js | 44 - .../dist/selectors/selector.js | 21 - .../dist/selectors/string.js | 21 - .../dist/selectors/tag.js | 21 - .../dist/selectors/types.js | 28 - .../dist/selectors/universal.js | 22 - .../dist/sortAscending.js | 11 - .../dist/tokenTypes.js | 70 - .../postcss-selector-parser/dist/tokenize.js | 239 - .../dist/util/ensureObject.js | 17 - .../dist/util/getProp.js | 18 - .../dist/util/index.js | 13 - .../dist/util/stripComments.js | 21 - .../dist/util/unesc.js | 76 - .../postcss-selector-parser/package.json | 80 - .../postcss-selector-parser.d.ts | 555 - node_modules/postcss-value-parser/LICENSE | 22 - node_modules/postcss-value-parser/README.md | 263 - .../postcss-value-parser/lib/index.d.ts | 177 - .../postcss-value-parser/lib/index.js | 28 - .../postcss-value-parser/lib/parse.js | 321 - .../postcss-value-parser/lib/stringify.js | 48 - node_modules/postcss-value-parser/lib/unit.js | 120 - node_modules/postcss-value-parser/lib/walk.js | 22 - .../postcss-value-parser/package.json | 58 - node_modules/postcss/LICENSE | 20 - node_modules/postcss/README.md | 29 - node_modules/postcss/lib/at-rule.d.ts | 140 - node_modules/postcss/lib/at-rule.js | 25 - node_modules/postcss/lib/comment.d.ts | 68 - node_modules/postcss/lib/comment.js | 13 - node_modules/postcss/lib/container.d.ts | 483 - node_modules/postcss/lib/container.js | 447 - .../postcss/lib/css-syntax-error.d.ts | 248 - node_modules/postcss/lib/css-syntax-error.js | 133 - node_modules/postcss/lib/declaration.d.ts | 151 - node_modules/postcss/lib/declaration.js | 24 - node_modules/postcss/lib/document.d.ts | 69 - node_modules/postcss/lib/document.js | 33 - node_modules/postcss/lib/fromJSON.d.ts | 9 - node_modules/postcss/lib/fromJSON.js | 54 - node_modules/postcss/lib/input.d.ts | 227 - node_modules/postcss/lib/input.js | 265 - node_modules/postcss/lib/lazy-result.d.ts | 190 - node_modules/postcss/lib/lazy-result.js | 550 - node_modules/postcss/lib/list.d.ts | 60 - node_modules/postcss/lib/list.js | 58 - node_modules/postcss/lib/map-generator.js | 368 - node_modules/postcss/lib/no-work-result.d.ts | 46 - node_modules/postcss/lib/no-work-result.js | 138 - node_modules/postcss/lib/node.d.ts | 556 - node_modules/postcss/lib/node.js | 449 - node_modules/postcss/lib/parse.d.ts | 9 - node_modules/postcss/lib/parse.js | 42 - node_modules/postcss/lib/parser.js | 611 - node_modules/postcss/lib/postcss.d.mts | 69 - node_modules/postcss/lib/postcss.d.ts | 458 - node_modules/postcss/lib/postcss.js | 101 - node_modules/postcss/lib/postcss.mjs | 30 - node_modules/postcss/lib/previous-map.d.ts | 81 - node_modules/postcss/lib/previous-map.js | 144 - node_modules/postcss/lib/processor.d.ts | 115 - node_modules/postcss/lib/processor.js | 67 - node_modules/postcss/lib/result.d.ts | 205 - node_modules/postcss/lib/result.js | 42 - node_modules/postcss/lib/root.d.ts | 87 - node_modules/postcss/lib/root.js | 61 - node_modules/postcss/lib/rule.d.ts | 126 - node_modules/postcss/lib/rule.js | 27 - node_modules/postcss/lib/stringifier.d.ts | 46 - node_modules/postcss/lib/stringifier.js | 353 - node_modules/postcss/lib/stringify.d.ts | 9 - node_modules/postcss/lib/stringify.js | 11 - node_modules/postcss/lib/symbols.js | 5 - .../postcss/lib/terminal-highlight.js | 70 - node_modules/postcss/lib/tokenize.js | 266 - node_modules/postcss/lib/warn-once.js | 13 - node_modules/postcss/lib/warning.d.ts | 147 - node_modules/postcss/lib/warning.js | 37 - node_modules/postcss/package.json | 88 - node_modules/queue-microtask/LICENSE | 20 - node_modules/queue-microtask/README.md | 90 - node_modules/queue-microtask/index.d.ts | 2 - node_modules/queue-microtask/index.js | 9 - node_modules/queue-microtask/package.json | 55 - node_modules/read-cache/LICENSE | 20 - node_modules/read-cache/README.md | 46 - node_modules/read-cache/index.js | 78 - node_modules/read-cache/package.json | 34 - node_modules/readdirp/LICENSE | 21 - node_modules/readdirp/README.md | 122 - node_modules/readdirp/index.d.ts | 43 - node_modules/readdirp/index.js | 287 - node_modules/readdirp/package.json | 122 - node_modules/resolve/.editorconfig | 37 - node_modules/resolve/.eslintrc | 65 - node_modules/resolve/.github/FUNDING.yml | 12 - .../.github/INCIDENT_RESPONSE_PROCESS.md | 119 - node_modules/resolve/.github/THREAT_MODEL.md | 74 - node_modules/resolve/LICENSE | 21 - node_modules/resolve/SECURITY.md | 11 - 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 | 333 - node_modules/resolve/lib/caller.js | 8 - node_modules/resolve/lib/core.js | 12 - node_modules/resolve/lib/core.json | 162 - node_modules/resolve/lib/homedir.js | 24 - node_modules/resolve/lib/is-core.js | 5 - .../resolve/lib/node-modules-paths.js | 45 - node_modules/resolve/lib/normalize-options.js | 10 - node_modules/resolve/lib/sync.js | 212 - node_modules/resolve/package.json | 75 - 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/reusify/.github/dependabot.yml | 7 - node_modules/reusify/.github/workflows/ci.yml | 96 - node_modules/reusify/LICENSE | 22 - node_modules/reusify/README.md | 139 - node_modules/reusify/SECURITY.md | 15 - .../benchmarks/createNoCodeFunction.js | 30 - node_modules/reusify/benchmarks/fib.js | 13 - .../reusify/benchmarks/reuseNoCodeFunction.js | 38 - node_modules/reusify/eslint.config.js | 14 - node_modules/reusify/package.json | 50 - node_modules/reusify/reusify.d.ts | 14 - node_modules/reusify/reusify.js | 33 - node_modules/reusify/test.js | 66 - node_modules/reusify/tsconfig.json | 11 - node_modules/run-parallel/LICENSE | 20 - node_modules/run-parallel/README.md | 85 - node_modules/run-parallel/index.js | 51 - node_modules/run-parallel/package.json | 58 - node_modules/source-map-js/LICENSE | 28 - node_modules/source-map-js/README.md | 765 - node_modules/source-map-js/lib/array-set.js | 121 - node_modules/source-map-js/lib/base64-vlq.js | 140 - node_modules/source-map-js/lib/base64.js | 67 - .../source-map-js/lib/binary-search.js | 111 - .../source-map-js/lib/mapping-list.js | 79 - node_modules/source-map-js/lib/quick-sort.js | 132 - .../lib/source-map-consumer.d.ts | 1 - .../source-map-js/lib/source-map-consumer.js | 1188 - .../lib/source-map-generator.d.ts | 1 - .../source-map-js/lib/source-map-generator.js | 444 - .../source-map-js/lib/source-node.d.ts | 1 - node_modules/source-map-js/lib/source-node.js | 413 - node_modules/source-map-js/lib/util.js | 594 - node_modules/source-map-js/package.json | 71 - node_modules/source-map-js/source-map.d.ts | 104 - node_modules/source-map-js/source-map.js | 8 - node_modules/sucrase/LICENSE | 21 - node_modules/sucrase/README.md | 295 - node_modules/sucrase/bin/sucrase | 3 - node_modules/sucrase/bin/sucrase-node | 18 - .../sucrase/dist/CJSImportProcessor.js | 456 - node_modules/sucrase/dist/HelperManager.js | 176 - node_modules/sucrase/dist/NameManager.js | 27 - .../sucrase/dist/Options-gen-types.js | 42 - node_modules/sucrase/dist/Options.js | 101 - node_modules/sucrase/dist/TokenProcessor.js | 357 - node_modules/sucrase/dist/cli.js | 317 - node_modules/sucrase/dist/computeSourceMap.js | 89 - .../sucrase/dist/esm/CJSImportProcessor.js | 456 - .../sucrase/dist/esm/HelperManager.js | 176 - node_modules/sucrase/dist/esm/NameManager.js | 27 - .../sucrase/dist/esm/Options-gen-types.js | 42 - node_modules/sucrase/dist/esm/Options.js | 101 - .../sucrase/dist/esm/TokenProcessor.js | 357 - node_modules/sucrase/dist/esm/cli.js | 317 - .../sucrase/dist/esm/computeSourceMap.js | 89 - .../dist/esm/identifyShadowedGlobals.js | 98 - node_modules/sucrase/dist/esm/index.js | 133 - node_modules/sucrase/dist/esm/parser/index.js | 31 - .../sucrase/dist/esm/parser/plugins/flow.js | 1105 - .../dist/esm/parser/plugins/jsx/index.js | 367 - .../dist/esm/parser/plugins/jsx/xhtml.js | 256 - .../sucrase/dist/esm/parser/plugins/types.js | 37 - .../dist/esm/parser/plugins/typescript.js | 1632 - .../dist/esm/parser/tokenizer/index.js | 1004 - .../dist/esm/parser/tokenizer/keywords.js | 43 - .../dist/esm/parser/tokenizer/readWord.js | 64 - .../dist/esm/parser/tokenizer/readWordTree.js | 671 - .../dist/esm/parser/tokenizer/state.js | 106 - .../dist/esm/parser/tokenizer/types.js | 361 - .../sucrase/dist/esm/parser/traverser/base.js | 60 - .../dist/esm/parser/traverser/expression.js | 1022 - .../dist/esm/parser/traverser/index.js | 18 - .../sucrase/dist/esm/parser/traverser/lval.js | 159 - .../dist/esm/parser/traverser/statement.js | 1332 - .../sucrase/dist/esm/parser/traverser/util.js | 104 - .../sucrase/dist/esm/parser/util/charcodes.js | 115 - .../dist/esm/parser/util/identifier.js | 34 - .../dist/esm/parser/util/whitespace.js | 33 - node_modules/sucrase/dist/esm/register.js | 88 - .../esm/transformers/CJSImportTransformer.js | 916 - .../esm/transformers/ESMImportTransformer.js | 415 - .../dist/esm/transformers/FlowTransformer.js | 182 - .../dist/esm/transformers/JSXTransformer.js | 733 - .../esm/transformers/JestHoistTransformer.js | 111 - .../NumericSeparatorTransformer.js | 20 - .../OptionalCatchBindingTransformer.js | 19 - .../OptionalChainingNullishTransformer.js | 155 - .../ReactDisplayNameTransformer.js | 160 - .../transformers/ReactHotLoaderTransformer.js | 69 - .../dist/esm/transformers/RootTransformer.js | 462 - .../dist/esm/transformers/Transformer.js | 16 - .../esm/transformers/TypeScriptTransformer.js | 279 - .../dist/esm/util/elideImportEquals.js | 29 - .../sucrase/dist/esm/util/formatTokens.js | 74 - .../sucrase/dist/esm/util/getClassInfo.js | 352 - .../dist/esm/util/getDeclarationInfo.js | 40 - .../dist/esm/util/getIdentifierNames.js | 15 - .../esm/util/getImportExportSpecifierInfo.js | 92 - .../sucrase/dist/esm/util/getJSXPragmaInfo.js | 22 - .../dist/esm/util/getNonTypeIdentifiers.js | 43 - .../dist/esm/util/getTSImportedNames.js | 84 - .../sucrase/dist/esm/util/isAsyncOperation.js | 38 - .../sucrase/dist/esm/util/isExportFrom.js | 18 - .../sucrase/dist/esm/util/isIdentifier.js | 81 - .../esm/util/removeMaybeImportAttributes.js | 22 - .../dist/esm/util/shouldElideDefaultExport.js | 38 - .../sucrase/dist/identifyShadowedGlobals.js | 98 - node_modules/sucrase/dist/index.js | 133 - node_modules/sucrase/dist/parser/index.js | 31 - .../sucrase/dist/parser/plugins/flow.js | 1105 - .../sucrase/dist/parser/plugins/jsx/index.js | 367 - .../sucrase/dist/parser/plugins/jsx/xhtml.js | 256 - .../sucrase/dist/parser/plugins/types.js | 37 - .../sucrase/dist/parser/plugins/typescript.js | 1632 - .../sucrase/dist/parser/tokenizer/index.js | 1004 - .../sucrase/dist/parser/tokenizer/keywords.js | 43 - .../sucrase/dist/parser/tokenizer/readWord.js | 64 - .../dist/parser/tokenizer/readWordTree.js | 671 - .../sucrase/dist/parser/tokenizer/state.js | 106 - .../sucrase/dist/parser/tokenizer/types.js | 361 - .../sucrase/dist/parser/traverser/base.js | 60 - .../dist/parser/traverser/expression.js | 1022 - .../sucrase/dist/parser/traverser/index.js | 18 - .../sucrase/dist/parser/traverser/lval.js | 159 - .../dist/parser/traverser/statement.js | 1332 - .../sucrase/dist/parser/traverser/util.js | 104 - .../sucrase/dist/parser/util/charcodes.js | 115 - .../sucrase/dist/parser/util/identifier.js | 34 - .../sucrase/dist/parser/util/whitespace.js | 33 - node_modules/sucrase/dist/register.js | 88 - .../dist/transformers/CJSImportTransformer.js | 916 - .../dist/transformers/ESMImportTransformer.js | 415 - .../dist/transformers/FlowTransformer.js | 182 - .../dist/transformers/JSXTransformer.js | 733 - .../dist/transformers/JestHoistTransformer.js | 111 - .../NumericSeparatorTransformer.js | 20 - .../OptionalCatchBindingTransformer.js | 19 - .../OptionalChainingNullishTransformer.js | 155 - .../ReactDisplayNameTransformer.js | 160 - .../transformers/ReactHotLoaderTransformer.js | 69 - .../dist/transformers/RootTransformer.js | 462 - .../sucrase/dist/transformers/Transformer.js | 16 - .../transformers/TypeScriptTransformer.js | 279 - .../dist/types/CJSImportProcessor.d.ts | 67 - .../sucrase/dist/types/HelperManager.d.ts | 15 - .../sucrase/dist/types/NameManager.d.ts | 7 - .../sucrase/dist/types/Options-gen-types.d.ts | 9 - node_modules/sucrase/dist/types/Options.d.ts | 90 - .../sucrase/dist/types/TokenProcessor.d.ts | 87 - node_modules/sucrase/dist/types/cli.d.ts | 1 - .../sucrase/dist/types/computeSourceMap.d.ts | 17 - .../dist/types/identifyShadowedGlobals.d.ts | 12 - node_modules/sucrase/dist/types/index.d.ts | 26 - .../sucrase/dist/types/parser/index.d.ts | 8 - .../dist/types/parser/plugins/flow.d.ts | 27 - .../dist/types/parser/plugins/jsx/index.d.ts | 2 - .../dist/types/parser/plugins/jsx/xhtml.d.ts | 2 - .../dist/types/parser/plugins/types.d.ts | 5 - .../dist/types/parser/plugins/typescript.d.ts | 49 - .../dist/types/parser/tokenizer/index.d.ts | 93 - .../dist/types/parser/tokenizer/keywords.d.ts | 43 - .../dist/types/parser/tokenizer/readWord.d.ts | 7 - .../types/parser/tokenizer/readWordTree.d.ts | 1 - .../dist/types/parser/tokenizer/state.d.ts | 50 - .../dist/types/parser/tokenizer/types.d.ts | 126 - .../dist/types/parser/traverser/base.d.ts | 16 - .../types/parser/traverser/expression.d.ts | 34 - .../dist/types/parser/traverser/index.d.ts | 2 - .../dist/types/parser/traverser/lval.d.ts | 9 - .../types/parser/traverser/statement.d.ts | 20 - .../dist/types/parser/traverser/util.d.ts | 17 - .../dist/types/parser/util/charcodes.d.ts | 107 - .../dist/types/parser/util/identifier.d.ts | 2 - .../dist/types/parser/util/whitespace.d.ts | 3 - node_modules/sucrase/dist/types/register.d.ts | 14 - .../transformers/CJSImportTransformer.d.ts | 149 - .../transformers/ESMImportTransformer.d.ts | 52 - .../types/transformers/FlowTransformer.d.ts | 79 - .../types/transformers/JSXTransformer.d.ts | 144 - .../transformers/JestHoistTransformer.d.ts | 32 - .../NumericSeparatorTransformer.d.ts | 7 - .../OptionalCatchBindingTransformer.d.ts | 9 - .../OptionalChainingNullishTransformer.d.ts | 36 - .../ReactDisplayNameTransformer.d.ts | 29 - .../ReactHotLoaderTransformer.d.ts | 12 - .../types/transformers/RootTransformer.d.ts | 52 - .../dist/types/transformers/Transformer.d.ts | 6 - .../transformers/TypeScriptTransformer.d.ts | 104 - .../dist/types/util/elideImportEquals.d.ts | 2 - .../sucrase/dist/types/util/formatTokens.d.ts | 2 - .../sucrase/dist/types/util/getClassInfo.d.ts | 34 - .../dist/types/util/getDeclarationInfo.d.ts | 18 - .../dist/types/util/getIdentifierNames.d.ts | 5 - .../util/getImportExportSpecifierInfo.d.ts | 36 - .../dist/types/util/getJSXPragmaInfo.d.ts | 8 - .../types/util/getNonTypeIdentifiers.d.ts | 3 - .../dist/types/util/getTSImportedNames.d.ts | 9 - .../dist/types/util/isAsyncOperation.d.ts | 11 - .../sucrase/dist/types/util/isExportFrom.d.ts | 6 - .../sucrase/dist/types/util/isIdentifier.d.ts | 8 - .../util/removeMaybeImportAttributes.d.ts | 6 - .../types/util/shouldElideDefaultExport.d.ts | 6 - .../sucrase/dist/util/elideImportEquals.js | 29 - .../sucrase/dist/util/formatTokens.js | 74 - .../sucrase/dist/util/getClassInfo.js | 352 - .../sucrase/dist/util/getDeclarationInfo.js | 40 - .../sucrase/dist/util/getIdentifierNames.js | 15 - .../dist/util/getImportExportSpecifierInfo.js | 92 - .../sucrase/dist/util/getJSXPragmaInfo.js | 22 - .../dist/util/getNonTypeIdentifiers.js | 43 - .../sucrase/dist/util/getTSImportedNames.js | 84 - .../sucrase/dist/util/isAsyncOperation.js | 38 - .../sucrase/dist/util/isExportFrom.js | 18 - .../sucrase/dist/util/isIdentifier.js | 81 - .../dist/util/removeMaybeImportAttributes.js | 22 - .../dist/util/shouldElideDefaultExport.js | 38 - node_modules/sucrase/package.json | 88 - node_modules/sucrase/register/index.js | 1 - node_modules/sucrase/register/js.js | 1 - node_modules/sucrase/register/jsx.js | 1 - .../register/ts-legacy-module-interop.js | 1 - node_modules/sucrase/register/ts.js | 1 - .../register/tsx-legacy-module-interop.js | 1 - node_modules/sucrase/register/tsx.js | 1 - node_modules/sucrase/ts-node-plugin/index.js | 83 - .../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/tailwindcss/LICENSE | 21 - node_modules/tailwindcss/README.md | 40 - node_modules/tailwindcss/base.css | 1 - node_modules/tailwindcss/colors.d.ts | 3 - node_modules/tailwindcss/colors.js | 2 - node_modules/tailwindcss/components.css | 1 - node_modules/tailwindcss/defaultConfig.d.ts | 3 - node_modules/tailwindcss/defaultConfig.js | 2 - node_modules/tailwindcss/defaultTheme.d.ts | 4 - node_modules/tailwindcss/defaultTheme.js | 2 - .../tailwindcss/lib/cli-peer-dependencies.js | 36 - node_modules/tailwindcss/lib/cli.js | 3 - .../tailwindcss/lib/cli/build/deps.js | 62 - .../tailwindcss/lib/cli/build/index.js | 54 - .../tailwindcss/lib/cli/build/plugin.js | 376 - .../tailwindcss/lib/cli/build/utils.js | 88 - .../tailwindcss/lib/cli/build/watching.js | 182 - .../tailwindcss/lib/cli/help/index.js | 73 - node_modules/tailwindcss/lib/cli/index.js | 230 - .../tailwindcss/lib/cli/init/index.js | 63 - .../tailwindcss/lib/corePluginList.js | 191 - node_modules/tailwindcss/lib/corePlugins.js | 4339 - node_modules/tailwindcss/lib/css/LICENSE | 25 - .../tailwindcss/lib/css/preflight.css | 386 - node_modules/tailwindcss/lib/featureFlags.js | 79 - node_modules/tailwindcss/lib/index.js | 2 - .../tailwindcss/lib/lib/cacheInvalidation.js | 92 - .../lib/lib/collapseAdjacentRules.js | 61 - .../lib/lib/collapseDuplicateDeclarations.js | 85 - node_modules/tailwindcss/lib/lib/content.js | 247 - .../tailwindcss/lib/lib/defaultExtractor.js | 273 - .../lib/lib/evaluateTailwindFunctions.js | 238 - .../tailwindcss/lib/lib/expandApplyAtRules.js | 553 - .../lib/lib/expandTailwindAtRules.js | 279 - .../tailwindcss/lib/lib/findAtConfigPath.js | 46 - .../tailwindcss/lib/lib/generateRules.js | 912 - .../lib/lib/getModuleDependencies.js | 99 - .../tailwindcss/lib/lib/load-config.js | 58 - .../lib/lib/normalizeTailwindDirectives.js | 89 - node_modules/tailwindcss/lib/lib/offsets.js | 355 - .../lib/lib/partitionApplyAtRules.js | 58 - node_modules/tailwindcss/lib/lib/regex.js | 74 - .../tailwindcss/lib/lib/remap-bitfield.js | 89 - .../lib/lib/resolveDefaultsAtRules.js | 165 - .../tailwindcss/lib/lib/setupContextUtils.js | 1298 - .../lib/lib/setupTrackingContext.js | 169 - .../tailwindcss/lib/lib/sharedState.js | 79 - .../lib/lib/substituteScreenAtRules.js | 31 - node_modules/tailwindcss/lib/plugin.js | 48 - .../lib/postcss-plugins/nesting/README.md | 42 - .../lib/postcss-plugins/nesting/index.js | 21 - .../lib/postcss-plugins/nesting/plugin.js | 89 - .../lib/processTailwindFeatures.js | 62 - node_modules/tailwindcss/lib/public/colors.js | 355 - .../tailwindcss/lib/public/create-plugin.js | 17 - .../tailwindcss/lib/public/default-config.js | 18 - .../tailwindcss/lib/public/default-theme.js | 18 - .../tailwindcss/lib/public/load-config.js | 12 - .../tailwindcss/lib/public/resolve-config.js | 24 - .../lib/util/applyImportantSelector.js | 38 - node_modules/tailwindcss/lib/util/bigSign.js | 13 - .../tailwindcss/lib/util/buildMediaQuery.js | 27 - .../tailwindcss/lib/util/cloneDeep.js | 22 - .../tailwindcss/lib/util/cloneNodes.js | 54 - node_modules/tailwindcss/lib/util/color.js | 116 - .../tailwindcss/lib/util/colorNames.js | 752 - .../tailwindcss/lib/util/configurePlugins.js | 23 - .../tailwindcss/lib/util/createPlugin.js | 32 - .../lib/util/createUtilityPlugin.js | 53 - .../tailwindcss/lib/util/dataTypes.js | 338 - node_modules/tailwindcss/lib/util/defaults.js | 27 - .../tailwindcss/lib/util/escapeClassName.js | 24 - .../tailwindcss/lib/util/escapeCommas.js | 13 - .../lib/util/flattenColorPalette.js | 18 - .../lib/util/formatVariantSelector.js | 270 - .../tailwindcss/lib/util/getAllConfigs.js | 50 - .../tailwindcss/lib/util/hashConfig.js | 21 - .../tailwindcss/lib/util/isKeyframeRule.js | 13 - .../tailwindcss/lib/util/isPlainObject.js | 17 - .../util/isSyntacticallyValidPropertyValue.js | 74 - node_modules/tailwindcss/lib/util/log.js | 61 - .../tailwindcss/lib/util/math-operators.js | 152 - .../tailwindcss/lib/util/nameClass.js | 49 - .../tailwindcss/lib/util/negateValue.js | 36 - .../tailwindcss/lib/util/normalizeConfig.js | 281 - .../tailwindcss/lib/util/normalizeScreens.js | 178 - .../lib/util/parseAnimationValue.js | 93 - .../lib/util/parseBoxShadowValue.js | 88 - .../tailwindcss/lib/util/parseDependency.js | 47 - .../tailwindcss/lib/util/parseGlob.js | 35 - .../tailwindcss/lib/util/parseObjectStyles.js | 36 - .../tailwindcss/lib/util/pluginUtils.js | 289 - .../tailwindcss/lib/util/prefixSelector.js | 39 - .../tailwindcss/lib/util/pseudoElements.js | 212 - .../lib/util/removeAlphaVariables.js | 33 - .../tailwindcss/lib/util/resolveConfig.js | 256 - .../tailwindcss/lib/util/resolveConfigPath.js | 72 - .../tailwindcss/lib/util/responsive.js | 24 - .../lib/util/splitAtTopLevelOnly.js | 47 - node_modules/tailwindcss/lib/util/tap.js | 14 - .../tailwindcss/lib/util/toColorValue.js | 13 - node_modules/tailwindcss/lib/util/toPath.js | 32 - .../lib/util/transformThemeValue.js | 73 - .../tailwindcss/lib/util/validateConfig.js | 37 - .../lib/util/validateFormalSyntax.js | 26 - .../tailwindcss/lib/util/withAlphaVariable.js | 79 - .../tailwindcss/lib/value-parser/LICENSE | 22 - .../tailwindcss/lib/value-parser/README.md | 3 - .../tailwindcss/lib/value-parser/index.d.js | 2 - .../tailwindcss/lib/value-parser/index.js | 22 - .../tailwindcss/lib/value-parser/parse.js | 259 - .../tailwindcss/lib/value-parser/stringify.js | 38 - .../tailwindcss/lib/value-parser/unit.js | 86 - .../tailwindcss/lib/value-parser/walk.js | 16 - node_modules/tailwindcss/loadConfig.d.ts | 4 - node_modules/tailwindcss/loadConfig.js | 2 - node_modules/tailwindcss/nesting/index.d.ts | 4 - node_modules/tailwindcss/nesting/index.js | 2 - node_modules/tailwindcss/package.json | 124 - node_modules/tailwindcss/peers/index.js | 97871 ---------------- node_modules/tailwindcss/plugin.d.ts | 11 - node_modules/tailwindcss/plugin.js | 2 - node_modules/tailwindcss/prettier.config.js | 19 - node_modules/tailwindcss/resolveConfig.d.ts | 31 - node_modules/tailwindcss/resolveConfig.js | 2 - node_modules/tailwindcss/screens.css | 1 - .../tailwindcss/scripts/create-plugin-list.js | 10 - .../tailwindcss/scripts/generate-types.js | 104 - .../tailwindcss/scripts/release-channel.js | 18 - .../tailwindcss/scripts/release-notes.js | 21 - .../tailwindcss/scripts/type-utils.js | 27 - .../tailwindcss/src/cli-peer-dependencies.js | 15 - node_modules/tailwindcss/src/cli.js | 3 - .../tailwindcss/src/cli/build/deps.js | 56 - .../tailwindcss/src/cli/build/index.js | 49 - .../tailwindcss/src/cli/build/plugin.js | 444 - .../tailwindcss/src/cli/build/utils.js | 76 - .../tailwindcss/src/cli/build/watching.js | 229 - .../tailwindcss/src/cli/help/index.js | 70 - node_modules/tailwindcss/src/cli/index.js | 216 - .../tailwindcss/src/cli/init/index.js | 79 - .../tailwindcss/src/corePluginList.js | 1 - node_modules/tailwindcss/src/corePlugins.js | 3007 - node_modules/tailwindcss/src/css/LICENSE | 25 - .../tailwindcss/src/css/preflight.css | 386 - node_modules/tailwindcss/src/featureFlags.js | 62 - node_modules/tailwindcss/src/index.js | 1 - .../tailwindcss/src/lib/cacheInvalidation.js | 52 - .../src/lib/collapseAdjacentRules.js | 58 - .../src/lib/collapseDuplicateDeclarations.js | 93 - node_modules/tailwindcss/src/lib/content.js | 295 - .../tailwindcss/src/lib/defaultExtractor.js | 255 - .../src/lib/evaluateTailwindFunctions.js | 272 - .../tailwindcss/src/lib/expandApplyAtRules.js | 637 - .../src/lib/expandTailwindAtRules.js | 282 - .../tailwindcss/src/lib/findAtConfigPath.js | 48 - .../tailwindcss/src/lib/generateRules.js | 958 - .../src/lib/getModuleDependencies.js | 79 - .../tailwindcss/src/lib/load-config.ts | 46 - .../src/lib/normalizeTailwindDirectives.js | 84 - node_modules/tailwindcss/src/lib/offsets.js | 432 - .../src/lib/partitionApplyAtRules.js | 52 - node_modules/tailwindcss/src/lib/regex.js | 74 - .../tailwindcss/src/lib/remap-bitfield.js | 82 - .../src/lib/resolveDefaultsAtRules.js | 165 - .../tailwindcss/src/lib/setupContextUtils.js | 1371 - .../src/lib/setupTrackingContext.js | 172 - .../tailwindcss/src/lib/sharedState.js | 57 - .../src/lib/substituteScreenAtRules.js | 19 - node_modules/tailwindcss/src/plugin.js | 47 - .../src/postcss-plugins/nesting/README.md | 42 - .../src/postcss-plugins/nesting/index.js | 13 - .../src/postcss-plugins/nesting/plugin.js | 80 - .../src/processTailwindFeatures.js | 56 - node_modules/tailwindcss/src/public/colors.js | 322 - .../tailwindcss/src/public/create-plugin.js | 2 - .../tailwindcss/src/public/default-config.js | 4 - .../tailwindcss/src/public/default-theme.js | 4 - .../tailwindcss/src/public/load-config.js | 2 - .../tailwindcss/src/public/resolve-config.js | 7 - .../src/util/applyImportantSelector.js | 26 - node_modules/tailwindcss/src/util/bigSign.js | 3 - .../tailwindcss/src/util/buildMediaQuery.js | 22 - .../tailwindcss/src/util/cloneDeep.js | 11 - .../tailwindcss/src/util/cloneNodes.js | 49 - node_modules/tailwindcss/src/util/color.js | 88 - .../tailwindcss/src/util/colorNames.js | 150 - .../tailwindcss/src/util/configurePlugins.js | 23 - .../tailwindcss/src/util/createPlugin.js | 27 - .../src/util/createUtilityPlugin.js | 37 - .../tailwindcss/src/util/dataTypes.js | 327 - node_modules/tailwindcss/src/util/defaults.js | 17 - .../tailwindcss/src/util/escapeClassName.js | 8 - .../tailwindcss/src/util/escapeCommas.js | 3 - .../src/util/flattenColorPalette.js | 13 - .../src/util/formatVariantSelector.js | 324 - .../tailwindcss/src/util/getAllConfigs.js | 38 - .../tailwindcss/src/util/hashConfig.js | 5 - .../tailwindcss/src/util/isKeyframeRule.js | 3 - .../tailwindcss/src/util/isPlainObject.js | 8 - .../util/isSyntacticallyValidPropertyValue.js | 61 - node_modules/tailwindcss/src/util/log.js | 29 - .../tailwindcss/src/util/math-operators.ts | 205 - .../tailwindcss/src/util/nameClass.js | 30 - .../tailwindcss/src/util/negateValue.js | 24 - .../tailwindcss/src/util/normalizeConfig.js | 299 - .../tailwindcss/src/util/normalizeScreens.js | 140 - .../src/util/parseAnimationValue.js | 68 - .../src/util/parseBoxShadowValue.js | 72 - .../tailwindcss/src/util/parseDependency.js | 44 - .../tailwindcss/src/util/parseGlob.js | 23 - .../tailwindcss/src/util/parseObjectStyles.js | 19 - .../tailwindcss/src/util/pluginUtils.js | 307 - .../tailwindcss/src/util/prefixSelector.js | 33 - .../tailwindcss/src/util/pseudoElements.js | 171 - .../src/util/removeAlphaVariables.js | 26 - .../tailwindcss/src/util/resolveConfig.js | 277 - .../tailwindcss/src/util/resolveConfigPath.js | 68 - .../tailwindcss/src/util/responsive.js | 10 - .../src/util/splitAtTopLevelOnly.js | 48 - node_modules/tailwindcss/src/util/tap.js | 4 - .../tailwindcss/src/util/toColorValue.js | 3 - node_modules/tailwindcss/src/util/toPath.js | 26 - .../src/util/transformThemeValue.js | 62 - .../tailwindcss/src/util/validateConfig.js | 26 - .../src/util/validateFormalSyntax.js | 34 - .../tailwindcss/src/util/withAlphaVariable.js | 49 - .../tailwindcss/src/value-parser/LICENSE | 22 - .../tailwindcss/src/value-parser/README.md | 3 - .../tailwindcss/src/value-parser/index.d.ts | 177 - .../tailwindcss/src/value-parser/index.js | 28 - .../tailwindcss/src/value-parser/parse.js | 303 - .../tailwindcss/src/value-parser/stringify.js | 41 - .../tailwindcss/src/value-parser/unit.js | 118 - .../tailwindcss/src/value-parser/walk.js | 18 - node_modules/tailwindcss/stubs/.npmignore | 1 - .../tailwindcss/stubs/.prettierrc.json | 6 - node_modules/tailwindcss/stubs/config.full.js | 1062 - .../tailwindcss/stubs/config.simple.js | 7 - .../tailwindcss/stubs/postcss.config.cjs | 6 - .../tailwindcss/stubs/postcss.config.js | 6 - .../tailwindcss/stubs/tailwind.config.cjs | 2 - .../tailwindcss/stubs/tailwind.config.js | 2 - .../tailwindcss/stubs/tailwind.config.ts | 3 - node_modules/tailwindcss/tailwind.css | 5 - node_modules/tailwindcss/types/config.d.ts | 379 - .../tailwindcss/types/generated/.gitkeep | 0 .../tailwindcss/types/generated/colors.d.ts | 298 - .../types/generated/corePluginList.d.ts | 1 - .../types/generated/default-theme.d.ts | 397 - node_modules/tailwindcss/types/index.d.ts | 11 - node_modules/tailwindcss/utilities.css | 1 - node_modules/tailwindcss/variants.css | 1 - node_modules/thenify-all/History.md | 11 - node_modules/thenify-all/LICENSE | 22 - node_modules/thenify-all/README.md | 66 - node_modules/thenify-all/index.js | 73 - node_modules/thenify-all/package.json | 34 - node_modules/thenify/History.md | 11 - node_modules/thenify/LICENSE | 22 - node_modules/thenify/README.md | 120 - node_modules/thenify/index.js | 77 - node_modules/thenify/package.json | 31 - node_modules/tinyglobby/LICENSE | 21 - node_modules/tinyglobby/README.md | 25 - node_modules/tinyglobby/dist/index.cjs | 350 - node_modules/tinyglobby/dist/index.d.cts | 147 - node_modules/tinyglobby/dist/index.d.mts | 147 - node_modules/tinyglobby/dist/index.mjs | 318 - .../tinyglobby/node_modules/fdir/LICENSE | 7 - .../tinyglobby/node_modules/fdir/README.md | 91 - .../node_modules/fdir/dist/index.cjs | 588 - .../node_modules/fdir/dist/index.d.cts | 155 - .../node_modules/fdir/dist/index.d.mts | 155 - .../node_modules/fdir/dist/index.mjs | 570 - .../tinyglobby/node_modules/fdir/package.json | 103 - .../tinyglobby/node_modules/picomatch/LICENSE | 21 - .../node_modules/picomatch/README.md | 738 - .../node_modules/picomatch/index.js | 17 - .../node_modules/picomatch/lib/constants.js | 180 - .../node_modules/picomatch/lib/parse.js | 1085 - .../node_modules/picomatch/lib/picomatch.js | 341 - .../node_modules/picomatch/lib/scan.js | 391 - .../node_modules/picomatch/lib/utils.js | 72 - .../node_modules/picomatch/package.json | 83 - .../node_modules/picomatch/posix.js | 3 - node_modules/tinyglobby/package.json | 73 - node_modules/to-regex-range/LICENSE | 21 - node_modules/to-regex-range/README.md | 305 - node_modules/to-regex-range/index.js | 288 - node_modules/to-regex-range/package.json | 88 - node_modules/ts-interface-checker/LICENSE | 201 - node_modules/ts-interface-checker/README.md | 185 - .../ts-interface-checker/dist/index.d.ts | 124 - .../ts-interface-checker/dist/index.js | 224 - .../ts-interface-checker/dist/types.d.ts | 181 - .../ts-interface-checker/dist/types.js | 566 - .../ts-interface-checker/dist/util.d.ts | 55 - .../ts-interface-checker/dist/util.js | 130 - .../ts-interface-checker/package.json | 60 - node_modules/util-deprecate/History.md | 16 - node_modules/util-deprecate/LICENSE | 24 - node_modules/util-deprecate/README.md | 53 - node_modules/util-deprecate/browser.js | 67 - node_modules/util-deprecate/node.js | 6 - node_modules/util-deprecate/package.json | 27 - .../typing_extensions.cpython-312.pyc | Bin 163747 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 491 -> 0 bytes .../__pycache__/_utilities.cpython-312.pyc | Bin 2718 -> 0 bytes .../blinker/__pycache__/base.cpython-312.pyc | Bin 21995 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 4063 -> 0 bytes .../click/__pycache__/_compat.cpython-312.pyc | Bin 24185 -> 0 bytes .../__pycache__/_termui_impl.cpython-312.pyc | Bin 31607 -> 0 bytes .../__pycache__/_textwrap.cpython-312.pyc | Bin 2416 -> 0 bytes .../click/__pycache__/_utils.cpython-312.pyc | Bin 1191 -> 0 bytes .../__pycache__/_winconsole.cpython-312.pyc | Bin 11761 -> 0 bytes .../click/__pycache__/core.cpython-312.pyc | Bin 134657 -> 0 bytes .../__pycache__/decorators.cpython-312.pyc | Bin 22128 -> 0 bytes .../__pycache__/exceptions.cpython-312.pyc | Bin 14767 -> 0 bytes .../__pycache__/formatting.cpython-312.pyc | Bin 13663 -> 0 bytes .../click/__pycache__/globals.cpython-312.pyc | Bin 2956 -> 0 bytes .../click/__pycache__/parser.cpython-312.pyc | Bin 20433 -> 0 bytes .../shell_completion.cpython-312.pyc | Bin 23328 -> 0 bytes .../click/__pycache__/termui.cpython-312.pyc | Bin 34642 -> 0 bytes .../click/__pycache__/testing.cpython-312.pyc | Bin 27400 -> 0 bytes .../click/__pycache__/types.cpython-312.pyc | Bin 50029 -> 0 bytes .../click/__pycache__/utils.cpython-312.pyc | Bin 24870 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 2470 -> 0 bytes .../__pycache__/__main__.cpython-312.pyc | Bin 231 -> 0 bytes .../flask/__pycache__/app.cpython-312.pyc | Bin 60708 -> 0 bytes .../__pycache__/blueprints.cpython-312.pyc | Bin 3917 -> 0 bytes .../flask/__pycache__/cli.cpython-312.pyc | Bin 39877 -> 0 bytes .../flask/__pycache__/config.cpython-312.pyc | Bin 15422 -> 0 bytes .../flask/__pycache__/ctx.cpython-312.pyc | Bin 19547 -> 0 bytes .../__pycache__/debughelpers.cpython-312.pyc | Bin 8552 -> 0 bytes .../flask/__pycache__/globals.cpython-312.pyc | Bin 1855 -> 0 bytes .../flask/__pycache__/helpers.cpython-312.pyc | Bin 24779 -> 0 bytes .../flask/__pycache__/logging.cpython-312.pyc | Bin 3257 -> 0 bytes .../__pycache__/sessions.cpython-312.pyc | Bin 15901 -> 0 bytes .../flask/__pycache__/signals.cpython-312.pyc | Bin 1212 -> 0 bytes .../__pycache__/templating.cpython-312.pyc | Bin 9951 -> 0 bytes .../flask/__pycache__/testing.cpython-312.pyc | Bin 13531 -> 0 bytes .../flask/__pycache__/typing.cpython-312.pyc | Bin 4135 -> 0 bytes .../flask/__pycache__/views.cpython-312.pyc | Bin 6834 -> 0 bytes .../__pycache__/wrappers.cpython-312.pyc | Bin 6072 -> 0 bytes .../json/__pycache__/__init__.cpython-312.pyc | Bin 6683 -> 0 bytes .../json/__pycache__/provider.cpython-312.pyc | Bin 9239 -> 0 bytes .../json/__pycache__/tag.cpython-312.pyc | Bin 13332 -> 0 bytes .../sansio/__pycache__/app.cpython-312.pyc | Bin 33543 -> 0 bytes .../__pycache__/blueprints.cpython-312.pyc | Bin 31016 -> 0 bytes .../__pycache__/scaffold.cpython-312.pyc | Bin 30278 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1039 -> 0 bytes .../__pycache__/cli.cpython-312.pyc | Bin 1017 -> 0 bytes .../__pycache__/extension.cpython-312.pyc | Bin 39946 -> 0 bytes .../__pycache__/model.cpython-312.pyc | Bin 13371 -> 0 bytes .../__pycache__/pagination.cpython-312.pyc | Bin 14273 -> 0 bytes .../__pycache__/query.cpython-312.pyc | Bin 4508 -> 0 bytes .../record_queries.cpython-312.pyc | Bin 4837 -> 0 bytes .../__pycache__/session.cpython-312.pyc | Bin 4541 -> 0 bytes .../__pycache__/table.cpython-312.pyc | Bin 1832 -> 0 bytes .../track_modifications.cpython-312.pyc | Bin 3614 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1066 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 189 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 9242 -> 0 bytes ...fail_clearing_run_switches.cpython-312.pyc | Bin 2074 -> 0 bytes .../fail_cpp_exception.cpython-312.pyc | Bin 1609 -> 0 bytes ...nitialstub_already_started.cpython-312.pyc | Bin 3477 -> 0 bytes .../fail_slp_switch.cpython-312.pyc | Bin 1302 -> 0 bytes ...ail_switch_three_greenlets.cpython-312.pyc | Bin 1718 -> 0 bytes ...il_switch_three_greenlets2.cpython-312.pyc | Bin 2572 -> 0 bytes .../fail_switch_two_greenlets.cpython-312.pyc | Bin 1689 -> 0 bytes .../__pycache__/leakcheck.cpython-312.pyc | Bin 11696 -> 0 bytes .../test_contextvars.cpython-312.pyc | Bin 15473 -> 0 bytes .../__pycache__/test_cpp.cpython-312.pyc | Bin 4103 -> 0 bytes .../test_extension_interface.cpython-312.pyc | Bin 7461 -> 0 bytes .../tests/__pycache__/test_gc.cpython-312.pyc | Bin 4912 -> 0 bytes .../test_generator.cpython-312.pyc | Bin 3077 -> 0 bytes .../test_generator_nested.cpython-312.pyc | Bin 7815 -> 0 bytes .../__pycache__/test_greenlet.cpython-312.pyc | Bin 76320 -> 0 bytes .../test_greenlet_trash.cpython-312.pyc | Bin 6774 -> 0 bytes .../__pycache__/test_leaks.cpython-312.pyc | Bin 19968 -> 0 bytes .../test_stack_saved.cpython-312.pyc | Bin 1341 -> 0 bytes .../__pycache__/test_throw.cpython-312.pyc | Bin 7377 -> 0 bytes .../__pycache__/test_tracing.cpython-312.pyc | Bin 13873 -> 0 bytes .../__pycache__/test_version.cpython-312.pyc | Bin 2560 -> 0 bytes .../__pycache__/test_weakref.cpython-312.pyc | Bin 2726 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1622 -> 0 bytes .../__pycache__/_json.cpython-312.pyc | Bin 1176 -> 0 bytes .../__pycache__/encoding.cpython-312.pyc | Bin 2676 -> 0 bytes .../__pycache__/exc.cpython-312.pyc | Bin 3936 -> 0 bytes .../__pycache__/serializer.cpython-312.pyc | Bin 15417 -> 0 bytes .../__pycache__/signer.cpython-312.pyc | Bin 11282 -> 0 bytes .../__pycache__/timed.cpython-312.pyc | Bin 8730 -> 0 bytes .../__pycache__/url_safe.cpython-312.pyc | Bin 3526 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1647 -> 0 bytes .../__pycache__/_identifier.cpython-312.pyc | Bin 2128 -> 0 bytes .../__pycache__/async_utils.cpython-312.pyc | Bin 4968 -> 0 bytes .../__pycache__/bccache.cpython-312.pyc | Bin 19339 -> 0 bytes .../__pycache__/compiler.cpython-312.pyc | Bin 104054 -> 0 bytes .../__pycache__/constants.cpython-312.pyc | Bin 1550 -> 0 bytes .../jinja2/__pycache__/debug.cpython-312.pyc | Bin 6575 -> 0 bytes .../__pycache__/defaults.cpython-312.pyc | Bin 1600 -> 0 bytes .../__pycache__/environment.cpython-312.pyc | Bin 76676 -> 0 bytes .../__pycache__/exceptions.cpython-312.pyc | Bin 7714 -> 0 bytes .../jinja2/__pycache__/ext.cpython-312.pyc | Bin 41907 -> 0 bytes .../__pycache__/filters.cpython-312.pyc | Bin 72324 -> 0 bytes .../__pycache__/idtracking.cpython-312.pyc | Bin 19189 -> 0 bytes .../jinja2/__pycache__/lexer.cpython-312.pyc | Bin 32070 -> 0 bytes .../__pycache__/loaders.cpython-312.pyc | Bin 32349 -> 0 bytes .../jinja2/__pycache__/meta.cpython-312.pyc | Bin 5484 -> 0 bytes .../__pycache__/nativetypes.cpython-312.pyc | Bin 7005 -> 0 bytes .../jinja2/__pycache__/nodes.cpython-312.pyc | Bin 58267 -> 0 bytes .../__pycache__/optimizer.cpython-312.pyc | Bin 2683 -> 0 bytes .../jinja2/__pycache__/parser.cpython-312.pyc | Bin 61197 -> 0 bytes .../__pycache__/runtime.cpython-312.pyc | Bin 48885 -> 0 bytes .../__pycache__/sandbox.cpython-312.pyc | Bin 18101 -> 0 bytes .../jinja2/__pycache__/tests.cpython-312.pyc | Bin 9044 -> 0 bytes .../jinja2/__pycache__/utils.cpython-312.pyc | Bin 34857 -> 0 bytes .../__pycache__/visitor.cpython-312.pyc | Bin 5359 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 20957 -> 0 bytes .../__pycache__/_native.cpython-312.pyc | Bin 609 -> 0 bytes .../pip/__pycache__/__init__.cpython-312.pyc | Bin 684 -> 0 bytes .../pip/__pycache__/__main__.cpython-312.pyc | Bin 840 -> 0 bytes .../__pip-runner__.cpython-312.pyc | Bin 2203 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 786 -> 0 bytes .../__pycache__/build_env.cpython-312.pyc | Bin 14293 -> 0 bytes .../__pycache__/cache.cpython-312.pyc | Bin 12664 -> 0 bytes .../__pycache__/configuration.cpython-312.pyc | Bin 17665 -> 0 bytes .../__pycache__/exceptions.cpython-312.pyc | Bin 33283 -> 0 bytes .../__pycache__/main.cpython-312.pyc | Bin 669 -> 0 bytes .../__pycache__/pyproject.cpython-312.pyc | Bin 4970 -> 0 bytes .../self_outdated_check.cpython-312.pyc | Bin 10551 -> 0 bytes .../__pycache__/wheel_builder.cpython-312.pyc | Bin 13648 -> 0 bytes .../cli/__pycache__/__init__.cpython-312.pyc | Bin 277 -> 0 bytes .../autocompletion.cpython-312.pyc | Bin 8464 -> 0 bytes .../__pycache__/base_command.cpython-312.pyc | Bin 10454 -> 0 bytes .../__pycache__/cmdoptions.cpython-312.pyc | Bin 30373 -> 0 bytes .../command_context.cpython-312.pyc | Bin 1780 -> 0 bytes .../cli/__pycache__/main.cpython-312.pyc | Bin 2297 -> 0 bytes .../__pycache__/main_parser.cpython-312.pyc | Bin 4904 -> 0 bytes .../cli/__pycache__/parser.cpython-312.pyc | Bin 15021 -> 0 bytes .../__pycache__/progress_bars.cpython-312.pyc | Bin 2619 -> 0 bytes .../__pycache__/req_command.cpython-312.pyc | Bin 18851 -> 0 bytes .../cli/__pycache__/spinners.cpython-312.pyc | Bin 7839 -> 0 bytes .../__pycache__/status_codes.cpython-312.pyc | Bin 374 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 4001 -> 0 bytes .../__pycache__/cache.cpython-312.pyc | Bin 9710 -> 0 bytes .../__pycache__/check.cpython-312.pyc | Bin 2089 -> 0 bytes .../__pycache__/completion.cpython-312.pyc | Bin 5191 -> 0 bytes .../__pycache__/configuration.cpython-312.pyc | Bin 13211 -> 0 bytes .../__pycache__/debug.cpython-312.pyc | Bin 10160 -> 0 bytes .../__pycache__/download.cpython-312.pyc | Bin 7588 -> 0 bytes .../__pycache__/freeze.cpython-312.pyc | Bin 4415 -> 0 bytes .../commands/__pycache__/hash.cpython-312.pyc | Bin 2982 -> 0 bytes .../commands/__pycache__/help.cpython-312.pyc | Bin 1672 -> 0 bytes .../__pycache__/index.cpython-312.pyc | Bin 6719 -> 0 bytes .../__pycache__/inspect.cpython-312.pyc | Bin 3974 -> 0 bytes .../__pycache__/install.cpython-312.pyc | Bin 28912 -> 0 bytes .../commands/__pycache__/list.cpython-312.pyc | Bin 15655 -> 0 bytes .../__pycache__/search.cpython-312.pyc | Bin 7620 -> 0 bytes .../commands/__pycache__/show.cpython-312.pyc | Bin 9727 -> 0 bytes .../__pycache__/uninstall.cpython-312.pyc | Bin 4725 -> 0 bytes .../__pycache__/wheel.cpython-312.pyc | Bin 8955 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 940 -> 0 bytes .../__pycache__/base.cpython-312.pyc | Bin 2861 -> 0 bytes .../__pycache__/installed.cpython-312.pyc | Bin 1699 -> 0 bytes .../__pycache__/sdist.cpython-312.pyc | Bin 8487 -> 0 bytes .../__pycache__/wheel.cpython-312.pyc | Bin 2247 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 231 -> 0 bytes .../__pycache__/collector.cpython-312.pyc | Bin 21885 -> 0 bytes .../package_finder.cpython-312.pyc | Bin 40734 -> 0 bytes .../index/__pycache__/sources.cpython-312.pyc | Bin 12603 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 16775 -> 0 bytes .../__pycache__/_distutils.cpython-312.pyc | Bin 6855 -> 0 bytes .../__pycache__/_sysconfig.cpython-312.pyc | Bin 8010 -> 0 bytes .../__pycache__/base.cpython-312.pyc | Bin 3780 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 5881 -> 0 bytes .../__pycache__/_json.cpython-312.pyc | Bin 2874 -> 0 bytes .../metadata/__pycache__/base.cpython-312.pyc | Bin 35711 -> 0 bytes .../__pycache__/pkg_resources.cpython-312.pyc | Bin 15789 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 357 -> 0 bytes .../__pycache__/_compat.cpython-312.pyc | Bin 3332 -> 0 bytes .../__pycache__/_dists.cpython-312.pyc | Bin 13424 -> 0 bytes .../__pycache__/_envs.cpython-312.pyc | Bin 11179 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 265 -> 0 bytes .../__pycache__/candidate.cpython-312.pyc | Bin 1904 -> 0 bytes .../__pycache__/direct_url.cpython-312.pyc | Bin 11198 -> 0 bytes .../format_control.cpython-312.pyc | Bin 4226 -> 0 bytes .../models/__pycache__/index.cpython-312.pyc | Bin 1693 -> 0 bytes .../installation_report.cpython-312.pyc | Bin 2271 -> 0 bytes .../models/__pycache__/link.cpython-312.pyc | Bin 26001 -> 0 bytes .../models/__pycache__/scheme.cpython-312.pyc | Bin 1168 -> 0 bytes .../__pycache__/search_scope.cpython-312.pyc | Bin 5087 -> 0 bytes .../selection_prefs.cpython-312.pyc | Bin 1850 -> 0 bytes .../__pycache__/target_python.cpython-312.pyc | Bin 4953 -> 0 bytes .../models/__pycache__/wheel.cpython-312.pyc | Bin 5779 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 253 -> 0 bytes .../network/__pycache__/auth.cpython-312.pyc | Bin 21995 -> 0 bytes .../network/__pycache__/cache.cpython-312.pyc | Bin 6517 -> 0 bytes .../__pycache__/download.cpython-312.pyc | Bin 8552 -> 0 bytes .../__pycache__/lazy_wheel.cpython-312.pyc | Bin 11662 -> 0 bytes .../__pycache__/session.cpython-312.pyc | Bin 18773 -> 0 bytes .../network/__pycache__/utils.cpython-312.pyc | Bin 2252 -> 0 bytes .../__pycache__/xmlrpc.cpython-312.pyc | Bin 2948 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 196 -> 0 bytes .../__pycache__/check.cpython-312.pyc | Bin 7578 -> 0 bytes .../__pycache__/freeze.cpython-312.pyc | Bin 10116 -> 0 bytes .../__pycache__/prepare.cpython-312.pyc | Bin 25746 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 202 -> 0 bytes .../__pycache__/build_tracker.cpython-312.pyc | Bin 7822 -> 0 bytes .../__pycache__/metadata.cpython-312.pyc | Bin 1879 -> 0 bytes .../metadata_editable.cpython-312.pyc | Bin 1913 -> 0 bytes .../metadata_legacy.cpython-312.pyc | Bin 3064 -> 0 bytes .../build/__pycache__/wheel.cpython-312.pyc | Bin 1683 -> 0 bytes .../wheel_editable.cpython-312.pyc | Bin 2024 -> 0 bytes .../__pycache__/wheel_legacy.cpython-312.pyc | Bin 3928 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 265 -> 0 bytes .../editable_legacy.cpython-312.pyc | Bin 1816 -> 0 bytes .../install/__pycache__/wheel.cpython-312.pyc | Bin 33858 -> 0 bytes .../req/__pycache__/__init__.cpython-312.pyc | Bin 3742 -> 0 bytes .../__pycache__/constructors.cpython-312.pyc | Bin 21581 -> 0 bytes .../req/__pycache__/req_file.cpython-312.pyc | Bin 21460 -> 0 bytes .../__pycache__/req_install.cpython-312.pyc | Bin 38413 -> 0 bytes .../req/__pycache__/req_set.cpython-312.pyc | Bin 7217 -> 0 bytes .../__pycache__/req_uninstall.cpython-312.pyc | Bin 32976 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 196 -> 0 bytes .../__pycache__/base.cpython-312.pyc | Bin 1184 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 203 -> 0 bytes .../__pycache__/resolver.cpython-312.pyc | Bin 22438 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 207 -> 0 bytes .../__pycache__/base.cpython-312.pyc | Bin 8336 -> 0 bytes .../__pycache__/candidates.cpython-312.pyc | Bin 30397 -> 0 bytes .../__pycache__/factory.cpython-312.pyc | Bin 32113 -> 0 bytes .../found_candidates.cpython-312.pyc | Bin 6207 -> 0 bytes .../__pycache__/provider.cpython-312.pyc | Bin 10377 -> 0 bytes .../__pycache__/reporter.cpython-312.pyc | Bin 4934 -> 0 bytes .../__pycache__/requirements.cpython-312.pyc | Bin 11428 -> 0 bytes .../__pycache__/resolver.cpython-312.pyc | Bin 12350 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 191 -> 0 bytes .../__pycache__/_jaraco_text.cpython-312.pyc | Bin 4532 -> 0 bytes .../utils/__pycache__/_log.cpython-312.pyc | Bin 1862 -> 0 bytes .../utils/__pycache__/appdirs.cpython-312.pyc | Bin 2406 -> 0 bytes .../utils/__pycache__/compat.cpython-312.pyc | Bin 2209 -> 0 bytes .../compatibility_tags.cpython-312.pyc | Bin 5557 -> 0 bytes .../__pycache__/datetime.cpython-312.pyc | Bin 680 -> 0 bytes .../__pycache__/deprecation.cpython-312.pyc | Bin 4182 -> 0 bytes .../direct_url_helpers.cpython-312.pyc | Bin 3559 -> 0 bytes .../__pycache__/egg_link.cpython-312.pyc | Bin 3222 -> 0 bytes .../__pycache__/encoding.cpython-312.pyc | Bin 2154 -> 0 bytes .../__pycache__/entrypoints.cpython-312.pyc | Bin 3989 -> 0 bytes .../__pycache__/filesystem.cpython-312.pyc | Bin 7454 -> 0 bytes .../__pycache__/filetypes.cpython-312.pyc | Bin 1160 -> 0 bytes .../utils/__pycache__/glibc.cpython-312.pyc | Bin 2338 -> 0 bytes .../utils/__pycache__/hashes.cpython-312.pyc | Bin 7550 -> 0 bytes .../utils/__pycache__/logging.cpython-312.pyc | Bin 13553 -> 0 bytes .../utils/__pycache__/misc.cpython-312.pyc | Bin 34117 -> 0 bytes .../utils/__pycache__/models.cpython-312.pyc | Bin 2708 -> 0 bytes .../__pycache__/packaging.cpython-312.pyc | Bin 2579 -> 0 bytes .../setuptools_build.cpython-312.pyc | Bin 4546 -> 0 bytes .../__pycache__/subprocess.cpython-312.pyc | Bin 8714 -> 0 bytes .../__pycache__/temp_dir.cpython-312.pyc | Bin 12058 -> 0 bytes .../__pycache__/unpacking.cpython-312.pyc | Bin 11104 -> 0 bytes .../utils/__pycache__/urls.cpython-312.pyc | Bin 2401 -> 0 bytes .../__pycache__/virtualenv.cpython-312.pyc | Bin 4476 -> 0 bytes .../utils/__pycache__/wheel.cpython-312.pyc | Bin 5922 -> 0 bytes .../vcs/__pycache__/__init__.cpython-312.pyc | Bin 530 -> 0 bytes .../vcs/__pycache__/bazaar.cpython-312.pyc | Bin 5022 -> 0 bytes .../vcs/__pycache__/git.cpython-312.pyc | Bin 18991 -> 0 bytes .../vcs/__pycache__/mercurial.cpython-312.pyc | Bin 7611 -> 0 bytes .../__pycache__/subversion.cpython-312.pyc | Bin 12483 -> 0 bytes .../versioncontrol.cpython-312.pyc | Bin 29009 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 4692 -> 0 bytes .../_vendor/__pycache__/six.cpython-312.pyc | Bin 41269 -> 0 bytes .../typing_extensions.cpython-312.pyc | Bin 122049 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 902 -> 0 bytes .../__pycache__/_cmd.cpython-312.pyc | Bin 2646 -> 0 bytes .../__pycache__/adapter.cpython-312.pyc | Bin 6464 -> 0 bytes .../__pycache__/cache.cpython-312.pyc | Bin 3809 -> 0 bytes .../__pycache__/controller.cpython-312.pyc | Bin 16167 -> 0 bytes .../__pycache__/filewrapper.cpython-312.pyc | Bin 4347 -> 0 bytes .../__pycache__/heuristics.cpython-312.pyc | Bin 6694 -> 0 bytes .../__pycache__/serialize.cpython-312.pyc | Bin 6405 -> 0 bytes .../__pycache__/wrapper.cpython-312.pyc | Bin 1674 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 435 -> 0 bytes .../__pycache__/file_cache.cpython-312.pyc | Bin 7710 -> 0 bytes .../__pycache__/redis_cache.cpython-312.pyc | Bin 2738 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 318 -> 0 bytes .../__pycache__/__main__.cpython-312.pyc | Bin 645 -> 0 bytes .../certifi/__pycache__/core.cpython-312.pyc | Bin 3327 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 4568 -> 0 bytes .../__pycache__/big5freq.cpython-312.pyc | Bin 27199 -> 0 bytes .../__pycache__/big5prober.cpython-312.pyc | Bin 1387 -> 0 bytes .../chardistribution.cpython-312.pyc | Bin 9638 -> 0 bytes .../charsetgroupprober.cpython-312.pyc | Bin 4122 -> 0 bytes .../__pycache__/charsetprober.cpython-312.pyc | Bin 5018 -> 0 bytes .../codingstatemachine.cpython-312.pyc | Bin 3878 -> 0 bytes .../codingstatemachinedict.cpython-312.pyc | Bin 789 -> 0 bytes .../__pycache__/cp949prober.cpython-312.pyc | Bin 1396 -> 0 bytes .../chardet/__pycache__/enums.cpython-312.pyc | Bin 2996 -> 0 bytes .../__pycache__/escprober.cpython-312.pyc | Bin 4566 -> 0 bytes .../chardet/__pycache__/escsm.cpython-312.pyc | Bin 15310 -> 0 bytes .../__pycache__/eucjpprober.cpython-312.pyc | Bin 4383 -> 0 bytes .../__pycache__/euckrfreq.cpython-312.pyc | Bin 12082 -> 0 bytes .../__pycache__/euckrprober.cpython-312.pyc | Bin 1390 -> 0 bytes .../__pycache__/euctwfreq.cpython-312.pyc | Bin 27204 -> 0 bytes .../__pycache__/euctwprober.cpython-312.pyc | Bin 1390 -> 0 bytes .../__pycache__/gb2312freq.cpython-312.pyc | Bin 19126 -> 0 bytes .../__pycache__/gb2312prober.cpython-312.pyc | Bin 1403 -> 0 bytes .../__pycache__/hebrewprober.cpython-312.pyc | Bin 5822 -> 0 bytes .../__pycache__/jisfreq.cpython-312.pyc | Bin 22155 -> 0 bytes .../__pycache__/johabfreq.cpython-312.pyc | Bin 83003 -> 0 bytes .../__pycache__/johabprober.cpython-312.pyc | Bin 1394 -> 0 bytes .../__pycache__/jpcntx.cpython-312.pyc | Bin 39549 -> 0 bytes .../langbulgarianmodel.cpython-312.pyc | Bin 83122 -> 0 bytes .../langgreekmodel.cpython-312.pyc | Bin 76988 -> 0 bytes .../langhebrewmodel.cpython-312.pyc | Bin 77499 -> 0 bytes .../langhungarianmodel.cpython-312.pyc | Bin 83076 -> 0 bytes .../langrussianmodel.cpython-312.pyc | Bin 105251 -> 0 bytes .../__pycache__/langthaimodel.cpython-312.pyc | Bin 77677 -> 0 bytes .../langturkishmodel.cpython-312.pyc | Bin 77516 -> 0 bytes .../__pycache__/latin1prober.cpython-312.pyc | Bin 7002 -> 0 bytes .../macromanprober.cpython-312.pyc | Bin 7182 -> 0 bytes .../mbcharsetprober.cpython-312.pyc | Bin 3903 -> 0 bytes .../mbcsgroupprober.cpython-312.pyc | Bin 1588 -> 0 bytes .../__pycache__/mbcssm.cpython-312.pyc | Bin 38645 -> 0 bytes .../__pycache__/resultdict.cpython-312.pyc | Bin 632 -> 0 bytes .../sbcharsetprober.cpython-312.pyc | Bin 6387 -> 0 bytes .../sbcsgroupprober.cpython-312.pyc | Bin 2357 -> 0 bytes .../__pycache__/sjisprober.cpython-312.pyc | Bin 4495 -> 0 bytes .../universaldetector.cpython-312.pyc | Bin 12269 -> 0 bytes .../__pycache__/utf1632prober.cpython-312.pyc | Bin 9979 -> 0 bytes .../__pycache__/utf8prober.cpython-312.pyc | Bin 3175 -> 0 bytes .../__pycache__/version.cpython-312.pyc | Bin 488 -> 0 bytes .../cli/__pycache__/__init__.cpython-312.pyc | Bin 195 -> 0 bytes .../__pycache__/chardetect.cpython-312.pyc | Bin 4012 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 200 -> 0 bytes .../__pycache__/languages.cpython-312.pyc | Bin 9755 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 492 -> 0 bytes .../colorama/__pycache__/ansi.cpython-312.pyc | Bin 3950 -> 0 bytes .../__pycache__/ansitowin32.cpython-312.pyc | Bin 16421 -> 0 bytes .../__pycache__/initialise.cpython-312.pyc | Bin 3550 -> 0 bytes .../__pycache__/win32.cpython-312.pyc | Bin 8126 -> 0 bytes .../__pycache__/winterm.cpython-312.pyc | Bin 9088 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 198 -> 0 bytes .../__pycache__/ansi_test.cpython-312.pyc | Bin 5467 -> 0 bytes .../ansitowin32_test.cpython-312.pyc | Bin 18103 -> 0 bytes .../initialise_test.cpython-312.pyc | Bin 11748 -> 0 bytes .../__pycache__/isatty_test.cpython-312.pyc | Bin 4904 -> 0 bytes .../tests/__pycache__/utils.cpython-312.pyc | Bin 2488 -> 0 bytes .../__pycache__/winterm_test.cpython-312.pyc | Bin 6612 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1269 -> 0 bytes .../__pycache__/compat.cpython-312.pyc | Bin 45605 -> 0 bytes .../__pycache__/database.cpython-312.pyc | Bin 66027 -> 0 bytes .../distlib/__pycache__/index.cpython-312.pyc | Bin 24366 -> 0 bytes .../__pycache__/locators.cpython-312.pyc | Bin 60158 -> 0 bytes .../__pycache__/manifest.cpython-312.pyc | Bin 15125 -> 0 bytes .../__pycache__/markers.cpython-312.pyc | Bin 7682 -> 0 bytes .../__pycache__/metadata.cpython-312.pyc | Bin 41799 -> 0 bytes .../__pycache__/resources.cpython-312.pyc | Bin 17325 -> 0 bytes .../__pycache__/scripts.cpython-312.pyc | Bin 19580 -> 0 bytes .../distlib/__pycache__/util.cpython-312.pyc | Bin 88256 -> 0 bytes .../__pycache__/version.cpython-312.pyc | Bin 30366 -> 0 bytes .../distlib/__pycache__/wheel.cpython-312.pyc | Bin 51861 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 960 -> 0 bytes .../__pycache__/__main__.cpython-312.pyc | Bin 292 -> 0 bytes .../distro/__pycache__/distro.cpython-312.pyc | Bin 53754 -> 0 bytes .../idna/__pycache__/__init__.cpython-312.pyc | Bin 881 -> 0 bytes .../idna/__pycache__/codec.cpython-312.pyc | Bin 4633 -> 0 bytes .../idna/__pycache__/compat.cpython-312.pyc | Bin 887 -> 0 bytes .../idna/__pycache__/core.cpython-312.pyc | Bin 16023 -> 0 bytes .../idna/__pycache__/idnadata.cpython-312.pyc | Bin 99497 -> 0 bytes .../__pycache__/intranges.cpython-312.pyc | Bin 2638 -> 0 bytes .../__pycache__/package_data.cpython-312.pyc | Bin 216 -> 0 bytes .../__pycache__/uts46data.cpython-312.pyc | Bin 158870 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1831 -> 0 bytes .../__pycache__/exceptions.cpython-312.pyc | Bin 2025 -> 0 bytes .../msgpack/__pycache__/ext.cpython-312.pyc | Bin 8668 -> 0 bytes .../__pycache__/fallback.cpython-312.pyc | Bin 43576 -> 0 bytes .../__pycache__/__about__.cpython-312.pyc | Bin 630 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 466 -> 0 bytes .../__pycache__/_manylinux.cpython-312.pyc | Bin 12076 -> 0 bytes .../__pycache__/_musllinux.cpython-312.pyc | Bin 6910 -> 0 bytes .../__pycache__/_structures.cpython-312.pyc | Bin 3241 -> 0 bytes .../__pycache__/markers.cpython-312.pyc | Bin 14058 -> 0 bytes .../__pycache__/requirements.cpython-312.pyc | Bin 6946 -> 0 bytes .../__pycache__/specifiers.cpython-312.pyc | Bin 31247 -> 0 bytes .../__pycache__/tags.cpython-312.pyc | Bin 18956 -> 0 bytes .../__pycache__/utils.cpython-312.pyc | Bin 5868 -> 0 bytes .../__pycache__/version.cpython-312.pyc | Bin 19939 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 146474 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 18029 -> 0 bytes .../__pycache__/__main__.cpython-312.pyc | Bin 1946 -> 0 bytes .../__pycache__/android.cpython-312.pyc | Bin 9444 -> 0 bytes .../__pycache__/api.cpython-312.pyc | Bin 9672 -> 0 bytes .../__pycache__/macos.cpython-312.pyc | Bin 5637 -> 0 bytes .../__pycache__/unix.cpython-312.pyc | Bin 12441 -> 0 bytes .../__pycache__/version.cpython-312.pyc | Bin 311 -> 0 bytes .../__pycache__/windows.cpython-312.pyc | Bin 12999 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 3489 -> 0 bytes .../__pycache__/__main__.cpython-312.pyc | Bin 735 -> 0 bytes .../__pycache__/cmdline.cpython-312.pyc | Bin 26606 -> 0 bytes .../__pycache__/console.cpython-312.pyc | Bin 2627 -> 0 bytes .../__pycache__/filter.cpython-312.pyc | Bin 3233 -> 0 bytes .../__pycache__/formatter.cpython-312.pyc | Bin 4570 -> 0 bytes .../__pycache__/lexer.cpython-312.pyc | Bin 38330 -> 0 bytes .../__pycache__/modeline.cpython-312.pyc | Bin 1569 -> 0 bytes .../__pycache__/plugin.cpython-312.pyc | Bin 3397 -> 0 bytes .../__pycache__/regexopt.cpython-312.pyc | Bin 4082 -> 0 bytes .../__pycache__/scanner.cpython-312.pyc | Bin 4757 -> 0 bytes .../__pycache__/sphinxext.cpython-312.pyc | Bin 11047 -> 0 bytes .../__pycache__/style.cpython-312.pyc | Bin 6675 -> 0 bytes .../__pycache__/token.cpython-312.pyc | Bin 8143 -> 0 bytes .../__pycache__/unistring.cpython-312.pyc | Bin 32989 -> 0 bytes .../pygments/__pycache__/util.cpython-312.pyc | Bin 13982 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 37937 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 6927 -> 0 bytes .../__pycache__/_mapping.cpython-312.pyc | Bin 4216 -> 0 bytes .../__pycache__/bbcode.cpython-312.pyc | Bin 4195 -> 0 bytes .../__pycache__/groff.cpython-312.pyc | Bin 7265 -> 0 bytes .../__pycache__/html.cpython-312.pyc | Bin 40573 -> 0 bytes .../__pycache__/img.cpython-312.pyc | Bin 27044 -> 0 bytes .../__pycache__/irc.cpython-312.pyc | Bin 6066 -> 0 bytes .../__pycache__/latex.cpython-312.pyc | Bin 19955 -> 0 bytes .../__pycache__/other.cpython-312.pyc | Bin 6885 -> 0 bytes .../__pycache__/pangomarkup.cpython-312.pyc | Bin 2931 -> 0 bytes .../__pycache__/rtf.cpython-312.pyc | Bin 6127 -> 0 bytes .../__pycache__/svg.cpython-312.pyc | Bin 9067 -> 0 bytes .../__pycache__/terminal.cpython-312.pyc | Bin 5830 -> 0 bytes .../__pycache__/terminal256.cpython-312.pyc | Bin 15158 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 14653 -> 0 bytes .../__pycache__/_mapping.cpython-312.pyc | Bin 64405 -> 0 bytes .../lexers/__pycache__/python.cpython-312.pyc | Bin 42640 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 4449 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 7912 -> 0 bytes .../__pycache__/actions.cpython-312.pyc | Bin 8396 -> 0 bytes .../__pycache__/common.cpython-312.pyc | Bin 13415 -> 0 bytes .../__pycache__/core.cpython-312.pyc | Bin 267709 -> 0 bytes .../__pycache__/exceptions.cpython-312.pyc | Bin 12995 -> 0 bytes .../__pycache__/helpers.cpython-312.pyc | Bin 48502 -> 0 bytes .../__pycache__/results.cpython-312.pyc | Bin 34111 -> 0 bytes .../__pycache__/testing.cpython-312.pyc | Bin 17189 -> 0 bytes .../__pycache__/unicode.cpython-312.pyc | Bin 13185 -> 0 bytes .../__pycache__/util.cpython-312.pyc | Bin 14905 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 26814 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 614 -> 0 bytes .../__pycache__/_compat.cpython-312.pyc | Bin 375 -> 0 bytes .../__pycache__/_impl.cpython-312.pyc | Bin 14726 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1081 -> 0 bytes .../__pycache__/_in_process.cpython-312.pyc | Bin 14398 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 5454 -> 0 bytes .../__pycache__/__version__.cpython-312.pyc | Bin 585 -> 0 bytes .../_internal_utils.cpython-312.pyc | Bin 2025 -> 0 bytes .../__pycache__/adapters.cpython-312.pyc | Bin 21281 -> 0 bytes .../requests/__pycache__/api.cpython-312.pyc | Bin 7205 -> 0 bytes .../requests/__pycache__/auth.cpython-312.pyc | Bin 13924 -> 0 bytes .../__pycache__/certs.cpython-312.pyc | Bin 923 -> 0 bytes .../__pycache__/compat.cpython-312.pyc | Bin 1508 -> 0 bytes .../__pycache__/cookies.cpython-312.pyc | Bin 25247 -> 0 bytes .../__pycache__/exceptions.cpython-312.pyc | Bin 7048 -> 0 bytes .../requests/__pycache__/help.cpython-312.pyc | Bin 4313 -> 0 bytes .../__pycache__/hooks.cpython-312.pyc | Bin 1053 -> 0 bytes .../__pycache__/models.cpython-312.pyc | Bin 35449 -> 0 bytes .../__pycache__/packages.cpython-312.pyc | Bin 773 -> 0 bytes .../__pycache__/sessions.cpython-312.pyc | Bin 27758 -> 0 bytes .../__pycache__/status_codes.cpython-312.pyc | Bin 5960 -> 0 bytes .../__pycache__/structures.cpython-312.pyc | Bin 5618 -> 0 bytes .../__pycache__/utils.cpython-312.pyc | Bin 36076 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 635 -> 0 bytes .../__pycache__/providers.cpython-312.pyc | Bin 6852 -> 0 bytes .../__pycache__/reporters.cpython-312.pyc | Bin 2655 -> 0 bytes .../__pycache__/resolvers.cpython-312.pyc | Bin 25898 -> 0 bytes .../__pycache__/structs.cpython-312.pyc | Bin 10507 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 201 -> 0 bytes .../collections_abc.cpython-312.pyc | Bin 421 -> 0 bytes .../rich/__pycache__/__init__.cpython-312.pyc | Bin 7016 -> 0 bytes .../rich/__pycache__/__main__.cpython-312.pyc | Bin 10305 -> 0 bytes .../__pycache__/_cell_widths.cpython-312.pyc | Bin 7822 -> 0 bytes .../__pycache__/_emoji_codes.cpython-312.pyc | Bin 205977 -> 0 bytes .../_emoji_replace.cpython-312.pyc | Bin 1730 -> 0 bytes .../_export_format.cpython-312.pyc | Bin 2322 -> 0 bytes .../__pycache__/_extension.cpython-312.pyc | Bin 538 -> 0 bytes .../rich/__pycache__/_fileno.cpython-312.pyc | Bin 856 -> 0 bytes .../rich/__pycache__/_inspect.cpython-312.pyc | Bin 12078 -> 0 bytes .../__pycache__/_log_render.cpython-312.pyc | Bin 4148 -> 0 bytes .../rich/__pycache__/_loop.cpython-312.pyc | Bin 1886 -> 0 bytes .../__pycache__/_null_file.cpython-312.pyc | Bin 3621 -> 0 bytes .../__pycache__/_palettes.cpython-312.pyc | Bin 5161 -> 0 bytes .../rich/__pycache__/_pick.cpython-312.pyc | Bin 727 -> 0 bytes .../rich/__pycache__/_ratio.cpython-312.pyc | Bin 6580 -> 0 bytes .../__pycache__/_spinners.cpython-312.pyc | Bin 13180 -> 0 bytes .../rich/__pycache__/_stack.cpython-312.pyc | Bin 966 -> 0 bytes .../rich/__pycache__/_timer.cpython-312.pyc | Bin 866 -> 0 bytes .../_win32_console.cpython-312.pyc | Bin 28977 -> 0 bytes .../rich/__pycache__/_windows.cpython-312.pyc | Bin 2491 -> 0 bytes .../_windows_renderer.cpython-312.pyc | Bin 3574 -> 0 bytes .../rich/__pycache__/_wrap.cpython-312.pyc | Bin 2361 -> 0 bytes .../rich/__pycache__/abc.cpython-312.pyc | Bin 1609 -> 0 bytes .../rich/__pycache__/align.cpython-312.pyc | Bin 12323 -> 0 bytes .../rich/__pycache__/ansi.cpython-312.pyc | Bin 9107 -> 0 bytes .../rich/__pycache__/bar.cpython-312.pyc | Bin 4273 -> 0 bytes .../rich/__pycache__/box.cpython-312.pyc | Bin 11859 -> 0 bytes .../rich/__pycache__/cells.cpython-312.pyc | Bin 5619 -> 0 bytes .../rich/__pycache__/color.cpython-312.pyc | Bin 26571 -> 0 bytes .../__pycache__/color_triplet.cpython-312.pyc | Bin 1702 -> 0 bytes .../rich/__pycache__/columns.cpython-312.pyc | Bin 8588 -> 0 bytes .../rich/__pycache__/console.cpython-312.pyc | Bin 113794 -> 0 bytes .../__pycache__/constrain.cpython-312.pyc | Bin 2259 -> 0 bytes .../__pycache__/containers.cpython-312.pyc | Bin 9227 -> 0 bytes .../rich/__pycache__/control.cpython-312.pyc | Bin 10930 -> 0 bytes .../default_styles.cpython-312.pyc | Bin 10374 -> 0 bytes .../rich/__pycache__/diagnose.cpython-312.pyc | Bin 1488 -> 0 bytes .../rich/__pycache__/emoji.cpython-312.pyc | Bin 4210 -> 0 bytes .../rich/__pycache__/errors.cpython-312.pyc | Bin 1846 -> 0 bytes .../__pycache__/file_proxy.cpython-312.pyc | Bin 3578 -> 0 bytes .../rich/__pycache__/filesize.cpython-312.pyc | Bin 3083 -> 0 bytes .../__pycache__/highlighter.cpython-312.pyc | Bin 9899 -> 0 bytes .../rich/__pycache__/json.cpython-312.pyc | Bin 6036 -> 0 bytes .../rich/__pycache__/jupyter.cpython-312.pyc | Bin 5210 -> 0 bytes .../rich/__pycache__/layout.cpython-312.pyc | Bin 20221 -> 0 bytes .../rich/__pycache__/live.cpython-312.pyc | Bin 19144 -> 0 bytes .../__pycache__/live_render.cpython-312.pyc | Bin 4895 -> 0 bytes .../rich/__pycache__/logging.cpython-312.pyc | Bin 13555 -> 0 bytes .../rich/__pycache__/markup.cpython-312.pyc | Bin 9299 -> 0 bytes .../rich/__pycache__/measure.cpython-312.pyc | Bin 6377 -> 0 bytes .../rich/__pycache__/padding.cpython-312.pyc | Bin 7135 -> 0 bytes .../rich/__pycache__/pager.cpython-312.pyc | Bin 1821 -> 0 bytes .../rich/__pycache__/palette.cpython-312.pyc | Bin 5315 -> 0 bytes .../rich/__pycache__/panel.cpython-312.pyc | Bin 12098 -> 0 bytes .../rich/__pycache__/pretty.cpython-312.pyc | Bin 40057 -> 0 bytes .../rich/__pycache__/progress.cpython-312.pyc | Bin 75079 -> 0 bytes .../__pycache__/progress_bar.cpython-312.pyc | Bin 10390 -> 0 bytes .../rich/__pycache__/prompt.cpython-312.pyc | Bin 14782 -> 0 bytes .../rich/__pycache__/protocol.cpython-312.pyc | Bin 1793 -> 0 bytes .../rich/__pycache__/region.cpython-312.pyc | Bin 568 -> 0 bytes .../rich/__pycache__/repr.cpython-312.pyc | Bin 6627 -> 0 bytes .../rich/__pycache__/rule.cpython-312.pyc | Bin 6569 -> 0 bytes .../rich/__pycache__/scope.cpython-312.pyc | Bin 3831 -> 0 bytes .../rich/__pycache__/screen.cpython-312.pyc | Bin 2485 -> 0 bytes .../rich/__pycache__/segment.cpython-312.pyc | Bin 28162 -> 0 bytes .../rich/__pycache__/spinner.cpython-312.pyc | Bin 6065 -> 0 bytes .../rich/__pycache__/status.cpython-312.pyc | Bin 6069 -> 0 bytes .../rich/__pycache__/style.cpython-312.pyc | Bin 33515 -> 0 bytes .../rich/__pycache__/styled.cpython-312.pyc | Bin 2140 -> 0 bytes .../rich/__pycache__/syntax.cpython-312.pyc | Bin 39613 -> 0 bytes .../rich/__pycache__/table.cpython-312.pyc | Bin 43585 -> 0 bytes .../terminal_theme.cpython-312.pyc | Bin 3349 -> 0 bytes .../rich/__pycache__/text.cpython-312.pyc | Bin 58964 -> 0 bytes .../rich/__pycache__/theme.cpython-312.pyc | Bin 6341 -> 0 bytes .../rich/__pycache__/themes.cpython-312.pyc | Bin 315 -> 0 bytes .../__pycache__/traceback.cpython-312.pyc | Bin 31549 -> 0 bytes .../rich/__pycache__/tree.cpython-312.pyc | Bin 11440 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 27087 -> 0 bytes .../__pycache__/_asyncio.cpython-312.pyc | Bin 4807 -> 0 bytes .../__pycache__/_utils.cpython-312.pyc | Bin 2316 -> 0 bytes .../__pycache__/after.cpython-312.pyc | Bin 1625 -> 0 bytes .../__pycache__/before.cpython-312.pyc | Bin 1465 -> 0 bytes .../__pycache__/before_sleep.cpython-312.pyc | Bin 2303 -> 0 bytes .../tenacity/__pycache__/nap.cpython-312.pyc | Bin 1413 -> 0 bytes .../__pycache__/retry.cpython-312.pyc | Bin 14282 -> 0 bytes .../tenacity/__pycache__/stop.cpython-312.pyc | Bin 5569 -> 0 bytes .../__pycache__/tornadoweb.cpython-312.pyc | Bin 2587 -> 0 bytes .../tenacity/__pycache__/wait.cpython-312.pyc | Bin 12414 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 385 -> 0 bytes .../tomli/__pycache__/_parser.cpython-312.pyc | Bin 26928 -> 0 bytes .../tomli/__pycache__/_re.cpython-312.pyc | Bin 3909 -> 0 bytes .../tomli/__pycache__/_types.cpython-312.pyc | Bin 367 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 619 -> 0 bytes .../__pycache__/_api.cpython-312.pyc | Bin 15798 -> 0 bytes .../__pycache__/_macos.cpython-312.pyc | Bin 16663 -> 0 bytes .../__pycache__/_openssl.cpython-312.pyc | Bin 2216 -> 0 bytes .../_ssl_constants.cpython-312.pyc | Bin 1100 -> 0 bytes .../__pycache__/_windows.cpython-312.pyc | Bin 15507 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 3406 -> 0 bytes .../__pycache__/_collections.cpython-312.pyc | Bin 16489 -> 0 bytes .../__pycache__/_version.cpython-312.pyc | Bin 219 -> 0 bytes .../__pycache__/connection.cpython-312.pyc | Bin 20408 -> 0 bytes .../connectionpool.cpython-312.pyc | Bin 36443 -> 0 bytes .../__pycache__/exceptions.cpython-312.pyc | Bin 13494 -> 0 bytes .../__pycache__/fields.cpython-312.pyc | Bin 10414 -> 0 bytes .../__pycache__/filepost.cpython-312.pyc | Bin 4019 -> 0 bytes .../__pycache__/poolmanager.cpython-312.pyc | Bin 20801 -> 0 bytes .../__pycache__/request.cpython-312.pyc | Bin 7295 -> 0 bytes .../__pycache__/response.cpython-312.pyc | Bin 33969 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 199 -> 0 bytes .../_appengine_environ.cpython-312.pyc | Bin 1849 -> 0 bytes .../__pycache__/appengine.cpython-312.pyc | Bin 11565 -> 0 bytes .../__pycache__/ntlmpool.cpython-312.pyc | Bin 5720 -> 0 bytes .../__pycache__/pyopenssl.cpython-312.pyc | Bin 24451 -> 0 bytes .../securetransport.cpython-312.pyc | Bin 35557 -> 0 bytes .../contrib/__pycache__/socks.cpython-312.pyc | Bin 7512 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 216 -> 0 bytes .../__pycache__/bindings.cpython-312.pyc | Bin 17428 -> 0 bytes .../__pycache__/low_level.cpython-312.pyc | Bin 14802 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 200 -> 0 bytes .../packages/__pycache__/six.cpython-312.pyc | Bin 41320 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 210 -> 0 bytes .../__pycache__/makefile.cpython-312.pyc | Bin 1826 -> 0 bytes .../weakref_finalize.cpython-312.pyc | Bin 7332 -> 0 bytes .../util/__pycache__/__init__.cpython-312.pyc | Bin 1147 -> 0 bytes .../__pycache__/connection.cpython-312.pyc | Bin 4757 -> 0 bytes .../util/__pycache__/proxy.cpython-312.pyc | Bin 1553 -> 0 bytes .../util/__pycache__/queue.cpython-312.pyc | Bin 1353 -> 0 bytes .../util/__pycache__/request.cpython-312.pyc | Bin 4184 -> 0 bytes .../util/__pycache__/response.cpython-312.pyc | Bin 2990 -> 0 bytes .../util/__pycache__/retry.cpython-312.pyc | Bin 21719 -> 0 bytes .../util/__pycache__/ssl_.cpython-312.pyc | Bin 15104 -> 0 bytes .../ssl_match_hostname.cpython-312.pyc | Bin 5072 -> 0 bytes .../__pycache__/ssltransport.cpython-312.pyc | Bin 10773 -> 0 bytes .../util/__pycache__/timeout.cpython-312.pyc | Bin 11140 -> 0 bytes .../util/__pycache__/url.cpython-312.pyc | Bin 15796 -> 0 bytes .../util/__pycache__/wait.cpython-312.pyc | Bin 4404 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 12002 -> 0 bytes .../__pycache__/labels.cpython-312.pyc | Bin 7133 -> 0 bytes .../__pycache__/mklabels.cpython-312.pyc | Bin 2700 -> 0 bytes .../__pycache__/tests.cpython-312.pyc | Bin 9252 -> 0 bytes .../x_user_defined.cpython-312.pyc | Bin 3296 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 514 -> 0 bytes .../__pycache__/__main__.cpython-312.pyc | Bin 5114 -> 0 bytes .../__pycache__/__version__.cpython-312.pyc | Bin 561 -> 0 bytes .../__pycache__/slugify.cpython-312.pyc | Bin 6802 -> 0 bytes .../__pycache__/special.cpython-312.pyc | Bin 1123 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 9418 -> 0 bytes .../__pycache__/events.cpython-312.pyc | Bin 555 -> 0 bytes .../__pycache__/exc.cpython-312.pyc | Bin 31226 -> 0 bytes .../__pycache__/inspection.cpython-312.pyc | Bin 6658 -> 0 bytes .../__pycache__/log.cpython-312.pyc | Bin 11616 -> 0 bytes .../__pycache__/schema.cpython-312.pyc | Bin 2370 -> 0 bytes .../__pycache__/types.cpython-312.pyc | Bin 2280 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 594 -> 0 bytes .../__pycache__/aioodbc.cpython-312.pyc | Bin 7841 -> 0 bytes .../__pycache__/asyncio.cpython-312.pyc | Bin 21657 -> 0 bytes .../__pycache__/pyodbc.cpython-312.pyc | Bin 9626 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 194 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1910 -> 0 bytes .../__pycache__/_typing.cpython-312.pyc | Bin 1084 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1662 -> 0 bytes .../mssql/__pycache__/aioodbc.cpython-312.pyc | Bin 2403 -> 0 bytes .../mssql/__pycache__/base.cpython-312.pyc | Bin 153640 -> 0 bytes .../information_schema.cpython-312.pyc | Bin 8938 -> 0 bytes .../mssql/__pycache__/json.cpython-312.pyc | Bin 5219 -> 0 bytes .../__pycache__/provision.cpython-312.pyc | Bin 8255 -> 0 bytes .../mssql/__pycache__/pymssql.cpython-312.pyc | Bin 5951 -> 0 bytes .../mssql/__pycache__/pyodbc.cpython-312.pyc | Bin 30615 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1991 -> 0 bytes .../__pycache__/aiomysql.cpython-312.pyc | Bin 11744 -> 0 bytes .../mysql/__pycache__/asyncmy.cpython-312.pyc | Bin 11221 -> 0 bytes .../mysql/__pycache__/base.cpython-312.pyc | Bin 155066 -> 0 bytes .../mysql/__pycache__/cymysql.cpython-312.pyc | Bin 4098 -> 0 bytes .../mysql/__pycache__/dml.cpython-312.pyc | Bin 8349 -> 0 bytes .../__pycache__/enumerated.cpython-312.pyc | Bin 11527 -> 0 bytes .../__pycache__/expression.cpython-312.pyc | Bin 5225 -> 0 bytes .../mysql/__pycache__/json.cpython-312.pyc | Bin 3939 -> 0 bytes .../mysql/__pycache__/mariadb.cpython-312.pyc | Bin 2659 -> 0 bytes .../mariadbconnector.cpython-312.pyc | Bin 13785 -> 0 bytes .../mysqlconnector.cpython-312.pyc | Bin 14203 -> 0 bytes .../mysql/__pycache__/mysqldb.cpython-312.pyc | Bin 12376 -> 0 bytes .../__pycache__/provision.cpython-312.pyc | Bin 6403 -> 0 bytes .../mysql/__pycache__/pymysql.cpython-312.pyc | Bin 6215 -> 0 bytes .../mysql/__pycache__/pyodbc.cpython-312.pyc | Bin 6101 -> 0 bytes .../__pycache__/reflection.cpython-312.pyc | Bin 25898 -> 0 bytes .../reserved_words.cpython-312.pyc | Bin 4391 -> 0 bytes .../mysql/__pycache__/types.cpython-312.pyc | Bin 33060 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1663 -> 0 bytes .../oracle/__pycache__/base.cpython-312.pyc | Bin 153951 -> 0 bytes .../__pycache__/cx_oracle.cpython-312.pyc | Bin 61005 -> 0 bytes .../__pycache__/dictionary.cpython-312.pyc | Bin 24598 -> 0 bytes .../__pycache__/oracledb.cpython-312.pyc | Bin 41079 -> 0 bytes .../__pycache__/provision.cpython-312.pyc | Bin 13292 -> 0 bytes .../oracle/__pycache__/types.cpython-312.pyc | Bin 13212 -> 0 bytes .../oracle/__pycache__/vector.cpython-312.pyc | Bin 12226 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 3432 -> 0 bytes .../_psycopg_common.cpython-312.pyc | Bin 7924 -> 0 bytes .../__pycache__/array.cpython-312.pyc | Bin 19552 -> 0 bytes .../__pycache__/asyncpg.cpython-312.pyc | Bin 58826 -> 0 bytes .../__pycache__/base.cpython-312.pyc | Bin 216452 -> 0 bytes .../__pycache__/dml.cpython-312.pyc | Bin 12586 -> 0 bytes .../__pycache__/ext.cpython-312.pyc | Bin 20619 -> 0 bytes .../__pycache__/hstore.cpython-312.pyc | Bin 15368 -> 0 bytes .../__pycache__/json.cpython-312.pyc | Bin 17138 -> 0 bytes .../__pycache__/named_types.cpython-312.pyc | Bin 23069 -> 0 bytes .../__pycache__/operators.cpython-312.pyc | Bin 2155 -> 0 bytes .../__pycache__/pg8000.cpython-312.pyc | Bin 30517 -> 0 bytes .../__pycache__/pg_catalog.cpython-312.pyc | Bin 11868 -> 0 bytes .../__pycache__/provision.cpython-312.pyc | Bin 7778 -> 0 bytes .../__pycache__/psycopg.cpython-312.pyc | Bin 40789 -> 0 bytes .../__pycache__/psycopg2.cpython-312.pyc | Bin 35986 -> 0 bytes .../__pycache__/psycopg2cffi.cpython-312.pyc | Bin 2162 -> 0 bytes .../__pycache__/ranges.cpython-312.pyc | Bin 34766 -> 0 bytes .../__pycache__/types.cpython-312.pyc | Bin 11513 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1058 -> 0 bytes .../__pycache__/aiosqlite.cpython-312.pyc | Bin 22001 -> 0 bytes .../sqlite/__pycache__/base.cpython-312.pyc | Bin 109133 -> 0 bytes .../sqlite/__pycache__/dml.cpython-312.pyc | Bin 10041 -> 0 bytes .../sqlite/__pycache__/json.cpython-312.pyc | Bin 3770 -> 0 bytes .../__pycache__/provision.cpython-312.pyc | Bin 8750 -> 0 bytes .../__pycache__/pysqlcipher.cpython-312.pyc | Bin 6217 -> 0 bytes .../__pycache__/pysqlite.cpython-312.pyc | Bin 31221 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 2273 -> 0 bytes .../_py_processors.cpython-312.pyc | Bin 4496 -> 0 bytes .../__pycache__/_py_row.cpython-312.pyc | Bin 5765 -> 0 bytes .../__pycache__/_py_util.cpython-312.pyc | Bin 2204 -> 0 bytes .../engine/__pycache__/base.cpython-312.pyc | Bin 130333 -> 0 bytes .../characteristics.cpython-312.pyc | Bin 6842 -> 0 bytes .../engine/__pycache__/create.cpython-312.pyc | Bin 34999 -> 0 bytes .../engine/__pycache__/cursor.cpython-312.pyc | Bin 83020 -> 0 bytes .../__pycache__/default.cpython-312.pyc | Bin 89159 -> 0 bytes .../engine/__pycache__/events.cpython-312.pyc | Bin 39925 -> 0 bytes .../__pycache__/interfaces.cpython-312.pyc | Bin 102560 -> 0 bytes .../engine/__pycache__/mock.cpython-312.pyc | Bin 5679 -> 0 bytes .../__pycache__/processors.cpython-312.pyc | Bin 1287 -> 0 bytes .../__pycache__/reflection.cpython-312.pyc | Bin 80802 -> 0 bytes .../engine/__pycache__/result.cpython-312.pyc | Bin 91742 -> 0 bytes .../engine/__pycache__/row.cpython-312.pyc | Bin 17416 -> 0 bytes .../__pycache__/strategies.cpython-312.pyc | Bin 551 -> 0 bytes .../engine/__pycache__/url.cpython-312.pyc | Bin 34408 -> 0 bytes .../engine/__pycache__/util.cpython-312.pyc | Bin 6641 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 882 -> 0 bytes .../event/__pycache__/api.cpython-312.pyc | Bin 9074 -> 0 bytes .../event/__pycache__/attr.cpython-312.pyc | Bin 31099 -> 0 bytes .../event/__pycache__/base.cpython-312.pyc | Bin 19995 -> 0 bytes .../event/__pycache__/legacy.cpython-312.pyc | Bin 9695 -> 0 bytes .../__pycache__/registry.cpython-312.pyc | Bin 12615 -> 0 bytes .../ext/__pycache__/__init__.cpython-312.pyc | Bin 349 -> 0 bytes .../associationproxy.cpython-312.pyc | Bin 87325 -> 0 bytes .../ext/__pycache__/automap.cpython-312.pyc | Bin 57405 -> 0 bytes .../ext/__pycache__/baked.cpython-312.pyc | Bin 23397 -> 0 bytes .../ext/__pycache__/compiler.cpython-312.pyc | Bin 21247 -> 0 bytes .../horizontal_shard.cpython-312.pyc | Bin 17665 -> 0 bytes .../ext/__pycache__/hybrid.cpython-312.pyc | Bin 59983 -> 0 bytes .../ext/__pycache__/indexable.cpython-312.pyc | Bin 13079 -> 0 bytes .../instrumentation.cpython-312.pyc | Bin 19884 -> 0 bytes .../ext/__pycache__/mutable.cpython-312.pyc | Bin 45872 -> 0 bytes .../__pycache__/orderinglist.cpython-312.pyc | Bin 18093 -> 0 bytes .../__pycache__/serializer.cpython-312.pyc | Bin 8044 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 972 -> 0 bytes .../asyncio/__pycache__/base.cpython-312.pyc | Bin 11350 -> 0 bytes .../__pycache__/engine.cpython-312.pyc | Bin 57557 -> 0 bytes .../asyncio/__pycache__/exc.cpython-312.pyc | Bin 1032 -> 0 bytes .../__pycache__/result.cpython-312.pyc | Bin 37671 -> 0 bytes .../__pycache__/scoping.cpython-312.pyc | Bin 56492 -> 0 bytes .../__pycache__/session.cpython-312.pyc | Bin 71602 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 2008 -> 0 bytes .../__pycache__/extensions.cpython-312.pyc | Bin 21276 -> 0 bytes .../mypy/__pycache__/__init__.cpython-312.pyc | Bin 191 -> 0 bytes .../mypy/__pycache__/apply.cpython-312.pyc | Bin 10538 -> 0 bytes .../__pycache__/decl_class.cpython-312.pyc | Bin 15842 -> 0 bytes .../mypy/__pycache__/infer.cpython-312.pyc | Bin 15631 -> 0 bytes .../mypy/__pycache__/names.cpython-312.pyc | Bin 11044 -> 0 bytes .../mypy/__pycache__/plugin.cpython-312.pyc | Bin 12515 -> 0 bytes .../ext/mypy/__pycache__/util.cpython-312.pyc | Bin 14001 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 459 -> 0 bytes .../future/__pycache__/engine.cpython-312.pyc | Bin 392 -> 0 bytes .../orm/__pycache__/__init__.cpython-312.pyc | Bin 6383 -> 0 bytes .../_orm_constructors.cpython-312.pyc | Bin 107027 -> 0 bytes .../orm/__pycache__/_typing.cpython-312.pyc | Bin 6799 -> 0 bytes .../__pycache__/attributes.cpython-312.pyc | Bin 100596 -> 0 bytes .../orm/__pycache__/base.cpython-312.pyc | Bin 30333 -> 0 bytes .../bulk_persistence.cpython-312.pyc | Bin 64713 -> 0 bytes .../__pycache__/clsregistry.cpython-312.pyc | Bin 23764 -> 0 bytes .../__pycache__/collections.cpython-312.pyc | Bin 61940 -> 0 bytes .../orm/__pycache__/context.cpython-312.pyc | Bin 103224 -> 0 bytes .../orm/__pycache__/decl_api.cpython-312.pyc | Bin 69701 -> 0 bytes .../orm/__pycache__/decl_base.cpython-312.pyc | Bin 68984 -> 0 bytes .../__pycache__/dependency.cpython-312.pyc | Bin 43336 -> 0 bytes .../descriptor_props.cpython-312.pyc | Bin 49634 -> 0 bytes .../orm/__pycache__/dynamic.cpython-312.pyc | Bin 12936 -> 0 bytes .../orm/__pycache__/evaluator.cpython-312.pyc | Bin 16756 -> 0 bytes .../orm/__pycache__/events.cpython-312.pyc | Bin 136514 -> 0 bytes .../orm/__pycache__/exc.cpython-312.pyc | Bin 10214 -> 0 bytes .../orm/__pycache__/identity.cpython-312.pyc | Bin 12622 -> 0 bytes .../instrumentation.cpython-312.pyc | Bin 31214 -> 0 bytes .../__pycache__/interfaces.cpython-312.pyc | Bin 54591 -> 0 bytes .../orm/__pycache__/loading.cpython-312.pyc | Bin 47118 -> 0 bytes .../mapped_collection.cpython-312.pyc | Bin 21881 -> 0 bytes .../orm/__pycache__/mapper.cpython-312.pyc | Bin 169062 -> 0 bytes .../__pycache__/path_registry.cpython-312.pyc | Bin 31485 -> 0 bytes .../__pycache__/persistence.cpython-312.pyc | Bin 48477 -> 0 bytes .../__pycache__/properties.cpython-312.pyc | Bin 34647 -> 0 bytes .../orm/__pycache__/query.cpython-312.pyc | Bin 128816 -> 0 bytes .../__pycache__/relationships.cpython-312.pyc | Bin 130394 -> 0 bytes .../orm/__pycache__/scoping.cpython-312.pyc | Bin 83103 -> 0 bytes .../orm/__pycache__/session.cpython-312.pyc | Bin 202960 -> 0 bytes .../orm/__pycache__/state.cpython-312.pyc | Bin 45876 -> 0 bytes .../__pycache__/state_changes.cpython-312.pyc | Bin 7002 -> 0 bytes .../__pycache__/strategies.cpython-312.pyc | Bin 105117 -> 0 bytes .../strategy_options.cpython-312.pyc | Bin 87541 -> 0 bytes .../orm/__pycache__/sync.cpython-312.pyc | Bin 6604 -> 0 bytes .../__pycache__/unitofwork.cpython-312.pyc | Bin 34093 -> 0 bytes .../orm/__pycache__/util.cpython-312.pyc | Bin 84980 -> 0 bytes .../orm/__pycache__/writeonly.cpython-312.pyc | Bin 28803 -> 0 bytes .../pool/__pycache__/__init__.cpython-312.pyc | Bin 1510 -> 0 bytes .../pool/__pycache__/base.cpython-312.pyc | Bin 56414 -> 0 bytes .../pool/__pycache__/events.cpython-312.pyc | Bin 14323 -> 0 bytes .../pool/__pycache__/impl.cpython-312.pyc | Bin 26314 -> 0 bytes .../sql/__pycache__/__init__.cpython-312.pyc | Bin 4683 -> 0 bytes .../_dml_constructors.cpython-312.pyc | Bin 3991 -> 0 bytes .../_elements_constructors.cpython-312.pyc | Bin 66011 -> 0 bytes .../__pycache__/_orm_types.cpython-312.pyc | Bin 623 -> 0 bytes .../sql/__pycache__/_py_util.cpython-312.pyc | Bin 2962 -> 0 bytes .../_selectable_constructors.cpython-312.pyc | Bin 25146 -> 0 bytes .../sql/__pycache__/_typing.cpython-312.pyc | Bin 15199 -> 0 bytes .../__pycache__/annotation.cpython-312.pyc | Bin 21389 -> 0 bytes .../sql/__pycache__/base.cpython-312.pyc | Bin 100137 -> 0 bytes .../sql/__pycache__/cache_key.cpython-312.pyc | Bin 35592 -> 0 bytes .../sql/__pycache__/coercions.cpython-312.pyc | Bin 49075 -> 0 bytes .../sql/__pycache__/compiler.cpython-312.pyc | Bin 280126 -> 0 bytes .../sql/__pycache__/crud.cpython-312.pyc | Bin 48074 -> 0 bytes .../sql/__pycache__/ddl.cpython-312.pyc | Bin 58682 -> 0 bytes .../default_comparator.cpython-312.pyc | Bin 19476 -> 0 bytes .../sql/__pycache__/dml.cpython-312.pyc | Bin 74278 -> 0 bytes .../sql/__pycache__/elements.cpython-312.pyc | Bin 214173 -> 0 bytes .../sql/__pycache__/events.cpython-312.pyc | Bin 19218 -> 0 bytes .../__pycache__/expression.cpython-312.pyc | Bin 5143 -> 0 bytes .../sql/__pycache__/functions.cpython-312.pyc | Bin 79644 -> 0 bytes .../sql/__pycache__/lambdas.cpython-312.pyc | Bin 54780 -> 0 bytes .../sql/__pycache__/naming.cpython-312.pyc | Bin 8467 -> 0 bytes .../sql/__pycache__/operators.cpython-312.pyc | Bin 89866 -> 0 bytes .../sql/__pycache__/roles.cpython-312.pyc | Bin 12242 -> 0 bytes .../sql/__pycache__/schema.cpython-312.pyc | Bin 246030 -> 0 bytes .../__pycache__/selectable.cpython-312.pyc | Bin 264514 -> 0 bytes .../sql/__pycache__/sqltypes.cpython-312.pyc | Bin 155268 -> 0 bytes .../__pycache__/traversals.cpython-312.pyc | Bin 42413 -> 0 bytes .../sql/__pycache__/type_api.cpython-312.pyc | Bin 87815 -> 0 bytes .../sql/__pycache__/util.cpython-312.pyc | Bin 54433 -> 0 bytes .../sql/__pycache__/visitors.cpython-312.pyc | Bin 36061 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 3327 -> 0 bytes .../__pycache__/assertions.cpython-312.pyc | Bin 42156 -> 0 bytes .../__pycache__/assertsql.cpython-312.pyc | Bin 20296 -> 0 bytes .../__pycache__/asyncio.cpython-312.pyc | Bin 4147 -> 0 bytes .../__pycache__/config.cpython-312.pyc | Bin 18177 -> 0 bytes .../__pycache__/engines.cpython-312.pyc | Bin 21243 -> 0 bytes .../__pycache__/entities.cpython-312.pyc | Bin 4986 -> 0 bytes .../__pycache__/exclusions.cpython-312.pyc | Bin 23458 -> 0 bytes .../__pycache__/pickleable.cpython-312.pyc | Bin 6686 -> 0 bytes .../__pycache__/profiling.cpython-312.pyc | Bin 13219 -> 0 bytes .../__pycache__/provision.cpython-312.pyc | Bin 25148 -> 0 bytes .../__pycache__/requirements.cpython-312.pyc | Bin 92357 -> 0 bytes .../__pycache__/schema.cpython-312.pyc | Bin 8365 -> 0 bytes .../testing/__pycache__/util.cpython-312.pyc | Bin 21829 -> 0 bytes .../__pycache__/warnings.cpython-312.pyc | Bin 2006 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 908 -> 0 bytes .../fixtures/__pycache__/base.cpython-312.pyc | Bin 13545 -> 0 bytes .../fixtures/__pycache__/mypy.cpython-312.pyc | Bin 13725 -> 0 bytes .../fixtures/__pycache__/orm.cpython-312.pyc | Bin 11447 -> 0 bytes .../fixtures/__pycache__/sql.cpython-312.pyc | Bin 21494 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 197 -> 0 bytes .../__pycache__/bootstrap.cpython-312.pyc | Bin 2148 -> 0 bytes .../__pycache__/plugin_base.cpython-312.pyc | Bin 29332 -> 0 bytes .../__pycache__/pytestplugin.cpython-312.pyc | Bin 33685 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 564 -> 0 bytes .../__pycache__/test_cte.cpython-312.pyc | Bin 11079 -> 0 bytes .../__pycache__/test_ddl.cpython-312.pyc | Bin 18751 -> 0 bytes .../test_deprecations.cpython-312.pyc | Bin 9035 -> 0 bytes .../__pycache__/test_dialect.cpython-312.pyc | Bin 36398 -> 0 bytes .../__pycache__/test_insert.cpython-312.pyc | Bin 25244 -> 0 bytes .../test_reflection.cpython-312.pyc | Bin 155679 -> 0 bytes .../__pycache__/test_results.cpython-312.pyc | Bin 25581 -> 0 bytes .../__pycache__/test_rowcount.cpython-312.pyc | Bin 10348 -> 0 bytes .../__pycache__/test_select.cpython-312.pyc | Bin 115211 -> 0 bytes .../__pycache__/test_sequence.cpython-312.pyc | Bin 14998 -> 0 bytes .../__pycache__/test_types.cpython-312.pyc | Bin 99157 -> 0 bytes .../test_unicode_ddl.cpython-312.pyc | Bin 7618 -> 0 bytes .../test_update_delete.cpython-312.pyc | Bin 7397 -> 0 bytes .../util/__pycache__/__init__.cpython-312.pyc | Bin 5736 -> 0 bytes .../__pycache__/_collections.cpython-312.pyc | Bin 31782 -> 0 bytes .../_concurrency_py3k.cpython-312.pyc | Bin 10837 -> 0 bytes .../util/__pycache__/_has_cy.cpython-312.pyc | Bin 1088 -> 0 bytes .../_py_collections.cpython-312.pyc | Bin 29202 -> 0 bytes .../util/__pycache__/compat.cpython-312.pyc | Bin 12953 -> 0 bytes .../__pycache__/concurrency.cpython-312.pyc | Bin 4092 -> 0 bytes .../__pycache__/deprecations.cpython-312.pyc | Bin 13658 -> 0 bytes .../__pycache__/langhelpers.cpython-312.pyc | Bin 86781 -> 0 bytes .../__pycache__/preloaded.cpython-312.pyc | Bin 5889 -> 0 bytes .../util/__pycache__/queue.cpython-312.pyc | Bin 14621 -> 0 bytes .../__pycache__/tool_support.cpython-312.pyc | Bin 8723 -> 0 bytes .../__pycache__/topological.cpython-312.pyc | Bin 3933 -> 0 bytes .../util/__pycache__/typing.cpython-312.pyc | Bin 26096 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1004 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1081 -> 0 bytes .../__pycache__/_internal.cpython-312.pyc | Bin 9761 -> 0 bytes .../__pycache__/_reloader.cpython-312.pyc | Bin 20251 -> 0 bytes .../__pycache__/exceptions.cpython-312.pyc | Bin 32925 -> 0 bytes .../__pycache__/formparser.cpython-312.pyc | Bin 16687 -> 0 bytes .../werkzeug/__pycache__/http.cpython-312.pyc | Bin 49362 -> 0 bytes .../__pycache__/local.cpython-312.pyc | Bin 28201 -> 0 bytes .../__pycache__/security.cpython-312.pyc | Bin 6958 -> 0 bytes .../__pycache__/serving.cpython-312.pyc | Bin 45751 -> 0 bytes .../werkzeug/__pycache__/test.cpython-312.pyc | Bin 59768 -> 0 bytes .../__pycache__/testapp.cpython-312.pyc | Bin 8571 -> 0 bytes .../werkzeug/__pycache__/urls.cpython-312.pyc | Bin 8939 -> 0 bytes .../__pycache__/user_agent.cpython-312.pyc | Bin 2147 -> 0 bytes .../__pycache__/utils.cpython-312.pyc | Bin 28189 -> 0 bytes .../werkzeug/__pycache__/wsgi.cpython-312.pyc | Bin 25210 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 1596 -> 0 bytes .../__pycache__/accept.cpython-312.pyc | Bin 13813 -> 0 bytes .../__pycache__/auth.cpython-312.pyc | Bin 14414 -> 0 bytes .../__pycache__/cache_control.cpython-312.pyc | Bin 7883 -> 0 bytes .../__pycache__/csp.cpython-312.pyc | Bin 5254 -> 0 bytes .../__pycache__/etag.cpython-312.pyc | Bin 5038 -> 0 bytes .../__pycache__/file_storage.cpython-312.pyc | Bin 7914 -> 0 bytes .../__pycache__/headers.cpython-312.pyc | Bin 23260 -> 0 bytes .../__pycache__/mixins.cpython-312.pyc | Bin 11387 -> 0 bytes .../__pycache__/range.cpython-312.pyc | Bin 8244 -> 0 bytes .../__pycache__/structures.cpython-312.pyc | Bin 48339 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 22161 -> 0 bytes .../debug/__pycache__/console.cpython-312.pyc | Bin 11602 -> 0 bytes .../debug/__pycache__/repr.cpython-312.pyc | Bin 13877 -> 0 bytes .../debug/__pycache__/tbtools.cpython-312.pyc | Bin 16655 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 191 -> 0 bytes .../__pycache__/dispatcher.cpython-312.pyc | Bin 3309 -> 0 bytes .../__pycache__/http_proxy.cpython-312.pyc | Bin 9401 -> 0 bytes .../__pycache__/lint.cpython-312.pyc | Bin 17698 -> 0 bytes .../__pycache__/profiler.cpython-312.pyc | Bin 7195 -> 0 bytes .../__pycache__/proxy_fix.cpython-312.pyc | Bin 7192 -> 0 bytes .../__pycache__/shared_data.cpython-312.pyc | Bin 12706 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 4664 -> 0 bytes .../__pycache__/converters.cpython-312.pyc | Bin 10847 -> 0 bytes .../__pycache__/exceptions.cpython-312.pyc | Bin 7838 -> 0 bytes .../routing/__pycache__/map.cpython-312.pyc | Bin 39359 -> 0 bytes .../__pycache__/matcher.cpython-312.pyc | Bin 8219 -> 0 bytes .../routing/__pycache__/rules.cpython-312.pyc | Bin 38300 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 187 -> 0 bytes .../sansio/__pycache__/http.cpython-312.pyc | Bin 5614 -> 0 bytes .../__pycache__/multipart.cpython-312.pyc | Bin 14044 -> 0 bytes .../__pycache__/request.cpython-312.pyc | Bin 21859 -> 0 bytes .../__pycache__/response.cpython-312.pyc | Bin 31327 -> 0 bytes .../sansio/__pycache__/utils.cpython-312.pyc | Bin 6011 -> 0 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 311 -> 0 bytes .../__pycache__/request.cpython-312.pyc | Bin 25968 -> 0 bytes .../__pycache__/response.cpython-312.pyc | Bin 34658 -> 0 bytes 2257 files changed, 242971 deletions(-) delete mode 100644 __pycache__/config.cpython-312.pyc delete mode 100644 __pycache__/models.cpython-312.pyc delete mode 120000 node_modules/.bin/cssesc delete mode 120000 node_modules/.bin/jiti delete mode 120000 node_modules/.bin/nanoid delete mode 120000 node_modules/.bin/resolve delete mode 120000 node_modules/.bin/sucrase delete mode 120000 node_modules/.bin/sucrase-node delete mode 120000 node_modules/.bin/tailwind delete mode 120000 node_modules/.bin/tailwindcss delete mode 100644 node_modules/.package-lock.json delete mode 100644 node_modules/@alloc/quick-lru/index.d.ts delete mode 100644 node_modules/@alloc/quick-lru/index.js delete mode 100644 node_modules/@alloc/quick-lru/license delete mode 100644 node_modules/@alloc/quick-lru/package.json delete mode 100644 node_modules/@alloc/quick-lru/readme.md 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/set-array.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/gen-mapping/src/gen-mapping.ts delete mode 100644 node_modules/@jridgewell/gen-mapping/src/set-array.ts delete mode 100644 node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts delete mode 100644 node_modules/@jridgewell/gen-mapping/src/types.ts delete mode 100644 node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts delete mode 100644 node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map delete mode 100644 node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts delete mode 100644 node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map delete mode 100644 node_modules/@jridgewell/gen-mapping/types/set-array.d.cts delete mode 100644 node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map delete mode 100644 node_modules/@jridgewell/gen-mapping/types/set-array.d.mts delete mode 100644 node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map delete mode 100644 node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts delete mode 100644 node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map delete mode 100644 node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts delete mode 100644 node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map delete mode 100644 node_modules/@jridgewell/gen-mapping/types/types.d.cts delete mode 100644 node_modules/@jridgewell/gen-mapping/types/types.d.cts.map delete mode 100644 node_modules/@jridgewell/gen-mapping/types/types.d.mts delete mode 100644 node_modules/@jridgewell/gen-mapping/types/types.d.mts.map 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/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/package.json delete mode 100644 node_modules/@jridgewell/sourcemap-codec/src/scopes.ts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/src/strings.ts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/src/vlq.ts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts delete mode 100644 node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map 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/package.json delete mode 100644 node_modules/@jridgewell/trace-mapping/src/binary-search.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/src/by-source.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/src/flatten-map.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/src/resolve.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/src/sort.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/src/strip-filename.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/src/types.ts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/by-source.d.cts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/by-source.d.mts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/resolve.d.cts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/resolve.d.mts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/sort.d.cts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/sort.d.mts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/types.d.cts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/types.d.cts.map delete mode 100644 node_modules/@jridgewell/trace-mapping/types/types.d.mts delete mode 100644 node_modules/@jridgewell/trace-mapping/types/types.d.mts.map delete mode 100644 node_modules/@nodelib/fs.scandir/LICENSE delete mode 100644 node_modules/@nodelib/fs.scandir/README.md delete mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/adapters/fs.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/constants.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/constants.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/index.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/index.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/async.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/common.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/providers/sync.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/settings.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/settings.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/types/index.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/utils/fs.js delete mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.d.ts delete mode 100644 node_modules/@nodelib/fs.scandir/out/utils/index.js delete mode 100644 node_modules/@nodelib/fs.scandir/package.json delete mode 100644 node_modules/@nodelib/fs.stat/LICENSE delete mode 100644 node_modules/@nodelib/fs.stat/README.md delete mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/adapters/fs.js delete mode 100644 node_modules/@nodelib/fs.stat/out/index.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/index.js delete mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/providers/async.js delete mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/providers/sync.js delete mode 100644 node_modules/@nodelib/fs.stat/out/settings.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/settings.js delete mode 100644 node_modules/@nodelib/fs.stat/out/types/index.d.ts delete mode 100644 node_modules/@nodelib/fs.stat/out/types/index.js delete mode 100644 node_modules/@nodelib/fs.stat/package.json delete mode 100644 node_modules/@nodelib/fs.walk/LICENSE delete mode 100644 node_modules/@nodelib/fs.walk/README.md delete mode 100644 node_modules/@nodelib/fs.walk/out/index.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/index.js delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/async.js delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/index.js delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/stream.js delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/providers/sync.js delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/async.js delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/common.js delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/reader.js delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/readers/sync.js delete mode 100644 node_modules/@nodelib/fs.walk/out/settings.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/settings.js delete mode 100644 node_modules/@nodelib/fs.walk/out/types/index.d.ts delete mode 100644 node_modules/@nodelib/fs.walk/out/types/index.js delete mode 100644 node_modules/@nodelib/fs.walk/package.json delete mode 100644 node_modules/any-promise/.jshintrc delete mode 100644 node_modules/any-promise/.npmignore delete mode 100644 node_modules/any-promise/LICENSE delete mode 100644 node_modules/any-promise/README.md delete mode 100644 node_modules/any-promise/implementation.d.ts delete mode 100644 node_modules/any-promise/implementation.js delete mode 100644 node_modules/any-promise/index.d.ts delete mode 100644 node_modules/any-promise/index.js delete mode 100644 node_modules/any-promise/loader.js delete mode 100644 node_modules/any-promise/optional.js delete mode 100644 node_modules/any-promise/package.json delete mode 100644 node_modules/any-promise/register-shim.js delete mode 100644 node_modules/any-promise/register.d.ts delete mode 100644 node_modules/any-promise/register.js delete mode 100644 node_modules/any-promise/register/bluebird.d.ts delete mode 100644 node_modules/any-promise/register/bluebird.js delete mode 100644 node_modules/any-promise/register/es6-promise.d.ts delete mode 100644 node_modules/any-promise/register/es6-promise.js delete mode 100644 node_modules/any-promise/register/lie.d.ts delete mode 100644 node_modules/any-promise/register/lie.js delete mode 100644 node_modules/any-promise/register/native-promise-only.d.ts delete mode 100644 node_modules/any-promise/register/native-promise-only.js delete mode 100644 node_modules/any-promise/register/pinkie.d.ts delete mode 100644 node_modules/any-promise/register/pinkie.js delete mode 100644 node_modules/any-promise/register/promise.d.ts delete mode 100644 node_modules/any-promise/register/promise.js delete mode 100644 node_modules/any-promise/register/q.d.ts delete mode 100644 node_modules/any-promise/register/q.js delete mode 100644 node_modules/any-promise/register/rsvp.d.ts delete mode 100644 node_modules/any-promise/register/rsvp.js delete mode 100644 node_modules/any-promise/register/vow.d.ts delete mode 100644 node_modules/any-promise/register/vow.js delete mode 100644 node_modules/any-promise/register/when.d.ts delete mode 100644 node_modules/any-promise/register/when.js delete mode 100644 node_modules/anymatch/LICENSE delete mode 100644 node_modules/anymatch/README.md delete mode 100644 node_modules/anymatch/index.d.ts delete mode 100644 node_modules/anymatch/index.js delete mode 100644 node_modules/anymatch/package.json 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/binary-extensions/binary-extensions.json delete mode 100644 node_modules/binary-extensions/binary-extensions.json.d.ts delete mode 100644 node_modules/binary-extensions/index.d.ts delete mode 100644 node_modules/binary-extensions/index.js delete mode 100644 node_modules/binary-extensions/license delete mode 100644 node_modules/binary-extensions/package.json delete mode 100644 node_modules/binary-extensions/readme.md delete mode 100644 node_modules/braces/LICENSE delete mode 100644 node_modules/braces/README.md delete mode 100644 node_modules/braces/index.js delete mode 100644 node_modules/braces/lib/compile.js delete mode 100644 node_modules/braces/lib/constants.js delete mode 100644 node_modules/braces/lib/expand.js delete mode 100644 node_modules/braces/lib/parse.js delete mode 100644 node_modules/braces/lib/stringify.js delete mode 100644 node_modules/braces/lib/utils.js delete mode 100644 node_modules/braces/package.json delete mode 100644 node_modules/camelcase-css/README.md delete mode 100644 node_modules/camelcase-css/index-es5.js delete mode 100644 node_modules/camelcase-css/index.js delete mode 100644 node_modules/camelcase-css/license delete mode 100644 node_modules/camelcase-css/package.json delete mode 100644 node_modules/chokidar/LICENSE delete mode 100644 node_modules/chokidar/README.md delete mode 100644 node_modules/chokidar/index.js delete mode 100644 node_modules/chokidar/lib/constants.js delete mode 100644 node_modules/chokidar/lib/fsevents-handler.js delete mode 100644 node_modules/chokidar/lib/nodefs-handler.js delete mode 100644 node_modules/chokidar/node_modules/glob-parent/CHANGELOG.md delete mode 100644 node_modules/chokidar/node_modules/glob-parent/LICENSE delete mode 100644 node_modules/chokidar/node_modules/glob-parent/README.md delete mode 100644 node_modules/chokidar/node_modules/glob-parent/index.js delete mode 100644 node_modules/chokidar/node_modules/glob-parent/package.json delete mode 100644 node_modules/chokidar/package.json delete mode 100644 node_modules/chokidar/types/index.d.ts 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/cssesc/LICENSE-MIT.txt delete mode 100644 node_modules/cssesc/README.md delete mode 100755 node_modules/cssesc/bin/cssesc delete mode 100644 node_modules/cssesc/cssesc.js delete mode 100644 node_modules/cssesc/man/cssesc.1 delete mode 100644 node_modules/cssesc/package.json delete mode 100644 node_modules/didyoumean/LICENSE delete mode 100644 node_modules/didyoumean/README.md delete mode 100644 node_modules/didyoumean/didYouMean-1.2.1.js delete mode 100644 node_modules/didyoumean/didYouMean-1.2.1.min.js delete mode 100755 node_modules/didyoumean/package.json delete mode 100644 node_modules/dlv/README.md delete mode 100644 node_modules/dlv/dist/dlv.es.js delete mode 100644 node_modules/dlv/dist/dlv.es.js.map delete mode 100644 node_modules/dlv/dist/dlv.js delete mode 100644 node_modules/dlv/dist/dlv.js.map delete mode 100644 node_modules/dlv/dist/dlv.umd.js delete mode 100644 node_modules/dlv/dist/dlv.umd.js.map delete mode 100644 node_modules/dlv/index.js delete mode 100644 node_modules/dlv/package.json delete mode 100644 node_modules/fast-glob/LICENSE delete mode 100644 node_modules/fast-glob/README.md delete mode 100644 node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md delete mode 100644 node_modules/fast-glob/node_modules/glob-parent/LICENSE delete mode 100644 node_modules/fast-glob/node_modules/glob-parent/README.md delete mode 100644 node_modules/fast-glob/node_modules/glob-parent/index.js delete mode 100644 node_modules/fast-glob/node_modules/glob-parent/package.json delete mode 100644 node_modules/fast-glob/out/index.d.ts delete mode 100644 node_modules/fast-glob/out/index.js delete mode 100644 node_modules/fast-glob/out/managers/tasks.d.ts delete mode 100644 node_modules/fast-glob/out/managers/tasks.js delete mode 100644 node_modules/fast-glob/out/providers/async.d.ts delete mode 100644 node_modules/fast-glob/out/providers/async.js delete mode 100644 node_modules/fast-glob/out/providers/filters/deep.d.ts delete mode 100644 node_modules/fast-glob/out/providers/filters/deep.js delete mode 100644 node_modules/fast-glob/out/providers/filters/entry.d.ts delete mode 100644 node_modules/fast-glob/out/providers/filters/entry.js delete mode 100644 node_modules/fast-glob/out/providers/filters/error.d.ts delete mode 100644 node_modules/fast-glob/out/providers/filters/error.js delete mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.d.ts delete mode 100644 node_modules/fast-glob/out/providers/matchers/matcher.js delete mode 100644 node_modules/fast-glob/out/providers/matchers/partial.d.ts delete mode 100644 node_modules/fast-glob/out/providers/matchers/partial.js delete mode 100644 node_modules/fast-glob/out/providers/provider.d.ts delete mode 100644 node_modules/fast-glob/out/providers/provider.js delete mode 100644 node_modules/fast-glob/out/providers/stream.d.ts delete mode 100644 node_modules/fast-glob/out/providers/stream.js delete mode 100644 node_modules/fast-glob/out/providers/sync.d.ts delete mode 100644 node_modules/fast-glob/out/providers/sync.js delete mode 100644 node_modules/fast-glob/out/providers/transformers/entry.d.ts delete mode 100644 node_modules/fast-glob/out/providers/transformers/entry.js delete mode 100644 node_modules/fast-glob/out/readers/async.d.ts delete mode 100644 node_modules/fast-glob/out/readers/async.js delete mode 100644 node_modules/fast-glob/out/readers/reader.d.ts delete mode 100644 node_modules/fast-glob/out/readers/reader.js delete mode 100644 node_modules/fast-glob/out/readers/stream.d.ts delete mode 100644 node_modules/fast-glob/out/readers/stream.js delete mode 100644 node_modules/fast-glob/out/readers/sync.d.ts delete mode 100644 node_modules/fast-glob/out/readers/sync.js delete mode 100644 node_modules/fast-glob/out/settings.d.ts delete mode 100644 node_modules/fast-glob/out/settings.js delete mode 100644 node_modules/fast-glob/out/types/index.d.ts delete mode 100644 node_modules/fast-glob/out/types/index.js delete mode 100644 node_modules/fast-glob/out/utils/array.d.ts delete mode 100644 node_modules/fast-glob/out/utils/array.js delete mode 100644 node_modules/fast-glob/out/utils/errno.d.ts delete mode 100644 node_modules/fast-glob/out/utils/errno.js delete mode 100644 node_modules/fast-glob/out/utils/fs.d.ts delete mode 100644 node_modules/fast-glob/out/utils/fs.js delete mode 100644 node_modules/fast-glob/out/utils/index.d.ts delete mode 100644 node_modules/fast-glob/out/utils/index.js delete mode 100644 node_modules/fast-glob/out/utils/path.d.ts delete mode 100644 node_modules/fast-glob/out/utils/path.js delete mode 100644 node_modules/fast-glob/out/utils/pattern.d.ts delete mode 100644 node_modules/fast-glob/out/utils/pattern.js delete mode 100644 node_modules/fast-glob/out/utils/stream.d.ts delete mode 100644 node_modules/fast-glob/out/utils/stream.js delete mode 100644 node_modules/fast-glob/out/utils/string.d.ts delete mode 100644 node_modules/fast-glob/out/utils/string.js delete mode 100644 node_modules/fast-glob/package.json delete mode 100644 node_modules/fastq/LICENSE delete mode 100644 node_modules/fastq/README.md delete mode 100644 node_modules/fastq/SECURITY.md delete mode 100644 node_modules/fastq/bench.js delete mode 100644 node_modules/fastq/eslint.config.js delete mode 100644 node_modules/fastq/example.js delete mode 100644 node_modules/fastq/example.mjs delete mode 100644 node_modules/fastq/index.d.ts delete mode 100644 node_modules/fastq/package.json delete mode 100644 node_modules/fastq/queue.js delete mode 100644 node_modules/fastq/test/example.ts delete mode 100644 node_modules/fastq/test/promise.js delete mode 100644 node_modules/fastq/test/test.js delete mode 100644 node_modules/fastq/test/tsconfig.json delete mode 100644 node_modules/fill-range/LICENSE delete mode 100644 node_modules/fill-range/README.md delete mode 100644 node_modules/fill-range/index.js delete mode 100644 node_modules/fill-range/package.json 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-parent/LICENSE delete mode 100644 node_modules/glob-parent/README.md delete mode 100644 node_modules/glob-parent/index.js delete mode 100644 node_modules/glob-parent/package.json 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.js delete mode 100644 node_modules/hasown/package.json delete mode 100644 node_modules/hasown/tsconfig.json delete mode 100644 node_modules/is-binary-path/index.d.ts delete mode 100644 node_modules/is-binary-path/index.js delete mode 100644 node_modules/is-binary-path/license delete mode 100644 node_modules/is-binary-path/package.json delete mode 100644 node_modules/is-binary-path/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-extglob/LICENSE delete mode 100644 node_modules/is-extglob/README.md delete mode 100644 node_modules/is-extglob/index.js delete mode 100644 node_modules/is-extglob/package.json delete mode 100644 node_modules/is-glob/LICENSE delete mode 100644 node_modules/is-glob/README.md delete mode 100644 node_modules/is-glob/index.js delete mode 100644 node_modules/is-glob/package.json delete mode 100644 node_modules/is-number/LICENSE delete mode 100644 node_modules/is-number/README.md delete mode 100644 node_modules/is-number/index.js delete mode 100644 node_modules/is-number/package.json delete mode 100644 node_modules/jiti/LICENSE delete mode 100644 node_modules/jiti/README.md delete mode 100755 node_modules/jiti/bin/jiti.js delete mode 100644 node_modules/jiti/dist/babel.d.ts delete mode 100644 node_modules/jiti/dist/babel.js delete mode 100644 node_modules/jiti/dist/jiti.d.ts delete mode 100644 node_modules/jiti/dist/jiti.js delete mode 100644 node_modules/jiti/dist/plugins/babel-plugin-transform-import-meta.d.ts delete mode 100644 node_modules/jiti/dist/plugins/import-meta-env.d.ts delete mode 100644 node_modules/jiti/dist/types.d.ts delete mode 100644 node_modules/jiti/dist/utils.d.ts delete mode 100644 node_modules/jiti/lib/index.js delete mode 100644 node_modules/jiti/package.json delete mode 100644 node_modules/jiti/register.js delete mode 100644 node_modules/lilconfig/LICENSE delete mode 100644 node_modules/lilconfig/package.json delete mode 100644 node_modules/lilconfig/readme.md delete mode 100644 node_modules/lilconfig/src/index.d.ts delete mode 100644 node_modules/lilconfig/src/index.js delete mode 100644 node_modules/lines-and-columns/LICENSE delete mode 100644 node_modules/lines-and-columns/README.md delete mode 100644 node_modules/lines-and-columns/build/index.d.ts delete mode 100644 node_modules/lines-and-columns/build/index.js delete mode 100644 node_modules/lines-and-columns/package.json delete mode 100644 node_modules/merge2/LICENSE delete mode 100644 node_modules/merge2/README.md delete mode 100644 node_modules/merge2/index.js delete mode 100644 node_modules/merge2/package.json delete mode 100755 node_modules/micromatch/LICENSE delete mode 100644 node_modules/micromatch/README.md delete mode 100644 node_modules/micromatch/index.js delete mode 100644 node_modules/micromatch/package.json delete mode 100644 node_modules/mz/HISTORY.md delete mode 100644 node_modules/mz/LICENSE delete mode 100644 node_modules/mz/README.md delete mode 100644 node_modules/mz/child_process.js delete mode 100644 node_modules/mz/crypto.js delete mode 100644 node_modules/mz/dns.js delete mode 100644 node_modules/mz/fs.js delete mode 100644 node_modules/mz/index.js delete mode 100644 node_modules/mz/package.json delete mode 100644 node_modules/mz/readline.js delete mode 100644 node_modules/mz/zlib.js delete mode 100644 node_modules/nanoid/LICENSE delete mode 100644 node_modules/nanoid/README.md delete mode 100644 node_modules/nanoid/async/index.browser.cjs delete mode 100644 node_modules/nanoid/async/index.browser.js delete mode 100644 node_modules/nanoid/async/index.cjs delete mode 100644 node_modules/nanoid/async/index.d.ts delete mode 100644 node_modules/nanoid/async/index.js delete mode 100644 node_modules/nanoid/async/index.native.js delete mode 100644 node_modules/nanoid/async/package.json delete mode 100755 node_modules/nanoid/bin/nanoid.cjs delete mode 100644 node_modules/nanoid/index.browser.cjs delete mode 100644 node_modules/nanoid/index.browser.js delete mode 100644 node_modules/nanoid/index.cjs delete mode 100644 node_modules/nanoid/index.d.cts delete mode 100644 node_modules/nanoid/index.d.ts delete mode 100644 node_modules/nanoid/index.js delete mode 100644 node_modules/nanoid/nanoid.js delete mode 100644 node_modules/nanoid/non-secure/index.cjs delete mode 100644 node_modules/nanoid/non-secure/index.d.ts delete mode 100644 node_modules/nanoid/non-secure/index.js delete mode 100644 node_modules/nanoid/non-secure/package.json delete mode 100644 node_modules/nanoid/package.json delete mode 100644 node_modules/nanoid/url-alphabet/index.cjs delete mode 100644 node_modules/nanoid/url-alphabet/index.js delete mode 100644 node_modules/nanoid/url-alphabet/package.json delete mode 100644 node_modules/normalize-path/LICENSE delete mode 100644 node_modules/normalize-path/README.md delete mode 100644 node_modules/normalize-path/index.js delete mode 100644 node_modules/normalize-path/package.json delete mode 100644 node_modules/object-assign/index.js delete mode 100644 node_modules/object-assign/license delete mode 100644 node_modules/object-assign/package.json delete mode 100644 node_modules/object-assign/readme.md delete mode 100644 node_modules/object-hash/LICENSE delete mode 100644 node_modules/object-hash/dist/object_hash.js delete mode 100644 node_modules/object-hash/index.js delete mode 100644 node_modules/object-hash/package.json delete mode 100644 node_modules/object-hash/readme.markdown 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.d.ts delete mode 100644 node_modules/picomatch/CHANGELOG.md delete mode 100644 node_modules/picomatch/LICENSE delete mode 100644 node_modules/picomatch/README.md delete mode 100644 node_modules/picomatch/index.js delete mode 100644 node_modules/picomatch/lib/constants.js delete mode 100644 node_modules/picomatch/lib/parse.js delete mode 100644 node_modules/picomatch/lib/picomatch.js delete mode 100644 node_modules/picomatch/lib/scan.js delete mode 100644 node_modules/picomatch/lib/utils.js delete mode 100644 node_modules/picomatch/package.json delete mode 100644 node_modules/pify/index.js delete mode 100644 node_modules/pify/license delete mode 100644 node_modules/pify/package.json delete mode 100644 node_modules/pify/readme.md delete mode 100644 node_modules/pirates/LICENSE delete mode 100644 node_modules/pirates/README.md delete mode 100644 node_modules/pirates/index.d.ts delete mode 100644 node_modules/pirates/lib/index.js delete mode 100644 node_modules/pirates/package.json delete mode 100755 node_modules/postcss-import/LICENSE delete mode 100644 node_modules/postcss-import/README.md delete mode 100755 node_modules/postcss-import/index.js delete mode 100644 node_modules/postcss-import/lib/assign-layer-names.js delete mode 100644 node_modules/postcss-import/lib/data-url.js delete mode 100644 node_modules/postcss-import/lib/join-layer.js delete mode 100644 node_modules/postcss-import/lib/join-media.js delete mode 100644 node_modules/postcss-import/lib/load-content.js delete mode 100644 node_modules/postcss-import/lib/parse-statements.js delete mode 100644 node_modules/postcss-import/lib/process-content.js delete mode 100644 node_modules/postcss-import/lib/resolve-id.js delete mode 100644 node_modules/postcss-import/package.json delete mode 100644 node_modules/postcss-js/LICENSE delete mode 100644 node_modules/postcss-js/README.md delete mode 100644 node_modules/postcss-js/async.js delete mode 100644 node_modules/postcss-js/index.js delete mode 100644 node_modules/postcss-js/index.mjs delete mode 100644 node_modules/postcss-js/objectifier.js delete mode 100644 node_modules/postcss-js/package.json delete mode 100644 node_modules/postcss-js/parser.js delete mode 100644 node_modules/postcss-js/process-result.js delete mode 100644 node_modules/postcss-js/sync.js delete mode 100644 node_modules/postcss-load-config/LICENSE delete mode 100644 node_modules/postcss-load-config/README.md delete mode 100644 node_modules/postcss-load-config/package.json delete mode 100644 node_modules/postcss-load-config/src/index.d.ts delete mode 100644 node_modules/postcss-load-config/src/index.js delete mode 100644 node_modules/postcss-load-config/src/options.js delete mode 100644 node_modules/postcss-load-config/src/plugins.js delete mode 100644 node_modules/postcss-load-config/src/req.js delete mode 100644 node_modules/postcss-nested/LICENSE delete mode 100644 node_modules/postcss-nested/README.md delete mode 100644 node_modules/postcss-nested/index.d.ts delete mode 100644 node_modules/postcss-nested/index.js delete mode 100644 node_modules/postcss-nested/package.json delete mode 100644 node_modules/postcss-selector-parser/API.md delete mode 100644 node_modules/postcss-selector-parser/CHANGELOG.md delete mode 100644 node_modules/postcss-selector-parser/LICENSE-MIT delete mode 100644 node_modules/postcss-selector-parser/README.md delete mode 100644 node_modules/postcss-selector-parser/dist/index.js delete mode 100644 node_modules/postcss-selector-parser/dist/parser.js delete mode 100644 node_modules/postcss-selector-parser/dist/processor.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/attribute.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/className.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/combinator.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/comment.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/constructors.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/container.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/guards.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/id.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/index.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/namespace.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/nesting.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/node.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/pseudo.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/root.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/selector.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/string.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/tag.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/types.js delete mode 100644 node_modules/postcss-selector-parser/dist/selectors/universal.js delete mode 100644 node_modules/postcss-selector-parser/dist/sortAscending.js delete mode 100644 node_modules/postcss-selector-parser/dist/tokenTypes.js delete mode 100644 node_modules/postcss-selector-parser/dist/tokenize.js delete mode 100644 node_modules/postcss-selector-parser/dist/util/ensureObject.js delete mode 100644 node_modules/postcss-selector-parser/dist/util/getProp.js delete mode 100644 node_modules/postcss-selector-parser/dist/util/index.js delete mode 100644 node_modules/postcss-selector-parser/dist/util/stripComments.js delete mode 100644 node_modules/postcss-selector-parser/dist/util/unesc.js delete mode 100644 node_modules/postcss-selector-parser/package.json delete mode 100644 node_modules/postcss-selector-parser/postcss-selector-parser.d.ts delete mode 100644 node_modules/postcss-value-parser/LICENSE delete mode 100644 node_modules/postcss-value-parser/README.md delete mode 100644 node_modules/postcss-value-parser/lib/index.d.ts delete mode 100644 node_modules/postcss-value-parser/lib/index.js delete mode 100644 node_modules/postcss-value-parser/lib/parse.js delete mode 100644 node_modules/postcss-value-parser/lib/stringify.js delete mode 100644 node_modules/postcss-value-parser/lib/unit.js delete mode 100644 node_modules/postcss-value-parser/lib/walk.js delete mode 100644 node_modules/postcss-value-parser/package.json delete mode 100644 node_modules/postcss/LICENSE delete mode 100644 node_modules/postcss/README.md delete mode 100644 node_modules/postcss/lib/at-rule.d.ts delete mode 100644 node_modules/postcss/lib/at-rule.js delete mode 100644 node_modules/postcss/lib/comment.d.ts delete mode 100644 node_modules/postcss/lib/comment.js delete mode 100644 node_modules/postcss/lib/container.d.ts delete mode 100644 node_modules/postcss/lib/container.js delete mode 100644 node_modules/postcss/lib/css-syntax-error.d.ts delete mode 100644 node_modules/postcss/lib/css-syntax-error.js delete mode 100644 node_modules/postcss/lib/declaration.d.ts delete mode 100644 node_modules/postcss/lib/declaration.js delete mode 100644 node_modules/postcss/lib/document.d.ts delete mode 100644 node_modules/postcss/lib/document.js delete mode 100644 node_modules/postcss/lib/fromJSON.d.ts delete mode 100644 node_modules/postcss/lib/fromJSON.js delete mode 100644 node_modules/postcss/lib/input.d.ts delete mode 100644 node_modules/postcss/lib/input.js delete mode 100644 node_modules/postcss/lib/lazy-result.d.ts delete mode 100644 node_modules/postcss/lib/lazy-result.js delete mode 100644 node_modules/postcss/lib/list.d.ts delete mode 100644 node_modules/postcss/lib/list.js delete mode 100644 node_modules/postcss/lib/map-generator.js delete mode 100644 node_modules/postcss/lib/no-work-result.d.ts delete mode 100644 node_modules/postcss/lib/no-work-result.js delete mode 100644 node_modules/postcss/lib/node.d.ts delete mode 100644 node_modules/postcss/lib/node.js delete mode 100644 node_modules/postcss/lib/parse.d.ts delete mode 100644 node_modules/postcss/lib/parse.js delete mode 100644 node_modules/postcss/lib/parser.js delete mode 100644 node_modules/postcss/lib/postcss.d.mts delete mode 100644 node_modules/postcss/lib/postcss.d.ts delete mode 100644 node_modules/postcss/lib/postcss.js delete mode 100644 node_modules/postcss/lib/postcss.mjs delete mode 100644 node_modules/postcss/lib/previous-map.d.ts delete mode 100644 node_modules/postcss/lib/previous-map.js delete mode 100644 node_modules/postcss/lib/processor.d.ts delete mode 100644 node_modules/postcss/lib/processor.js delete mode 100644 node_modules/postcss/lib/result.d.ts delete mode 100644 node_modules/postcss/lib/result.js delete mode 100644 node_modules/postcss/lib/root.d.ts delete mode 100644 node_modules/postcss/lib/root.js delete mode 100644 node_modules/postcss/lib/rule.d.ts delete mode 100644 node_modules/postcss/lib/rule.js delete mode 100644 node_modules/postcss/lib/stringifier.d.ts delete mode 100644 node_modules/postcss/lib/stringifier.js delete mode 100644 node_modules/postcss/lib/stringify.d.ts delete mode 100644 node_modules/postcss/lib/stringify.js delete mode 100644 node_modules/postcss/lib/symbols.js delete mode 100644 node_modules/postcss/lib/terminal-highlight.js delete mode 100644 node_modules/postcss/lib/tokenize.js delete mode 100644 node_modules/postcss/lib/warn-once.js delete mode 100644 node_modules/postcss/lib/warning.d.ts delete mode 100644 node_modules/postcss/lib/warning.js delete mode 100644 node_modules/postcss/package.json delete mode 100755 node_modules/queue-microtask/LICENSE delete mode 100644 node_modules/queue-microtask/README.md delete mode 100644 node_modules/queue-microtask/index.d.ts delete mode 100644 node_modules/queue-microtask/index.js delete mode 100644 node_modules/queue-microtask/package.json delete mode 100644 node_modules/read-cache/LICENSE delete mode 100644 node_modules/read-cache/README.md delete mode 100644 node_modules/read-cache/index.js delete mode 100644 node_modules/read-cache/package.json delete mode 100644 node_modules/readdirp/LICENSE delete mode 100644 node_modules/readdirp/README.md delete mode 100644 node_modules/readdirp/index.d.ts delete mode 100644 node_modules/readdirp/index.js delete mode 100644 node_modules/readdirp/package.json 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/.github/INCIDENT_RESPONSE_PROCESS.md delete mode 100644 node_modules/resolve/.github/THREAT_MODEL.md 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 100755 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/reusify/.github/dependabot.yml delete mode 100644 node_modules/reusify/.github/workflows/ci.yml delete mode 100644 node_modules/reusify/LICENSE delete mode 100644 node_modules/reusify/README.md delete mode 100644 node_modules/reusify/SECURITY.md delete mode 100644 node_modules/reusify/benchmarks/createNoCodeFunction.js delete mode 100644 node_modules/reusify/benchmarks/fib.js delete mode 100644 node_modules/reusify/benchmarks/reuseNoCodeFunction.js delete mode 100644 node_modules/reusify/eslint.config.js delete mode 100644 node_modules/reusify/package.json delete mode 100644 node_modules/reusify/reusify.d.ts delete mode 100644 node_modules/reusify/reusify.js delete mode 100644 node_modules/reusify/test.js delete mode 100644 node_modules/reusify/tsconfig.json delete mode 100644 node_modules/run-parallel/LICENSE delete mode 100644 node_modules/run-parallel/README.md delete mode 100644 node_modules/run-parallel/index.js delete mode 100644 node_modules/run-parallel/package.json delete mode 100644 node_modules/source-map-js/LICENSE delete mode 100644 node_modules/source-map-js/README.md delete mode 100644 node_modules/source-map-js/lib/array-set.js delete mode 100644 node_modules/source-map-js/lib/base64-vlq.js delete mode 100644 node_modules/source-map-js/lib/base64.js delete mode 100644 node_modules/source-map-js/lib/binary-search.js delete mode 100644 node_modules/source-map-js/lib/mapping-list.js delete mode 100644 node_modules/source-map-js/lib/quick-sort.js delete mode 100644 node_modules/source-map-js/lib/source-map-consumer.d.ts delete mode 100644 node_modules/source-map-js/lib/source-map-consumer.js delete mode 100644 node_modules/source-map-js/lib/source-map-generator.d.ts delete mode 100644 node_modules/source-map-js/lib/source-map-generator.js delete mode 100644 node_modules/source-map-js/lib/source-node.d.ts delete mode 100644 node_modules/source-map-js/lib/source-node.js delete mode 100644 node_modules/source-map-js/lib/util.js delete mode 100644 node_modules/source-map-js/package.json delete mode 100644 node_modules/source-map-js/source-map.d.ts delete mode 100644 node_modules/source-map-js/source-map.js delete mode 100644 node_modules/sucrase/LICENSE delete mode 100644 node_modules/sucrase/README.md delete mode 100755 node_modules/sucrase/bin/sucrase delete mode 100755 node_modules/sucrase/bin/sucrase-node delete mode 100644 node_modules/sucrase/dist/CJSImportProcessor.js delete mode 100644 node_modules/sucrase/dist/HelperManager.js delete mode 100644 node_modules/sucrase/dist/NameManager.js delete mode 100644 node_modules/sucrase/dist/Options-gen-types.js delete mode 100644 node_modules/sucrase/dist/Options.js delete mode 100644 node_modules/sucrase/dist/TokenProcessor.js delete mode 100644 node_modules/sucrase/dist/cli.js delete mode 100644 node_modules/sucrase/dist/computeSourceMap.js delete mode 100644 node_modules/sucrase/dist/esm/CJSImportProcessor.js delete mode 100644 node_modules/sucrase/dist/esm/HelperManager.js delete mode 100644 node_modules/sucrase/dist/esm/NameManager.js delete mode 100644 node_modules/sucrase/dist/esm/Options-gen-types.js delete mode 100644 node_modules/sucrase/dist/esm/Options.js delete mode 100644 node_modules/sucrase/dist/esm/TokenProcessor.js delete mode 100644 node_modules/sucrase/dist/esm/cli.js delete mode 100644 node_modules/sucrase/dist/esm/computeSourceMap.js delete mode 100644 node_modules/sucrase/dist/esm/identifyShadowedGlobals.js delete mode 100644 node_modules/sucrase/dist/esm/index.js delete mode 100644 node_modules/sucrase/dist/esm/parser/index.js delete mode 100644 node_modules/sucrase/dist/esm/parser/plugins/flow.js delete mode 100644 node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js delete mode 100644 node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js delete mode 100644 node_modules/sucrase/dist/esm/parser/plugins/types.js delete mode 100644 node_modules/sucrase/dist/esm/parser/plugins/typescript.js delete mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/index.js delete mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js delete mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js delete mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js delete mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/state.js delete mode 100644 node_modules/sucrase/dist/esm/parser/tokenizer/types.js delete mode 100644 node_modules/sucrase/dist/esm/parser/traverser/base.js delete mode 100644 node_modules/sucrase/dist/esm/parser/traverser/expression.js delete mode 100644 node_modules/sucrase/dist/esm/parser/traverser/index.js delete mode 100644 node_modules/sucrase/dist/esm/parser/traverser/lval.js delete mode 100644 node_modules/sucrase/dist/esm/parser/traverser/statement.js delete mode 100644 node_modules/sucrase/dist/esm/parser/traverser/util.js delete mode 100644 node_modules/sucrase/dist/esm/parser/util/charcodes.js delete mode 100644 node_modules/sucrase/dist/esm/parser/util/identifier.js delete mode 100644 node_modules/sucrase/dist/esm/parser/util/whitespace.js delete mode 100644 node_modules/sucrase/dist/esm/register.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/CJSImportTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/ESMImportTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/FlowTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/JSXTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/JestHoistTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/NumericSeparatorTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/OptionalCatchBindingTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/OptionalChainingNullishTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/ReactDisplayNameTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/ReactHotLoaderTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/RootTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/Transformer.js delete mode 100644 node_modules/sucrase/dist/esm/transformers/TypeScriptTransformer.js delete mode 100644 node_modules/sucrase/dist/esm/util/elideImportEquals.js delete mode 100644 node_modules/sucrase/dist/esm/util/formatTokens.js delete mode 100644 node_modules/sucrase/dist/esm/util/getClassInfo.js delete mode 100644 node_modules/sucrase/dist/esm/util/getDeclarationInfo.js delete mode 100644 node_modules/sucrase/dist/esm/util/getIdentifierNames.js delete mode 100644 node_modules/sucrase/dist/esm/util/getImportExportSpecifierInfo.js delete mode 100644 node_modules/sucrase/dist/esm/util/getJSXPragmaInfo.js delete mode 100644 node_modules/sucrase/dist/esm/util/getNonTypeIdentifiers.js delete mode 100644 node_modules/sucrase/dist/esm/util/getTSImportedNames.js delete mode 100644 node_modules/sucrase/dist/esm/util/isAsyncOperation.js delete mode 100644 node_modules/sucrase/dist/esm/util/isExportFrom.js delete mode 100644 node_modules/sucrase/dist/esm/util/isIdentifier.js delete mode 100644 node_modules/sucrase/dist/esm/util/removeMaybeImportAttributes.js delete mode 100644 node_modules/sucrase/dist/esm/util/shouldElideDefaultExport.js delete mode 100644 node_modules/sucrase/dist/identifyShadowedGlobals.js delete mode 100644 node_modules/sucrase/dist/index.js delete mode 100644 node_modules/sucrase/dist/parser/index.js delete mode 100644 node_modules/sucrase/dist/parser/plugins/flow.js delete mode 100644 node_modules/sucrase/dist/parser/plugins/jsx/index.js delete mode 100644 node_modules/sucrase/dist/parser/plugins/jsx/xhtml.js delete mode 100644 node_modules/sucrase/dist/parser/plugins/types.js delete mode 100644 node_modules/sucrase/dist/parser/plugins/typescript.js delete mode 100644 node_modules/sucrase/dist/parser/tokenizer/index.js delete mode 100644 node_modules/sucrase/dist/parser/tokenizer/keywords.js delete mode 100644 node_modules/sucrase/dist/parser/tokenizer/readWord.js delete mode 100644 node_modules/sucrase/dist/parser/tokenizer/readWordTree.js delete mode 100644 node_modules/sucrase/dist/parser/tokenizer/state.js delete mode 100644 node_modules/sucrase/dist/parser/tokenizer/types.js delete mode 100644 node_modules/sucrase/dist/parser/traverser/base.js delete mode 100644 node_modules/sucrase/dist/parser/traverser/expression.js delete mode 100644 node_modules/sucrase/dist/parser/traverser/index.js delete mode 100644 node_modules/sucrase/dist/parser/traverser/lval.js delete mode 100644 node_modules/sucrase/dist/parser/traverser/statement.js delete mode 100644 node_modules/sucrase/dist/parser/traverser/util.js delete mode 100644 node_modules/sucrase/dist/parser/util/charcodes.js delete mode 100644 node_modules/sucrase/dist/parser/util/identifier.js delete mode 100644 node_modules/sucrase/dist/parser/util/whitespace.js delete mode 100644 node_modules/sucrase/dist/register.js delete mode 100644 node_modules/sucrase/dist/transformers/CJSImportTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/ESMImportTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/FlowTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/JSXTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/JestHoistTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/NumericSeparatorTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/OptionalCatchBindingTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/OptionalChainingNullishTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/ReactDisplayNameTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/ReactHotLoaderTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/RootTransformer.js delete mode 100644 node_modules/sucrase/dist/transformers/Transformer.js delete mode 100644 node_modules/sucrase/dist/transformers/TypeScriptTransformer.js delete mode 100644 node_modules/sucrase/dist/types/CJSImportProcessor.d.ts delete mode 100644 node_modules/sucrase/dist/types/HelperManager.d.ts delete mode 100644 node_modules/sucrase/dist/types/NameManager.d.ts delete mode 100644 node_modules/sucrase/dist/types/Options-gen-types.d.ts delete mode 100644 node_modules/sucrase/dist/types/Options.d.ts delete mode 100644 node_modules/sucrase/dist/types/TokenProcessor.d.ts delete mode 100644 node_modules/sucrase/dist/types/cli.d.ts delete mode 100644 node_modules/sucrase/dist/types/computeSourceMap.d.ts delete mode 100644 node_modules/sucrase/dist/types/identifyShadowedGlobals.d.ts delete mode 100644 node_modules/sucrase/dist/types/index.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/index.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/plugins/flow.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/plugins/jsx/index.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/plugins/jsx/xhtml.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/plugins/types.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/plugins/typescript.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/index.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/keywords.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/readWord.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/readWordTree.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/state.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/tokenizer/types.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/traverser/base.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/traverser/expression.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/traverser/index.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/traverser/lval.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/traverser/statement.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/traverser/util.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/util/charcodes.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/util/identifier.d.ts delete mode 100644 node_modules/sucrase/dist/types/parser/util/whitespace.d.ts delete mode 100644 node_modules/sucrase/dist/types/register.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/CJSImportTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/ESMImportTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/FlowTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/JSXTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/JestHoistTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/NumericSeparatorTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/OptionalCatchBindingTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/OptionalChainingNullishTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/ReactDisplayNameTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/ReactHotLoaderTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/RootTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/Transformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/transformers/TypeScriptTransformer.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/elideImportEquals.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/formatTokens.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/getClassInfo.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/getDeclarationInfo.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/getIdentifierNames.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/getImportExportSpecifierInfo.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/getJSXPragmaInfo.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/getNonTypeIdentifiers.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/getTSImportedNames.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/isAsyncOperation.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/isExportFrom.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/isIdentifier.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/removeMaybeImportAttributes.d.ts delete mode 100644 node_modules/sucrase/dist/types/util/shouldElideDefaultExport.d.ts delete mode 100644 node_modules/sucrase/dist/util/elideImportEquals.js delete mode 100644 node_modules/sucrase/dist/util/formatTokens.js delete mode 100644 node_modules/sucrase/dist/util/getClassInfo.js delete mode 100644 node_modules/sucrase/dist/util/getDeclarationInfo.js delete mode 100644 node_modules/sucrase/dist/util/getIdentifierNames.js delete mode 100644 node_modules/sucrase/dist/util/getImportExportSpecifierInfo.js delete mode 100644 node_modules/sucrase/dist/util/getJSXPragmaInfo.js delete mode 100644 node_modules/sucrase/dist/util/getNonTypeIdentifiers.js delete mode 100644 node_modules/sucrase/dist/util/getTSImportedNames.js delete mode 100644 node_modules/sucrase/dist/util/isAsyncOperation.js delete mode 100644 node_modules/sucrase/dist/util/isExportFrom.js delete mode 100644 node_modules/sucrase/dist/util/isIdentifier.js delete mode 100644 node_modules/sucrase/dist/util/removeMaybeImportAttributes.js delete mode 100644 node_modules/sucrase/dist/util/shouldElideDefaultExport.js delete mode 100644 node_modules/sucrase/package.json delete mode 100644 node_modules/sucrase/register/index.js delete mode 100644 node_modules/sucrase/register/js.js delete mode 100644 node_modules/sucrase/register/jsx.js delete mode 100644 node_modules/sucrase/register/ts-legacy-module-interop.js delete mode 100644 node_modules/sucrase/register/ts.js delete mode 100644 node_modules/sucrase/register/tsx-legacy-module-interop.js delete mode 100644 node_modules/sucrase/register/tsx.js delete mode 100644 node_modules/sucrase/ts-node-plugin/index.js 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/tailwindcss/LICENSE delete mode 100644 node_modules/tailwindcss/README.md delete mode 100644 node_modules/tailwindcss/base.css delete mode 100644 node_modules/tailwindcss/colors.d.ts delete mode 100644 node_modules/tailwindcss/colors.js delete mode 100644 node_modules/tailwindcss/components.css delete mode 100644 node_modules/tailwindcss/defaultConfig.d.ts delete mode 100644 node_modules/tailwindcss/defaultConfig.js delete mode 100644 node_modules/tailwindcss/defaultTheme.d.ts delete mode 100644 node_modules/tailwindcss/defaultTheme.js delete mode 100644 node_modules/tailwindcss/lib/cli-peer-dependencies.js delete mode 100755 node_modules/tailwindcss/lib/cli.js delete mode 100644 node_modules/tailwindcss/lib/cli/build/deps.js delete mode 100644 node_modules/tailwindcss/lib/cli/build/index.js delete mode 100644 node_modules/tailwindcss/lib/cli/build/plugin.js delete mode 100644 node_modules/tailwindcss/lib/cli/build/utils.js delete mode 100644 node_modules/tailwindcss/lib/cli/build/watching.js delete mode 100644 node_modules/tailwindcss/lib/cli/help/index.js delete mode 100644 node_modules/tailwindcss/lib/cli/index.js delete mode 100644 node_modules/tailwindcss/lib/cli/init/index.js delete mode 100644 node_modules/tailwindcss/lib/corePluginList.js delete mode 100644 node_modules/tailwindcss/lib/corePlugins.js delete mode 100644 node_modules/tailwindcss/lib/css/LICENSE delete mode 100644 node_modules/tailwindcss/lib/css/preflight.css delete mode 100644 node_modules/tailwindcss/lib/featureFlags.js delete mode 100644 node_modules/tailwindcss/lib/index.js delete mode 100644 node_modules/tailwindcss/lib/lib/cacheInvalidation.js delete mode 100644 node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js delete mode 100644 node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js delete mode 100644 node_modules/tailwindcss/lib/lib/content.js delete mode 100644 node_modules/tailwindcss/lib/lib/defaultExtractor.js delete mode 100644 node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js delete mode 100644 node_modules/tailwindcss/lib/lib/expandApplyAtRules.js delete mode 100644 node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js delete mode 100644 node_modules/tailwindcss/lib/lib/findAtConfigPath.js delete mode 100644 node_modules/tailwindcss/lib/lib/generateRules.js delete mode 100644 node_modules/tailwindcss/lib/lib/getModuleDependencies.js delete mode 100644 node_modules/tailwindcss/lib/lib/load-config.js delete mode 100644 node_modules/tailwindcss/lib/lib/normalizeTailwindDirectives.js delete mode 100644 node_modules/tailwindcss/lib/lib/offsets.js delete mode 100644 node_modules/tailwindcss/lib/lib/partitionApplyAtRules.js delete mode 100644 node_modules/tailwindcss/lib/lib/regex.js delete mode 100644 node_modules/tailwindcss/lib/lib/remap-bitfield.js delete mode 100644 node_modules/tailwindcss/lib/lib/resolveDefaultsAtRules.js delete mode 100644 node_modules/tailwindcss/lib/lib/setupContextUtils.js delete mode 100644 node_modules/tailwindcss/lib/lib/setupTrackingContext.js delete mode 100644 node_modules/tailwindcss/lib/lib/sharedState.js delete mode 100644 node_modules/tailwindcss/lib/lib/substituteScreenAtRules.js delete mode 100644 node_modules/tailwindcss/lib/plugin.js delete mode 100644 node_modules/tailwindcss/lib/postcss-plugins/nesting/README.md delete mode 100644 node_modules/tailwindcss/lib/postcss-plugins/nesting/index.js delete mode 100644 node_modules/tailwindcss/lib/postcss-plugins/nesting/plugin.js delete mode 100644 node_modules/tailwindcss/lib/processTailwindFeatures.js delete mode 100644 node_modules/tailwindcss/lib/public/colors.js delete mode 100644 node_modules/tailwindcss/lib/public/create-plugin.js delete mode 100644 node_modules/tailwindcss/lib/public/default-config.js delete mode 100644 node_modules/tailwindcss/lib/public/default-theme.js delete mode 100644 node_modules/tailwindcss/lib/public/load-config.js delete mode 100644 node_modules/tailwindcss/lib/public/resolve-config.js delete mode 100644 node_modules/tailwindcss/lib/util/applyImportantSelector.js delete mode 100644 node_modules/tailwindcss/lib/util/bigSign.js delete mode 100644 node_modules/tailwindcss/lib/util/buildMediaQuery.js delete mode 100644 node_modules/tailwindcss/lib/util/cloneDeep.js delete mode 100644 node_modules/tailwindcss/lib/util/cloneNodes.js delete mode 100644 node_modules/tailwindcss/lib/util/color.js delete mode 100644 node_modules/tailwindcss/lib/util/colorNames.js delete mode 100644 node_modules/tailwindcss/lib/util/configurePlugins.js delete mode 100644 node_modules/tailwindcss/lib/util/createPlugin.js delete mode 100644 node_modules/tailwindcss/lib/util/createUtilityPlugin.js delete mode 100644 node_modules/tailwindcss/lib/util/dataTypes.js delete mode 100644 node_modules/tailwindcss/lib/util/defaults.js delete mode 100644 node_modules/tailwindcss/lib/util/escapeClassName.js delete mode 100644 node_modules/tailwindcss/lib/util/escapeCommas.js delete mode 100644 node_modules/tailwindcss/lib/util/flattenColorPalette.js delete mode 100644 node_modules/tailwindcss/lib/util/formatVariantSelector.js delete mode 100644 node_modules/tailwindcss/lib/util/getAllConfigs.js delete mode 100644 node_modules/tailwindcss/lib/util/hashConfig.js delete mode 100644 node_modules/tailwindcss/lib/util/isKeyframeRule.js delete mode 100644 node_modules/tailwindcss/lib/util/isPlainObject.js delete mode 100644 node_modules/tailwindcss/lib/util/isSyntacticallyValidPropertyValue.js delete mode 100644 node_modules/tailwindcss/lib/util/log.js delete mode 100644 node_modules/tailwindcss/lib/util/math-operators.js delete mode 100644 node_modules/tailwindcss/lib/util/nameClass.js delete mode 100644 node_modules/tailwindcss/lib/util/negateValue.js delete mode 100644 node_modules/tailwindcss/lib/util/normalizeConfig.js delete mode 100644 node_modules/tailwindcss/lib/util/normalizeScreens.js delete mode 100644 node_modules/tailwindcss/lib/util/parseAnimationValue.js delete mode 100644 node_modules/tailwindcss/lib/util/parseBoxShadowValue.js delete mode 100644 node_modules/tailwindcss/lib/util/parseDependency.js delete mode 100644 node_modules/tailwindcss/lib/util/parseGlob.js delete mode 100644 node_modules/tailwindcss/lib/util/parseObjectStyles.js delete mode 100644 node_modules/tailwindcss/lib/util/pluginUtils.js delete mode 100644 node_modules/tailwindcss/lib/util/prefixSelector.js delete mode 100644 node_modules/tailwindcss/lib/util/pseudoElements.js delete mode 100644 node_modules/tailwindcss/lib/util/removeAlphaVariables.js delete mode 100644 node_modules/tailwindcss/lib/util/resolveConfig.js delete mode 100644 node_modules/tailwindcss/lib/util/resolveConfigPath.js delete mode 100644 node_modules/tailwindcss/lib/util/responsive.js delete mode 100644 node_modules/tailwindcss/lib/util/splitAtTopLevelOnly.js delete mode 100644 node_modules/tailwindcss/lib/util/tap.js delete mode 100644 node_modules/tailwindcss/lib/util/toColorValue.js delete mode 100644 node_modules/tailwindcss/lib/util/toPath.js delete mode 100644 node_modules/tailwindcss/lib/util/transformThemeValue.js delete mode 100644 node_modules/tailwindcss/lib/util/validateConfig.js delete mode 100644 node_modules/tailwindcss/lib/util/validateFormalSyntax.js delete mode 100644 node_modules/tailwindcss/lib/util/withAlphaVariable.js delete mode 100644 node_modules/tailwindcss/lib/value-parser/LICENSE delete mode 100644 node_modules/tailwindcss/lib/value-parser/README.md delete mode 100644 node_modules/tailwindcss/lib/value-parser/index.d.js delete mode 100644 node_modules/tailwindcss/lib/value-parser/index.js delete mode 100644 node_modules/tailwindcss/lib/value-parser/parse.js delete mode 100644 node_modules/tailwindcss/lib/value-parser/stringify.js delete mode 100644 node_modules/tailwindcss/lib/value-parser/unit.js delete mode 100644 node_modules/tailwindcss/lib/value-parser/walk.js delete mode 100644 node_modules/tailwindcss/loadConfig.d.ts delete mode 100644 node_modules/tailwindcss/loadConfig.js delete mode 100644 node_modules/tailwindcss/nesting/index.d.ts delete mode 100644 node_modules/tailwindcss/nesting/index.js delete mode 100644 node_modules/tailwindcss/package.json delete mode 100644 node_modules/tailwindcss/peers/index.js delete mode 100644 node_modules/tailwindcss/plugin.d.ts delete mode 100644 node_modules/tailwindcss/plugin.js delete mode 100644 node_modules/tailwindcss/prettier.config.js delete mode 100644 node_modules/tailwindcss/resolveConfig.d.ts delete mode 100644 node_modules/tailwindcss/resolveConfig.js delete mode 100644 node_modules/tailwindcss/screens.css delete mode 100644 node_modules/tailwindcss/scripts/create-plugin-list.js delete mode 100644 node_modules/tailwindcss/scripts/generate-types.js delete mode 100644 node_modules/tailwindcss/scripts/release-channel.js delete mode 100644 node_modules/tailwindcss/scripts/release-notes.js delete mode 100644 node_modules/tailwindcss/scripts/type-utils.js delete mode 100644 node_modules/tailwindcss/src/cli-peer-dependencies.js delete mode 100644 node_modules/tailwindcss/src/cli.js delete mode 100644 node_modules/tailwindcss/src/cli/build/deps.js delete mode 100644 node_modules/tailwindcss/src/cli/build/index.js delete mode 100644 node_modules/tailwindcss/src/cli/build/plugin.js delete mode 100644 node_modules/tailwindcss/src/cli/build/utils.js delete mode 100644 node_modules/tailwindcss/src/cli/build/watching.js delete mode 100644 node_modules/tailwindcss/src/cli/help/index.js delete mode 100644 node_modules/tailwindcss/src/cli/index.js delete mode 100644 node_modules/tailwindcss/src/cli/init/index.js delete mode 100644 node_modules/tailwindcss/src/corePluginList.js delete mode 100644 node_modules/tailwindcss/src/corePlugins.js delete mode 100644 node_modules/tailwindcss/src/css/LICENSE delete mode 100644 node_modules/tailwindcss/src/css/preflight.css delete mode 100644 node_modules/tailwindcss/src/featureFlags.js delete mode 100644 node_modules/tailwindcss/src/index.js delete mode 100644 node_modules/tailwindcss/src/lib/cacheInvalidation.js delete mode 100644 node_modules/tailwindcss/src/lib/collapseAdjacentRules.js delete mode 100644 node_modules/tailwindcss/src/lib/collapseDuplicateDeclarations.js delete mode 100644 node_modules/tailwindcss/src/lib/content.js delete mode 100644 node_modules/tailwindcss/src/lib/defaultExtractor.js delete mode 100644 node_modules/tailwindcss/src/lib/evaluateTailwindFunctions.js delete mode 100644 node_modules/tailwindcss/src/lib/expandApplyAtRules.js delete mode 100644 node_modules/tailwindcss/src/lib/expandTailwindAtRules.js delete mode 100644 node_modules/tailwindcss/src/lib/findAtConfigPath.js delete mode 100644 node_modules/tailwindcss/src/lib/generateRules.js delete mode 100644 node_modules/tailwindcss/src/lib/getModuleDependencies.js delete mode 100644 node_modules/tailwindcss/src/lib/load-config.ts delete mode 100644 node_modules/tailwindcss/src/lib/normalizeTailwindDirectives.js delete mode 100644 node_modules/tailwindcss/src/lib/offsets.js delete mode 100644 node_modules/tailwindcss/src/lib/partitionApplyAtRules.js delete mode 100644 node_modules/tailwindcss/src/lib/regex.js delete mode 100644 node_modules/tailwindcss/src/lib/remap-bitfield.js delete mode 100644 node_modules/tailwindcss/src/lib/resolveDefaultsAtRules.js delete mode 100644 node_modules/tailwindcss/src/lib/setupContextUtils.js delete mode 100644 node_modules/tailwindcss/src/lib/setupTrackingContext.js delete mode 100644 node_modules/tailwindcss/src/lib/sharedState.js delete mode 100644 node_modules/tailwindcss/src/lib/substituteScreenAtRules.js delete mode 100644 node_modules/tailwindcss/src/plugin.js delete mode 100644 node_modules/tailwindcss/src/postcss-plugins/nesting/README.md delete mode 100644 node_modules/tailwindcss/src/postcss-plugins/nesting/index.js delete mode 100644 node_modules/tailwindcss/src/postcss-plugins/nesting/plugin.js delete mode 100644 node_modules/tailwindcss/src/processTailwindFeatures.js delete mode 100644 node_modules/tailwindcss/src/public/colors.js delete mode 100644 node_modules/tailwindcss/src/public/create-plugin.js delete mode 100644 node_modules/tailwindcss/src/public/default-config.js delete mode 100644 node_modules/tailwindcss/src/public/default-theme.js delete mode 100644 node_modules/tailwindcss/src/public/load-config.js delete mode 100644 node_modules/tailwindcss/src/public/resolve-config.js delete mode 100644 node_modules/tailwindcss/src/util/applyImportantSelector.js delete mode 100644 node_modules/tailwindcss/src/util/bigSign.js delete mode 100644 node_modules/tailwindcss/src/util/buildMediaQuery.js delete mode 100644 node_modules/tailwindcss/src/util/cloneDeep.js delete mode 100644 node_modules/tailwindcss/src/util/cloneNodes.js delete mode 100644 node_modules/tailwindcss/src/util/color.js delete mode 100644 node_modules/tailwindcss/src/util/colorNames.js delete mode 100644 node_modules/tailwindcss/src/util/configurePlugins.js delete mode 100644 node_modules/tailwindcss/src/util/createPlugin.js delete mode 100644 node_modules/tailwindcss/src/util/createUtilityPlugin.js delete mode 100644 node_modules/tailwindcss/src/util/dataTypes.js delete mode 100644 node_modules/tailwindcss/src/util/defaults.js delete mode 100644 node_modules/tailwindcss/src/util/escapeClassName.js delete mode 100644 node_modules/tailwindcss/src/util/escapeCommas.js delete mode 100644 node_modules/tailwindcss/src/util/flattenColorPalette.js delete mode 100644 node_modules/tailwindcss/src/util/formatVariantSelector.js delete mode 100644 node_modules/tailwindcss/src/util/getAllConfigs.js delete mode 100644 node_modules/tailwindcss/src/util/hashConfig.js delete mode 100644 node_modules/tailwindcss/src/util/isKeyframeRule.js delete mode 100644 node_modules/tailwindcss/src/util/isPlainObject.js delete mode 100644 node_modules/tailwindcss/src/util/isSyntacticallyValidPropertyValue.js delete mode 100644 node_modules/tailwindcss/src/util/log.js delete mode 100644 node_modules/tailwindcss/src/util/math-operators.ts delete mode 100644 node_modules/tailwindcss/src/util/nameClass.js delete mode 100644 node_modules/tailwindcss/src/util/negateValue.js delete mode 100644 node_modules/tailwindcss/src/util/normalizeConfig.js delete mode 100644 node_modules/tailwindcss/src/util/normalizeScreens.js delete mode 100644 node_modules/tailwindcss/src/util/parseAnimationValue.js delete mode 100644 node_modules/tailwindcss/src/util/parseBoxShadowValue.js delete mode 100644 node_modules/tailwindcss/src/util/parseDependency.js delete mode 100644 node_modules/tailwindcss/src/util/parseGlob.js delete mode 100644 node_modules/tailwindcss/src/util/parseObjectStyles.js delete mode 100644 node_modules/tailwindcss/src/util/pluginUtils.js delete mode 100644 node_modules/tailwindcss/src/util/prefixSelector.js delete mode 100644 node_modules/tailwindcss/src/util/pseudoElements.js delete mode 100644 node_modules/tailwindcss/src/util/removeAlphaVariables.js delete mode 100644 node_modules/tailwindcss/src/util/resolveConfig.js delete mode 100644 node_modules/tailwindcss/src/util/resolveConfigPath.js delete mode 100644 node_modules/tailwindcss/src/util/responsive.js delete mode 100644 node_modules/tailwindcss/src/util/splitAtTopLevelOnly.js delete mode 100644 node_modules/tailwindcss/src/util/tap.js delete mode 100644 node_modules/tailwindcss/src/util/toColorValue.js delete mode 100644 node_modules/tailwindcss/src/util/toPath.js delete mode 100644 node_modules/tailwindcss/src/util/transformThemeValue.js delete mode 100644 node_modules/tailwindcss/src/util/validateConfig.js delete mode 100644 node_modules/tailwindcss/src/util/validateFormalSyntax.js delete mode 100644 node_modules/tailwindcss/src/util/withAlphaVariable.js delete mode 100644 node_modules/tailwindcss/src/value-parser/LICENSE delete mode 100644 node_modules/tailwindcss/src/value-parser/README.md delete mode 100644 node_modules/tailwindcss/src/value-parser/index.d.ts delete mode 100644 node_modules/tailwindcss/src/value-parser/index.js delete mode 100644 node_modules/tailwindcss/src/value-parser/parse.js delete mode 100644 node_modules/tailwindcss/src/value-parser/stringify.js delete mode 100644 node_modules/tailwindcss/src/value-parser/unit.js delete mode 100644 node_modules/tailwindcss/src/value-parser/walk.js delete mode 100644 node_modules/tailwindcss/stubs/.npmignore delete mode 100644 node_modules/tailwindcss/stubs/.prettierrc.json delete mode 100644 node_modules/tailwindcss/stubs/config.full.js delete mode 100644 node_modules/tailwindcss/stubs/config.simple.js delete mode 100644 node_modules/tailwindcss/stubs/postcss.config.cjs delete mode 100644 node_modules/tailwindcss/stubs/postcss.config.js delete mode 100644 node_modules/tailwindcss/stubs/tailwind.config.cjs delete mode 100644 node_modules/tailwindcss/stubs/tailwind.config.js delete mode 100644 node_modules/tailwindcss/stubs/tailwind.config.ts delete mode 100644 node_modules/tailwindcss/tailwind.css delete mode 100644 node_modules/tailwindcss/types/config.d.ts delete mode 100644 node_modules/tailwindcss/types/generated/.gitkeep delete mode 100644 node_modules/tailwindcss/types/generated/colors.d.ts delete mode 100644 node_modules/tailwindcss/types/generated/corePluginList.d.ts delete mode 100644 node_modules/tailwindcss/types/generated/default-theme.d.ts delete mode 100644 node_modules/tailwindcss/types/index.d.ts delete mode 100644 node_modules/tailwindcss/utilities.css delete mode 100644 node_modules/tailwindcss/variants.css delete mode 100644 node_modules/thenify-all/History.md delete mode 100644 node_modules/thenify-all/LICENSE delete mode 100644 node_modules/thenify-all/README.md delete mode 100644 node_modules/thenify-all/index.js delete mode 100644 node_modules/thenify-all/package.json delete mode 100644 node_modules/thenify/History.md delete mode 100644 node_modules/thenify/LICENSE delete mode 100644 node_modules/thenify/README.md delete mode 100644 node_modules/thenify/index.js delete mode 100644 node_modules/thenify/package.json delete mode 100644 node_modules/tinyglobby/LICENSE delete mode 100644 node_modules/tinyglobby/README.md delete mode 100644 node_modules/tinyglobby/dist/index.cjs delete mode 100644 node_modules/tinyglobby/dist/index.d.cts delete mode 100644 node_modules/tinyglobby/dist/index.d.mts delete mode 100644 node_modules/tinyglobby/dist/index.mjs delete mode 100644 node_modules/tinyglobby/node_modules/fdir/LICENSE delete mode 100644 node_modules/tinyglobby/node_modules/fdir/README.md delete mode 100644 node_modules/tinyglobby/node_modules/fdir/dist/index.cjs delete mode 100644 node_modules/tinyglobby/node_modules/fdir/dist/index.d.cts delete mode 100644 node_modules/tinyglobby/node_modules/fdir/dist/index.d.mts delete mode 100644 node_modules/tinyglobby/node_modules/fdir/dist/index.mjs delete mode 100644 node_modules/tinyglobby/node_modules/fdir/package.json delete mode 100644 node_modules/tinyglobby/node_modules/picomatch/LICENSE delete mode 100644 node_modules/tinyglobby/node_modules/picomatch/README.md delete mode 100644 node_modules/tinyglobby/node_modules/picomatch/index.js delete mode 100644 node_modules/tinyglobby/node_modules/picomatch/lib/constants.js delete mode 100644 node_modules/tinyglobby/node_modules/picomatch/lib/parse.js delete mode 100644 node_modules/tinyglobby/node_modules/picomatch/lib/picomatch.js delete mode 100644 node_modules/tinyglobby/node_modules/picomatch/lib/scan.js delete mode 100644 node_modules/tinyglobby/node_modules/picomatch/lib/utils.js delete mode 100644 node_modules/tinyglobby/node_modules/picomatch/package.json delete mode 100644 node_modules/tinyglobby/node_modules/picomatch/posix.js delete mode 100644 node_modules/tinyglobby/package.json delete mode 100644 node_modules/to-regex-range/LICENSE delete mode 100644 node_modules/to-regex-range/README.md delete mode 100644 node_modules/to-regex-range/index.js delete mode 100644 node_modules/to-regex-range/package.json delete mode 100644 node_modules/ts-interface-checker/LICENSE delete mode 100644 node_modules/ts-interface-checker/README.md delete mode 100644 node_modules/ts-interface-checker/dist/index.d.ts delete mode 100644 node_modules/ts-interface-checker/dist/index.js delete mode 100644 node_modules/ts-interface-checker/dist/types.d.ts delete mode 100644 node_modules/ts-interface-checker/dist/types.js delete mode 100644 node_modules/ts-interface-checker/dist/util.d.ts delete mode 100644 node_modules/ts-interface-checker/dist/util.js delete mode 100644 node_modules/ts-interface-checker/package.json delete mode 100644 node_modules/util-deprecate/History.md delete mode 100644 node_modules/util-deprecate/LICENSE delete mode 100644 node_modules/util-deprecate/README.md delete mode 100644 node_modules/util-deprecate/browser.js delete mode 100644 node_modules/util-deprecate/node.js delete mode 100644 node_modules/util-deprecate/package.json delete mode 100644 venv/lib/python3.12/site-packages/__pycache__/typing_extensions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/blinker/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/blinker/__pycache__/_utilities.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/blinker/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/_compat.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/_termui_impl.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/_textwrap.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/_utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/_winconsole.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/core.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/decorators.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/exceptions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/formatting.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/globals.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/parser.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/shell_completion.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/termui.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/testing.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/types.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/click/__pycache__/utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/__main__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/app.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/blueprints.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/cli.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/config.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/ctx.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/debughelpers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/globals.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/helpers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/logging.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/sessions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/signals.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/templating.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/testing.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/typing.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/views.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/__pycache__/wrappers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/json/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/json/__pycache__/provider.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/json/__pycache__/tag.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/sansio/__pycache__/app.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/sansio/__pycache__/blueprints.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask/sansio/__pycache__/scaffold.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask_sqlalchemy/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask_sqlalchemy/__pycache__/cli.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask_sqlalchemy/__pycache__/extension.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask_sqlalchemy/__pycache__/model.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask_sqlalchemy/__pycache__/pagination.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask_sqlalchemy/__pycache__/query.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask_sqlalchemy/__pycache__/record_queries.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask_sqlalchemy/__pycache__/session.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask_sqlalchemy/__pycache__/table.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/flask_sqlalchemy/__pycache__/track_modifications.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/platform/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_clearing_run_switches.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_cpp_exception.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_initialstub_already_started.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_slp_switch.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_switch_three_greenlets.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_switch_three_greenlets2.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/fail_switch_two_greenlets.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/leakcheck.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_contextvars.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_cpp.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_extension_interface.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_gc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_generator.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_generator_nested.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_greenlet.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_greenlet_trash.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_leaks.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_stack_saved.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_throw.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_tracing.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_version.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/greenlet/tests/__pycache__/test_weakref.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/itsdangerous/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/itsdangerous/__pycache__/_json.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/itsdangerous/__pycache__/encoding.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/itsdangerous/__pycache__/exc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/itsdangerous/__pycache__/serializer.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/itsdangerous/__pycache__/signer.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/itsdangerous/__pycache__/timed.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/itsdangerous/__pycache__/url_safe.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/_identifier.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/async_utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/bccache.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/compiler.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/constants.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/debug.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/defaults.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/environment.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/exceptions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/ext.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/filters.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/idtracking.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/lexer.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/loaders.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/meta.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/nativetypes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/nodes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/optimizer.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/parser.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/runtime.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/sandbox.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/tests.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/jinja2/__pycache__/visitor.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/markupsafe/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/markupsafe/__pycache__/_native.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/__pycache__/__main__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/__pycache__/__pip-runner__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/__pycache__/build_env.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/__pycache__/cache.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/__pycache__/configuration.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/__pycache__/exceptions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/__pycache__/main.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/__pycache__/pyproject.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/__pycache__/self_outdated_check.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/__pycache__/wheel_builder.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/autocompletion.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/base_command.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/cmdoptions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/command_context.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/main.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/main_parser.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/parser.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/progress_bars.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/req_command.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/spinners.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/cli/__pycache__/status_codes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/cache.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/check.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/completion.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/configuration.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/debug.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/download.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/freeze.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/hash.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/help.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/index.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/inspect.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/install.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/list.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/search.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/show.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/uninstall.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/commands/__pycache__/wheel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/installed.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/sdist.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/distributions/__pycache__/wheel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/index/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/index/__pycache__/collector.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/index/__pycache__/package_finder.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/index/__pycache__/sources.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/_distutils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/_sysconfig.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/locations/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/_json.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/metadata/__pycache__/pkg_resources.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_compat.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_dists.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__pycache__/_envs.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/candidate.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/direct_url.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/format_control.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/index.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/installation_report.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/link.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/scheme.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/search_scope.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/selection_prefs.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/target_python.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/models/__pycache__/wheel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/auth.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/cache.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/download.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/lazy_wheel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/session.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/network/__pycache__/xmlrpc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/check.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/freeze.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/__pycache__/prepare.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/build_tracker.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/metadata.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/metadata_editable.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/metadata_legacy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/wheel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/wheel_editable.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/build/__pycache__/wheel_legacy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/install/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/install/__pycache__/editable_legacy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/operations/install/__pycache__/wheel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/constructors.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/req_file.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/req_install.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/req_set.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/req/__pycache__/req_uninstall.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/legacy/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/legacy/__pycache__/resolver.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/candidates.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/factory.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/found_candidates.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/provider.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/reporter.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/requirements.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__pycache__/resolver.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/_jaraco_text.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/_log.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/appdirs.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/compat.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/compatibility_tags.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/datetime.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/deprecation.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/direct_url_helpers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/egg_link.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/encoding.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/entrypoints.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/filesystem.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/filetypes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/glibc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/hashes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/logging.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/misc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/models.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/packaging.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/setuptools_build.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/subprocess.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/temp_dir.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/unpacking.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/urls.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/virtualenv.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/utils/__pycache__/wheel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/bazaar.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/git.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/mercurial.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/subversion.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_internal/vcs/__pycache__/versioncontrol.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/__pycache__/six.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/__pycache__/typing_extensions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/_cmd.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/adapter.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/cache.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/controller.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/filewrapper.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/heuristics.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/serialize.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__pycache__/wrapper.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/file_cache.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/__pycache__/redis_cache.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/certifi/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/certifi/__pycache__/__main__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/certifi/__pycache__/core.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/big5freq.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/big5prober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/chardistribution.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/charsetgroupprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/charsetprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/codingstatemachine.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/codingstatemachinedict.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/cp949prober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/enums.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/escprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/escsm.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/eucjpprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/euckrfreq.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/euckrprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/euctwfreq.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/euctwprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/gb2312freq.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/gb2312prober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/hebrewprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/jisfreq.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/johabfreq.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/johabprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/jpcntx.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/langbulgarianmodel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/langgreekmodel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/langhebrewmodel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/langhungarianmodel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/langrussianmodel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/langthaimodel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/langturkishmodel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/latin1prober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/macromanprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/mbcharsetprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/mbcsgroupprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/mbcssm.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/resultdict.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/sbcharsetprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/sbcsgroupprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/sjisprober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/universaldetector.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/utf1632prober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/utf8prober.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/__pycache__/version.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/cli/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/cli/__pycache__/chardetect.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/metadata/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/chardet/metadata/__pycache__/languages.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/__pycache__/ansi.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/__pycache__/ansitowin32.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/__pycache__/initialise.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/__pycache__/win32.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/__pycache__/winterm.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/tests/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/tests/__pycache__/ansi_test.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/tests/__pycache__/ansitowin32_test.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/tests/__pycache__/initialise_test.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/tests/__pycache__/isatty_test.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/tests/__pycache__/utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/colorama/tests/__pycache__/winterm_test.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/compat.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/database.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/index.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/locators.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/manifest.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/markers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/metadata.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/resources.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/scripts.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/util.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/version.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distlib/__pycache__/wheel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distro/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distro/__pycache__/__main__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/distro/__pycache__/distro.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/codec.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/compat.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/core.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/idnadata.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/intranges.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/package_data.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/idna/__pycache__/uts46data.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/msgpack/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/msgpack/__pycache__/exceptions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/msgpack/__pycache__/ext.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/msgpack/__pycache__/fallback.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/__about__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/_manylinux.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/_musllinux.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/_structures.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/markers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/requirements.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/specifiers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/tags.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/packaging/__pycache__/version.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/__main__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/android.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/api.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/macos.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/unix.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/version.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/platformdirs/__pycache__/windows.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/__main__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/cmdline.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/console.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/filter.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/formatter.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/lexer.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/modeline.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/plugin.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/regexopt.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/scanner.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/sphinxext.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/style.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/token.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/unistring.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/__pycache__/util.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/filters/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/_mapping.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/bbcode.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/groff.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/html.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/img.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/irc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/latex.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/other.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/pangomarkup.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/rtf.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/svg.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/terminal.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__pycache__/terminal256.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/__pycache__/_mapping.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/__pycache__/python.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pygments/styles/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/__pycache__/actions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/__pycache__/common.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/__pycache__/core.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/__pycache__/exceptions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/__pycache__/helpers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/__pycache__/results.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/__pycache__/testing.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/__pycache__/unicode.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/__pycache__/util.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyparsing/diagram/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/__pycache__/_compat.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/__pycache__/_impl.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/__pycache__/_in_process.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/__version__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/_internal_utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/adapters.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/api.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/auth.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/certs.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/compat.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/cookies.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/exceptions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/help.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/hooks.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/models.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/packages.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/sessions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/status_codes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/structures.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/requests/__pycache__/utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__pycache__/providers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__pycache__/reporters.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__pycache__/resolvers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/__pycache__/structs.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/compat/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/resolvelib/compat/__pycache__/collections_abc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/__main__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_cell_widths.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_codes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_emoji_replace.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_export_format.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_extension.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_fileno.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_inspect.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_log_render.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_loop.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_null_file.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_palettes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_pick.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_ratio.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_spinners.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_stack.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_timer.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_win32_console.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_windows.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_windows_renderer.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/_wrap.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/abc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/align.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/ansi.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/bar.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/box.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/cells.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/color.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/color_triplet.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/columns.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/console.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/constrain.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/containers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/control.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/default_styles.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/diagnose.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/emoji.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/errors.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/file_proxy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/filesize.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/highlighter.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/json.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/jupyter.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/layout.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/live.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/live_render.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/logging.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/markup.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/measure.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/padding.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/pager.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/palette.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/panel.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/pretty.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/progress.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/progress_bar.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/prompt.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/protocol.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/region.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/repr.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/rule.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/scope.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/screen.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/segment.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/spinner.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/status.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/style.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/styled.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/syntax.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/table.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/terminal_theme.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/text.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/theme.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/themes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/traceback.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/rich/__pycache__/tree.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/_asyncio.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/_utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/after.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/before.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/before_sleep.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/nap.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/retry.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/stop.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/tornadoweb.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tenacity/__pycache__/wait.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tomli/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tomli/__pycache__/_parser.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tomli/__pycache__/_re.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/tomli/__pycache__/_types.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/_api.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/_macos.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/_openssl.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/_ssl_constants.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/truststore/__pycache__/_windows.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/_collections.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/_version.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/connection.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/connectionpool.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/exceptions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/fields.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/filepost.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/poolmanager.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/request.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/__pycache__/response.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/_appengine_environ.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/appengine.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/ntlmpool.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/pyopenssl.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/securetransport.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__pycache__/socks.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/bindings.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__pycache__/low_level.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/__pycache__/six.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/makefile.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/packages/backports/__pycache__/weakref_finalize.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/connection.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/proxy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/queue.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/request.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/response.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/retry.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/ssl_.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/ssl_match_hostname.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/ssltransport.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/timeout.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/url.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__pycache__/wait.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/webencodings/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/webencodings/__pycache__/labels.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/webencodings/__pycache__/mklabels.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/webencodings/__pycache__/tests.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/pip/_vendor/webencodings/__pycache__/x_user_defined.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/slugify/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/slugify/__pycache__/__main__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/slugify/__pycache__/__version__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/slugify/__pycache__/slugify.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/slugify/__pycache__/special.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/__pycache__/events.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/__pycache__/exc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/__pycache__/inspection.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/__pycache__/log.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/__pycache__/schema.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/__pycache__/types.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/connectors/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/connectors/__pycache__/aioodbc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/connectors/__pycache__/asyncio.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/connectors/__pycache__/pyodbc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/cyextension/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/__pycache__/_typing.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mssql/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mssql/__pycache__/aioodbc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mssql/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mssql/__pycache__/information_schema.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mssql/__pycache__/json.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mssql/__pycache__/provision.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mssql/__pycache__/pymssql.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mssql/__pycache__/pyodbc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/aiomysql.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/asyncmy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/cymysql.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/dml.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/enumerated.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/expression.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/json.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/mariadb.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/mariadbconnector.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/mysqlconnector.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/mysqldb.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/provision.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/pymysql.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/pyodbc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/reflection.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/reserved_words.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/mysql/__pycache__/types.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/oracle/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/oracle/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/oracle/__pycache__/cx_oracle.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/oracle/__pycache__/dictionary.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/oracle/__pycache__/oracledb.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/oracle/__pycache__/provision.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/oracle/__pycache__/types.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/oracle/__pycache__/vector.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/_psycopg_common.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/array.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/asyncpg.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/dml.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/ext.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/hstore.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/json.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/named_types.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/operators.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/pg8000.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/pg_catalog.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/provision.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/psycopg.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/psycopg2.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/psycopg2cffi.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/ranges.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/__pycache__/types.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/__pycache__/aiosqlite.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/__pycache__/dml.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/__pycache__/json.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/__pycache__/provision.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/__pycache__/pysqlcipher.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/dialects/sqlite/__pycache__/pysqlite.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/_py_processors.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/_py_row.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/_py_util.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/characteristics.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/create.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/cursor.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/default.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/events.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/interfaces.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/mock.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/processors.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/reflection.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/result.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/row.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/strategies.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/url.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/engine/__pycache__/util.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/event/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/event/__pycache__/api.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/event/__pycache__/attr.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/event/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/event/__pycache__/legacy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/event/__pycache__/registry.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/associationproxy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/automap.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/baked.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/compiler.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/horizontal_shard.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/hybrid.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/indexable.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/instrumentation.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/mutable.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/orderinglist.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/__pycache__/serializer.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/__pycache__/engine.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/__pycache__/exc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/__pycache__/result.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/__pycache__/scoping.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/__pycache__/session.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/declarative/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/declarative/__pycache__/extensions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/mypy/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/mypy/__pycache__/apply.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/mypy/__pycache__/decl_class.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/mypy/__pycache__/infer.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/mypy/__pycache__/names.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/mypy/__pycache__/plugin.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/ext/mypy/__pycache__/util.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/future/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/future/__pycache__/engine.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/_orm_constructors.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/_typing.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/attributes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/bulk_persistence.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/clsregistry.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/collections.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/context.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/decl_api.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/decl_base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/dependency.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/descriptor_props.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/dynamic.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/evaluator.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/events.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/exc.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/identity.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/instrumentation.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/interfaces.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/loading.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/mapped_collection.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/mapper.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/path_registry.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/persistence.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/properties.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/query.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/relationships.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/scoping.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/session.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/state.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/state_changes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/strategies.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/strategy_options.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/sync.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/unitofwork.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/util.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/orm/__pycache__/writeonly.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/pool/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/pool/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/pool/__pycache__/events.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/pool/__pycache__/impl.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/_dml_constructors.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/_elements_constructors.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/_orm_types.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/_py_util.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/_selectable_constructors.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/_typing.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/annotation.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/cache_key.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/coercions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/compiler.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/crud.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/ddl.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/default_comparator.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/dml.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/elements.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/events.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/expression.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/functions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/lambdas.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/naming.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/operators.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/roles.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/schema.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/selectable.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/sqltypes.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/traversals.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/type_api.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/util.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/sql/__pycache__/visitors.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/assertions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/assertsql.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/asyncio.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/config.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/engines.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/entities.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/exclusions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/pickleable.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/profiling.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/provision.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/requirements.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/schema.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/util.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/__pycache__/warnings.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/fixtures/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/fixtures/__pycache__/base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/fixtures/__pycache__/mypy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/fixtures/__pycache__/orm.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/fixtures/__pycache__/sql.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/plugin/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/plugin/__pycache__/bootstrap.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/plugin/__pycache__/plugin_base.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/plugin/__pycache__/pytestplugin.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_cte.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_ddl.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_deprecations.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_dialect.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_insert.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_reflection.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_results.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_rowcount.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_select.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_sequence.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_types.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_unicode_ddl.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/testing/suite/__pycache__/test_update_delete.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/_collections.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/_concurrency_py3k.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/_has_cy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/_py_collections.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/compat.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/concurrency.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/deprecations.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/langhelpers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/preloaded.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/queue.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/tool_support.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/topological.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/sqlalchemy/util/__pycache__/typing.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/text_unidecode/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/_internal.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/_reloader.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/exceptions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/formparser.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/http.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/local.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/security.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/serving.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/test.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/testapp.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/urls.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/user_agent.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/__pycache__/wsgi.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/accept.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/auth.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/cache_control.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/csp.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/etag.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/file_storage.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/headers.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/mixins.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/range.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/datastructures/__pycache__/structures.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/debug/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/debug/__pycache__/console.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/debug/__pycache__/repr.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/debug/__pycache__/tbtools.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/middleware/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/middleware/__pycache__/dispatcher.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/middleware/__pycache__/http_proxy.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/middleware/__pycache__/lint.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/middleware/__pycache__/profiler.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/middleware/__pycache__/proxy_fix.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/middleware/__pycache__/shared_data.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/routing/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/routing/__pycache__/converters.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/routing/__pycache__/exceptions.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/routing/__pycache__/map.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/routing/__pycache__/matcher.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/routing/__pycache__/rules.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/sansio/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/sansio/__pycache__/http.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/sansio/__pycache__/multipart.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/sansio/__pycache__/request.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/sansio/__pycache__/response.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/sansio/__pycache__/utils.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/wrappers/__pycache__/__init__.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/wrappers/__pycache__/request.cpython-312.pyc delete mode 100644 venv/lib/python3.12/site-packages/werkzeug/wrappers/__pycache__/response.cpython-312.pyc diff --git a/__pycache__/config.cpython-312.pyc b/__pycache__/config.cpython-312.pyc deleted file mode 100644 index 2521ff0acc26b74919f5221d499e8537f4d52414..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1771 zcmb7E&rcgi6rTOz-SuLA*rp<-30+Yo#Hq}xYA>y#N)8x8L!1^IRJK)Ci+3RFE^9Ko zcCbZNQsod%gp)z4M2=Ma13C6ssTWdT+-VO;?WH%Ukt*fXnYEV%q)P2b`{vs>Z)V=S z`M&w7yITgNeRHjBB{=|or$0f9bU^C|0_wm7CSwB)Ku~0ZkgzWX(V^?#BE>Ty9SHe- zrVWE$i?Co4nCw$va{HbAG{N`r#210WKFOChP4vA2@rq}>5)>i%OzAsLi&mLb^iLX` zD^MFWp#xe!5>O}kYK#dq7IH-?2nqXQSBL{-GC{tpjLR}4UrqQQv$->~6*8MAb9;id z!@d{~ae!ddjF_i2s1dg&o1)fLl~PeGjFp^4YYEG<*|C{yUcZx_uf1c!O4@}51ikcE zu$nGBG@K=vww&||Dw*YiXO$cr8_(o3w=%O?{r=2!O?DsImIpslRTWE?<9dcufVD2u zLa^Z3tE1+^L@pJ>lCC?(GSqb}>-sWT%ceM{>yOHY-5Fs^E*7Cvu@KpXTY?^uulp3mA92w8vx<84M)Zy>*21Nsb=_bIXaw7+e^*zb9W9aa?Tmm__6f$x?7syiy z?h`+4TBORQc-;5tDP!8HO%#IT&?u@)`n4VqQwJWg?e<^ajZjrzGi!|7<(u|3Vvkv~~>Dw%B6gQm>XZy=W z&y8o?FTIK15|u67aN&;8C9(#VNWv=+c~$?o7cYE}gdl3@ zL*c$j488F9diF5Vea!NaWQzkrkB{0Eps|ExUF1y&NQULGCRjA#qEWWJl-w>3eUz|h zEV#a2MItDwYpVQ3i>e(_7PkfElaH>Cg|^f#B>P&r*?uEFMk6GO636|5m?Ms1m|sEk zP>yYmY>aHG8|wD(?#Rx_uDYY{U2hD&-;h687ylM`=G|jJ%t;T!#J7bLK)Mr2Vv^4* aCxCQEmq7p3W@5P6s~n5G%svtPGyenI1A52+ diff --git a/__pycache__/models.cpython-312.pyc b/__pycache__/models.cpython-312.pyc deleted file mode 100644 index cac10dda6b34b111fd6d4136c6c071c24d4c4f32..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9066 zcmd^FT~Hg>72Xw+(7zBu7}+7l#&#^g5Mw*B9byv2!K$bh!8Kx##}v{mysK@+Y&|KtX!2FUs}WDC%EW$R|xMv;GcEQS%f-F*HvFDGxqApO3`aZ>ISZ%?ZyWqXO!bJ3!X@kQ7O z7i1xC82<3`2fTlb4aQt5v2m0Qu>_ua$9;luFH9Kkm`@lJ?V#YlQ(EaSEF48C`_rMq z{b4B&%}^c{Lwjmib--AxD(9irw7Hg1E!8{$3z$5$Ra?T_QJxs}6L>Q)F)Bv0q*eA( zzauNPRje3xWJRY~(Jbke`53F(Xp%=>ELn5ljpDMLUot4xtW~YGY;FfDQfO&|mIo{7 z7#R~|Ua}}FXRo4XEz@hLqE}a@=U{C2DNiF)4{{e{2iX*Ba5+TvM*>SkO%$YX<1sB7 z#|anok(l=m8+&;T273OnO4LR}+}$WE>OxVT_l@xE%L#b$63##Mm?l=pL(5u*z3q$g z5mDF2hexl4g@~y2MI&Qj0*_)LUy$>IsoD{r{|;eqi)!9C850fX!z3EK5gzCKx%_o@ zoR9f)uc5S12n_gJKLBE$isW83ikhPHTRla2mD(5#X2_)?cq&A5$x(v-)dI`k7Ipb* z0Xu4Gd3~r$2uF#Z?PB%$8Nnj(&Nu0Fd;&m2R z?E-TGE=ZjETl2By!EE#U)9SzIcCSMfRWd6zR7kVxgiOh-s6g@Tu^}XwYp!;fB5y(k z%uow|$X*mJAaYY7t&kTjrI;~kmquDzxf>ffK)_h7`%}kPTTiUCo>-p9T6;6PUV?9_ zUs+WsDEqJ<3g8ClDJlTD^7H^e;8!)nl&fZFQrm<5w!Eg#AoAf$2JZn2@60}EC7|&Z zdAvHWm$2i+>zy=9Bh43^QBNM@nr&B7y=Y!A&;2~*%UBO*bcdxe4!N8nG)Kc;uW0ak zVYi|@=1pGj-KdYxJu!Q|5qx)ZMHMq5YR`rFXfPz!x-bmDaS__Q;te>>i{X0^@6W@5?uMdyMu)%~D3 z9eK)5$FkP`_~4q!GV7jk&yCD;2`*LhMJRpa>AmXh7O5oi6@KX{V22AT;!a4abJ3(}Txzp;|nF}m+q_v7WsO|zA z8H&u02l^nU^JoCuvF;{J0fkJ>Tp4hU)==0V}$ia@BC~FJgktj<=jujnd zWvbIs)(DD~tyQjFGAg@(&bD$N2o`0j#O*gSKq)=DVrG|xAe@o+LEIq7xnDj9ah}v; ztr^Q3fQzpsuoOBuhS;I*v5GXnA5j+$MaPjq{!m~x^yHm%3vpoww5W-25uPROP%1)Z z34SJRdF{?TFr(K}fO$`{fAQkN#bi(FZpP}$=;SjxEK#ia-=|b@~ilZpHQ5-{Y z9K{I~ZV=$0`RJ&qzQIlaochB6%pu6I6MmMAMR3;}; zoI*ned8H7S$!V<6k4Hy%P8eeuX;P#YRng1Iuqtf}3duKp3mJsfma4G22|A+)oF@P{ zjpo@?GpFXR&wrBmBq@CHS-St}iRn{W;|KBnHA~$rH^U`Wi?s{2>4Vc;*7A1zLZMc_ zpii|vuw*T7L2X_Aygs2%?q6(MXiJSe3O)=jU(6ml`~2XXK3jJ!?*0xO-i*-C5C6IA zk6nn<9>CsW(`gp%9gn-$0cqRh6~T2VfmdWxnAWG@?fgH2*X@C1_1i@SkYw~lu!Zov zM_$@u$&}v*EQ}QZ#ELgb(JYbXa{vRQVG_ zB%?bby{JR3x}9OnO`PUM5TcP`1wY}&k(-GcxNWn9^xy-n%*ZNt8Tf%qkS2?9al zP*srF1O+St!EpeBO;3tI0@#u(;Y#)`x);fvW`)f%HBEn~wMZa4Ucm z?~FHjYx(pu_p~=_9*UpGliVqvWE^bCNmhu`FaKAF61u*!R6=ofbo$`DIm?VektxI; zisKhMB|nucE0n5){8*||3B25uCAKcGzpM(1MbVA=s@4u|ZU^Hi#6_x8nyp$opigw~ zWr;B;*rk>qd3Lc)h+a=}njR;V>x#;|rP#!tSiQ?Gp%TG^FM}BAgRBfaBvt}?h>=Jp*53g!PgTC= z22i6cBi!d)BsSS3y&LjUmpu6hj0giD;?xU=bN*K1)~cgz#nHBOdbPcGrM-8xePE@1 zAlrT+>lj>h46QhZvW{!hhQA)}o}OH_9$2v+$mlLSRsX^Idn;r%Zw_vZv^jX7w--b) z$qrQ-tn5w6AT%z2mt>}HFPd1Mt9w9O@uSU2W-+i3NZv}@GS>Etu07{R-`JTSMXpXR zp}34<2!v?NlL@5cSFySRFVAsth>whOp%BZ6ddTu&{~e&^=zgW0h5#K2kFz8aBO_Qh ziUI>6<)j@+jD#786GAg^Q}oCCtNP>Wq`fjRS3EIXZ_=t?n;)Aq?_A0rzMT2VtvOe= z{!?(v#Z-ESEWNm?!oo`oDz)I}A&wKC2`BmG3(s7ckAu_UtR)n`@Iqt$T19IPtk+Ol z%PY)*s@C$gN~Ia3bCpt7M{7D{N`Q;zho6%2CvW}Lk3sJ1lzx>Aqh8W%BVtm4OoJ1` zyGmJNw0T65EaQQL51cDgx#YnA=2LCC-+X)70mF;v7&ic@Pg1h&zI(c~v((P8_xfvpVAbkfYf6U(ka-xYC5a#ASJ zWeL9pfwQO z#fkXgrz9mB@b@1BFe=@_3xU$_A8aigs@QOfRB@(O(i(BKWbES214s^2(p z6Uq{64YZV1L9vM4mc$iszLD?~>E@SUzQ7ur?YN`Z}gFgOJ^_N5Ly z>Uh|ZdNU2N%cB|H(HtLgY#TOC;9RA+0^S!$1O-BgSesj)>NH3VpN=X=Bk!UW6g>PC z0Qo+FhHX%uT-0&df$_+9i{p_cQOeDLk^k(Y1T#DdPuhVYj;?q=0!X*aIB+6E5c)|i&Z>Brv`sN1{gBuiNH(H!@$6Wn=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } - }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", - "dev": true, - "license": "MIT" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", - "dev": true, - "license": "MIT" - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "license": "ISC", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/arg": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true, - "license": "MIT" - }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/camelcase-css": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/camelcase-css/-/camelcase-css-2.0.1.tgz", - "integrity": "sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, - "license": "MIT", - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/chokidar/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/commander": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", - "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/cssesc": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", - "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", - "dev": true, - "license": "MIT", - "bin": { - "cssesc": "bin/cssesc" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/didyoumean": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/didyoumean/-/didyoumean-1.2.2.tgz", - "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/dlv": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", - "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-glob": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", - "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.8" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fastq": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", - "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "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, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "license": "MIT", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-core-module": { - "version": "2.16.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.1.tgz", - "integrity": "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/jiti": { - "version": "1.21.7", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.7.tgz", - "integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==", - "dev": true, - "license": "MIT", - "peer": true, - "bin": { - "jiti": "bin/jiti.js" - } - }, - "node_modules/lilconfig": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", - "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" - } - }, - "node_modules/lines-and-columns": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", - "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", - "dev": true, - "license": "MIT" - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", - "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", - "dev": true, - "license": "MIT", - "dependencies": { - "braces": "^3.0.3", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mz": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", - "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0", - "object-assign": "^4.0.1", - "thenify-all": "^1.0.0" - } - }, - "node_modules/nanoid": { - "version": "3.3.11", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.11.tgz", - "integrity": "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-hash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", - "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "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, - "license": "MIT" - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "dev": true, - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/pirates": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", - "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 6" - } - }, - "node_modules/postcss": { - "version": "8.5.6", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.6.tgz", - "integrity": "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "peer": true, - "dependencies": { - "nanoid": "^3.3.11", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-import": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/postcss-import/-/postcss-import-15.1.0.tgz", - "integrity": "sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==", - "dev": true, - "license": "MIT", - "dependencies": { - "postcss-value-parser": "^4.0.0", - "read-cache": "^1.0.0", - "resolve": "^1.1.7" - }, - "engines": { - "node": ">=14.0.0" - }, - "peerDependencies": { - "postcss": "^8.0.0" - } - }, - "node_modules/postcss-js": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/postcss-js/-/postcss-js-4.1.0.tgz", - "integrity": "sha512-oIAOTqgIo7q2EOwbhb8UalYePMvYoIeRY2YKntdpFQXNosSu3vLrniGgmH9OKs/qAkfoj5oB3le/7mINW1LCfw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "camelcase-css": "^2.0.1" - }, - "engines": { - "node": "^12 || ^14 || >= 16" - }, - "peerDependencies": { - "postcss": "^8.4.21" - } - }, - "node_modules/postcss-load-config": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", - "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "lilconfig": "^3.1.1" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "jiti": ">=1.21.0", - "postcss": ">=8.0.9", - "tsx": "^4.8.1", - "yaml": "^2.4.2" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - }, - "postcss": { - "optional": true - }, - "tsx": { - "optional": true - }, - "yaml": { - "optional": true - } - } - }, - "node_modules/postcss-nested": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", - "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "postcss-selector-parser": "^6.1.1" - }, - "engines": { - "node": ">=12.0" - }, - "peerDependencies": { - "postcss": "^8.2.14" - } - }, - "node_modules/postcss-selector-parser": { - "version": "6.1.2", - "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz", - "integrity": "sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==", - "dev": true, - "license": "MIT", - "dependencies": { - "cssesc": "^3.0.0", - "util-deprecate": "^1.0.2" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "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" - } - ], - "license": "MIT" - }, - "node_modules/read-cache": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", - "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", - "dev": true, - "license": "MIT", - "dependencies": { - "pify": "^2.3.0" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/resolve": { - "version": "1.22.11", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.11.tgz", - "integrity": "sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-core-module": "^2.16.1", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/reusify": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", - "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", - "dev": true, - "license": "MIT", - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "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" - } - ], - "license": "MIT", - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "dev": true, - "license": "BSD-3-Clause", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/sucrase": { - "version": "3.35.1", - "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", - "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.2", - "commander": "^4.0.0", - "lines-and-columns": "^1.1.6", - "mz": "^2.7.0", - "pirates": "^4.0.1", - "tinyglobby": "^0.2.11", - "ts-interface-checker": "^0.1.9" - }, - "bin": { - "sucrase": "bin/sucrase", - "sucrase-node": "bin/sucrase-node" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "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, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/tailwindcss": { - "version": "3.4.19", - "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.4.19.tgz", - "integrity": "sha512-3ofp+LL8E+pK/JuPLPggVAIaEuhvIz4qNcf3nA1Xn2o/7fb7s/TYpHhwGDv1ZU3PkBluUVaF8PyCHcm48cKLWQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "@alloc/quick-lru": "^5.2.0", - "arg": "^5.0.2", - "chokidar": "^3.6.0", - "didyoumean": "^1.2.2", - "dlv": "^1.1.3", - "fast-glob": "^3.3.2", - "glob-parent": "^6.0.2", - "is-glob": "^4.0.3", - "jiti": "^1.21.7", - "lilconfig": "^3.1.3", - "micromatch": "^4.0.8", - "normalize-path": "^3.0.0", - "object-hash": "^3.0.0", - "picocolors": "^1.1.1", - "postcss": "^8.4.47", - "postcss-import": "^15.1.0", - "postcss-js": "^4.0.1", - "postcss-load-config": "^4.0.2 || ^5.0 || ^6.0", - "postcss-nested": "^6.2.0", - "postcss-selector-parser": "^6.1.2", - "resolve": "^1.22.8", - "sucrase": "^3.35.0" - }, - "bin": { - "tailwind": "lib/cli.js", - "tailwindcss": "lib/cli.js" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/thenify": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", - "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", - "dev": true, - "license": "MIT", - "dependencies": { - "any-promise": "^1.0.0" - } - }, - "node_modules/thenify-all": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", - "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", - "dev": true, - "license": "MIT", - "dependencies": { - "thenify": ">= 3.1.0 < 4" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tinyglobby": { - "version": "0.2.15", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.15.tgz", - "integrity": "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "fdir": "^6.5.0", - "picomatch": "^4.0.3" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=12.0.0" - }, - "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } - } - }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", - "dev": true, - "license": "MIT", - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/ts-interface-checker": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", - "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", - "dev": true, - "license": "Apache-2.0" - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true, - "license": "MIT" - } - } -} diff --git a/node_modules/@alloc/quick-lru/index.d.ts b/node_modules/@alloc/quick-lru/index.d.ts deleted file mode 100644 index eb819ba..0000000 --- a/node_modules/@alloc/quick-lru/index.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -declare namespace QuickLRU { - interface Options { - /** - The maximum number of milliseconds an item should remain in the cache. - - @default Infinity - - By default, `maxAge` will be `Infinity`, which means that items will never expire. - Lazy expiration upon the next write or read call. - - Individual expiration of an item can be specified by the `set(key, value, maxAge)` method. - */ - readonly maxAge?: number; - - /** - The maximum number of items before evicting the least recently used items. - */ - readonly maxSize: number; - - /** - Called right before an item is evicted from the cache. - - Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`). - */ - onEviction?: (key: KeyType, value: ValueType) => void; - } -} - -declare class QuickLRU - implements Iterable<[KeyType, ValueType]> { - /** - The stored item count. - */ - readonly size: number; - - /** - Simple ["Least Recently Used" (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29). - - The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. - - @example - ``` - import QuickLRU = require('quick-lru'); - - const lru = new QuickLRU({maxSize: 1000}); - - lru.set('🦄', '🌈'); - - lru.has('🦄'); - //=> true - - lru.get('🦄'); - //=> '🌈' - ``` - */ - constructor(options: QuickLRU.Options); - - [Symbol.iterator](): IterableIterator<[KeyType, ValueType]>; - - /** - Set an item. Returns the instance. - - Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified in the constructor, otherwise the item will never expire. - - @returns The list instance. - */ - set(key: KeyType, value: ValueType, options?: {maxAge?: number}): this; - - /** - Get an item. - - @returns The stored item or `undefined`. - */ - get(key: KeyType): ValueType | undefined; - - /** - Check if an item exists. - */ - has(key: KeyType): boolean; - - /** - Get an item without marking it as recently used. - - @returns The stored item or `undefined`. - */ - peek(key: KeyType): ValueType | undefined; - - /** - Delete an item. - - @returns `true` if the item is removed or `false` if the item doesn't exist. - */ - delete(key: KeyType): boolean; - - /** - Delete all items. - */ - clear(): void; - - /** - Update the `maxSize` in-place, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee. - - Useful for on-the-fly tuning of cache sizes in live systems. - */ - resize(maxSize: number): void; - - /** - Iterable for all the keys. - */ - keys(): IterableIterator; - - /** - Iterable for all the values. - */ - values(): IterableIterator; - - /** - Iterable for all entries, starting with the oldest (ascending in recency). - */ - entriesAscending(): IterableIterator<[KeyType, ValueType]>; - - /** - Iterable for all entries, starting with the newest (descending in recency). - */ - entriesDescending(): IterableIterator<[KeyType, ValueType]>; -} - -export = QuickLRU; diff --git a/node_modules/@alloc/quick-lru/index.js b/node_modules/@alloc/quick-lru/index.js deleted file mode 100644 index 7eeced2..0000000 --- a/node_modules/@alloc/quick-lru/index.js +++ /dev/null @@ -1,263 +0,0 @@ -'use strict'; - -class QuickLRU { - constructor(options = {}) { - if (!(options.maxSize && options.maxSize > 0)) { - throw new TypeError('`maxSize` must be a number greater than 0'); - } - - if (typeof options.maxAge === 'number' && options.maxAge === 0) { - throw new TypeError('`maxAge` must be a number greater than 0'); - } - - this.maxSize = options.maxSize; - this.maxAge = options.maxAge || Infinity; - this.onEviction = options.onEviction; - this.cache = new Map(); - this.oldCache = new Map(); - this._size = 0; - } - - _emitEvictions(cache) { - if (typeof this.onEviction !== 'function') { - return; - } - - for (const [key, item] of cache) { - this.onEviction(key, item.value); - } - } - - _deleteIfExpired(key, item) { - if (typeof item.expiry === 'number' && item.expiry <= Date.now()) { - if (typeof this.onEviction === 'function') { - this.onEviction(key, item.value); - } - - return this.delete(key); - } - - return false; - } - - _getOrDeleteIfExpired(key, item) { - const deleted = this._deleteIfExpired(key, item); - if (deleted === false) { - return item.value; - } - } - - _getItemValue(key, item) { - return item.expiry ? this._getOrDeleteIfExpired(key, item) : item.value; - } - - _peek(key, cache) { - const item = cache.get(key); - - return this._getItemValue(key, item); - } - - _set(key, value) { - this.cache.set(key, value); - this._size++; - - if (this._size >= this.maxSize) { - this._size = 0; - this._emitEvictions(this.oldCache); - this.oldCache = this.cache; - this.cache = new Map(); - } - } - - _moveToRecent(key, item) { - this.oldCache.delete(key); - this._set(key, item); - } - - * _entriesAscending() { - for (const item of this.oldCache) { - const [key, value] = item; - if (!this.cache.has(key)) { - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield item; - } - } - } - - for (const item of this.cache) { - const [key, value] = item; - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield item; - } - } - } - - get(key) { - if (this.cache.has(key)) { - const item = this.cache.get(key); - - return this._getItemValue(key, item); - } - - if (this.oldCache.has(key)) { - const item = this.oldCache.get(key); - if (this._deleteIfExpired(key, item) === false) { - this._moveToRecent(key, item); - return item.value; - } - } - } - - set(key, value, {maxAge = this.maxAge === Infinity ? undefined : Date.now() + this.maxAge} = {}) { - if (this.cache.has(key)) { - this.cache.set(key, { - value, - maxAge - }); - } else { - this._set(key, {value, expiry: maxAge}); - } - } - - has(key) { - if (this.cache.has(key)) { - return !this._deleteIfExpired(key, this.cache.get(key)); - } - - if (this.oldCache.has(key)) { - return !this._deleteIfExpired(key, this.oldCache.get(key)); - } - - return false; - } - - peek(key) { - if (this.cache.has(key)) { - return this._peek(key, this.cache); - } - - if (this.oldCache.has(key)) { - return this._peek(key, this.oldCache); - } - } - - delete(key) { - const deleted = this.cache.delete(key); - if (deleted) { - this._size--; - } - - return this.oldCache.delete(key) || deleted; - } - - clear() { - this.cache.clear(); - this.oldCache.clear(); - this._size = 0; - } - - resize(newSize) { - if (!(newSize && newSize > 0)) { - throw new TypeError('`maxSize` must be a number greater than 0'); - } - - const items = [...this._entriesAscending()]; - const removeCount = items.length - newSize; - if (removeCount < 0) { - this.cache = new Map(items); - this.oldCache = new Map(); - this._size = items.length; - } else { - if (removeCount > 0) { - this._emitEvictions(items.slice(0, removeCount)); - } - - this.oldCache = new Map(items.slice(removeCount)); - this.cache = new Map(); - this._size = 0; - } - - this.maxSize = newSize; - } - - * keys() { - for (const [key] of this) { - yield key; - } - } - - * values() { - for (const [, value] of this) { - yield value; - } - } - - * [Symbol.iterator]() { - for (const item of this.cache) { - const [key, value] = item; - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield [key, value.value]; - } - } - - for (const item of this.oldCache) { - const [key, value] = item; - if (!this.cache.has(key)) { - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield [key, value.value]; - } - } - } - } - - * entriesDescending() { - let items = [...this.cache]; - for (let i = items.length - 1; i >= 0; --i) { - const item = items[i]; - const [key, value] = item; - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield [key, value.value]; - } - } - - items = [...this.oldCache]; - for (let i = items.length - 1; i >= 0; --i) { - const item = items[i]; - const [key, value] = item; - if (!this.cache.has(key)) { - const deleted = this._deleteIfExpired(key, value); - if (deleted === false) { - yield [key, value.value]; - } - } - } - } - - * entriesAscending() { - for (const [key, value] of this._entriesAscending()) { - yield [key, value.value]; - } - } - - get size() { - if (!this._size) { - return this.oldCache.size; - } - - let oldCacheSize = 0; - for (const key of this.oldCache.keys()) { - if (!this.cache.has(key)) { - oldCacheSize++; - } - } - - return Math.min(this._size + oldCacheSize, this.maxSize); - } -} - -module.exports = QuickLRU; diff --git a/node_modules/@alloc/quick-lru/license b/node_modules/@alloc/quick-lru/license deleted file mode 100644 index e7af2f7..0000000 --- a/node_modules/@alloc/quick-lru/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/@alloc/quick-lru/package.json b/node_modules/@alloc/quick-lru/package.json deleted file mode 100644 index 21f1072..0000000 --- a/node_modules/@alloc/quick-lru/package.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "@alloc/quick-lru", - "version": "5.2.0", - "description": "Simple “Least Recently Used” (LRU) cache", - "license": "MIT", - "repository": "sindresorhus/quick-lru", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "engines": { - "node": ">=10" - }, - "scripts": { - "test": "xo && nyc ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "lru", - "quick", - "cache", - "caching", - "least", - "recently", - "used", - "fast", - "map", - "hash", - "buffer" - ], - "devDependencies": { - "ava": "^2.0.0", - "coveralls": "^3.0.3", - "nyc": "^15.0.0", - "tsd": "^0.11.0", - "xo": "^0.26.0" - } -} diff --git a/node_modules/@alloc/quick-lru/readme.md b/node_modules/@alloc/quick-lru/readme.md deleted file mode 100644 index 7187ba5..0000000 --- a/node_modules/@alloc/quick-lru/readme.md +++ /dev/null @@ -1,139 +0,0 @@ -# quick-lru [![Build Status](https://travis-ci.org/sindresorhus/quick-lru.svg?branch=master)](https://travis-ci.org/sindresorhus/quick-lru) [![Coverage Status](https://coveralls.io/repos/github/sindresorhus/quick-lru/badge.svg?branch=master)](https://coveralls.io/github/sindresorhus/quick-lru?branch=master) - -> Simple [“Least Recently Used” (LRU) cache](https://en.m.wikipedia.org/wiki/Cache_replacement_policies#Least_Recently_Used_.28LRU.29) - -Useful when you need to cache something and limit memory usage. - -Inspired by the [`hashlru` algorithm](https://github.com/dominictarr/hashlru#algorithm), but instead uses [`Map`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map) to support keys of any type, not just strings, and values can be `undefined`. - -## Install - -``` -$ npm install quick-lru -``` - -## Usage - -```js -const QuickLRU = require('quick-lru'); - -const lru = new QuickLRU({maxSize: 1000}); - -lru.set('🦄', '🌈'); - -lru.has('🦄'); -//=> true - -lru.get('🦄'); -//=> '🌈' -``` - -## API - -### new QuickLRU(options?) - -Returns a new instance. - -### options - -Type: `object` - -#### maxSize - -*Required*\ -Type: `number` - -The maximum number of items before evicting the least recently used items. - -#### maxAge - -Type: `number`\ -Default: `Infinity` - -The maximum number of milliseconds an item should remain in cache. -By default maxAge will be Infinity, which means that items will never expire. - -Lazy expiration happens upon the next `write` or `read` call. - -Individual expiration of an item can be specified by the `set(key, value, options)` method. - -#### onEviction - -*Optional*\ -Type: `(key, value) => void` - -Called right before an item is evicted from the cache. - -Useful for side effects or for items like object URLs that need explicit cleanup (`revokeObjectURL`). - -### Instance - -The instance is [`iterable`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Iteration_protocols) so you can use it directly in a [`for…of`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/for...of) loop. - -Both `key` and `value` can be of any type. - -#### .set(key, value, options?) - -Set an item. Returns the instance. - -Individual expiration of an item can be specified with the `maxAge` option. If not specified, the global `maxAge` value will be used in case it is specified on the constructor, otherwise the item will never expire. - -#### .get(key) - -Get an item. - -#### .has(key) - -Check if an item exists. - -#### .peek(key) - -Get an item without marking it as recently used. - -#### .delete(key) - -Delete an item. - -Returns `true` if the item is removed or `false` if the item doesn't exist. - -#### .clear() - -Delete all items. - -#### .resize(maxSize) - -Update the `maxSize`, discarding items as necessary. Insertion order is mostly preserved, though this is not a strong guarantee. - -Useful for on-the-fly tuning of cache sizes in live systems. - -#### .keys() - -Iterable for all the keys. - -#### .values() - -Iterable for all the values. - -#### .entriesAscending() - -Iterable for all entries, starting with the oldest (ascending in recency). - -#### .entriesDescending() - -Iterable for all entries, starting with the newest (descending in recency). - -#### .size - -The stored item count. - ---- - -
- - 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/@jridgewell/gen-mapping/LICENSE b/node_modules/@jridgewell/gen-mapping/LICENSE deleted file mode 100644 index 1f6ce94..0000000 --- a/node_modules/@jridgewell/gen-mapping/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2024 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 93692b1..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/sourcemaps/tree/main/packages/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 bbb0cac..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs +++ /dev/null @@ -1,292 +0,0 @@ -// src/set-array.ts -var SetArray = class { - constructor() { - this._indexes = { __proto__: null }; - this.array = []; - } -}; -function cast(set) { - return set; -} -function get(setarr, key) { - return cast(setarr)._indexes[key]; -} -function put(setarr, key) { - const index = get(setarr, key); - if (index !== void 0) return index; - const { array, _indexes: indexes } = cast(setarr); - const length = array.push(key); - return indexes[key] = length - 1; -} -function remove(setarr, key) { - const index = get(setarr, key); - if (index === void 0) return; - const { array, _indexes: indexes } = cast(setarr); - for (let i = index + 1; i < array.length; i++) { - const k = array[i]; - array[i - 1] = k; - indexes[k]--; - } - indexes[key] = void 0; - array.pop(); -} - -// src/gen-mapping.ts -import { - encode -} from "@jridgewell/sourcemap-codec"; -import { TraceMap, decodedMappings } from "@jridgewell/trace-mapping"; - -// src/sourcemap-segment.ts -var COLUMN = 0; -var SOURCES_INDEX = 1; -var SOURCE_LINE = 2; -var SOURCE_COLUMN = 3; -var NAMES_INDEX = 4; - -// src/gen-mapping.ts -var NO_NAME = -1; -var GenMapping = class { - constructor({ file, sourceRoot } = {}) { - this._names = new SetArray(); - this._sources = new SetArray(); - this._sourcesContent = []; - this._mappings = []; - this.file = file; - this.sourceRoot = sourceRoot; - this._ignoreList = new SetArray(); - } -}; -function cast2(map) { - return map; -} -function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { - return addSegmentInternal( - false, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content - ); -} -function addMapping(map, mapping) { - return addMappingInternal(false, map, mapping); -} -var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - return addSegmentInternal( - true, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content - ); -}; -var maybeAddMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping); -}; -function setSourceContent(map, source, content) { - const { - _sources: sources, - _sourcesContent: sourcesContent - // _originalScopes: originalScopes, - } = cast2(map); - const index = put(sources, source); - sourcesContent[index] = content; -} -function setIgnore(map, source, ignore = true) { - const { - _sources: sources, - _sourcesContent: sourcesContent, - _ignoreList: ignoreList - // _originalScopes: originalScopes, - } = cast2(map); - const index = put(sources, source); - if (index === sourcesContent.length) sourcesContent[index] = null; - if (ignore) put(ignoreList, index); - else remove(ignoreList, index); -} -function toDecodedMap(map) { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names, - _ignoreList: ignoreList - // _originalScopes: originalScopes, - // _generatedRanges: generatedRanges, - } = cast2(map); - removeEmptyFinalLines(mappings); - return { - version: 3, - file: map.file || void 0, - names: names.array, - sourceRoot: map.sourceRoot || void 0, - sources: sources.array, - sourcesContent, - mappings, - // originalScopes, - // generatedRanges, - ignoreList: ignoreList.array - }; -} -function toEncodedMap(map) { - const decoded = toDecodedMap(map); - return Object.assign({}, decoded, { - // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), - // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), - mappings: encode(decoded.mappings) - }); -} -function fromMap(input) { - const map = new TraceMap(input); - const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); - putAll(cast2(gen)._names, map.names); - putAll(cast2(gen)._sources, map.sources); - cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); - cast2(gen)._mappings = decodedMappings(map); - if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList); - return gen; -} -function allMappings(map) { - const out = []; - const { _mappings: mappings, _sources: sources, _names: names } = cast2(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 = void 0; - let original = void 0; - let name = void 0; - 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; -} -function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names - // _originalScopes: originalScopes, - } = cast2(map); - const line = getIndex(mappings, genLine); - const index = getColumnIndex(line, genColumn); - if (!source) { - if (skipable && skipSourceless(line, index)) return; - return insert(line, index, [genColumn]); - } - assert(sourceLine); - assert(sourceColumn); - const sourcesIndex = put(sources, source); - const namesIndex = name ? put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? 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 assert(_val) { -} -function getIndex(arr, index) { - for (let i = arr.length; i <= index; i++) { - arr[i] = []; - } - return arr[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(setarr, array) { - for (let i = 0; i < array.length; i++) put(setarr, array[i]); -} -function skipSourceless(line, index) { - if (index === 0) return true; - const prev = line[index - 1]; - return prev.length === 1; -} -function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { - if (index === 0) return false; - const prev = line[index - 1]; - if (prev.length === 1) return false; - 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 - ); - } - assert(original); - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - source, - original.line - 1, - original.column, - name, - content - ); -} -export { - GenMapping, - addMapping, - addSegment, - allMappings, - fromMap, - maybeAddMapping, - maybeAddSegment, - setIgnore, - 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 4e37e45..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["../src/set-array.ts", "../src/gen-mapping.ts", "../src/sourcemap-segment.ts"], - "mappings": ";AAUO,IAAM,WAAN,MAAoC;AAAA,EAIzC,cAAc;AACZ,SAAK,WAAW,EAAE,WAAW,KAAK;AAClC,SAAK,QAAQ,CAAC;AAAA,EAChB;AACF;AAWA,SAAS,KAAoB,KAAgC;AAC3D,SAAO;AACT;AAKO,SAAS,IAAmB,QAAqB,KAA4B;AAClF,SAAO,KAAK,MAAM,EAAE,SAAS,GAAG;AAClC;AAMO,SAAS,IAAmB,QAAqB,KAAgB;AAEtE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW,QAAO;AAEhC,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAEhD,QAAM,SAAS,MAAM,KAAK,GAAG;AAC7B,SAAQ,QAAQ,GAAG,IAAI,SAAS;AAClC;AAgBO,SAAS,OAAsB,QAAqB,KAAc;AACvE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW;AAEzB,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAChD,WAAS,IAAI,QAAQ,GAAG,IAAI,MAAM,QAAQ,KAAK;AAC7C,UAAM,IAAI,MAAM,CAAC;AACjB,UAAM,IAAI,CAAC,IAAI;AACf,YAAQ,CAAC;AAAA,EACX;AACA,UAAQ,GAAG,IAAI;AACf,QAAM,IAAI;AACZ;;;AChFA;AAAA,EACE;AAAA,OAGK;AACP,SAAS,UAAU,uBAAuB;;;ACKnC,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;;;ADsB3B,IAAM,UAAU;AAKT,IAAM,aAAN,MAAiB;AAAA,EAWtB,YAAY,EAAE,MAAM,WAAW,IAAa,CAAC,GAAG;AAC9C,SAAK,SAAS,IAAI,SAAS;AAC3B,SAAK,WAAW,IAAI,SAAS;AAC7B,SAAK,kBAAkB,CAAC;AACxB,SAAK,YAAY,CAAC;AAGlB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,cAAc,IAAI,SAAS;AAAA,EAClC;AACF;AAgBA,SAASA,MAAK,KAAyB;AACrC,SAAO;AACT;AAoCO,SAAS,WACd,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAoCO,SAAS,WACd,KACA,SAOM;AACN,SAAO,mBAAmB,OAAO,KAAK,OAAmD;AAC3F;AAOO,IAAM,kBAAqC,CAChD,KACA,SACA,WACA,QACA,YACA,cACA,MACA,YACG;AACH,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAOO,IAAM,kBAAqC,CAAC,KAAK,YAAY;AAClE,SAAO,mBAAmB,MAAM,KAAK,OAAmD;AAC1F;AAKO,SAAS,iBAAiB,KAAiB,QAAgB,SAA8B;AAC9F,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA;AAAA,EAEnB,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,iBAAe,KAAK,IAAI;AAE1B;AAEO,SAAS,UAAU,KAAiB,QAAgB,SAAS,MAAM;AACxE,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,aAAa;AAAA;AAAA,EAEf,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,MAAI,UAAU,eAAe,OAAQ,gBAAe,KAAK,IAAI;AAE7D,MAAI,OAAQ,KAAI,YAAY,KAAK;AAAA,MAC5B,QAAO,YAAY,KAAK;AAC/B;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,aAAa;AAAA;AAAA;AAAA,EAGf,IAAIA,MAAK,GAAG;AACZ,wBAAsB,QAAQ;AAE9B,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM,IAAI,QAAQ;AAAA,IAClB,OAAO,MAAM;AAAA,IACb,YAAY,IAAI,cAAc;AAAA,IAC9B,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA;AAAA;AAAA,IAGA,YAAY,WAAW;AAAA,EACzB;AACF;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM,UAAU,aAAa,GAAG;AAChC,SAAO,OAAO,OAAO,CAAC,GAAG,SAAS;AAAA;AAAA;AAAA,IAGhC,UAAU,OAAO,QAAQ,QAAgC;AAAA,EAC3D,CAAC;AACH;AAKO,SAAS,QAAQ,OAAmC;AACzD,QAAM,MAAM,IAAI,SAAS,KAAK;AAC9B,QAAM,MAAM,IAAI,WAAW,EAAE,MAAM,IAAI,MAAM,YAAY,IAAI,WAAW,CAAC;AAEzE,SAAOA,MAAK,GAAG,EAAE,QAAQ,IAAI,KAAK;AAClC,SAAOA,MAAK,GAAG,EAAE,UAAU,IAAI,OAAmB;AAClD,EAAAA,MAAK,GAAG,EAAE,kBAAkB,IAAI,kBAAkB,IAAI,QAAQ,IAAI,MAAM,IAAI;AAC5E,EAAAA,MAAK,GAAG,EAAE,YAAY,gBAAgB,GAAG;AAEzC,MAAI,IAAI,WAAY,QAAOA,MAAK,GAAG,EAAE,aAAa,IAAI,UAAU;AAEhE,SAAO;AACT;AAMO,SAAS,YAAY,KAA4B;AACtD,QAAM,MAAiB,CAAC;AACxB,QAAM,EAAE,WAAW,UAAU,UAAU,SAAS,QAAQ,MAAM,IAAIA,MAAK,GAAG;AAE1E,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,OAAO,SAAS,CAAC;AACvB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,YAAY,EAAE,MAAM,IAAI,GAAG,QAAQ,IAAI,MAAM,EAAE;AACrD,UAAI,SAA6B;AACjC,UAAI,WAA4B;AAChC,UAAI,OAA2B;AAE/B,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,QAAQ,MAAM,IAAI,aAAa,CAAC;AACzC,mBAAW,EAAE,MAAM,IAAI,WAAW,IAAI,GAAG,QAAQ,IAAI,aAAa,EAAE;AAEpE,YAAI,IAAI,WAAW,EAAG,QAAO,MAAM,MAAM,IAAI,WAAW,CAAC;AAAA,MAC3D;AAEA,UAAI,KAAK,EAAE,WAAW,QAAQ,UAAU,KAAK,CAAY;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO;AACT;AAGA,SAAS,mBACP,UACA,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA;AAAA,EAEV,IAAIA,MAAK,GAAG;AACZ,QAAM,OAAO,SAAS,UAAU,OAAO;AACvC,QAAM,QAAQ,eAAe,MAAM,SAAS;AAE5C,MAAI,CAAC,QAAQ;AACX,QAAI,YAAY,eAAe,MAAM,KAAK,EAAG;AAC7C,WAAO,OAAO,MAAM,OAAO,CAAC,SAAS,CAAC;AAAA,EACxC;AAIA,SAAe,UAAU;AACzB,SAAe,YAAY;AAE3B,QAAM,eAAe,IAAI,SAAS,MAAM;AACxC,QAAM,aAAa,OAAO,IAAI,OAAO,IAAI,IAAI;AAC7C,MAAI,iBAAiB,eAAe,OAAQ,gBAAe,YAAY,IAAI,4BAAW;AAGtF,MAAI,YAAY,WAAW,MAAM,OAAO,cAAc,YAAY,cAAc,UAAU,GAAG;AAC3F;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OACI,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU,IAC9D,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,EACxD;AACF;AAEA,SAAS,OAAU,MAAkC;AAErD;AAEA,SAAS,SAAY,KAAY,OAAoB;AACnD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,KAAK;AACxC,QAAI,CAAC,IAAI,CAAC;AAAA,EACZ;AACA,SAAO,IAAI,KAAK;AAClB;AAEA,SAAS,eAAe,MAA0B,WAA2B;AAC3E,MAAI,QAAQ,KAAK;AACjB,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,UAAM,UAAU,KAAK,CAAC;AACtB,QAAI,aAAa,QAAQ,MAAM,EAAG;AAAA,EACpC;AACA,SAAO;AACT;AAEA,SAAS,OAAU,OAAY,OAAe,OAAU;AACtD,WAAS,IAAI,MAAM,QAAQ,IAAI,OAAO,KAAK;AACzC,UAAM,CAAC,IAAI,MAAM,IAAI,CAAC;AAAA,EACxB;AACA,QAAM,KAAK,IAAI;AACjB;AAEA,SAAS,sBAAsB,UAAgC;AAC7D,QAAM,EAAE,OAAO,IAAI;AACnB,MAAI,MAAM;AACV,WAAS,IAAI,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK;AAC1C,QAAI,SAAS,CAAC,EAAE,SAAS,EAAG;AAAA,EAC9B;AACA,MAAI,MAAM,OAAQ,UAAS,SAAS;AACtC;AAEA,SAAS,OAAkC,QAAqB,OAAY;AAC1E,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,QAAQ,MAAM,CAAC,CAAC;AAC7D;AAEA,SAAS,eAAe,MAA0B,OAAwB;AAGxE,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAI3B,SAAO,KAAK,WAAW;AACzB;AAEA,SAAS,WACP,MACA,OACA,cACA,YACA,cACA,YACS;AAET,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAG3B,MAAI,KAAK,WAAW,EAAG,QAAO;AAI9B,SACE,iBAAiB,KAAK,aAAa,KACnC,eAAe,KAAK,WAAW,KAC/B,iBAAiB,KAAK,aAAa,KACnC,gBAAgB,KAAK,WAAW,IAAI,KAAK,WAAW,IAAI;AAE5D;AAEA,SAAS,mBACP,UACA,KACA,SAOA;AACA,QAAM,EAAE,WAAW,QAAQ,UAAU,MAAM,QAAQ,IAAI;AACvD,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU,OAAO;AAAA,MACjB,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAY,QAAQ;AACpB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU,OAAO;AAAA,IACjB,UAAU;AAAA,IACV;AAAA,IACA,SAAS,OAAO;AAAA,IAChB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;", - "names": ["cast"] -} 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 cb84af5..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js +++ /dev/null @@ -1,358 +0,0 @@ -(function (global, factory) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - factory(module, require('@jridgewell/sourcemap-codec'), require('@jridgewell/trace-mapping')); - module.exports = def(module); - } else if (typeof define === 'function' && define.amd) { - define(['module', '@jridgewell/sourcemap-codec', '@jridgewell/trace-mapping'], function(mod) { - factory.apply(this, arguments); - mod.exports = def(mod); - }); - } else { - const mod = { exports: {} }; - factory(mod, global.sourcemapCodec, global.traceMapping); - global = typeof globalThis !== 'undefined' ? globalThis : global || self; - global.genMapping = def(mod); - } - function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } -})(this, (function (module, require_sourcemapCodec, require_traceMapping) { -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// umd:@jridgewell/sourcemap-codec -var require_sourcemap_codec = __commonJS({ - "umd:@jridgewell/sourcemap-codec"(exports, module2) { - module2.exports = require_sourcemapCodec; - } -}); - -// umd:@jridgewell/trace-mapping -var require_trace_mapping = __commonJS({ - "umd:@jridgewell/trace-mapping"(exports, module2) { - module2.exports = require_traceMapping; - } -}); - -// src/gen-mapping.ts -var gen_mapping_exports = {}; -__export(gen_mapping_exports, { - GenMapping: () => GenMapping, - addMapping: () => addMapping, - addSegment: () => addSegment, - allMappings: () => allMappings, - fromMap: () => fromMap, - maybeAddMapping: () => maybeAddMapping, - maybeAddSegment: () => maybeAddSegment, - setIgnore: () => setIgnore, - setSourceContent: () => setSourceContent, - toDecodedMap: () => toDecodedMap, - toEncodedMap: () => toEncodedMap -}); -module.exports = __toCommonJS(gen_mapping_exports); - -// src/set-array.ts -var SetArray = class { - constructor() { - this._indexes = { __proto__: null }; - this.array = []; - } -}; -function cast(set) { - return set; -} -function get(setarr, key) { - return cast(setarr)._indexes[key]; -} -function put(setarr, key) { - const index = get(setarr, key); - if (index !== void 0) return index; - const { array, _indexes: indexes } = cast(setarr); - const length = array.push(key); - return indexes[key] = length - 1; -} -function remove(setarr, key) { - const index = get(setarr, key); - if (index === void 0) return; - const { array, _indexes: indexes } = cast(setarr); - for (let i = index + 1; i < array.length; i++) { - const k = array[i]; - array[i - 1] = k; - indexes[k]--; - } - indexes[key] = void 0; - array.pop(); -} - -// src/gen-mapping.ts -var import_sourcemap_codec = __toESM(require_sourcemap_codec()); -var import_trace_mapping = __toESM(require_trace_mapping()); - -// src/sourcemap-segment.ts -var COLUMN = 0; -var SOURCES_INDEX = 1; -var SOURCE_LINE = 2; -var SOURCE_COLUMN = 3; -var NAMES_INDEX = 4; - -// src/gen-mapping.ts -var NO_NAME = -1; -var GenMapping = class { - constructor({ file, sourceRoot } = {}) { - this._names = new SetArray(); - this._sources = new SetArray(); - this._sourcesContent = []; - this._mappings = []; - this.file = file; - this.sourceRoot = sourceRoot; - this._ignoreList = new SetArray(); - } -}; -function cast2(map) { - return map; -} -function addSegment(map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { - return addSegmentInternal( - false, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content - ); -} -function addMapping(map, mapping) { - return addMappingInternal(false, map, mapping); -} -var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => { - return addSegmentInternal( - true, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content - ); -}; -var maybeAddMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping); -}; -function setSourceContent(map, source, content) { - const { - _sources: sources, - _sourcesContent: sourcesContent - // _originalScopes: originalScopes, - } = cast2(map); - const index = put(sources, source); - sourcesContent[index] = content; -} -function setIgnore(map, source, ignore = true) { - const { - _sources: sources, - _sourcesContent: sourcesContent, - _ignoreList: ignoreList - // _originalScopes: originalScopes, - } = cast2(map); - const index = put(sources, source); - if (index === sourcesContent.length) sourcesContent[index] = null; - if (ignore) put(ignoreList, index); - else remove(ignoreList, index); -} -function toDecodedMap(map) { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names, - _ignoreList: ignoreList - // _originalScopes: originalScopes, - // _generatedRanges: generatedRanges, - } = cast2(map); - removeEmptyFinalLines(mappings); - return { - version: 3, - file: map.file || void 0, - names: names.array, - sourceRoot: map.sourceRoot || void 0, - sources: sources.array, - sourcesContent, - mappings, - // originalScopes, - // generatedRanges, - ignoreList: ignoreList.array - }; -} -function toEncodedMap(map) { - const decoded = toDecodedMap(map); - return Object.assign({}, decoded, { - // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), - // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), - mappings: (0, import_sourcemap_codec.encode)(decoded.mappings) - }); -} -function fromMap(input) { - const map = new import_trace_mapping.TraceMap(input); - const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); - putAll(cast2(gen)._names, map.names); - putAll(cast2(gen)._sources, map.sources); - cast2(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); - cast2(gen)._mappings = (0, import_trace_mapping.decodedMappings)(map); - if (map.ignoreList) putAll(cast2(gen)._ignoreList, map.ignoreList); - return gen; -} -function allMappings(map) { - const out = []; - const { _mappings: mappings, _sources: sources, _names: names } = cast2(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 = void 0; - let original = void 0; - let name = void 0; - 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; -} -function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names - // _originalScopes: originalScopes, - } = cast2(map); - const line = getIndex(mappings, genLine); - const index = getColumnIndex(line, genColumn); - if (!source) { - if (skipable && skipSourceless(line, index)) return; - return insert(line, index, [genColumn]); - } - assert(sourceLine); - assert(sourceColumn); - const sourcesIndex = put(sources, source); - const namesIndex = name ? put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? 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 assert(_val) { -} -function getIndex(arr, index) { - for (let i = arr.length; i <= index; i++) { - arr[i] = []; - } - return arr[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(setarr, array) { - for (let i = 0; i < array.length; i++) put(setarr, array[i]); -} -function skipSourceless(line, index) { - if (index === 0) return true; - const prev = line[index - 1]; - return prev.length === 1; -} -function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) { - if (index === 0) return false; - const prev = line[index - 1]; - if (prev.length === 1) return false; - 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 - ); - } - assert(original); - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - source, - original.line - 1, - original.column, - name, - content - ); -} -})); -//# 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 b13750b..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["umd:@jridgewell/sourcemap-codec", "umd:@jridgewell/trace-mapping", "../src/gen-mapping.ts", "../src/set-array.ts", "../src/sourcemap-segment.ts"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,2CAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACUO,IAAM,WAAN,MAAoC;AAAA,EAIzC,cAAc;AACZ,SAAK,WAAW,EAAE,WAAW,KAAK;AAClC,SAAK,QAAQ,CAAC;AAAA,EAChB;AACF;AAWA,SAAS,KAAoB,KAAgC;AAC3D,SAAO;AACT;AAKO,SAAS,IAAmB,QAAqB,KAA4B;AAClF,SAAO,KAAK,MAAM,EAAE,SAAS,GAAG;AAClC;AAMO,SAAS,IAAmB,QAAqB,KAAgB;AAEtE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW,QAAO;AAEhC,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAEhD,QAAM,SAAS,MAAM,KAAK,GAAG;AAC7B,SAAQ,QAAQ,GAAG,IAAI,SAAS;AAClC;AAgBO,SAAS,OAAsB,QAAqB,KAAc;AACvE,QAAM,QAAQ,IAAI,QAAQ,GAAG;AAC7B,MAAI,UAAU,OAAW;AAEzB,QAAM,EAAE,OAAO,UAAU,QAAQ,IAAI,KAAK,MAAM;AAChD,WAAS,IAAI,QAAQ,GAAG,IAAI,MAAM,QAAQ,KAAK;AAC7C,UAAM,IAAI,MAAM,CAAC;AACjB,UAAM,IAAI,CAAC,IAAI;AACf,YAAQ,CAAC;AAAA,EACX;AACA,UAAQ,GAAG,IAAI;AACf,QAAM,IAAI;AACZ;;;ADhFA,6BAIO;AACP,2BAA0C;;;AEKnC,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;;;AFsB3B,IAAM,UAAU;AAKT,IAAM,aAAN,MAAiB;AAAA,EAWtB,YAAY,EAAE,MAAM,WAAW,IAAa,CAAC,GAAG;AAC9C,SAAK,SAAS,IAAI,SAAS;AAC3B,SAAK,WAAW,IAAI,SAAS;AAC7B,SAAK,kBAAkB,CAAC;AACxB,SAAK,YAAY,CAAC;AAGlB,SAAK,OAAO;AACZ,SAAK,aAAa;AAClB,SAAK,cAAc,IAAI,SAAS;AAAA,EAClC;AACF;AAgBA,SAASC,MAAK,KAAyB;AACrC,SAAO;AACT;AAoCO,SAAS,WACd,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAoCO,SAAS,WACd,KACA,SAOM;AACN,SAAO,mBAAmB,OAAO,KAAK,OAAmD;AAC3F;AAOO,IAAM,kBAAqC,CAChD,KACA,SACA,WACA,QACA,YACA,cACA,MACA,YACG;AACH,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAOO,IAAM,kBAAqC,CAAC,KAAK,YAAY;AAClE,SAAO,mBAAmB,MAAM,KAAK,OAAmD;AAC1F;AAKO,SAAS,iBAAiB,KAAiB,QAAgB,SAA8B;AAC9F,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA;AAAA,EAEnB,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,iBAAe,KAAK,IAAI;AAE1B;AAEO,SAAS,UAAU,KAAiB,QAAgB,SAAS,MAAM;AACxE,QAAM;AAAA,IACJ,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,aAAa;AAAA;AAAA,EAEf,IAAIA,MAAK,GAAG;AACZ,QAAM,QAAQ,IAAI,SAAS,MAAM;AACjC,MAAI,UAAU,eAAe,OAAQ,gBAAe,KAAK,IAAI;AAE7D,MAAI,OAAQ,KAAI,YAAY,KAAK;AAAA,MAC5B,QAAO,YAAY,KAAK;AAC/B;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,aAAa;AAAA;AAAA;AAAA,EAGf,IAAIA,MAAK,GAAG;AACZ,wBAAsB,QAAQ;AAE9B,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM,IAAI,QAAQ;AAAA,IAClB,OAAO,MAAM;AAAA,IACb,YAAY,IAAI,cAAc;AAAA,IAC9B,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA;AAAA;AAAA;AAAA,IAGA,YAAY,WAAW;AAAA,EACzB;AACF;AAMO,SAAS,aAAa,KAAmC;AAC9D,QAAM,UAAU,aAAa,GAAG;AAChC,SAAO,OAAO,OAAO,CAAC,GAAG,SAAS;AAAA;AAAA;AAAA,IAGhC,cAAU,+BAAO,QAAQ,QAAgC;AAAA,EAC3D,CAAC;AACH;AAKO,SAAS,QAAQ,OAAmC;AACzD,QAAM,MAAM,IAAI,8BAAS,KAAK;AAC9B,QAAM,MAAM,IAAI,WAAW,EAAE,MAAM,IAAI,MAAM,YAAY,IAAI,WAAW,CAAC;AAEzE,SAAOA,MAAK,GAAG,EAAE,QAAQ,IAAI,KAAK;AAClC,SAAOA,MAAK,GAAG,EAAE,UAAU,IAAI,OAAmB;AAClD,EAAAA,MAAK,GAAG,EAAE,kBAAkB,IAAI,kBAAkB,IAAI,QAAQ,IAAI,MAAM,IAAI;AAC5E,EAAAA,MAAK,GAAG,EAAE,gBAAY,sCAAgB,GAAG;AAEzC,MAAI,IAAI,WAAY,QAAOA,MAAK,GAAG,EAAE,aAAa,IAAI,UAAU;AAEhE,SAAO;AACT;AAMO,SAAS,YAAY,KAA4B;AACtD,QAAM,MAAiB,CAAC;AACxB,QAAM,EAAE,WAAW,UAAU,UAAU,SAAS,QAAQ,MAAM,IAAIA,MAAK,GAAG;AAE1E,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,OAAO,SAAS,CAAC;AACvB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,YAAY,EAAE,MAAM,IAAI,GAAG,QAAQ,IAAI,MAAM,EAAE;AACrD,UAAI,SAA6B;AACjC,UAAI,WAA4B;AAChC,UAAI,OAA2B;AAE/B,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,QAAQ,MAAM,IAAI,aAAa,CAAC;AACzC,mBAAW,EAAE,MAAM,IAAI,WAAW,IAAI,GAAG,QAAQ,IAAI,aAAa,EAAE;AAEpE,YAAI,IAAI,WAAW,EAAG,QAAO,MAAM,MAAM,IAAI,WAAW,CAAC;AAAA,MAC3D;AAEA,UAAI,KAAK,EAAE,WAAW,QAAQ,UAAU,KAAK,CAAY;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO;AACT;AAGA,SAAS,mBACP,UACA,KACA,SACA,WACA,QACA,YACA,cACA,MACA,SACM;AACN,QAAM;AAAA,IACJ,WAAW;AAAA,IACX,UAAU;AAAA,IACV,iBAAiB;AAAA,IACjB,QAAQ;AAAA;AAAA,EAEV,IAAIA,MAAK,GAAG;AACZ,QAAM,OAAO,SAAS,UAAU,OAAO;AACvC,QAAM,QAAQ,eAAe,MAAM,SAAS;AAE5C,MAAI,CAAC,QAAQ;AACX,QAAI,YAAY,eAAe,MAAM,KAAK,EAAG;AAC7C,WAAO,OAAO,MAAM,OAAO,CAAC,SAAS,CAAC;AAAA,EACxC;AAIA,SAAe,UAAU;AACzB,SAAe,YAAY;AAE3B,QAAM,eAAe,IAAI,SAAS,MAAM;AACxC,QAAM,aAAa,OAAO,IAAI,OAAO,IAAI,IAAI;AAC7C,MAAI,iBAAiB,eAAe,OAAQ,gBAAe,YAAY,IAAI,4BAAW;AAGtF,MAAI,YAAY,WAAW,MAAM,OAAO,cAAc,YAAY,cAAc,UAAU,GAAG;AAC3F;AAAA,EACF;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OACI,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU,IAC9D,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,EACxD;AACF;AAEA,SAAS,OAAU,MAAkC;AAErD;AAEA,SAAS,SAAY,KAAY,OAAoB;AACnD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,KAAK;AACxC,QAAI,CAAC,IAAI,CAAC;AAAA,EACZ;AACA,SAAO,IAAI,KAAK;AAClB;AAEA,SAAS,eAAe,MAA0B,WAA2B;AAC3E,MAAI,QAAQ,KAAK;AACjB,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,UAAM,UAAU,KAAK,CAAC;AACtB,QAAI,aAAa,QAAQ,MAAM,EAAG;AAAA,EACpC;AACA,SAAO;AACT;AAEA,SAAS,OAAU,OAAY,OAAe,OAAU;AACtD,WAAS,IAAI,MAAM,QAAQ,IAAI,OAAO,KAAK;AACzC,UAAM,CAAC,IAAI,MAAM,IAAI,CAAC;AAAA,EACxB;AACA,QAAM,KAAK,IAAI;AACjB;AAEA,SAAS,sBAAsB,UAAgC;AAC7D,QAAM,EAAE,OAAO,IAAI;AACnB,MAAI,MAAM;AACV,WAAS,IAAI,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK;AAC1C,QAAI,SAAS,CAAC,EAAE,SAAS,EAAG;AAAA,EAC9B;AACA,MAAI,MAAM,OAAQ,UAAS,SAAS;AACtC;AAEA,SAAS,OAAkC,QAAqB,OAAY;AAC1E,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,QAAQ,MAAM,CAAC,CAAC;AAC7D;AAEA,SAAS,eAAe,MAA0B,OAAwB;AAGxE,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAI3B,SAAO,KAAK,WAAW;AACzB;AAEA,SAAS,WACP,MACA,OACA,cACA,YACA,cACA,YACS;AAET,MAAI,UAAU,EAAG,QAAO;AAExB,QAAM,OAAO,KAAK,QAAQ,CAAC;AAG3B,MAAI,KAAK,WAAW,EAAG,QAAO;AAI9B,SACE,iBAAiB,KAAK,aAAa,KACnC,eAAe,KAAK,WAAW,KAC/B,iBAAiB,KAAK,aAAa,KACnC,gBAAgB,KAAK,WAAW,IAAI,KAAK,WAAW,IAAI;AAE5D;AAEA,SAAS,mBACP,UACA,KACA,SAOA;AACA,QAAM,EAAE,WAAW,QAAQ,UAAU,MAAM,QAAQ,IAAI;AACvD,MAAI,CAAC,QAAQ;AACX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA,UAAU,OAAO;AAAA,MACjB,UAAU;AAAA,MACV;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACA,SAAY,QAAQ;AACpB,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,UAAU,OAAO;AAAA,IACjB,UAAU;AAAA,IACV;AAAA,IACA,SAAS,OAAO;AAAA,IAChB,SAAS;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;", - "names": ["module", "module", "cast"] -} 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 9ba936e..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types'; -export type { DecodedSourceMap, EncodedSourceMap, Mapping }; -export type Options = { - file?: string | null; - sourceRoot?: string | null; -}; -/** - * Provides the state to generate a sourcemap. - */ -export declare class GenMapping { - private _names; - private _sources; - private _sourcesContent; - private _mappings; - private _ignoreList; - file: string | null | undefined; - sourceRoot: string | null | undefined; - constructor({ file, sourceRoot }?: Options); -} -/** - * 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 function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; -export declare function addSegment(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 function addMapping(map: GenMapping, mapping: { - generated: Pos; - source?: null; - original?: null; - name?: null; - content?: null; -}): void; -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name?: null; - content?: string | null; -}): void; -export declare function addMapping(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 const 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 const maybeAddMapping: typeof addMapping; -/** - * Adds/removes the content of the source file to the source map. - */ -export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; -export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function 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 function toEncodedMap(map: GenMapping): EncodedSourceMap; -/** - * Constructs a new GenMapping, using the already present mappings of the input. - */ -export declare function 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 function allMappings(map: GenMapping): Mapping[]; diff --git a/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts b/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts deleted file mode 100644 index 6ed4354..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -type Key = string | number | symbol; -/** - * 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 T[]; - constructor(); -} -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -export declare function get(setarr: SetArray, key: T): 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 function put(setarr: SetArray, key: T): number; -/** - * Pops the last added item out of the SetArray. - */ -export declare function pop(setarr: SetArray): void; -/** - * Removes the key, if it exists in the set. - */ -export declare function remove(setarr: SetArray, key: T): void; -export {}; 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 aa19fb5..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; -export 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 8eb90fb..0000000 --- a/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts +++ /dev/null @@ -1,43 +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; - ignoreList?: readonly number[]; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: readonly SourceMapSegment[][]; -} -export interface Pos { - line: number; - column: number; -} -export interface OriginalPos extends Pos { - source: string; -} -export interface BindingExpressionRange { - start: Pos; - expression: string; -} -export 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 036f9b7..0000000 --- a/node_modules/@jridgewell/gen-mapping/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@jridgewell/gen-mapping", - "version": "0.3.13", - "description": "Generate source maps", - "keywords": [ - "source", - "map" - ], - "main": "dist/gen-mapping.umd.js", - "module": "dist/gen-mapping.mjs", - "types": "types/gen-mapping.d.cts", - "files": [ - "dist", - "src", - "types" - ], - "exports": { - ".": [ - { - "import": { - "types": "./types/gen-mapping.d.mts", - "default": "./dist/gen-mapping.mjs" - }, - "default": { - "types": "./types/gen-mapping.d.cts", - "default": "./dist/gen-mapping.umd.js" - } - }, - "./dist/gen-mapping.umd.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "benchmark": "run-s build:code benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node --expose-gc benchmark/index.js", - "build": "run-s -n build:code build:types", - "build:code": "node ../../esbuild.mjs gen-mapping.ts", - "build:types": "run-s build:types:force build:types:emit build:types:mts", - "build:types:force": "rimraf tsconfig.build.tsbuildinfo", - "build:types:emit": "tsc --project tsconfig.build.json", - "build:types:mts": "node ../../mts-types.mjs", - "clean": "run-s -n clean:code clean:types", - "clean:code": "tsc --build --clean tsconfig.build.json", - "clean:types": "rimraf dist types", - "test": "run-s -n test:types test:only test:format", - "test:format": "prettier --check '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:types": "eslint '{src,test}/**/*.ts'", - "lint": "run-s -n lint:types lint:format", - "lint:format": "npm run test:format -- --write", - "lint:types": "npm run test:types -- --fix", - "prepublishOnly": "npm run-s -n build test" - }, - "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/gen-mapping", - "repository": { - "type": "git", - "url": "git+https://github.com/jridgewell/sourcemaps.git", - "directory": "packages/gen-mapping" - }, - "author": "Justin Ridgewell ", - "license": "MIT", - "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" - } -} diff --git a/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts b/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts deleted file mode 100644 index ecc878c..0000000 --- a/node_modules/@jridgewell/gen-mapping/src/gen-mapping.ts +++ /dev/null @@ -1,614 +0,0 @@ -import { SetArray, put, remove } from './set-array'; -import { - encode, - // encodeGeneratedRanges, - // encodeOriginalScopes -} from '@jridgewell/sourcemap-codec'; -import { TraceMap, decodedMappings } from '@jridgewell/trace-mapping'; - -import { - COLUMN, - SOURCES_INDEX, - SOURCE_LINE, - SOURCE_COLUMN, - NAMES_INDEX, -} from './sourcemap-segment'; - -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -// import type { OriginalScope, GeneratedRange } from '@jridgewell/sourcemap-codec'; -import type { SourceMapSegment } from './sourcemap-segment'; -import type { - DecodedSourceMap, - EncodedSourceMap, - Pos, - Mapping, - // BindingExpressionRange, - // OriginalPos, - // OriginalScopeInfo, - // GeneratedRangeInfo, -} from './types'; - -export type { DecodedSourceMap, EncodedSourceMap, Mapping }; - -export type Options = { - file?: string | null; - sourceRoot?: string | null; -}; - -const NO_NAME = -1; - -/** - * Provides the state to generate a sourcemap. - */ -export class GenMapping { - declare private _names: SetArray; - declare private _sources: SetArray; - declare private _sourcesContent: (string | null)[]; - declare private _mappings: SourceMapSegment[][]; - // private declare _originalScopes: OriginalScope[][]; - // private declare _generatedRanges: GeneratedRange[]; - declare private _ignoreList: SetArray; - declare file: string | null | undefined; - declare sourceRoot: string | null | undefined; - - constructor({ file, sourceRoot }: Options = {}) { - this._names = new SetArray(); - this._sources = new SetArray(); - this._sourcesContent = []; - this._mappings = []; - // this._originalScopes = []; - // this._generatedRanges = []; - this.file = file; - this.sourceRoot = sourceRoot; - this._ignoreList = new SetArray(); - } -} - -interface PublicMap { - _names: GenMapping['_names']; - _sources: GenMapping['_sources']; - _sourcesContent: GenMapping['_sourcesContent']; - _mappings: GenMapping['_mappings']; - // _originalScopes: GenMapping['_originalScopes']; - // _generatedRanges: GenMapping['_generatedRanges']; - _ignoreList: GenMapping['_ignoreList']; -} - -/** - * Typescript doesn't allow friend access to private fields, so this just casts the map into a type - * with public access modifiers. - */ -function cast(map: unknown): PublicMap { - return map as any; -} - -/** - * A low-level API to associate a generated position with an original source position. Line and - * column here are 0-based, unlike `addMapping`. - */ -export function addSegment( - map: GenMapping, - genLine: number, - genColumn: number, - source?: null, - sourceLine?: null, - sourceColumn?: null, - name?: null, - content?: null, -): void; -export function addSegment( - map: GenMapping, - genLine: number, - genColumn: number, - source: string, - sourceLine: number, - sourceColumn: number, - name?: null, - content?: string | null, -): void; -export function addSegment( - map: GenMapping, - genLine: number, - genColumn: number, - source: string, - sourceLine: number, - sourceColumn: number, - name: string, - content?: string | null, -): void; -export function addSegment( - map: GenMapping, - genLine: number, - genColumn: number, - source?: string | null, - sourceLine?: number | null, - sourceColumn?: number | null, - name?: string | null, - content?: string | null, -): void { - return addSegmentInternal( - false, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content, - ); -} - -/** - * 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 function addMapping( - map: GenMapping, - mapping: { - generated: Pos; - source?: null; - original?: null; - name?: null; - content?: null; - }, -): void; -export function addMapping( - map: GenMapping, - mapping: { - generated: Pos; - source: string; - original: Pos; - name?: null; - content?: string | null; - }, -): void; -export function addMapping( - map: GenMapping, - mapping: { - generated: Pos; - source: string; - original: Pos; - name: string; - content?: string | null; - }, -): void; -export function addMapping( - map: GenMapping, - mapping: { - generated: Pos; - source?: string | null; - original?: Pos | null; - name?: string | null; - content?: string | null; - }, -): void { - return addMappingInternal(false, map, mapping as Parameters[2]); -} - -/** - * 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 const maybeAddSegment: typeof addSegment = ( - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content, -) => { - return addSegmentInternal( - true, - map, - genLine, - genColumn, - source, - sourceLine, - sourceColumn, - name, - content, - ); -}; - -/** - * 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 const maybeAddMapping: typeof addMapping = (map, mapping) => { - return addMappingInternal(true, map, mapping as Parameters[2]); -}; - -/** - * Adds/removes the content of the source file to the source map. - */ -export function setSourceContent(map: GenMapping, source: string, content: string | null): void { - const { - _sources: sources, - _sourcesContent: sourcesContent, - // _originalScopes: originalScopes, - } = cast(map); - const index = put(sources, source); - sourcesContent[index] = content; - // if (index === originalScopes.length) originalScopes[index] = []; -} - -export function setIgnore(map: GenMapping, source: string, ignore = true) { - const { - _sources: sources, - _sourcesContent: sourcesContent, - _ignoreList: ignoreList, - // _originalScopes: originalScopes, - } = cast(map); - const index = put(sources, source); - if (index === sourcesContent.length) sourcesContent[index] = null; - // if (index === originalScopes.length) originalScopes[index] = []; - if (ignore) put(ignoreList, index); - else remove(ignoreList, index); -} - -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export function toDecodedMap(map: GenMapping): DecodedSourceMap { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names, - _ignoreList: ignoreList, - // _originalScopes: originalScopes, - // _generatedRanges: generatedRanges, - } = cast(map); - removeEmptyFinalLines(mappings); - - return { - version: 3, - file: map.file || undefined, - names: names.array, - sourceRoot: map.sourceRoot || undefined, - sources: sources.array, - sourcesContent, - mappings, - // originalScopes, - // generatedRanges, - ignoreList: ignoreList.array, - }; -} - -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export function toEncodedMap(map: GenMapping): EncodedSourceMap { - const decoded = toDecodedMap(map); - return Object.assign({}, decoded, { - // originalScopes: decoded.originalScopes.map((os) => encodeOriginalScopes(os)), - // generatedRanges: encodeGeneratedRanges(decoded.generatedRanges as GeneratedRange[]), - mappings: encode(decoded.mappings as SourceMapSegment[][]), - }); -} - -/** - * Constructs a new GenMapping, using the already present mappings of the input. - */ -export function fromMap(input: SourceMapInput): GenMapping { - const map = new TraceMap(input); - const gen = new GenMapping({ file: map.file, sourceRoot: map.sourceRoot }); - - putAll(cast(gen)._names, map.names); - putAll(cast(gen)._sources, map.sources as string[]); - cast(gen)._sourcesContent = map.sourcesContent || map.sources.map(() => null); - cast(gen)._mappings = decodedMappings(map) as GenMapping['_mappings']; - // TODO: implement originalScopes/generatedRanges - if (map.ignoreList) putAll(cast(gen)._ignoreList, map.ignoreList); - - return gen; -} - -/** - * Returns an array of high-level mapping objects for every recorded segment, which could then be - * passed to the `source-map` library. - */ -export function allMappings(map: GenMapping): Mapping[] { - const out: Mapping[] = []; - const { _mappings: mappings, _sources: sources, _names: names } = cast(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: string | undefined = undefined; - let original: Pos | undefined = undefined; - let name: string | undefined = 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 } as Mapping); - } - } - - return out; -} - -// This split declaration is only so that terser can elminiate the static initialization block. -function addSegmentInternal( - skipable: boolean, - map: GenMapping, - genLine: number, - genColumn: number, - source: S, - sourceLine: S extends string ? number : null | undefined, - sourceColumn: S extends string ? number : null | undefined, - name: S extends string ? string | null | undefined : null | undefined, - content: S extends string ? string | null | undefined : null | undefined, -): void { - const { - _mappings: mappings, - _sources: sources, - _sourcesContent: sourcesContent, - _names: names, - // _originalScopes: originalScopes, - } = cast(map); - const line = getIndex(mappings, genLine); - const index = getColumnIndex(line, genColumn); - - if (!source) { - if (skipable && skipSourceless(line, index)) return; - return insert(line, index, [genColumn]); - } - - // Sigh, TypeScript can't figure out sourceLine and sourceColumn aren't nullish if source - // isn't nullish. - assert(sourceLine); - assert(sourceColumn); - - const sourcesIndex = put(sources, source); - const namesIndex = name ? put(names, name) : NO_NAME; - if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content ?? null; - // if (sourcesIndex === originalScopes.length) originalScopes[sourcesIndex] = []; - - 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 assert(_val: unknown): asserts _val is T { - // noop. -} - -function getIndex(arr: T[][], index: number): T[] { - for (let i = arr.length; i <= index; i++) { - arr[i] = []; - } - return arr[index]; -} - -function getColumnIndex(line: SourceMapSegment[], genColumn: number): number { - 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: T[], index: number, value: T) { - for (let i = array.length; i > index; i--) { - array[i] = array[i - 1]; - } - array[index] = value; -} - -function removeEmptyFinalLines(mappings: SourceMapSegment[][]) { - 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(setarr: SetArray, array: T[]) { - for (let i = 0; i < array.length; i++) put(setarr, array[i]); -} - -function skipSourceless(line: SourceMapSegment[], index: number): boolean { - // 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: SourceMapSegment[], - index: number, - sourcesIndex: number, - sourceLine: number, - sourceColumn: number, - namesIndex: number, -): boolean { - // 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: boolean, - map: GenMapping, - mapping: { - generated: Pos; - source: S; - original: S extends string ? Pos : null | undefined; - name: S extends string ? string | null | undefined : null | undefined; - content: S extends string ? string | null | undefined : null | undefined; - }, -) { - const { generated, source, original, name, content } = mapping; - if (!source) { - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - null, - null, - null, - null, - null, - ); - } - assert(original); - return addSegmentInternal( - skipable, - map, - generated.line - 1, - generated.column, - source as string, - original.line - 1, - original.column, - name, - content, - ); -} - -/* -export function addOriginalScope( - map: GenMapping, - data: { - start: Pos; - end: Pos; - source: string; - kind: string; - name?: string; - variables?: string[]; - }, -): OriginalScopeInfo { - const { start, end, source, kind, name, variables } = data; - const { - _sources: sources, - _sourcesContent: sourcesContent, - _originalScopes: originalScopes, - _names: names, - } = cast(map); - const index = put(sources, source); - if (index === sourcesContent.length) sourcesContent[index] = null; - if (index === originalScopes.length) originalScopes[index] = []; - - const kindIndex = put(names, kind); - const scope: OriginalScope = name - ? [start.line - 1, start.column, end.line - 1, end.column, kindIndex, put(names, name)] - : [start.line - 1, start.column, end.line - 1, end.column, kindIndex]; - if (variables) { - scope.vars = variables.map((v) => put(names, v)); - } - const len = originalScopes[index].push(scope); - return [index, len - 1, variables]; -} -*/ - -// Generated Ranges -/* -export function addGeneratedRange( - map: GenMapping, - data: { - start: Pos; - isScope: boolean; - originalScope?: OriginalScopeInfo; - callsite?: OriginalPos; - }, -): GeneratedRangeInfo { - const { start, isScope, originalScope, callsite } = data; - const { - _originalScopes: originalScopes, - _sources: sources, - _sourcesContent: sourcesContent, - _generatedRanges: generatedRanges, - } = cast(map); - - const range: GeneratedRange = [ - start.line - 1, - start.column, - 0, - 0, - originalScope ? originalScope[0] : -1, - originalScope ? originalScope[1] : -1, - ]; - if (originalScope?.[2]) { - range.bindings = originalScope[2].map(() => [[-1]]); - } - if (callsite) { - const index = put(sources, callsite.source); - if (index === sourcesContent.length) sourcesContent[index] = null; - if (index === originalScopes.length) originalScopes[index] = []; - range.callsite = [index, callsite.line - 1, callsite.column]; - } - if (isScope) range.isScope = true; - generatedRanges.push(range); - - return [range, originalScope?.[2]]; -} - -export function setEndPosition(range: GeneratedRangeInfo, pos: Pos) { - range[0][2] = pos.line - 1; - range[0][3] = pos.column; -} - -export function addBinding( - map: GenMapping, - range: GeneratedRangeInfo, - variable: string, - expression: string | BindingExpressionRange, -) { - const { _names: names } = cast(map); - const bindings = (range[0].bindings ||= []); - const vars = range[1]; - - const index = vars!.indexOf(variable); - const binding = getIndex(bindings, index); - - if (typeof expression === 'string') binding[0] = [put(names, expression)]; - else { - const { start } = expression; - binding.push([put(names, expression.expression), start.line - 1, start.column]); - } -} -*/ diff --git a/node_modules/@jridgewell/gen-mapping/src/set-array.ts b/node_modules/@jridgewell/gen-mapping/src/set-array.ts deleted file mode 100644 index a2a73a5..0000000 --- a/node_modules/@jridgewell/gen-mapping/src/set-array.ts +++ /dev/null @@ -1,82 +0,0 @@ -type Key = string | number | symbol; - -/** - * 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 { - declare private _indexes: Record; - declare array: readonly T[]; - - constructor() { - this._indexes = { __proto__: null } as any; - this.array = []; - } -} - -interface PublicSet { - array: T[]; - _indexes: SetArray['_indexes']; -} - -/** - * Typescript doesn't allow friend access to private fields, so this just casts the set into a type - * with public access modifiers. - */ -function cast(set: SetArray): PublicSet { - return set as any; -} - -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -export function get(setarr: SetArray, key: T): number | undefined { - return cast(setarr)._indexes[key]; -} - -/** - * Puts `key` into the backing array, if it is not already present. Returns - * the index of the `key` in the backing array. - */ -export function put(setarr: SetArray, key: T): number { - // The key may or may not be present. If it is present, it's a number. - const index = get(setarr, key); - if (index !== undefined) return index; - - const { array, _indexes: indexes } = cast(setarr); - - const length = array.push(key); - return (indexes[key] = length - 1); -} - -/** - * Pops the last added item out of the SetArray. - */ -export function pop(setarr: SetArray): void { - const { array, _indexes: indexes } = cast(setarr); - if (array.length === 0) return; - - const last = array.pop()!; - indexes[last] = undefined; -} - -/** - * Removes the key, if it exists in the set. - */ -export function remove(setarr: SetArray, key: T): void { - const index = get(setarr, key); - if (index === undefined) return; - - const { array, _indexes: indexes } = cast(setarr); - for (let i = index + 1; i < array.length; i++) { - const k = array[i]; - array[i - 1] = k; - indexes[k]!--; - } - indexes[key] = undefined; - array.pop(); -} diff --git a/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts b/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts deleted file mode 100644 index fb296dd..0000000 --- a/node_modules/@jridgewell/gen-mapping/src/sourcemap-segment.ts +++ /dev/null @@ -1,16 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; - -export type SourceMapSegment = - | [GeneratedColumn] - | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn] - | [GeneratedColumn, SourcesIndex, SourceLine, SourceColumn, NamesIndex]; - -export const COLUMN = 0; -export const SOURCES_INDEX = 1; -export const SOURCE_LINE = 2; -export const SOURCE_COLUMN = 3; -export const NAMES_INDEX = 4; diff --git a/node_modules/@jridgewell/gen-mapping/src/types.ts b/node_modules/@jridgewell/gen-mapping/src/types.ts deleted file mode 100644 index b087f70..0000000 --- a/node_modules/@jridgewell/gen-mapping/src/types.ts +++ /dev/null @@ -1,61 +0,0 @@ -// import type { GeneratedRange, OriginalScope } from '@jridgewell/sourcemap-codec'; -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; - ignoreList?: readonly number[]; -} - -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; - // originalScopes: string[]; - // generatedRanges: string; -} - -export interface DecodedSourceMap extends SourceMapV3 { - mappings: readonly SourceMapSegment[][]; - // originalScopes: readonly OriginalScope[][]; - // generatedRanges: readonly GeneratedRange[]; -} - -export interface Pos { - line: number; // 1-based - column: number; // 0-based -} - -export interface OriginalPos extends Pos { - source: string; -} - -export interface BindingExpressionRange { - start: Pos; - expression: string; -} - -// export type OriginalScopeInfo = [number, number, string[] | undefined]; -// export type GeneratedRangeInfo = [GeneratedRange, string[] | undefined]; - -export 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/types/gen-mapping.d.cts b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts deleted file mode 100644 index 7618d85..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts +++ /dev/null @@ -1,89 +0,0 @@ -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types.cts'; -export type { DecodedSourceMap, EncodedSourceMap, Mapping }; -export type Options = { - file?: string | null; - sourceRoot?: string | null; -}; -/** - * Provides the state to generate a sourcemap. - */ -export declare class GenMapping { - private _names; - private _sources; - private _sourcesContent; - private _mappings; - private _ignoreList; - file: string | null | undefined; - sourceRoot: string | null | undefined; - constructor({ file, sourceRoot }?: Options); -} -/** - * 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 function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; -export declare function addSegment(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 function addMapping(map: GenMapping, mapping: { - generated: Pos; - source?: null; - original?: null; - name?: null; - content?: null; -}): void; -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name?: null; - content?: string | null; -}): void; -export declare function addMapping(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 const 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 const maybeAddMapping: typeof addMapping; -/** - * Adds/removes the content of the source file to the source map. - */ -export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; -export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function 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 function toEncodedMap(map: GenMapping): EncodedSourceMap; -/** - * Constructs a new GenMapping, using the already present mappings of the input. - */ -export declare function 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 function allMappings(map: GenMapping): Mapping[]; -//# sourceMappingURL=gen-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map deleted file mode 100644 index 8a2b183..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gen-mapping.d.ts","sourceRoot":"","sources":["../src/gen-mapping.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EAKR,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAIF;;GAEG;AACH,qBAAa,UAAU;IACrB,QAAgB,MAAM,CAAmB;IACzC,QAAgB,QAAQ,CAAmB;IAC3C,QAAgB,eAAe,CAAoB;IACnD,QAAgB,SAAS,CAAuB;IAGhD,QAAgB,WAAW,CAAmB;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAE,OAAY;CAW/C;AAoBD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,IAAI,EACb,UAAU,CAAC,EAAE,IAAI,EACjB,YAAY,CAAC,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AAwBR;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AAcR;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAqBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAEpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAO,QAYvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAwB9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAO9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAYzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,CA0BtD"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts deleted file mode 100644 index bbc0d89..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts +++ /dev/null @@ -1,89 +0,0 @@ -import type { SourceMapInput } from '@jridgewell/trace-mapping'; -import type { DecodedSourceMap, EncodedSourceMap, Pos, Mapping } from './types.mts'; -export type { DecodedSourceMap, EncodedSourceMap, Mapping }; -export type Options = { - file?: string | null; - sourceRoot?: string | null; -}; -/** - * Provides the state to generate a sourcemap. - */ -export declare class GenMapping { - private _names; - private _sources; - private _sourcesContent; - private _mappings; - private _ignoreList; - file: string | null | undefined; - sourceRoot: string | null | undefined; - constructor({ file, sourceRoot }?: Options); -} -/** - * 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 function addSegment(map: GenMapping, genLine: number, genColumn: number, source?: null, sourceLine?: null, sourceColumn?: null, name?: null, content?: null): void; -export declare function addSegment(map: GenMapping, genLine: number, genColumn: number, source: string, sourceLine: number, sourceColumn: number, name?: null, content?: string | null): void; -export declare function addSegment(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 function addMapping(map: GenMapping, mapping: { - generated: Pos; - source?: null; - original?: null; - name?: null; - content?: null; -}): void; -export declare function addMapping(map: GenMapping, mapping: { - generated: Pos; - source: string; - original: Pos; - name?: null; - content?: string | null; -}): void; -export declare function addMapping(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 const 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 const maybeAddMapping: typeof addMapping; -/** - * Adds/removes the content of the source file to the source map. - */ -export declare function setSourceContent(map: GenMapping, source: string, content: string | null): void; -export declare function setIgnore(map: GenMapping, source: string, ignore?: boolean): void; -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export declare function 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 function toEncodedMap(map: GenMapping): EncodedSourceMap; -/** - * Constructs a new GenMapping, using the already present mappings of the input. - */ -export declare function 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 function allMappings(map: GenMapping): Mapping[]; -//# sourceMappingURL=gen-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map b/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map deleted file mode 100644 index 8a2b183..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"gen-mapping.d.ts","sourceRoot":"","sources":["../src/gen-mapping.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,GAAG,EACH,OAAO,EAKR,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B,CAAC;AAIF;;GAEG;AACH,qBAAa,UAAU;IACrB,QAAgB,MAAM,CAAmB;IACzC,QAAgB,QAAQ,CAAmB;IAC3C,QAAgB,eAAe,CAAoB;IACnD,QAAgB,SAAS,CAAuB;IAGhD,QAAgB,WAAW,CAAmB;IACtC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;gBAElC,EAAE,IAAI,EAAE,UAAU,EAAE,GAAE,OAAY;CAW/C;AAoBD;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,IAAI,EACb,UAAU,CAAC,EAAE,IAAI,EACjB,YAAY,CAAC,EAAE,IAAI,EACnB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,IAAI,GACb,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GACtB,IAAI,CAAC;AAwBR;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AACR,wBAAgB,UAAU,CACxB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE;IACP,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB,GACA,IAAI,CAAC;AAcR;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAqBpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,OAAO,UAEpC,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAS9F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAAO,QAYvE;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAwB9D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,gBAAgB,CAO9D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,UAAU,CAYzD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,EAAE,CA0BtD"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts b/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts deleted file mode 100644 index 5d8cda3..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts +++ /dev/null @@ -1,33 +0,0 @@ -type Key = string | number | symbol; -/** - * 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 T[]; - constructor(); -} -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -export declare function get(setarr: SetArray, key: T): 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 function put(setarr: SetArray, key: T): number; -/** - * Pops the last added item out of the SetArray. - */ -export declare function pop(setarr: SetArray): void; -/** - * Removes the key, if it exists in the set. - */ -export declare function remove(setarr: SetArray, key: T): void; -export {}; -//# sourceMappingURL=set-array.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map b/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map deleted file mode 100644 index c52b8bc..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/set-array.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"set-array.d.ts","sourceRoot":"","sources":["../src/set-array.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACvC,QAAgB,QAAQ,CAAgC;IAChD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;;CAM7B;AAeD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAYvE"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts b/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts deleted file mode 100644 index 5d8cda3..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts +++ /dev/null @@ -1,33 +0,0 @@ -type Key = string | number | symbol; -/** - * 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 T[]; - constructor(); -} -/** - * Gets the index associated with `key` in the backing array, if it is already present. - */ -export declare function get(setarr: SetArray, key: T): 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 function put(setarr: SetArray, key: T): number; -/** - * Pops the last added item out of the SetArray. - */ -export declare function pop(setarr: SetArray): void; -/** - * Removes the key, if it exists in the set. - */ -export declare function remove(setarr: SetArray, key: T): void; -export {}; -//# sourceMappingURL=set-array.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map b/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map deleted file mode 100644 index c52b8bc..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"set-array.d.ts","sourceRoot":"","sources":["../src/set-array.ts"],"names":[],"mappings":"AAAA,KAAK,GAAG,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG;IACvC,QAAgB,QAAQ,CAAgC;IAChD,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;;CAM7B;AAeD;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS,CAElF;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,MAAM,CAStE;AAED;;GAEG;AACH,wBAAgB,GAAG,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAM5D;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAYvE"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts deleted file mode 100644 index 6886295..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts +++ /dev/null @@ -1,13 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; -export 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 {}; -//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map deleted file mode 100644 index 23cdc45..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts deleted file mode 100644 index 6886295..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts +++ /dev/null @@ -1,13 +0,0 @@ -type GeneratedColumn = number; -type SourcesIndex = number; -type SourceLine = number; -type SourceColumn = number; -type NamesIndex = number; -export 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 {}; -//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map b/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map deleted file mode 100644 index 23cdc45..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/types.d.cts b/node_modules/@jridgewell/gen-mapping/types/types.d.cts deleted file mode 100644 index 58da00a..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/types.d.cts +++ /dev/null @@ -1,44 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.cts'; -export interface SourceMapV3 { - file?: string | null; - names: readonly string[]; - sourceRoot?: string; - sources: readonly (string | null)[]; - sourcesContent?: readonly (string | null)[]; - version: 3; - ignoreList?: readonly number[]; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: readonly SourceMapSegment[][]; -} -export interface Pos { - line: number; - column: number; -} -export interface OriginalPos extends Pos { - source: string; -} -export interface BindingExpressionRange { - start: Pos; - expression: string; -} -export 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; -}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map b/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map deleted file mode 100644 index 159e734..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/types.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAGlB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAC;CAGzC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAKD,MAAM,MAAM,OAAO,GACf;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/types.d.mts b/node_modules/@jridgewell/gen-mapping/types/types.d.mts deleted file mode 100644 index e9837eb..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/types.d.mts +++ /dev/null @@ -1,44 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.mts'; -export interface SourceMapV3 { - file?: string | null; - names: readonly string[]; - sourceRoot?: string; - sources: readonly (string | null)[]; - sourcesContent?: readonly (string | null)[]; - version: 3; - ignoreList?: readonly number[]; -} -export interface EncodedSourceMap extends SourceMapV3 { - mappings: string; -} -export interface DecodedSourceMap extends SourceMapV3 { - mappings: readonly SourceMapSegment[][]; -} -export interface Pos { - line: number; - column: number; -} -export interface OriginalPos extends Pos { - source: string; -} -export interface BindingExpressionRange { - start: Pos; - expression: string; -} -export 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; -}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map b/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map deleted file mode 100644 index 159e734..0000000 --- a/node_modules/@jridgewell/gen-mapping/types/types.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACpC,cAAc,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC5C,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAGlB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAC;CAGzC;AAED,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,GAAG,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;CACpB;AAKD,MAAM,MAAM,OAAO,GACf;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,GACD;IACE,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC"} \ No newline at end of file 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 e958e88..0000000 --- a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs +++ /dev/null @@ -1,232 +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; -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: 7 /* Absolute */, - }; -} -function parseUrl(input) { - if (isSchemeRelativeUrl(input)) { - const url = parseAbsoluteUrl('http:' + input); - url.scheme = ''; - url.type = 6 /* SchemeRelative */; - return url; - } - if (isAbsolutePath(input)) { - const url = parseAbsoluteUrl('http://foo.com' + input); - url.scheme = ''; - url.host = ''; - url.type = 5 /* 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('?') - ? 3 /* Query */ - : input.startsWith('#') - ? 2 /* Hash */ - : 4 /* RelativePath */ - : 1 /* 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 <= 4 /* 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 !== 7 /* Absolute */) { - const baseUrl = parseUrl(base); - const baseType = baseUrl.type; - switch (inputType) { - case 1 /* Empty */: - url.hash = baseUrl.hash; - // fall through - case 2 /* Hash */: - url.query = baseUrl.query; - // fall through - case 3 /* Query */: - case 4 /* RelativePath */: - mergePaths(url, baseUrl); - // fall through - case 5 /* 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 6 /* 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 2 /* Hash */: - case 3 /* Query */: - return queryHash; - case 4 /* 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 5 /* 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 1de97d0..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\nconst enum 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;AAuBpF,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,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;IACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;IACpC,OAAO,OAAO,CACZ,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,EACf,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;IACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACtB,OAAO,OAAO,CACZ,OAAO,EACP,EAAE,EACF,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,EAAE,EACF,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,EACxC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CACd,MAAc,EACd,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,KAAa,EACb,IAAY;IAEZ,OAAO;QACL,MAAM;QACN,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,KAAK;QACL,IAAI;QACJ,IAAI;KACL,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa;IAC7B,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE;QAC9B,MAAM,GAAG,GAAG,gBAAgB,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;QAC9C,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,0BAA0B;QAClC,OAAO,GAAG,CAAC;KACZ;IAED,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE;QACzB,MAAM,GAAG,GAAG,gBAAgB,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;QACvD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;QACd,GAAG,CAAC,IAAI,wBAAwB;QAChC,OAAO,GAAG,CAAC;KACZ;IAED,IAAI,SAAS,CAAC,KAAK,CAAC;QAAE,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;IAEjD,IAAI,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;IAEzD,MAAM,GAAG,GAAG,gBAAgB,CAAC,iBAAiB,GAAG,KAAK,CAAC,CAAC;IACxD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;IACd,GAAG,CAAC,IAAI,GAAG,KAAK;UACZ,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;cAEnB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;;wBAGT;IAClB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAY;;;IAGrC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,SAAS,UAAU,CAAC,GAAQ,EAAE,IAAS;IACrC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;;;IAI/B,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE;QACpB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;KACtB;SAAM;;QAEL,GAAG,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC;KACpD;AACH,CAAC;AAED;;;;AAIA,SAAS,aAAa,CAAC,GAAQ,EAAE,IAAa;IAC5C,MAAM,GAAG,GAAG,IAAI,yBAAyB;IACzC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;;;IAInC,IAAI,OAAO,GAAG,CAAC,CAAC;;;IAIhB,IAAI,QAAQ,GAAG,CAAC,CAAC;;;;IAKjB,IAAI,gBAAgB,GAAG,KAAK,CAAC;IAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACtC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;;QAGxB,IAAI,CAAC,KAAK,EAAE;YACV,gBAAgB,GAAG,IAAI,CAAC;YACxB,SAAS;SACV;;QAGD,gBAAgB,GAAG,KAAK,CAAC;;QAGzB,IAAI,KAAK,KAAK,GAAG;YAAE,SAAS;;;QAI5B,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,IAAI,QAAQ,EAAE;gBACZ,gBAAgB,GAAG,IAAI,CAAC;gBACxB,QAAQ,EAAE,CAAC;gBACX,OAAO,EAAE,CAAC;aACX;iBAAM,IAAI,GAAG,EAAE;;;gBAGd,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;aAC3B;YACD,SAAS;SACV;;;QAID,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;QAC1B,QAAQ,EAAE,CAAC;KACZ;IAED,IAAI,IAAI,GAAG,EAAE,CAAC;IACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE;QAChC,IAAI,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;KACzB;IACD,IAAI,CAAC,IAAI,KAAK,gBAAgB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;QACxD,IAAI,IAAI,GAAG,CAAC;KACb;IACD,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;AAClB,CAAC;AAED;;;SAGwB,OAAO,CAAC,KAAa,EAAE,IAAwB;IACrE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAE/B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC;IAEzB,IAAI,IAAI,IAAI,SAAS,uBAAuB;QAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;QAE9B,QAAQ,SAAS;YACf;gBACE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;YAG1B;gBACE,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;;YAG5B,mBAAmB;YACnB;gBACE,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;;YAG3B;;gBAEE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;gBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;gBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;YAG1B;;gBAEE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;SAC/B;QACD,IAAI,QAAQ,GAAG,SAAS;YAAE,SAAS,GAAG,QAAQ,CAAC;KAChD;IAED,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAE9B,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC;IACvC,QAAQ,SAAS;;;QAIf,kBAAkB;QAClB;YACE,OAAO,SAAS,CAAC;QAEnB,2BAA2B;;YAEzB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,CAAC,IAAI;gBAAE,OAAO,SAAS,IAAI,GAAG,CAAC;YAEnC,IAAI,UAAU,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;;;;gBAIlD,OAAO,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;aAChC;YAED,OAAO,IAAI,GAAG,SAAS,CAAC;SACzB;QAED;YACE,OAAO,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;QAE9B;YACE,OAAO,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,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 a783049..0000000 --- a/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js +++ /dev/null @@ -1,240 +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; - 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: 7 /* Absolute */, - }; - } - function parseUrl(input) { - if (isSchemeRelativeUrl(input)) { - const url = parseAbsoluteUrl('http:' + input); - url.scheme = ''; - url.type = 6 /* SchemeRelative */; - return url; - } - if (isAbsolutePath(input)) { - const url = parseAbsoluteUrl('http://foo.com' + input); - url.scheme = ''; - url.host = ''; - url.type = 5 /* 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('?') - ? 3 /* Query */ - : input.startsWith('#') - ? 2 /* Hash */ - : 4 /* RelativePath */ - : 1 /* 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 <= 4 /* 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 !== 7 /* Absolute */) { - const baseUrl = parseUrl(base); - const baseType = baseUrl.type; - switch (inputType) { - case 1 /* Empty */: - url.hash = baseUrl.hash; - // fall through - case 2 /* Hash */: - url.query = baseUrl.query; - // fall through - case 3 /* Query */: - case 4 /* RelativePath */: - mergePaths(url, baseUrl); - // fall through - case 5 /* 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 6 /* 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 2 /* Hash */: - case 3 /* Query */: - return queryHash; - case 4 /* 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 5 /* 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 70a37f2..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\nconst enum 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;IAuBpF,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;IAED,SAAS,UAAU,CAAC,KAAa;QAC/B,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED,SAAS,gBAAgB,CAAC,KAAa;QACrC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;QACpC,OAAO,OAAO,CACZ,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,EACR,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,GAAG,EACf,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;IACJ,CAAC;IAED,SAAS,YAAY,CAAC,KAAa;QACjC,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC;QACrC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACtB,OAAO,OAAO,CACZ,OAAO,EACP,EAAE,EACF,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,EAAE,EACF,cAAc,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,EACxC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,EACd,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CACf,CAAC;IACJ,CAAC;IAED,SAAS,OAAO,CACd,MAAc,EACd,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,IAAY,EACZ,KAAa,EACb,IAAY;QAEZ,OAAO;YACL,MAAM;YACN,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,IAAI;YACJ,KAAK;YACL,IAAI;YACJ,IAAI;SACL,CAAC;IACJ,CAAC;IAED,SAAS,QAAQ,CAAC,KAAa;QAC7B,IAAI,mBAAmB,CAAC,KAAK,CAAC,EAAE;YAC9B,MAAM,GAAG,GAAG,gBAAgB,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;YAC9C,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,0BAA0B;YAClC,OAAO,GAAG,CAAC;SACZ;QAED,IAAI,cAAc,CAAC,KAAK,CAAC,EAAE;YACzB,MAAM,GAAG,GAAG,gBAAgB,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC;YACvD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;YAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;YACd,GAAG,CAAC,IAAI,wBAAwB;YAChC,OAAO,GAAG,CAAC;SACZ;QAED,IAAI,SAAS,CAAC,KAAK,CAAC;YAAE,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;QAEjD,IAAI,aAAa,CAAC,KAAK,CAAC;YAAE,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAEzD,MAAM,GAAG,GAAG,gBAAgB,CAAC,iBAAiB,GAAG,KAAK,CAAC,CAAC;QACxD,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;QAChB,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;QACd,GAAG,CAAC,IAAI,GAAG,KAAK;cACZ,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;kBAEnB,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC;;;4BAGT;QAClB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,SAAS,iBAAiB,CAAC,IAAY;;;QAGrC,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,SAAS,UAAU,CAAC,GAAQ,EAAE,IAAS;QACrC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;;;QAI/B,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,EAAE;YACpB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACtB;aAAM;;YAEL,GAAG,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC;SACpD;IACH,CAAC;IAED;;;;IAIA,SAAS,aAAa,CAAC,GAAQ,EAAE,IAAa;QAC5C,MAAM,GAAG,GAAG,IAAI,yBAAyB;QACzC,MAAM,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;;;QAInC,IAAI,OAAO,GAAG,CAAC,CAAC;;;QAIhB,IAAI,QAAQ,GAAG,CAAC,CAAC;;;;QAKjB,IAAI,gBAAgB,GAAG,KAAK,CAAC;QAE7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;;YAGxB,IAAI,CAAC,KAAK,EAAE;gBACV,gBAAgB,GAAG,IAAI,CAAC;gBACxB,SAAS;aACV;;YAGD,gBAAgB,GAAG,KAAK,CAAC;;YAGzB,IAAI,KAAK,KAAK,GAAG;gBAAE,SAAS;;;YAI5B,IAAI,KAAK,KAAK,IAAI,EAAE;gBAClB,IAAI,QAAQ,EAAE;oBACZ,gBAAgB,GAAG,IAAI,CAAC;oBACxB,QAAQ,EAAE,CAAC;oBACX,OAAO,EAAE,CAAC;iBACX;qBAAM,IAAI,GAAG,EAAE;;;oBAGd,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;iBAC3B;gBACD,SAAS;aACV;;;YAID,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAK,CAAC;YAC1B,QAAQ,EAAE,CAAC;SACZ;QAED,IAAI,IAAI,GAAG,EAAE,CAAC;QACd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,EAAE,EAAE;YAChC,IAAI,IAAI,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;SACzB;QACD,IAAI,CAAC,IAAI,KAAK,gBAAgB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE;YACxD,IAAI,IAAI,GAAG,CAAC;SACb;QACD,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;IAED;;;aAGwB,OAAO,CAAC,KAAa,EAAE,IAAwB;QACrE,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QAE/B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC;QAEzB,IAAI,IAAI,IAAI,SAAS,uBAAuB;YAC1C,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;YAC/B,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;YAE9B,QAAQ,SAAS;gBACf;oBACE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;gBAG1B;oBACE,GAAG,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;;gBAG5B,mBAAmB;gBACnB;oBACE,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;;gBAG3B;;oBAEE,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;oBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;oBACxB,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;;gBAG1B;;oBAEE,GAAG,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;aAC/B;YACD,IAAI,QAAQ,GAAG,SAAS;gBAAE,SAAS,GAAG,QAAQ,CAAC;SAChD;QAED,aAAa,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAE9B,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC;QACvC,QAAQ,SAAS;;;YAIf,kBAAkB;YAClB;gBACE,OAAO,SAAS,CAAC;YAEnB,2BAA2B;;gBAEzB,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAE/B,IAAI,CAAC,IAAI;oBAAE,OAAO,SAAS,IAAI,GAAG,CAAC;gBAEnC,IAAI,UAAU,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;;;;oBAIlD,OAAO,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;iBAChC;gBAED,OAAO,IAAI,GAAG,SAAS,CAAC;aACzB;YAED;gBACE,OAAO,GAAG,CAAC,IAAI,GAAG,SAAS,CAAC;YAE9B;gBACE,OAAO,GAAG,CAAC,MAAM,GAAG,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,GAAG,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 02a4c51..0000000 --- a/node_modules/@jridgewell/resolve-uri/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@jridgewell/resolve-uri", - "version": "3.1.2", - "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/sourcemap-codec/LICENSE b/node_modules/@jridgewell/sourcemap-codec/LICENSE deleted file mode 100644 index 1f6ce94..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2024 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/sourcemap-codec/README.md b/node_modules/@jridgewell/sourcemap-codec/README.md deleted file mode 100644 index b3e0708..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/README.md +++ /dev/null @@ -1,264 +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 v20.10.0 - -amp.js.map - 45120 segments - -Decode Memory Usage: -local code 5815135 bytes -@jridgewell/sourcemap-codec 1.4.15 5868160 bytes -sourcemap-codec 5492584 bytes -source-map-0.6.1 13569984 bytes -source-map-0.8.0 6390584 bytes -chrome dev tools 8011136 bytes -Smallest memory usage is sourcemap-codec - -Decode speed: -decode: local code x 492 ops/sec ±1.22% (90 runs sampled) -decode: @jridgewell/sourcemap-codec 1.4.15 x 499 ops/sec ±1.16% (89 runs sampled) -decode: sourcemap-codec x 376 ops/sec ±1.66% (89 runs sampled) -decode: source-map-0.6.1 x 34.99 ops/sec ±0.94% (48 runs sampled) -decode: source-map-0.8.0 x 351 ops/sec ±0.07% (95 runs sampled) -chrome dev tools x 165 ops/sec ±0.91% (86 runs sampled) -Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 - -Encode Memory Usage: -local code 444248 bytes -@jridgewell/sourcemap-codec 1.4.15 623024 bytes -sourcemap-codec 8696280 bytes -source-map-0.6.1 8745176 bytes -source-map-0.8.0 8736624 bytes -Smallest memory usage is local code - -Encode speed: -encode: local code x 796 ops/sec ±0.11% (97 runs sampled) -encode: @jridgewell/sourcemap-codec 1.4.15 x 795 ops/sec ±0.25% (98 runs sampled) -encode: sourcemap-codec x 231 ops/sec ±0.83% (86 runs sampled) -encode: source-map-0.6.1 x 166 ops/sec ±0.57% (86 runs sampled) -encode: source-map-0.8.0 x 203 ops/sec ±0.45% (88 runs sampled) -Fastest is encode: local code,encode: @jridgewell/sourcemap-codec 1.4.15 - - -*** - - -babel.min.js.map - 347793 segments - -Decode Memory Usage: -local code 35424960 bytes -@jridgewell/sourcemap-codec 1.4.15 35424696 bytes -sourcemap-codec 36033464 bytes -source-map-0.6.1 62253704 bytes -source-map-0.8.0 43843920 bytes -chrome dev tools 45111400 bytes -Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15 - -Decode speed: -decode: local code x 38.18 ops/sec ±5.44% (52 runs sampled) -decode: @jridgewell/sourcemap-codec 1.4.15 x 38.36 ops/sec ±5.02% (52 runs sampled) -decode: sourcemap-codec x 34.05 ops/sec ±4.45% (47 runs sampled) -decode: source-map-0.6.1 x 4.31 ops/sec ±2.76% (15 runs sampled) -decode: source-map-0.8.0 x 55.60 ops/sec ±0.13% (73 runs sampled) -chrome dev tools x 16.94 ops/sec ±3.78% (46 runs sampled) -Fastest is decode: source-map-0.8.0 - -Encode Memory Usage: -local code 2606016 bytes -@jridgewell/sourcemap-codec 1.4.15 2626440 bytes -sourcemap-codec 21152576 bytes -source-map-0.6.1 25023928 bytes -source-map-0.8.0 25256448 bytes -Smallest memory usage is local code - -Encode speed: -encode: local code x 127 ops/sec ±0.18% (83 runs sampled) -encode: @jridgewell/sourcemap-codec 1.4.15 x 128 ops/sec ±0.26% (83 runs sampled) -encode: sourcemap-codec x 29.31 ops/sec ±2.55% (53 runs sampled) -encode: source-map-0.6.1 x 18.85 ops/sec ±3.19% (36 runs sampled) -encode: source-map-0.8.0 x 19.34 ops/sec ±1.97% (36 runs sampled) -Fastest is encode: @jridgewell/sourcemap-codec 1.4.15 - - -*** - - -preact.js.map - 1992 segments - -Decode Memory Usage: -local code 261696 bytes -@jridgewell/sourcemap-codec 1.4.15 244296 bytes -sourcemap-codec 302816 bytes -source-map-0.6.1 939176 bytes -source-map-0.8.0 336 bytes -chrome dev tools 587368 bytes -Smallest memory usage is source-map-0.8.0 - -Decode speed: -decode: local code x 17,782 ops/sec ±0.32% (97 runs sampled) -decode: @jridgewell/sourcemap-codec 1.4.15 x 17,863 ops/sec ±0.40% (100 runs sampled) -decode: sourcemap-codec x 12,453 ops/sec ±0.27% (101 runs sampled) -decode: source-map-0.6.1 x 1,288 ops/sec ±1.05% (96 runs sampled) -decode: source-map-0.8.0 x 9,289 ops/sec ±0.27% (101 runs sampled) -chrome dev tools x 4,769 ops/sec ±0.18% (100 runs sampled) -Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 - -Encode Memory Usage: -local code 262944 bytes -@jridgewell/sourcemap-codec 1.4.15 25544 bytes -sourcemap-codec 323048 bytes -source-map-0.6.1 507808 bytes -source-map-0.8.0 507480 bytes -Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15 - -Encode speed: -encode: local code x 24,207 ops/sec ±0.79% (95 runs sampled) -encode: @jridgewell/sourcemap-codec 1.4.15 x 24,288 ops/sec ±0.48% (96 runs sampled) -encode: sourcemap-codec x 6,761 ops/sec ±0.21% (100 runs sampled) -encode: source-map-0.6.1 x 5,374 ops/sec ±0.17% (99 runs sampled) -encode: source-map-0.8.0 x 5,633 ops/sec ±0.32% (99 runs sampled) -Fastest is encode: @jridgewell/sourcemap-codec 1.4.15,encode: local code - - -*** - - -react.js.map - 5726 segments - -Decode Memory Usage: -local code 678816 bytes -@jridgewell/sourcemap-codec 1.4.15 678816 bytes -sourcemap-codec 816400 bytes -source-map-0.6.1 2288864 bytes -source-map-0.8.0 721360 bytes -chrome dev tools 1012512 bytes -Smallest memory usage is local code - -Decode speed: -decode: local code x 6,178 ops/sec ±0.19% (98 runs sampled) -decode: @jridgewell/sourcemap-codec 1.4.15 x 6,261 ops/sec ±0.22% (100 runs sampled) -decode: sourcemap-codec x 4,472 ops/sec ±0.90% (99 runs sampled) -decode: source-map-0.6.1 x 449 ops/sec ±0.31% (95 runs sampled) -decode: source-map-0.8.0 x 3,219 ops/sec ±0.13% (100 runs sampled) -chrome dev tools x 1,743 ops/sec ±0.20% (99 runs sampled) -Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 - -Encode Memory Usage: -local code 140960 bytes -@jridgewell/sourcemap-codec 1.4.15 159808 bytes -sourcemap-codec 969304 bytes -source-map-0.6.1 930520 bytes -source-map-0.8.0 930248 bytes -Smallest memory usage is local code - -Encode speed: -encode: local code x 8,013 ops/sec ±0.19% (100 runs sampled) -encode: @jridgewell/sourcemap-codec 1.4.15 x 7,989 ops/sec ±0.20% (101 runs sampled) -encode: sourcemap-codec x 2,472 ops/sec ±0.21% (99 runs sampled) -encode: source-map-0.6.1 x 2,200 ops/sec ±0.17% (99 runs sampled) -encode: source-map-0.8.0 x 2,220 ops/sec ±0.37% (99 runs sampled) -Fastest is encode: local code - - -*** - - -vscode.map - 2141001 segments - -Decode Memory Usage: -local code 198955264 bytes -@jridgewell/sourcemap-codec 1.4.15 199175352 bytes -sourcemap-codec 199102688 bytes -source-map-0.6.1 386323432 bytes -source-map-0.8.0 244116432 bytes -chrome dev tools 293734280 bytes -Smallest memory usage is local code - -Decode speed: -decode: local code x 3.90 ops/sec ±22.21% (15 runs sampled) -decode: @jridgewell/sourcemap-codec 1.4.15 x 3.95 ops/sec ±23.53% (15 runs sampled) -decode: sourcemap-codec x 3.82 ops/sec ±17.94% (14 runs sampled) -decode: source-map-0.6.1 x 0.61 ops/sec ±7.81% (6 runs sampled) -decode: source-map-0.8.0 x 9.54 ops/sec ±0.28% (28 runs sampled) -chrome dev tools x 2.18 ops/sec ±10.58% (10 runs sampled) -Fastest is decode: source-map-0.8.0 - -Encode Memory Usage: -local code 13509880 bytes -@jridgewell/sourcemap-codec 1.4.15 13537648 bytes -sourcemap-codec 32540104 bytes -source-map-0.6.1 127531040 bytes -source-map-0.8.0 127535312 bytes -Smallest memory usage is local code - -Encode speed: -encode: local code x 20.10 ops/sec ±0.19% (38 runs sampled) -encode: @jridgewell/sourcemap-codec 1.4.15 x 20.26 ops/sec ±0.32% (38 runs sampled) -encode: sourcemap-codec x 5.44 ops/sec ±1.64% (18 runs sampled) -encode: source-map-0.6.1 x 2.30 ops/sec ±4.79% (10 runs sampled) -encode: source-map-0.8.0 x 2.46 ops/sec ±6.53% (10 runs sampled) -Fastest is encode: @jridgewell/sourcemap-codec 1.4.15 -``` - -# 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 532bab3..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +++ /dev/null @@ -1,423 +0,0 @@ -// src/vlq.ts -var comma = ",".charCodeAt(0); -var semicolon = ";".charCodeAt(0); -var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -var intToChar = new Uint8Array(64); -var charToInt = new Uint8Array(128); -for (let i = 0; i < chars.length; i++) { - const c = chars.charCodeAt(i); - intToChar[i] = c; - charToInt[c] = i; -} -function decodeInteger(reader, relative) { - let value = 0; - let shift = 0; - let integer = 0; - do { - const c = reader.next(); - integer = charToInt[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - const shouldNegate = value & 1; - value >>>= 1; - if (shouldNegate) { - value = -2147483648 | -value; - } - return relative + value; -} -function encodeInteger(builder, num, relative) { - let delta = num - relative; - delta = delta < 0 ? -delta << 1 | 1 : delta << 1; - do { - let clamped = delta & 31; - delta >>>= 5; - if (delta > 0) clamped |= 32; - builder.write(intToChar[clamped]); - } while (delta > 0); - return num; -} -function hasMoreVlq(reader, max) { - if (reader.pos >= max) return false; - return reader.peek() !== comma; -} - -// src/strings.ts -var bufLength = 1024 * 16; -var 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; - } -}; -var StringWriter = class { - constructor() { - this.pos = 0; - this.out = ""; - this.buffer = new Uint8Array(bufLength); - } - write(v) { - const { buffer } = this; - buffer[this.pos++] = v; - if (this.pos === bufLength) { - this.out += td.decode(buffer); - this.pos = 0; - } - } - flush() { - const { buffer, out, pos } = this; - return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; - } -}; -var StringReader = class { - constructor(buffer) { - this.pos = 0; - this.buffer = buffer; - } - next() { - return this.buffer.charCodeAt(this.pos++); - } - peek() { - return this.buffer.charCodeAt(this.pos); - } - indexOf(char) { - const { buffer, pos } = this; - const idx = buffer.indexOf(char, pos); - return idx === -1 ? buffer.length : idx; - } -}; - -// src/scopes.ts -var EMPTY = []; -function decodeOriginalScopes(input) { - const { length } = input; - const reader = new StringReader(input); - const scopes = []; - const stack = []; - let line = 0; - for (; reader.pos < length; reader.pos++) { - line = decodeInteger(reader, line); - const column = decodeInteger(reader, 0); - if (!hasMoreVlq(reader, length)) { - const last = stack.pop(); - last[2] = line; - last[3] = column; - continue; - } - const kind = decodeInteger(reader, 0); - const fields = decodeInteger(reader, 0); - const hasName = fields & 1; - const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]; - let vars = EMPTY; - if (hasMoreVlq(reader, length)) { - vars = []; - do { - const varsIndex = decodeInteger(reader, 0); - vars.push(varsIndex); - } while (hasMoreVlq(reader, length)); - } - scope.vars = vars; - scopes.push(scope); - stack.push(scope); - } - return scopes; -} -function encodeOriginalScopes(scopes) { - const writer = new StringWriter(); - for (let i = 0; i < scopes.length; ) { - i = _encodeOriginalScopes(scopes, i, writer, [0]); - } - return writer.flush(); -} -function _encodeOriginalScopes(scopes, index, writer, state) { - const scope = scopes[index]; - const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; - if (index > 0) writer.write(comma); - state[0] = encodeInteger(writer, startLine, state[0]); - encodeInteger(writer, startColumn, 0); - encodeInteger(writer, kind, 0); - const fields = scope.length === 6 ? 1 : 0; - encodeInteger(writer, fields, 0); - if (scope.length === 6) encodeInteger(writer, scope[5], 0); - for (const v of vars) { - encodeInteger(writer, v, 0); - } - for (index++; index < scopes.length; ) { - const next = scopes[index]; - const { 0: l, 1: c } = next; - if (l > endLine || l === endLine && c >= endColumn) { - break; - } - index = _encodeOriginalScopes(scopes, index, writer, state); - } - writer.write(comma); - state[0] = encodeInteger(writer, endLine, state[0]); - encodeInteger(writer, endColumn, 0); - return index; -} -function decodeGeneratedRanges(input) { - const { length } = input; - const reader = new StringReader(input); - const ranges = []; - const stack = []; - let genLine = 0; - let definitionSourcesIndex = 0; - let definitionScopeIndex = 0; - let callsiteSourcesIndex = 0; - let callsiteLine = 0; - let callsiteColumn = 0; - let bindingLine = 0; - let bindingColumn = 0; - do { - const semi = reader.indexOf(";"); - let genColumn = 0; - for (; reader.pos < semi; reader.pos++) { - genColumn = decodeInteger(reader, genColumn); - if (!hasMoreVlq(reader, semi)) { - const last = stack.pop(); - last[2] = genLine; - last[3] = genColumn; - continue; - } - const fields = decodeInteger(reader, 0); - const hasDefinition = fields & 1; - const hasCallsite = fields & 2; - const hasScope = fields & 4; - let callsite = null; - let bindings = EMPTY; - let range; - if (hasDefinition) { - const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); - definitionScopeIndex = decodeInteger( - reader, - definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0 - ); - definitionSourcesIndex = defSourcesIndex; - range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex]; - } else { - range = [genLine, genColumn, 0, 0]; - } - range.isScope = !!hasScope; - if (hasCallsite) { - const prevCsi = callsiteSourcesIndex; - const prevLine = callsiteLine; - callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); - const sameSource = prevCsi === callsiteSourcesIndex; - callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); - callsiteColumn = decodeInteger( - reader, - sameSource && prevLine === callsiteLine ? callsiteColumn : 0 - ); - callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; - } - range.callsite = callsite; - if (hasMoreVlq(reader, semi)) { - bindings = []; - do { - bindingLine = genLine; - bindingColumn = genColumn; - const expressionsCount = decodeInteger(reader, 0); - let expressionRanges; - if (expressionsCount < -1) { - expressionRanges = [[decodeInteger(reader, 0)]]; - for (let i = -1; i > expressionsCount; i--) { - const prevBl = bindingLine; - bindingLine = decodeInteger(reader, bindingLine); - bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); - const expression = decodeInteger(reader, 0); - expressionRanges.push([expression, bindingLine, bindingColumn]); - } - } else { - expressionRanges = [[expressionsCount]]; - } - bindings.push(expressionRanges); - } while (hasMoreVlq(reader, semi)); - } - range.bindings = bindings; - ranges.push(range); - stack.push(range); - } - genLine++; - reader.pos = semi + 1; - } while (reader.pos < length); - return ranges; -} -function encodeGeneratedRanges(ranges) { - if (ranges.length === 0) return ""; - const writer = new StringWriter(); - for (let i = 0; i < ranges.length; ) { - i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); - } - return writer.flush(); -} -function _encodeGeneratedRanges(ranges, index, writer, state) { - const range = ranges[index]; - const { - 0: startLine, - 1: startColumn, - 2: endLine, - 3: endColumn, - isScope, - callsite, - bindings - } = range; - if (state[0] < startLine) { - catchupLine(writer, state[0], startLine); - state[0] = startLine; - state[1] = 0; - } else if (index > 0) { - writer.write(comma); - } - state[1] = encodeInteger(writer, range[1], state[1]); - const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0); - encodeInteger(writer, fields, 0); - if (range.length === 6) { - const { 4: sourcesIndex, 5: scopesIndex } = range; - if (sourcesIndex !== state[2]) { - state[3] = 0; - } - state[2] = encodeInteger(writer, sourcesIndex, state[2]); - state[3] = encodeInteger(writer, scopesIndex, state[3]); - } - if (callsite) { - const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite; - if (sourcesIndex !== state[4]) { - state[5] = 0; - state[6] = 0; - } else if (callLine !== state[5]) { - state[6] = 0; - } - state[4] = encodeInteger(writer, sourcesIndex, state[4]); - state[5] = encodeInteger(writer, callLine, state[5]); - state[6] = encodeInteger(writer, callColumn, state[6]); - } - if (bindings) { - for (const binding of bindings) { - if (binding.length > 1) encodeInteger(writer, -binding.length, 0); - const expression = binding[0][0]; - encodeInteger(writer, expression, 0); - let bindingStartLine = startLine; - let bindingStartColumn = startColumn; - for (let i = 1; i < binding.length; i++) { - const expRange = binding[i]; - bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine); - bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn); - encodeInteger(writer, expRange[0], 0); - } - } - } - for (index++; index < ranges.length; ) { - const next = ranges[index]; - const { 0: l, 1: c } = next; - if (l > endLine || l === endLine && c >= endColumn) { - break; - } - index = _encodeGeneratedRanges(ranges, index, writer, state); - } - if (state[0] < endLine) { - catchupLine(writer, state[0], endLine); - state[0] = endLine; - state[1] = 0; - } else { - writer.write(comma); - } - state[1] = encodeInteger(writer, endColumn, state[1]); - return index; -} -function catchupLine(writer, lastLine, line) { - do { - writer.write(semicolon); - } while (++lastLine < line); -} - -// src/sourcemap-codec.ts -function decode(mappings) { - const { length } = mappings; - const reader = new StringReader(mappings); - const decoded = []; - let genColumn = 0; - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - do { - const semi = reader.indexOf(";"); - const line = []; - let sorted = true; - let lastCol = 0; - genColumn = 0; - while (reader.pos < semi) { - let seg; - genColumn = decodeInteger(reader, genColumn); - if (genColumn < lastCol) sorted = false; - lastCol = genColumn; - if (hasMoreVlq(reader, semi)) { - sourcesIndex = decodeInteger(reader, sourcesIndex); - sourceLine = decodeInteger(reader, sourceLine); - sourceColumn = decodeInteger(reader, sourceColumn); - if (hasMoreVlq(reader, semi)) { - namesIndex = decodeInteger(reader, namesIndex); - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; - } else { - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; - } - } else { - seg = [genColumn]; - } - line.push(seg); - reader.pos++; - } - if (!sorted) sort(line); - decoded.push(line); - reader.pos = semi + 1; - } while (reader.pos <= length); - return decoded; -} -function sort(line) { - line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[0] - b[0]; -} -function encode(decoded) { - const writer = new StringWriter(); - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) writer.write(semicolon); - if (line.length === 0) continue; - let genColumn = 0; - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - if (j > 0) writer.write(comma); - genColumn = encodeInteger(writer, segment[0], genColumn); - if (segment.length === 1) continue; - sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); - sourceLine = encodeInteger(writer, segment[2], sourceLine); - sourceColumn = encodeInteger(writer, segment[3], sourceColumn); - if (segment.length === 4) continue; - namesIndex = encodeInteger(writer, segment[4], namesIndex); - } - } - return writer.flush(); -} -export { - decode, - decodeGeneratedRanges, - decodeOriginalScopes, - encode, - encodeGeneratedRanges, - encodeOriginalScopes -}; -//# 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 c276844..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["../src/vlq.ts", "../src/strings.ts", "../src/scopes.ts", "../src/sourcemap-codec.ts"], - "mappings": ";AAEO,IAAM,QAAQ,IAAI,WAAW,CAAC;AAC9B,IAAM,YAAY,IAAI,WAAW,CAAC;AAEzC,IAAM,QAAQ;AACd,IAAM,YAAY,IAAI,WAAW,EAAE;AACnC,IAAM,YAAY,IAAI,WAAW,GAAG;AAEpC,SAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,IAAI,MAAM,WAAW,CAAC;AAC5B,YAAU,CAAC,IAAI;AACf,YAAU,CAAC,IAAI;AACjB;AAEO,SAAS,cAAc,QAAsB,UAA0B;AAC5E,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,KAAG;AACD,UAAM,IAAI,OAAO,KAAK;AACtB,cAAU,UAAU,CAAC;AACrB,cAAU,UAAU,OAAO;AAC3B,aAAS;AAAA,EACX,SAAS,UAAU;AAEnB,QAAM,eAAe,QAAQ;AAC7B,aAAW;AAEX,MAAI,cAAc;AAChB,YAAQ,cAAc,CAAC;AAAA,EACzB;AAEA,SAAO,WAAW;AACpB;AAEO,SAAS,cAAc,SAAuB,KAAa,UAA0B;AAC1F,MAAI,QAAQ,MAAM;AAElB,UAAQ,QAAQ,IAAK,CAAC,SAAS,IAAK,IAAI,SAAS;AACjD,KAAG;AACD,QAAI,UAAU,QAAQ;AACtB,eAAW;AACX,QAAI,QAAQ,EAAG,YAAW;AAC1B,YAAQ,MAAM,UAAU,OAAO,CAAC;AAAA,EAClC,SAAS,QAAQ;AAEjB,SAAO;AACT;AAEO,SAAS,WAAW,QAAsB,KAAa;AAC5D,MAAI,OAAO,OAAO,IAAK,QAAO;AAC9B,SAAO,OAAO,KAAK,MAAM;AAC3B;;;ACtDA,IAAM,YAAY,OAAO;AAGzB,IAAM,KACJ,OAAO,gBAAgB,cACH,oBAAI,YAAY,IAChC,OAAO,WAAW,cAChB;AAAA,EACE,OAAO,KAAyB;AAC9B,UAAM,MAAM,OAAO,KAAK,IAAI,QAAQ,IAAI,YAAY,IAAI,UAAU;AAClE,WAAO,IAAI,SAAS;AAAA,EACtB;AACF,IACA;AAAA,EACE,OAAO,KAAyB;AAC9B,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,aAAO,OAAO,aAAa,IAAI,CAAC,CAAC;AAAA,IACnC;AACA,WAAO;AAAA,EACT;AACF;AAED,IAAM,eAAN,MAAmB;AAAA,EAAnB;AACL,eAAM;AACN,SAAQ,MAAM;AACd,SAAQ,SAAS,IAAI,WAAW,SAAS;AAAA;AAAA,EAEzC,MAAM,GAAiB;AACrB,UAAM,EAAE,OAAO,IAAI;AACnB,WAAO,KAAK,KAAK,IAAI;AACrB,QAAI,KAAK,QAAQ,WAAW;AAC1B,WAAK,OAAO,GAAG,OAAO,MAAM;AAC5B,WAAK,MAAM;AAAA,IACb;AAAA,EACF;AAAA,EAEA,QAAgB;AACd,UAAM,EAAE,QAAQ,KAAK,IAAI,IAAI;AAC7B,WAAO,MAAM,IAAI,MAAM,GAAG,OAAO,OAAO,SAAS,GAAG,GAAG,CAAC,IAAI;AAAA,EAC9D;AACF;AAEO,IAAM,eAAN,MAAmB;AAAA,EAIxB,YAAY,QAAgB;AAH5B,eAAM;AAIJ,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,KAAK;AAAA,EAC1C;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,GAAG;AAAA,EACxC;AAAA,EAEA,QAAQ,MAAsB;AAC5B,UAAM,EAAE,QAAQ,IAAI,IAAI;AACxB,UAAM,MAAM,OAAO,QAAQ,MAAM,GAAG;AACpC,WAAO,QAAQ,KAAK,OAAO,SAAS;AAAA,EACtC;AACF;;;AC7DA,IAAM,QAAe,CAAC;AA+Bf,SAAS,qBAAqB,OAAgC;AACnE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA0B,CAAC;AACjC,QAAM,QAAyB,CAAC;AAChC,MAAI,OAAO;AAEX,SAAO,OAAO,MAAM,QAAQ,OAAO,OAAO;AACxC,WAAO,cAAc,QAAQ,IAAI;AACjC,UAAM,SAAS,cAAc,QAAQ,CAAC;AAEtC,QAAI,CAAC,WAAW,QAAQ,MAAM,GAAG;AAC/B,YAAM,OAAO,MAAM,IAAI;AACvB,WAAK,CAAC,IAAI;AACV,WAAK,CAAC,IAAI;AACV;AAAA,IACF;AAEA,UAAM,OAAO,cAAc,QAAQ,CAAC;AACpC,UAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,UAAM,UAAU,SAAS;AAEzB,UAAM,QACJ,UAAU,CAAC,MAAM,QAAQ,GAAG,GAAG,MAAM,cAAc,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,QAAQ,GAAG,GAAG,IAAI;AAG5F,QAAI,OAAc;AAClB,QAAI,WAAW,QAAQ,MAAM,GAAG;AAC9B,aAAO,CAAC;AACR,SAAG;AACD,cAAM,YAAY,cAAc,QAAQ,CAAC;AACzC,aAAK,KAAK,SAAS;AAAA,MACrB,SAAS,WAAW,QAAQ,MAAM;AAAA,IACpC;AACA,UAAM,OAAO;AAEb,WAAO,KAAK,KAAK;AACjB,UAAM,KAAK,KAAK;AAAA,EAClB;AAEA,SAAO;AACT;AAEO,SAAS,qBAAqB,QAAiC;AACpE,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,sBAAsB,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAAA,EAClD;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,sBACP,QACA,OACA,QACA,OAGQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM,EAAE,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,KAAK,IAAI;AAElF,MAAI,QAAQ,EAAG,QAAO,MAAM,KAAK;AAEjC,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AACpD,gBAAc,QAAQ,aAAa,CAAC;AACpC,gBAAc,QAAQ,MAAM,CAAC;AAE7B,QAAM,SAAS,MAAM,WAAW,IAAI,IAAS;AAC7C,gBAAc,QAAQ,QAAQ,CAAC;AAC/B,MAAI,MAAM,WAAW,EAAG,eAAc,QAAQ,MAAM,CAAC,GAAG,CAAC;AAEzD,aAAW,KAAK,MAAM;AACpB,kBAAc,QAAQ,GAAG,CAAC;AAAA,EAC5B;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,sBAAsB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC5D;AAEA,SAAO,MAAM,KAAK;AAClB,QAAM,CAAC,IAAI,cAAc,QAAQ,SAAS,MAAM,CAAC,CAAC;AAClD,gBAAc,QAAQ,WAAW,CAAC;AAElC,SAAO;AACT;AAEO,SAAS,sBAAsB,OAAiC;AACrE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA2B,CAAC;AAClC,QAAM,QAA0B,CAAC;AAEjC,MAAI,UAAU;AACd,MAAI,yBAAyB;AAC7B,MAAI,uBAAuB;AAC3B,MAAI,uBAAuB;AAC3B,MAAI,eAAe;AACnB,MAAI,iBAAiB;AACrB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAEpB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,QAAI,YAAY;AAEhB,WAAO,OAAO,MAAM,MAAM,OAAO,OAAO;AACtC,kBAAY,cAAc,QAAQ,SAAS;AAE3C,UAAI,CAAC,WAAW,QAAQ,IAAI,GAAG;AAC7B,cAAM,OAAO,MAAM,IAAI;AACvB,aAAK,CAAC,IAAI;AACV,aAAK,CAAC,IAAI;AACV;AAAA,MACF;AAEA,YAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,YAAM,gBAAgB,SAAS;AAC/B,YAAM,cAAc,SAAS;AAC7B,YAAM,WAAW,SAAS;AAE1B,UAAI,WAA4B;AAChC,UAAI,WAAsB;AAC1B,UAAI;AACJ,UAAI,eAAe;AACjB,cAAM,kBAAkB,cAAc,QAAQ,sBAAsB;AACpE,+BAAuB;AAAA,UACrB;AAAA,UACA,2BAA2B,kBAAkB,uBAAuB;AAAA,QACtE;AAEA,iCAAyB;AACzB,gBAAQ,CAAC,SAAS,WAAW,GAAG,GAAG,iBAAiB,oBAAoB;AAAA,MAC1E,OAAO;AACL,gBAAQ,CAAC,SAAS,WAAW,GAAG,CAAC;AAAA,MACnC;AAEA,YAAM,UAAU,CAAC,CAAC;AAElB,UAAI,aAAa;AACf,cAAM,UAAU;AAChB,cAAM,WAAW;AACjB,+BAAuB,cAAc,QAAQ,oBAAoB;AACjE,cAAM,aAAa,YAAY;AAC/B,uBAAe,cAAc,QAAQ,aAAa,eAAe,CAAC;AAClE,yBAAiB;AAAA,UACf;AAAA,UACA,cAAc,aAAa,eAAe,iBAAiB;AAAA,QAC7D;AAEA,mBAAW,CAAC,sBAAsB,cAAc,cAAc;AAAA,MAChE;AACA,YAAM,WAAW;AAEjB,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,mBAAW,CAAC;AACZ,WAAG;AACD,wBAAc;AACd,0BAAgB;AAChB,gBAAM,mBAAmB,cAAc,QAAQ,CAAC;AAChD,cAAI;AACJ,cAAI,mBAAmB,IAAI;AACzB,+BAAmB,CAAC,CAAC,cAAc,QAAQ,CAAC,CAAC,CAAC;AAC9C,qBAAS,IAAI,IAAI,IAAI,kBAAkB,KAAK;AAC1C,oBAAM,SAAS;AACf,4BAAc,cAAc,QAAQ,WAAW;AAC/C,8BAAgB,cAAc,QAAQ,gBAAgB,SAAS,gBAAgB,CAAC;AAChF,oBAAM,aAAa,cAAc,QAAQ,CAAC;AAC1C,+BAAiB,KAAK,CAAC,YAAY,aAAa,aAAa,CAAC;AAAA,YAChE;AAAA,UACF,OAAO;AACL,+BAAmB,CAAC,CAAC,gBAAgB,CAAC;AAAA,UACxC;AACA,mBAAS,KAAK,gBAAgB;AAAA,QAChC,SAAS,WAAW,QAAQ,IAAI;AAAA,MAClC;AACA,YAAM,WAAW;AAEjB,aAAO,KAAK,KAAK;AACjB,YAAM,KAAK,KAAK;AAAA,IAClB;AAEA;AACA,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,MAAM;AAEtB,SAAO;AACT;AAEO,SAAS,sBAAsB,QAAkC;AACtE,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,uBAAuB,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAAA,EACrE;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,uBACP,QACA,OACA,QACA,OASQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM;AAAA,IACJ,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,MAAM,CAAC,IAAI,WAAW;AACxB,gBAAY,QAAQ,MAAM,CAAC,GAAG,SAAS;AACvC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,WAAW,QAAQ,GAAG;AACpB,WAAO,MAAM,KAAK;AAAA,EACpB;AAEA,QAAM,CAAC,IAAI,cAAc,QAAQ,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAEnD,QAAM,UACH,MAAM,WAAW,IAAI,IAAS,MAAM,WAAW,IAAS,MAAM,UAAU,IAAS;AACpF,gBAAc,QAAQ,QAAQ,CAAC;AAE/B,MAAI,MAAM,WAAW,GAAG;AACtB,UAAM,EAAE,GAAG,cAAc,GAAG,YAAY,IAAI;AAC5C,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,aAAa,MAAM,CAAC,CAAC;AAAA,EACxD;AAEA,MAAI,UAAU;AACZ,UAAM,EAAE,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,IAAI,MAAM;AAC9D,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AACX,YAAM,CAAC,IAAI;AAAA,IACb,WAAW,aAAa,MAAM,CAAC,GAAG;AAChC,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,UAAU,MAAM,CAAC,CAAC;AACnD,UAAM,CAAC,IAAI,cAAc,QAAQ,YAAY,MAAM,CAAC,CAAC;AAAA,EACvD;AAEA,MAAI,UAAU;AACZ,eAAW,WAAW,UAAU;AAC9B,UAAI,QAAQ,SAAS,EAAG,eAAc,QAAQ,CAAC,QAAQ,QAAQ,CAAC;AAChE,YAAM,aAAa,QAAQ,CAAC,EAAE,CAAC;AAC/B,oBAAc,QAAQ,YAAY,CAAC;AACnC,UAAI,mBAAmB;AACvB,UAAI,qBAAqB;AACzB,eAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,cAAM,WAAW,QAAQ,CAAC;AAC1B,2BAAmB,cAAc,QAAQ,SAAS,CAAC,GAAI,gBAAgB;AACvE,6BAAqB,cAAc,QAAQ,SAAS,CAAC,GAAI,kBAAkB;AAC3E,sBAAc,QAAQ,SAAS,CAAC,GAAI,CAAC;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,uBAAuB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC7D;AAEA,MAAI,MAAM,CAAC,IAAI,SAAS;AACtB,gBAAY,QAAQ,MAAM,CAAC,GAAG,OAAO;AACrC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,OAAO;AACL,WAAO,MAAM,KAAK;AAAA,EACpB;AACA,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AAEpD,SAAO;AACT;AAEA,SAAS,YAAY,QAAsB,UAAkB,MAAc;AACzE,KAAG;AACD,WAAO,MAAM,SAAS;AAAA,EACxB,SAAS,EAAE,WAAW;AACxB;;;ACtUO,SAAS,OAAO,UAAqC;AAC1D,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,QAAQ;AACxC,QAAM,UAA6B,CAAC;AACpC,MAAI,YAAY;AAChB,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,UAAM,OAAsB,CAAC;AAC7B,QAAI,SAAS;AACb,QAAI,UAAU;AACd,gBAAY;AAEZ,WAAO,OAAO,MAAM,MAAM;AACxB,UAAI;AAEJ,kBAAY,cAAc,QAAQ,SAAS;AAC3C,UAAI,YAAY,QAAS,UAAS;AAClC,gBAAU;AAEV,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAe,cAAc,QAAQ,YAAY;AACjD,qBAAa,cAAc,QAAQ,UAAU;AAC7C,uBAAe,cAAc,QAAQ,YAAY;AAEjD,YAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAa,cAAc,QAAQ,UAAU;AAC7C,gBAAM,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU;AAAA,QACtE,OAAO;AACL,gBAAM,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,QAC1D;AAAA,MACF,OAAO;AACL,cAAM,CAAC,SAAS;AAAA,MAClB;AAEA,WAAK,KAAK,GAAG;AACb,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,OAAQ,MAAK,IAAI;AACtB,YAAQ,KAAK,IAAI;AACjB,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,OAAO;AAEvB,SAAO;AACT;AAEA,SAAS,KAAK,MAA0B;AACtC,OAAK,KAAK,cAAc;AAC1B;AAEA,SAAS,eAAe,GAAqB,GAA6B;AACxE,SAAO,EAAE,CAAC,IAAI,EAAE,CAAC;AACnB;AAIO,SAAS,OAAO,SAA8C;AACnE,QAAM,SAAS,IAAI,aAAa;AAChC,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,QAAI,IAAI,EAAG,QAAO,MAAM,SAAS;AACjC,QAAI,KAAK,WAAW,EAAG;AAEvB,QAAI,YAAY;AAEhB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,UAAU,KAAK,CAAC;AACtB,UAAI,IAAI,EAAG,QAAO,MAAM,KAAK;AAE7B,kBAAY,cAAc,QAAQ,QAAQ,CAAC,GAAG,SAAS;AAEvD,UAAI,QAAQ,WAAW,EAAG;AAC1B,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAC7D,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AACzD,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAE7D,UAAI,QAAQ,WAAW,EAAG;AAC1B,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO,OAAO,MAAM;AACtB;", - "names": [] -} 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 2d8e459..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js +++ /dev/null @@ -1,464 +0,0 @@ -(function (global, factory) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - factory(module); - module.exports = def(module); - } else if (typeof define === 'function' && define.amd) { - define(['module'], function(mod) { - factory.apply(this, arguments); - mod.exports = def(mod); - }); - } else { - const mod = { exports: {} }; - factory(mod); - global = typeof globalThis !== 'undefined' ? globalThis : global || self; - global.sourcemapCodec = def(mod); - } - function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } -})(this, (function (module) { -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// src/sourcemap-codec.ts -var sourcemap_codec_exports = {}; -__export(sourcemap_codec_exports, { - decode: () => decode, - decodeGeneratedRanges: () => decodeGeneratedRanges, - decodeOriginalScopes: () => decodeOriginalScopes, - encode: () => encode, - encodeGeneratedRanges: () => encodeGeneratedRanges, - encodeOriginalScopes: () => encodeOriginalScopes -}); -module.exports = __toCommonJS(sourcemap_codec_exports); - -// src/vlq.ts -var comma = ",".charCodeAt(0); -var semicolon = ";".charCodeAt(0); -var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -var intToChar = new Uint8Array(64); -var charToInt = new Uint8Array(128); -for (let i = 0; i < chars.length; i++) { - const c = chars.charCodeAt(i); - intToChar[i] = c; - charToInt[c] = i; -} -function decodeInteger(reader, relative) { - let value = 0; - let shift = 0; - let integer = 0; - do { - const c = reader.next(); - integer = charToInt[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - const shouldNegate = value & 1; - value >>>= 1; - if (shouldNegate) { - value = -2147483648 | -value; - } - return relative + value; -} -function encodeInteger(builder, num, relative) { - let delta = num - relative; - delta = delta < 0 ? -delta << 1 | 1 : delta << 1; - do { - let clamped = delta & 31; - delta >>>= 5; - if (delta > 0) clamped |= 32; - builder.write(intToChar[clamped]); - } while (delta > 0); - return num; -} -function hasMoreVlq(reader, max) { - if (reader.pos >= max) return false; - return reader.peek() !== comma; -} - -// src/strings.ts -var bufLength = 1024 * 16; -var 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; - } -}; -var StringWriter = class { - constructor() { - this.pos = 0; - this.out = ""; - this.buffer = new Uint8Array(bufLength); - } - write(v) { - const { buffer } = this; - buffer[this.pos++] = v; - if (this.pos === bufLength) { - this.out += td.decode(buffer); - this.pos = 0; - } - } - flush() { - const { buffer, out, pos } = this; - return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; - } -}; -var StringReader = class { - constructor(buffer) { - this.pos = 0; - this.buffer = buffer; - } - next() { - return this.buffer.charCodeAt(this.pos++); - } - peek() { - return this.buffer.charCodeAt(this.pos); - } - indexOf(char) { - const { buffer, pos } = this; - const idx = buffer.indexOf(char, pos); - return idx === -1 ? buffer.length : idx; - } -}; - -// src/scopes.ts -var EMPTY = []; -function decodeOriginalScopes(input) { - const { length } = input; - const reader = new StringReader(input); - const scopes = []; - const stack = []; - let line = 0; - for (; reader.pos < length; reader.pos++) { - line = decodeInteger(reader, line); - const column = decodeInteger(reader, 0); - if (!hasMoreVlq(reader, length)) { - const last = stack.pop(); - last[2] = line; - last[3] = column; - continue; - } - const kind = decodeInteger(reader, 0); - const fields = decodeInteger(reader, 0); - const hasName = fields & 1; - const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind]; - let vars = EMPTY; - if (hasMoreVlq(reader, length)) { - vars = []; - do { - const varsIndex = decodeInteger(reader, 0); - vars.push(varsIndex); - } while (hasMoreVlq(reader, length)); - } - scope.vars = vars; - scopes.push(scope); - stack.push(scope); - } - return scopes; -} -function encodeOriginalScopes(scopes) { - const writer = new StringWriter(); - for (let i = 0; i < scopes.length; ) { - i = _encodeOriginalScopes(scopes, i, writer, [0]); - } - return writer.flush(); -} -function _encodeOriginalScopes(scopes, index, writer, state) { - const scope = scopes[index]; - const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; - if (index > 0) writer.write(comma); - state[0] = encodeInteger(writer, startLine, state[0]); - encodeInteger(writer, startColumn, 0); - encodeInteger(writer, kind, 0); - const fields = scope.length === 6 ? 1 : 0; - encodeInteger(writer, fields, 0); - if (scope.length === 6) encodeInteger(writer, scope[5], 0); - for (const v of vars) { - encodeInteger(writer, v, 0); - } - for (index++; index < scopes.length; ) { - const next = scopes[index]; - const { 0: l, 1: c } = next; - if (l > endLine || l === endLine && c >= endColumn) { - break; - } - index = _encodeOriginalScopes(scopes, index, writer, state); - } - writer.write(comma); - state[0] = encodeInteger(writer, endLine, state[0]); - encodeInteger(writer, endColumn, 0); - return index; -} -function decodeGeneratedRanges(input) { - const { length } = input; - const reader = new StringReader(input); - const ranges = []; - const stack = []; - let genLine = 0; - let definitionSourcesIndex = 0; - let definitionScopeIndex = 0; - let callsiteSourcesIndex = 0; - let callsiteLine = 0; - let callsiteColumn = 0; - let bindingLine = 0; - let bindingColumn = 0; - do { - const semi = reader.indexOf(";"); - let genColumn = 0; - for (; reader.pos < semi; reader.pos++) { - genColumn = decodeInteger(reader, genColumn); - if (!hasMoreVlq(reader, semi)) { - const last = stack.pop(); - last[2] = genLine; - last[3] = genColumn; - continue; - } - const fields = decodeInteger(reader, 0); - const hasDefinition = fields & 1; - const hasCallsite = fields & 2; - const hasScope = fields & 4; - let callsite = null; - let bindings = EMPTY; - let range; - if (hasDefinition) { - const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); - definitionScopeIndex = decodeInteger( - reader, - definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0 - ); - definitionSourcesIndex = defSourcesIndex; - range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex]; - } else { - range = [genLine, genColumn, 0, 0]; - } - range.isScope = !!hasScope; - if (hasCallsite) { - const prevCsi = callsiteSourcesIndex; - const prevLine = callsiteLine; - callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); - const sameSource = prevCsi === callsiteSourcesIndex; - callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); - callsiteColumn = decodeInteger( - reader, - sameSource && prevLine === callsiteLine ? callsiteColumn : 0 - ); - callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; - } - range.callsite = callsite; - if (hasMoreVlq(reader, semi)) { - bindings = []; - do { - bindingLine = genLine; - bindingColumn = genColumn; - const expressionsCount = decodeInteger(reader, 0); - let expressionRanges; - if (expressionsCount < -1) { - expressionRanges = [[decodeInteger(reader, 0)]]; - for (let i = -1; i > expressionsCount; i--) { - const prevBl = bindingLine; - bindingLine = decodeInteger(reader, bindingLine); - bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); - const expression = decodeInteger(reader, 0); - expressionRanges.push([expression, bindingLine, bindingColumn]); - } - } else { - expressionRanges = [[expressionsCount]]; - } - bindings.push(expressionRanges); - } while (hasMoreVlq(reader, semi)); - } - range.bindings = bindings; - ranges.push(range); - stack.push(range); - } - genLine++; - reader.pos = semi + 1; - } while (reader.pos < length); - return ranges; -} -function encodeGeneratedRanges(ranges) { - if (ranges.length === 0) return ""; - const writer = new StringWriter(); - for (let i = 0; i < ranges.length; ) { - i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); - } - return writer.flush(); -} -function _encodeGeneratedRanges(ranges, index, writer, state) { - const range = ranges[index]; - const { - 0: startLine, - 1: startColumn, - 2: endLine, - 3: endColumn, - isScope, - callsite, - bindings - } = range; - if (state[0] < startLine) { - catchupLine(writer, state[0], startLine); - state[0] = startLine; - state[1] = 0; - } else if (index > 0) { - writer.write(comma); - } - state[1] = encodeInteger(writer, range[1], state[1]); - const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0); - encodeInteger(writer, fields, 0); - if (range.length === 6) { - const { 4: sourcesIndex, 5: scopesIndex } = range; - if (sourcesIndex !== state[2]) { - state[3] = 0; - } - state[2] = encodeInteger(writer, sourcesIndex, state[2]); - state[3] = encodeInteger(writer, scopesIndex, state[3]); - } - if (callsite) { - const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite; - if (sourcesIndex !== state[4]) { - state[5] = 0; - state[6] = 0; - } else if (callLine !== state[5]) { - state[6] = 0; - } - state[4] = encodeInteger(writer, sourcesIndex, state[4]); - state[5] = encodeInteger(writer, callLine, state[5]); - state[6] = encodeInteger(writer, callColumn, state[6]); - } - if (bindings) { - for (const binding of bindings) { - if (binding.length > 1) encodeInteger(writer, -binding.length, 0); - const expression = binding[0][0]; - encodeInteger(writer, expression, 0); - let bindingStartLine = startLine; - let bindingStartColumn = startColumn; - for (let i = 1; i < binding.length; i++) { - const expRange = binding[i]; - bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine); - bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn); - encodeInteger(writer, expRange[0], 0); - } - } - } - for (index++; index < ranges.length; ) { - const next = ranges[index]; - const { 0: l, 1: c } = next; - if (l > endLine || l === endLine && c >= endColumn) { - break; - } - index = _encodeGeneratedRanges(ranges, index, writer, state); - } - if (state[0] < endLine) { - catchupLine(writer, state[0], endLine); - state[0] = endLine; - state[1] = 0; - } else { - writer.write(comma); - } - state[1] = encodeInteger(writer, endColumn, state[1]); - return index; -} -function catchupLine(writer, lastLine, line) { - do { - writer.write(semicolon); - } while (++lastLine < line); -} - -// src/sourcemap-codec.ts -function decode(mappings) { - const { length } = mappings; - const reader = new StringReader(mappings); - const decoded = []; - let genColumn = 0; - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - do { - const semi = reader.indexOf(";"); - const line = []; - let sorted = true; - let lastCol = 0; - genColumn = 0; - while (reader.pos < semi) { - let seg; - genColumn = decodeInteger(reader, genColumn); - if (genColumn < lastCol) sorted = false; - lastCol = genColumn; - if (hasMoreVlq(reader, semi)) { - sourcesIndex = decodeInteger(reader, sourcesIndex); - sourceLine = decodeInteger(reader, sourceLine); - sourceColumn = decodeInteger(reader, sourceColumn); - if (hasMoreVlq(reader, semi)) { - namesIndex = decodeInteger(reader, namesIndex); - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; - } else { - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; - } - } else { - seg = [genColumn]; - } - line.push(seg); - reader.pos++; - } - if (!sorted) sort(line); - decoded.push(line); - reader.pos = semi + 1; - } while (reader.pos <= length); - return decoded; -} -function sort(line) { - line.sort(sortComparator); -} -function sortComparator(a, b) { - return a[0] - b[0]; -} -function encode(decoded) { - const writer = new StringWriter(); - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) writer.write(semicolon); - if (line.length === 0) continue; - let genColumn = 0; - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - if (j > 0) writer.write(comma); - genColumn = encodeInteger(writer, segment[0], genColumn); - if (segment.length === 1) continue; - sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); - sourceLine = encodeInteger(writer, segment[2], sourceLine); - sourceColumn = encodeInteger(writer, segment[3], sourceColumn); - if (segment.length === 4) continue; - namesIndex = encodeInteger(writer, segment[4], namesIndex); - } - } - return writer.flush(); -} -})); -//# 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 abc18d2..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["../src/sourcemap-codec.ts", "../src/vlq.ts", "../src/strings.ts", "../src/scopes.ts"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAM,QAAQ,IAAI,WAAW,CAAC;AAC9B,IAAM,YAAY,IAAI,WAAW,CAAC;AAEzC,IAAM,QAAQ;AACd,IAAM,YAAY,IAAI,WAAW,EAAE;AACnC,IAAM,YAAY,IAAI,WAAW,GAAG;AAEpC,SAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAM,IAAI,MAAM,WAAW,CAAC;AAC5B,YAAU,CAAC,IAAI;AACf,YAAU,CAAC,IAAI;AACjB;AAEO,SAAS,cAAc,QAAsB,UAA0B;AAC5E,MAAI,QAAQ;AACZ,MAAI,QAAQ;AACZ,MAAI,UAAU;AAEd,KAAG;AACD,UAAM,IAAI,OAAO,KAAK;AACtB,cAAU,UAAU,CAAC;AACrB,cAAU,UAAU,OAAO;AAC3B,aAAS;AAAA,EACX,SAAS,UAAU;AAEnB,QAAM,eAAe,QAAQ;AAC7B,aAAW;AAEX,MAAI,cAAc;AAChB,YAAQ,cAAc,CAAC;AAAA,EACzB;AAEA,SAAO,WAAW;AACpB;AAEO,SAAS,cAAc,SAAuB,KAAa,UAA0B;AAC1F,MAAI,QAAQ,MAAM;AAElB,UAAQ,QAAQ,IAAK,CAAC,SAAS,IAAK,IAAI,SAAS;AACjD,KAAG;AACD,QAAI,UAAU,QAAQ;AACtB,eAAW;AACX,QAAI,QAAQ,EAAG,YAAW;AAC1B,YAAQ,MAAM,UAAU,OAAO,CAAC;AAAA,EAClC,SAAS,QAAQ;AAEjB,SAAO;AACT;AAEO,SAAS,WAAW,QAAsB,KAAa;AAC5D,MAAI,OAAO,OAAO,IAAK,QAAO;AAC9B,SAAO,OAAO,KAAK,MAAM;AAC3B;;;ACtDA,IAAM,YAAY,OAAO;AAGzB,IAAM,KACJ,OAAO,gBAAgB,cACH,oBAAI,YAAY,IAChC,OAAO,WAAW,cAChB;AAAA,EACE,OAAO,KAAyB;AAC9B,UAAM,MAAM,OAAO,KAAK,IAAI,QAAQ,IAAI,YAAY,IAAI,UAAU;AAClE,WAAO,IAAI,SAAS;AAAA,EACtB;AACF,IACA;AAAA,EACE,OAAO,KAAyB;AAC9B,QAAI,MAAM;AACV,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,aAAO,OAAO,aAAa,IAAI,CAAC,CAAC;AAAA,IACnC;AACA,WAAO;AAAA,EACT;AACF;AAED,IAAM,eAAN,MAAmB;AAAA,EAAnB;AACL,eAAM;AACN,SAAQ,MAAM;AACd,SAAQ,SAAS,IAAI,WAAW,SAAS;AAAA;AAAA,EAEzC,MAAM,GAAiB;AACrB,UAAM,EAAE,OAAO,IAAI;AACnB,WAAO,KAAK,KAAK,IAAI;AACrB,QAAI,KAAK,QAAQ,WAAW;AAC1B,WAAK,OAAO,GAAG,OAAO,MAAM;AAC5B,WAAK,MAAM;AAAA,IACb;AAAA,EACF;AAAA,EAEA,QAAgB;AACd,UAAM,EAAE,QAAQ,KAAK,IAAI,IAAI;AAC7B,WAAO,MAAM,IAAI,MAAM,GAAG,OAAO,OAAO,SAAS,GAAG,GAAG,CAAC,IAAI;AAAA,EAC9D;AACF;AAEO,IAAM,eAAN,MAAmB;AAAA,EAIxB,YAAY,QAAgB;AAH5B,eAAM;AAIJ,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,KAAK;AAAA,EAC1C;AAAA,EAEA,OAAe;AACb,WAAO,KAAK,OAAO,WAAW,KAAK,GAAG;AAAA,EACxC;AAAA,EAEA,QAAQ,MAAsB;AAC5B,UAAM,EAAE,QAAQ,IAAI,IAAI;AACxB,UAAM,MAAM,OAAO,QAAQ,MAAM,GAAG;AACpC,WAAO,QAAQ,KAAK,OAAO,SAAS;AAAA,EACtC;AACF;;;AC7DA,IAAM,QAAe,CAAC;AA+Bf,SAAS,qBAAqB,OAAgC;AACnE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA0B,CAAC;AACjC,QAAM,QAAyB,CAAC;AAChC,MAAI,OAAO;AAEX,SAAO,OAAO,MAAM,QAAQ,OAAO,OAAO;AACxC,WAAO,cAAc,QAAQ,IAAI;AACjC,UAAM,SAAS,cAAc,QAAQ,CAAC;AAEtC,QAAI,CAAC,WAAW,QAAQ,MAAM,GAAG;AAC/B,YAAM,OAAO,MAAM,IAAI;AACvB,WAAK,CAAC,IAAI;AACV,WAAK,CAAC,IAAI;AACV;AAAA,IACF;AAEA,UAAM,OAAO,cAAc,QAAQ,CAAC;AACpC,UAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,UAAM,UAAU,SAAS;AAEzB,UAAM,QACJ,UAAU,CAAC,MAAM,QAAQ,GAAG,GAAG,MAAM,cAAc,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,QAAQ,GAAG,GAAG,IAAI;AAG5F,QAAI,OAAc;AAClB,QAAI,WAAW,QAAQ,MAAM,GAAG;AAC9B,aAAO,CAAC;AACR,SAAG;AACD,cAAM,YAAY,cAAc,QAAQ,CAAC;AACzC,aAAK,KAAK,SAAS;AAAA,MACrB,SAAS,WAAW,QAAQ,MAAM;AAAA,IACpC;AACA,UAAM,OAAO;AAEb,WAAO,KAAK,KAAK;AACjB,UAAM,KAAK,KAAK;AAAA,EAClB;AAEA,SAAO;AACT;AAEO,SAAS,qBAAqB,QAAiC;AACpE,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,sBAAsB,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC;AAAA,EAClD;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,sBACP,QACA,OACA,QACA,OAGQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM,EAAE,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,KAAK,IAAI;AAElF,MAAI,QAAQ,EAAG,QAAO,MAAM,KAAK;AAEjC,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AACpD,gBAAc,QAAQ,aAAa,CAAC;AACpC,gBAAc,QAAQ,MAAM,CAAC;AAE7B,QAAM,SAAS,MAAM,WAAW,IAAI,IAAS;AAC7C,gBAAc,QAAQ,QAAQ,CAAC;AAC/B,MAAI,MAAM,WAAW,EAAG,eAAc,QAAQ,MAAM,CAAC,GAAG,CAAC;AAEzD,aAAW,KAAK,MAAM;AACpB,kBAAc,QAAQ,GAAG,CAAC;AAAA,EAC5B;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,sBAAsB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC5D;AAEA,SAAO,MAAM,KAAK;AAClB,QAAM,CAAC,IAAI,cAAc,QAAQ,SAAS,MAAM,CAAC,CAAC;AAClD,gBAAc,QAAQ,WAAW,CAAC;AAElC,SAAO;AACT;AAEO,SAAS,sBAAsB,OAAiC;AACrE,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,KAAK;AACrC,QAAM,SAA2B,CAAC;AAClC,QAAM,QAA0B,CAAC;AAEjC,MAAI,UAAU;AACd,MAAI,yBAAyB;AAC7B,MAAI,uBAAuB;AAC3B,MAAI,uBAAuB;AAC3B,MAAI,eAAe;AACnB,MAAI,iBAAiB;AACrB,MAAI,cAAc;AAClB,MAAI,gBAAgB;AAEpB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,QAAI,YAAY;AAEhB,WAAO,OAAO,MAAM,MAAM,OAAO,OAAO;AACtC,kBAAY,cAAc,QAAQ,SAAS;AAE3C,UAAI,CAAC,WAAW,QAAQ,IAAI,GAAG;AAC7B,cAAM,OAAO,MAAM,IAAI;AACvB,aAAK,CAAC,IAAI;AACV,aAAK,CAAC,IAAI;AACV;AAAA,MACF;AAEA,YAAM,SAAS,cAAc,QAAQ,CAAC;AACtC,YAAM,gBAAgB,SAAS;AAC/B,YAAM,cAAc,SAAS;AAC7B,YAAM,WAAW,SAAS;AAE1B,UAAI,WAA4B;AAChC,UAAI,WAAsB;AAC1B,UAAI;AACJ,UAAI,eAAe;AACjB,cAAM,kBAAkB,cAAc,QAAQ,sBAAsB;AACpE,+BAAuB;AAAA,UACrB;AAAA,UACA,2BAA2B,kBAAkB,uBAAuB;AAAA,QACtE;AAEA,iCAAyB;AACzB,gBAAQ,CAAC,SAAS,WAAW,GAAG,GAAG,iBAAiB,oBAAoB;AAAA,MAC1E,OAAO;AACL,gBAAQ,CAAC,SAAS,WAAW,GAAG,CAAC;AAAA,MACnC;AAEA,YAAM,UAAU,CAAC,CAAC;AAElB,UAAI,aAAa;AACf,cAAM,UAAU;AAChB,cAAM,WAAW;AACjB,+BAAuB,cAAc,QAAQ,oBAAoB;AACjE,cAAM,aAAa,YAAY;AAC/B,uBAAe,cAAc,QAAQ,aAAa,eAAe,CAAC;AAClE,yBAAiB;AAAA,UACf;AAAA,UACA,cAAc,aAAa,eAAe,iBAAiB;AAAA,QAC7D;AAEA,mBAAW,CAAC,sBAAsB,cAAc,cAAc;AAAA,MAChE;AACA,YAAM,WAAW;AAEjB,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,mBAAW,CAAC;AACZ,WAAG;AACD,wBAAc;AACd,0BAAgB;AAChB,gBAAM,mBAAmB,cAAc,QAAQ,CAAC;AAChD,cAAI;AACJ,cAAI,mBAAmB,IAAI;AACzB,+BAAmB,CAAC,CAAC,cAAc,QAAQ,CAAC,CAAC,CAAC;AAC9C,qBAAS,IAAI,IAAI,IAAI,kBAAkB,KAAK;AAC1C,oBAAM,SAAS;AACf,4BAAc,cAAc,QAAQ,WAAW;AAC/C,8BAAgB,cAAc,QAAQ,gBAAgB,SAAS,gBAAgB,CAAC;AAChF,oBAAM,aAAa,cAAc,QAAQ,CAAC;AAC1C,+BAAiB,KAAK,CAAC,YAAY,aAAa,aAAa,CAAC;AAAA,YAChE;AAAA,UACF,OAAO;AACL,+BAAmB,CAAC,CAAC,gBAAgB,CAAC;AAAA,UACxC;AACA,mBAAS,KAAK,gBAAgB;AAAA,QAChC,SAAS,WAAW,QAAQ,IAAI;AAAA,MAClC;AACA,YAAM,WAAW;AAEjB,aAAO,KAAK,KAAK;AACjB,YAAM,KAAK,KAAK;AAAA,IAClB;AAEA;AACA,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,MAAM;AAEtB,SAAO;AACT;AAEO,SAAS,sBAAsB,QAAkC;AACtE,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,SAAS,IAAI,aAAa;AAEhC,WAAS,IAAI,GAAG,IAAI,OAAO,UAAU;AACnC,QAAI,uBAAuB,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAAA,EACrE;AAEA,SAAO,OAAO,MAAM;AACtB;AAEA,SAAS,uBACP,QACA,OACA,QACA,OASQ;AACR,QAAM,QAAQ,OAAO,KAAK;AAC1B,QAAM;AAAA,IACJ,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,MAAI,MAAM,CAAC,IAAI,WAAW;AACxB,gBAAY,QAAQ,MAAM,CAAC,GAAG,SAAS;AACvC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,WAAW,QAAQ,GAAG;AACpB,WAAO,MAAM,KAAK;AAAA,EACpB;AAEA,QAAM,CAAC,IAAI,cAAc,QAAQ,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC;AAEnD,QAAM,UACH,MAAM,WAAW,IAAI,IAAS,MAAM,WAAW,IAAS,MAAM,UAAU,IAAS;AACpF,gBAAc,QAAQ,QAAQ,CAAC;AAE/B,MAAI,MAAM,WAAW,GAAG;AACtB,UAAM,EAAE,GAAG,cAAc,GAAG,YAAY,IAAI;AAC5C,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,aAAa,MAAM,CAAC,CAAC;AAAA,EACxD;AAEA,MAAI,UAAU;AACZ,UAAM,EAAE,GAAG,cAAc,GAAG,UAAU,GAAG,WAAW,IAAI,MAAM;AAC9D,QAAI,iBAAiB,MAAM,CAAC,GAAG;AAC7B,YAAM,CAAC,IAAI;AACX,YAAM,CAAC,IAAI;AAAA,IACb,WAAW,aAAa,MAAM,CAAC,GAAG;AAChC,YAAM,CAAC,IAAI;AAAA,IACb;AACA,UAAM,CAAC,IAAI,cAAc,QAAQ,cAAc,MAAM,CAAC,CAAC;AACvD,UAAM,CAAC,IAAI,cAAc,QAAQ,UAAU,MAAM,CAAC,CAAC;AACnD,UAAM,CAAC,IAAI,cAAc,QAAQ,YAAY,MAAM,CAAC,CAAC;AAAA,EACvD;AAEA,MAAI,UAAU;AACZ,eAAW,WAAW,UAAU;AAC9B,UAAI,QAAQ,SAAS,EAAG,eAAc,QAAQ,CAAC,QAAQ,QAAQ,CAAC;AAChE,YAAM,aAAa,QAAQ,CAAC,EAAE,CAAC;AAC/B,oBAAc,QAAQ,YAAY,CAAC;AACnC,UAAI,mBAAmB;AACvB,UAAI,qBAAqB;AACzB,eAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,cAAM,WAAW,QAAQ,CAAC;AAC1B,2BAAmB,cAAc,QAAQ,SAAS,CAAC,GAAI,gBAAgB;AACvE,6BAAqB,cAAc,QAAQ,SAAS,CAAC,GAAI,kBAAkB;AAC3E,sBAAc,QAAQ,SAAS,CAAC,GAAI,CAAC;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AAEA,OAAK,SAAS,QAAQ,OAAO,UAAU;AACrC,UAAM,OAAO,OAAO,KAAK;AACzB,UAAM,EAAE,GAAG,GAAG,GAAG,EAAE,IAAI;AACvB,QAAI,IAAI,WAAY,MAAM,WAAW,KAAK,WAAY;AACpD;AAAA,IACF;AACA,YAAQ,uBAAuB,QAAQ,OAAO,QAAQ,KAAK;AAAA,EAC7D;AAEA,MAAI,MAAM,CAAC,IAAI,SAAS;AACtB,gBAAY,QAAQ,MAAM,CAAC,GAAG,OAAO;AACrC,UAAM,CAAC,IAAI;AACX,UAAM,CAAC,IAAI;AAAA,EACb,OAAO;AACL,WAAO,MAAM,KAAK;AAAA,EACpB;AACA,QAAM,CAAC,IAAI,cAAc,QAAQ,WAAW,MAAM,CAAC,CAAC;AAEpD,SAAO;AACT;AAEA,SAAS,YAAY,QAAsB,UAAkB,MAAc;AACzE,KAAG;AACD,WAAO,MAAM,SAAS;AAAA,EACxB,SAAS,EAAE,WAAW;AACxB;;;AHtUO,SAAS,OAAO,UAAqC;AAC1D,QAAM,EAAE,OAAO,IAAI;AACnB,QAAM,SAAS,IAAI,aAAa,QAAQ;AACxC,QAAM,UAA6B,CAAC;AACpC,MAAI,YAAY;AAChB,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,KAAG;AACD,UAAM,OAAO,OAAO,QAAQ,GAAG;AAC/B,UAAM,OAAsB,CAAC;AAC7B,QAAI,SAAS;AACb,QAAI,UAAU;AACd,gBAAY;AAEZ,WAAO,OAAO,MAAM,MAAM;AACxB,UAAI;AAEJ,kBAAY,cAAc,QAAQ,SAAS;AAC3C,UAAI,YAAY,QAAS,UAAS;AAClC,gBAAU;AAEV,UAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAe,cAAc,QAAQ,YAAY;AACjD,qBAAa,cAAc,QAAQ,UAAU;AAC7C,uBAAe,cAAc,QAAQ,YAAY;AAEjD,YAAI,WAAW,QAAQ,IAAI,GAAG;AAC5B,uBAAa,cAAc,QAAQ,UAAU;AAC7C,gBAAM,CAAC,WAAW,cAAc,YAAY,cAAc,UAAU;AAAA,QACtE,OAAO;AACL,gBAAM,CAAC,WAAW,cAAc,YAAY,YAAY;AAAA,QAC1D;AAAA,MACF,OAAO;AACL,cAAM,CAAC,SAAS;AAAA,MAClB;AAEA,WAAK,KAAK,GAAG;AACb,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,OAAQ,MAAK,IAAI;AACtB,YAAQ,KAAK,IAAI;AACjB,WAAO,MAAM,OAAO;AAAA,EACtB,SAAS,OAAO,OAAO;AAEvB,SAAO;AACT;AAEA,SAAS,KAAK,MAA0B;AACtC,OAAK,KAAK,cAAc;AAC1B;AAEA,SAAS,eAAe,GAAqB,GAA6B;AACxE,SAAO,EAAE,CAAC,IAAI,EAAE,CAAC;AACnB;AAIO,SAAS,OAAO,SAA8C;AACnE,QAAM,SAAS,IAAI,aAAa;AAChC,MAAI,eAAe;AACnB,MAAI,aAAa;AACjB,MAAI,eAAe;AACnB,MAAI,aAAa;AAEjB,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,QAAI,IAAI,EAAG,QAAO,MAAM,SAAS;AACjC,QAAI,KAAK,WAAW,EAAG;AAEvB,QAAI,YAAY;AAEhB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,UAAU,KAAK,CAAC;AACtB,UAAI,IAAI,EAAG,QAAO,MAAM,KAAK;AAE7B,kBAAY,cAAc,QAAQ,QAAQ,CAAC,GAAG,SAAS;AAEvD,UAAI,QAAQ,WAAW,EAAG;AAC1B,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAC7D,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AACzD,qBAAe,cAAc,QAAQ,QAAQ,CAAC,GAAG,YAAY;AAE7D,UAAI,QAAQ,WAAW,EAAG;AAC1B,mBAAa,cAAc,QAAQ,QAAQ,CAAC,GAAG,UAAU;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO,OAAO,MAAM;AACtB;", - "names": [] -} diff --git a/node_modules/@jridgewell/sourcemap-codec/package.json b/node_modules/@jridgewell/sourcemap-codec/package.json deleted file mode 100644 index da55137..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@jridgewell/sourcemap-codec", - "version": "1.5.5", - "description": "Encode/decode sourcemap mappings", - "keywords": [ - "sourcemap", - "vlq" - ], - "main": "dist/sourcemap-codec.umd.js", - "module": "dist/sourcemap-codec.mjs", - "types": "types/sourcemap-codec.d.cts", - "files": [ - "dist", - "src", - "types" - ], - "exports": { - ".": [ - { - "import": { - "types": "./types/sourcemap-codec.d.mts", - "default": "./dist/sourcemap-codec.mjs" - }, - "default": { - "types": "./types/sourcemap-codec.d.cts", - "default": "./dist/sourcemap-codec.umd.js" - } - }, - "./dist/sourcemap-codec.umd.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "benchmark": "run-s build:code benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node --expose-gc benchmark/index.js", - "build": "run-s -n build:code build:types", - "build:code": "node ../../esbuild.mjs sourcemap-codec.ts", - "build:types": "run-s build:types:force build:types:emit build:types:mts", - "build:types:force": "rimraf tsconfig.build.tsbuildinfo", - "build:types:emit": "tsc --project tsconfig.build.json", - "build:types:mts": "node ../../mts-types.mjs", - "clean": "run-s -n clean:code clean:types", - "clean:code": "tsc --build --clean tsconfig.build.json", - "clean:types": "rimraf dist types", - "test": "run-s -n test:types test:only test:format", - "test:format": "prettier --check '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:types": "eslint '{src,test}/**/*.ts'", - "lint": "run-s -n lint:types lint:format", - "lint:format": "npm run test:format -- --write", - "lint:types": "npm run test:types -- --fix", - "prepublishOnly": "npm run-s -n build test" - }, - "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/sourcemap-codec", - "repository": { - "type": "git", - "url": "git+https://github.com/jridgewell/sourcemaps.git", - "directory": "packages/sourcemap-codec" - }, - "author": "Justin Ridgewell ", - "license": "MIT" -} diff --git a/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts b/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts deleted file mode 100644 index d194c2f..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/src/scopes.ts +++ /dev/null @@ -1,345 +0,0 @@ -import { StringReader, StringWriter } from './strings'; -import { comma, decodeInteger, encodeInteger, hasMoreVlq, semicolon } from './vlq'; - -const EMPTY: any[] = []; - -type Line = number; -type Column = number; -type Kind = number; -type Name = number; -type Var = number; -type SourcesIndex = number; -type ScopesIndex = number; - -type Mix = (A & O) | (B & O); - -export type OriginalScope = Mix< - [Line, Column, Line, Column, Kind], - [Line, Column, Line, Column, Kind, Name], - { vars: Var[] } ->; - -export type GeneratedRange = Mix< - [Line, Column, Line, Column], - [Line, Column, Line, Column, SourcesIndex, ScopesIndex], - { - callsite: CallSite | null; - bindings: Binding[]; - isScope: boolean; - } ->; -export type CallSite = [SourcesIndex, Line, Column]; -type Binding = BindingExpressionRange[]; -export type BindingExpressionRange = [Name] | [Name, Line, Column]; - -export function decodeOriginalScopes(input: string): OriginalScope[] { - const { length } = input; - const reader = new StringReader(input); - const scopes: OriginalScope[] = []; - const stack: OriginalScope[] = []; - let line = 0; - - for (; reader.pos < length; reader.pos++) { - line = decodeInteger(reader, line); - const column = decodeInteger(reader, 0); - - if (!hasMoreVlq(reader, length)) { - const last = stack.pop()!; - last[2] = line; - last[3] = column; - continue; - } - - const kind = decodeInteger(reader, 0); - const fields = decodeInteger(reader, 0); - const hasName = fields & 0b0001; - - const scope: OriginalScope = ( - hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind] - ) as OriginalScope; - - let vars: Var[] = EMPTY; - if (hasMoreVlq(reader, length)) { - vars = []; - do { - const varsIndex = decodeInteger(reader, 0); - vars.push(varsIndex); - } while (hasMoreVlq(reader, length)); - } - scope.vars = vars; - - scopes.push(scope); - stack.push(scope); - } - - return scopes; -} - -export function encodeOriginalScopes(scopes: OriginalScope[]): string { - const writer = new StringWriter(); - - for (let i = 0; i < scopes.length; ) { - i = _encodeOriginalScopes(scopes, i, writer, [0]); - } - - return writer.flush(); -} - -function _encodeOriginalScopes( - scopes: OriginalScope[], - index: number, - writer: StringWriter, - state: [ - number, // GenColumn - ], -): number { - const scope = scopes[index]; - const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope; - - if (index > 0) writer.write(comma); - - state[0] = encodeInteger(writer, startLine, state[0]); - encodeInteger(writer, startColumn, 0); - encodeInteger(writer, kind, 0); - - const fields = scope.length === 6 ? 0b0001 : 0; - encodeInteger(writer, fields, 0); - if (scope.length === 6) encodeInteger(writer, scope[5], 0); - - for (const v of vars) { - encodeInteger(writer, v, 0); - } - - for (index++; index < scopes.length; ) { - const next = scopes[index]; - const { 0: l, 1: c } = next; - if (l > endLine || (l === endLine && c >= endColumn)) { - break; - } - index = _encodeOriginalScopes(scopes, index, writer, state); - } - - writer.write(comma); - state[0] = encodeInteger(writer, endLine, state[0]); - encodeInteger(writer, endColumn, 0); - - return index; -} - -export function decodeGeneratedRanges(input: string): GeneratedRange[] { - const { length } = input; - const reader = new StringReader(input); - const ranges: GeneratedRange[] = []; - const stack: GeneratedRange[] = []; - - let genLine = 0; - let definitionSourcesIndex = 0; - let definitionScopeIndex = 0; - let callsiteSourcesIndex = 0; - let callsiteLine = 0; - let callsiteColumn = 0; - let bindingLine = 0; - let bindingColumn = 0; - - do { - const semi = reader.indexOf(';'); - let genColumn = 0; - - for (; reader.pos < semi; reader.pos++) { - genColumn = decodeInteger(reader, genColumn); - - if (!hasMoreVlq(reader, semi)) { - const last = stack.pop()!; - last[2] = genLine; - last[3] = genColumn; - continue; - } - - const fields = decodeInteger(reader, 0); - const hasDefinition = fields & 0b0001; - const hasCallsite = fields & 0b0010; - const hasScope = fields & 0b0100; - - let callsite: CallSite | null = null; - let bindings: Binding[] = EMPTY; - let range: GeneratedRange; - if (hasDefinition) { - const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex); - definitionScopeIndex = decodeInteger( - reader, - definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0, - ); - - definitionSourcesIndex = defSourcesIndex; - range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex] as GeneratedRange; - } else { - range = [genLine, genColumn, 0, 0] as GeneratedRange; - } - - range.isScope = !!hasScope; - - if (hasCallsite) { - const prevCsi = callsiteSourcesIndex; - const prevLine = callsiteLine; - callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex); - const sameSource = prevCsi === callsiteSourcesIndex; - callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0); - callsiteColumn = decodeInteger( - reader, - sameSource && prevLine === callsiteLine ? callsiteColumn : 0, - ); - - callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn]; - } - range.callsite = callsite; - - if (hasMoreVlq(reader, semi)) { - bindings = []; - do { - bindingLine = genLine; - bindingColumn = genColumn; - const expressionsCount = decodeInteger(reader, 0); - let expressionRanges: BindingExpressionRange[]; - if (expressionsCount < -1) { - expressionRanges = [[decodeInteger(reader, 0)]]; - for (let i = -1; i > expressionsCount; i--) { - const prevBl = bindingLine; - bindingLine = decodeInteger(reader, bindingLine); - bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0); - const expression = decodeInteger(reader, 0); - expressionRanges.push([expression, bindingLine, bindingColumn]); - } - } else { - expressionRanges = [[expressionsCount]]; - } - bindings.push(expressionRanges); - } while (hasMoreVlq(reader, semi)); - } - range.bindings = bindings; - - ranges.push(range); - stack.push(range); - } - - genLine++; - reader.pos = semi + 1; - } while (reader.pos < length); - - return ranges; -} - -export function encodeGeneratedRanges(ranges: GeneratedRange[]): string { - if (ranges.length === 0) return ''; - - const writer = new StringWriter(); - - for (let i = 0; i < ranges.length; ) { - i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]); - } - - return writer.flush(); -} - -function _encodeGeneratedRanges( - ranges: GeneratedRange[], - index: number, - writer: StringWriter, - state: [ - number, // GenLine - number, // GenColumn - number, // DefSourcesIndex - number, // DefScopesIndex - number, // CallSourcesIndex - number, // CallLine - number, // CallColumn - ], -): number { - const range = ranges[index]; - const { - 0: startLine, - 1: startColumn, - 2: endLine, - 3: endColumn, - isScope, - callsite, - bindings, - } = range; - - if (state[0] < startLine) { - catchupLine(writer, state[0], startLine); - state[0] = startLine; - state[1] = 0; - } else if (index > 0) { - writer.write(comma); - } - - state[1] = encodeInteger(writer, range[1], state[1]); - - const fields = - (range.length === 6 ? 0b0001 : 0) | (callsite ? 0b0010 : 0) | (isScope ? 0b0100 : 0); - encodeInteger(writer, fields, 0); - - if (range.length === 6) { - const { 4: sourcesIndex, 5: scopesIndex } = range; - if (sourcesIndex !== state[2]) { - state[3] = 0; - } - state[2] = encodeInteger(writer, sourcesIndex, state[2]); - state[3] = encodeInteger(writer, scopesIndex, state[3]); - } - - if (callsite) { - const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite!; - if (sourcesIndex !== state[4]) { - state[5] = 0; - state[6] = 0; - } else if (callLine !== state[5]) { - state[6] = 0; - } - state[4] = encodeInteger(writer, sourcesIndex, state[4]); - state[5] = encodeInteger(writer, callLine, state[5]); - state[6] = encodeInteger(writer, callColumn, state[6]); - } - - if (bindings) { - for (const binding of bindings) { - if (binding.length > 1) encodeInteger(writer, -binding.length, 0); - const expression = binding[0][0]; - encodeInteger(writer, expression, 0); - let bindingStartLine = startLine; - let bindingStartColumn = startColumn; - for (let i = 1; i < binding.length; i++) { - const expRange = binding[i]; - bindingStartLine = encodeInteger(writer, expRange[1]!, bindingStartLine); - bindingStartColumn = encodeInteger(writer, expRange[2]!, bindingStartColumn); - encodeInteger(writer, expRange[0]!, 0); - } - } - } - - for (index++; index < ranges.length; ) { - const next = ranges[index]; - const { 0: l, 1: c } = next; - if (l > endLine || (l === endLine && c >= endColumn)) { - break; - } - index = _encodeGeneratedRanges(ranges, index, writer, state); - } - - if (state[0] < endLine) { - catchupLine(writer, state[0], endLine); - state[0] = endLine; - state[1] = 0; - } else { - writer.write(comma); - } - state[1] = encodeInteger(writer, endColumn, state[1]); - - return index; -} - -function catchupLine(writer: StringWriter, lastLine: number, line: number) { - do { - writer.write(semicolon); - } while (++lastLine < line); -} diff --git a/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts b/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts deleted file mode 100644 index a81f894..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/src/sourcemap-codec.ts +++ /dev/null @@ -1,111 +0,0 @@ -import { comma, decodeInteger, encodeInteger, hasMoreVlq, semicolon } from './vlq'; -import { StringWriter, StringReader } from './strings'; - -export { - decodeOriginalScopes, - encodeOriginalScopes, - decodeGeneratedRanges, - encodeGeneratedRanges, -} from './scopes'; -export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes'; - -export type SourceMapSegment = - | [number] - | [number, number, number, number] - | [number, number, number, number, number]; -export type SourceMapLine = SourceMapSegment[]; -export type SourceMapMappings = SourceMapLine[]; - -export function decode(mappings: string): SourceMapMappings { - const { length } = mappings; - const reader = new StringReader(mappings); - const decoded: SourceMapMappings = []; - let genColumn = 0; - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - - do { - const semi = reader.indexOf(';'); - const line: SourceMapLine = []; - let sorted = true; - let lastCol = 0; - genColumn = 0; - - while (reader.pos < semi) { - let seg: SourceMapSegment; - - genColumn = decodeInteger(reader, genColumn); - if (genColumn < lastCol) sorted = false; - lastCol = genColumn; - - if (hasMoreVlq(reader, semi)) { - sourcesIndex = decodeInteger(reader, sourcesIndex); - sourceLine = decodeInteger(reader, sourceLine); - sourceColumn = decodeInteger(reader, sourceColumn); - - if (hasMoreVlq(reader, semi)) { - namesIndex = decodeInteger(reader, namesIndex); - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]; - } else { - seg = [genColumn, sourcesIndex, sourceLine, sourceColumn]; - } - } else { - seg = [genColumn]; - } - - line.push(seg); - reader.pos++; - } - - if (!sorted) sort(line); - decoded.push(line); - reader.pos = semi + 1; - } while (reader.pos <= length); - - return decoded; -} - -function sort(line: SourceMapSegment[]) { - line.sort(sortComparator); -} - -function sortComparator(a: SourceMapSegment, b: SourceMapSegment): number { - return a[0] - b[0]; -} - -export function encode(decoded: SourceMapMappings): string; -export function encode(decoded: Readonly): string; -export function encode(decoded: Readonly): string { - const writer = new StringWriter(); - let sourcesIndex = 0; - let sourceLine = 0; - let sourceColumn = 0; - let namesIndex = 0; - - for (let i = 0; i < decoded.length; i++) { - const line = decoded[i]; - if (i > 0) writer.write(semicolon); - if (line.length === 0) continue; - - let genColumn = 0; - - for (let j = 0; j < line.length; j++) { - const segment = line[j]; - if (j > 0) writer.write(comma); - - genColumn = encodeInteger(writer, segment[0], genColumn); - - if (segment.length === 1) continue; - sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex); - sourceLine = encodeInteger(writer, segment[2], sourceLine); - sourceColumn = encodeInteger(writer, segment[3], sourceColumn); - - if (segment.length === 4) continue; - namesIndex = encodeInteger(writer, segment[4], namesIndex); - } - } - - return writer.flush(); -} diff --git a/node_modules/@jridgewell/sourcemap-codec/src/strings.ts b/node_modules/@jridgewell/sourcemap-codec/src/strings.ts deleted file mode 100644 index d161965..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/src/strings.ts +++ /dev/null @@ -1,65 +0,0 @@ -const bufLength = 1024 * 16; - -// Provide a fallback for older environments. -const td = - typeof TextDecoder !== 'undefined' - ? /* #__PURE__ */ new TextDecoder() - : typeof Buffer !== 'undefined' - ? { - decode(buf: Uint8Array): string { - const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength); - return out.toString(); - }, - } - : { - decode(buf: Uint8Array): string { - let out = ''; - for (let i = 0; i < buf.length; i++) { - out += String.fromCharCode(buf[i]); - } - return out; - }, - }; - -export class StringWriter { - pos = 0; - private out = ''; - private buffer = new Uint8Array(bufLength); - - write(v: number): void { - const { buffer } = this; - buffer[this.pos++] = v; - if (this.pos === bufLength) { - this.out += td.decode(buffer); - this.pos = 0; - } - } - - flush(): string { - const { buffer, out, pos } = this; - return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out; - } -} - -export class StringReader { - pos = 0; - declare private buffer: string; - - constructor(buffer: string) { - this.buffer = buffer; - } - - next(): number { - return this.buffer.charCodeAt(this.pos++); - } - - peek(): number { - return this.buffer.charCodeAt(this.pos); - } - - indexOf(char: string): number { - const { buffer, pos } = this; - const idx = buffer.indexOf(char, pos); - return idx === -1 ? buffer.length : idx; - } -} diff --git a/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts b/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts deleted file mode 100644 index a42c681..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/src/vlq.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { StringReader, StringWriter } from './strings'; - -export const comma = ','.charCodeAt(0); -export 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; -} - -export function decodeInteger(reader: StringReader, relative: number): number { - let value = 0; - let shift = 0; - let integer = 0; - - do { - const c = reader.next(); - integer = charToInt[c]; - value |= (integer & 31) << shift; - shift += 5; - } while (integer & 32); - - const shouldNegate = value & 1; - value >>>= 1; - - if (shouldNegate) { - value = -0x80000000 | -value; - } - - return relative + value; -} - -export function encodeInteger(builder: StringWriter, num: number, relative: number): number { - let delta = num - relative; - - delta = delta < 0 ? (-delta << 1) | 1 : delta << 1; - do { - let clamped = delta & 0b011111; - delta >>>= 5; - if (delta > 0) clamped |= 0b100000; - builder.write(intToChar[clamped]); - } while (delta > 0); - - return num; -} - -export function hasMoreVlq(reader: StringReader, max: number) { - if (reader.pos >= max) return false; - return reader.peek() !== comma; -} diff --git a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts deleted file mode 100644 index c583c75..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts +++ /dev/null @@ -1,50 +0,0 @@ -type Line = number; -type Column = number; -type Kind = number; -type Name = number; -type Var = number; -type SourcesIndex = number; -type ScopesIndex = number; -type Mix = (A & O) | (B & O); -export type OriginalScope = Mix<[ - Line, - Column, - Line, - Column, - Kind -], [ - Line, - Column, - Line, - Column, - Kind, - Name -], { - vars: Var[]; -}>; -export type GeneratedRange = Mix<[ - Line, - Column, - Line, - Column -], [ - Line, - Column, - Line, - Column, - SourcesIndex, - ScopesIndex -], { - callsite: CallSite | null; - bindings: Binding[]; - isScope: boolean; -}>; -export type CallSite = [SourcesIndex, Line, Column]; -type Binding = BindingExpressionRange[]; -export type BindingExpressionRange = [Name] | [Name, Line, Column]; -export declare function decodeOriginalScopes(input: string): OriginalScope[]; -export declare function encodeOriginalScopes(scopes: OriginalScope[]): string; -export declare function decodeGeneratedRanges(input: string): GeneratedRange[]; -export declare function encodeGeneratedRanges(ranges: GeneratedRange[]): string; -export {}; -//# sourceMappingURL=scopes.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map deleted file mode 100644 index 630e647..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAKA,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,MAAM,GAAG,MAAM,CAAC;AACrB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,GAAG,CAC7B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;CAAC,EAClC;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,IAAI;CAAC,EACxC;IAAE,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,GAAG,CAC9B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;CAAC,EAC5B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,YAAY;IAAE,WAAW;CAAC,EACvD;IACE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CACF,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,KAAK,OAAO,GAAG,sBAAsB,EAAE,CAAC;AACxC,MAAM,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAyCnE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAQpE;AA2CD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAoGrE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAUtE"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts deleted file mode 100644 index c583c75..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts +++ /dev/null @@ -1,50 +0,0 @@ -type Line = number; -type Column = number; -type Kind = number; -type Name = number; -type Var = number; -type SourcesIndex = number; -type ScopesIndex = number; -type Mix = (A & O) | (B & O); -export type OriginalScope = Mix<[ - Line, - Column, - Line, - Column, - Kind -], [ - Line, - Column, - Line, - Column, - Kind, - Name -], { - vars: Var[]; -}>; -export type GeneratedRange = Mix<[ - Line, - Column, - Line, - Column -], [ - Line, - Column, - Line, - Column, - SourcesIndex, - ScopesIndex -], { - callsite: CallSite | null; - bindings: Binding[]; - isScope: boolean; -}>; -export type CallSite = [SourcesIndex, Line, Column]; -type Binding = BindingExpressionRange[]; -export type BindingExpressionRange = [Name] | [Name, Line, Column]; -export declare function decodeOriginalScopes(input: string): OriginalScope[]; -export declare function encodeOriginalScopes(scopes: OriginalScope[]): string; -export declare function decodeGeneratedRanges(input: string): GeneratedRange[]; -export declare function encodeGeneratedRanges(ranges: GeneratedRange[]): string; -export {}; -//# sourceMappingURL=scopes.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map b/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map deleted file mode 100644 index 630e647..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"scopes.d.ts","sourceRoot":"","sources":["../src/scopes.ts"],"names":[],"mappings":"AAKA,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,MAAM,GAAG,MAAM,CAAC;AACrB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,IAAI,GAAG,MAAM,CAAC;AACnB,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,WAAW,GAAG,MAAM,CAAC;AAE1B,KAAK,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,GAAG,CAC7B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;CAAC,EAClC;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,IAAI;CAAC,EACxC;IAAE,IAAI,EAAE,GAAG,EAAE,CAAA;CAAE,CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,GAAG,CAC9B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;CAAC,EAC5B;IAAC,IAAI;IAAE,MAAM;IAAE,IAAI;IAAE,MAAM;IAAE,YAAY;IAAE,WAAW;CAAC,EACvD;IACE,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB,CACF,CAAC;AACF,MAAM,MAAM,QAAQ,GAAG,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,KAAK,OAAO,GAAG,sBAAsB,EAAE,CAAC;AACxC,MAAM,MAAM,sBAAsB,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;AAEnE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,EAAE,CAyCnE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,MAAM,CAQpE;AA2CD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,EAAE,CAoGrE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAUtE"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts deleted file mode 100644 index 5f35e22..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -export { decodeOriginalScopes, encodeOriginalScopes, decodeGeneratedRanges, encodeGeneratedRanges, } from './scopes.cts'; -export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes.cts'; -export type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; -export type SourceMapLine = SourceMapSegment[]; -export type SourceMapMappings = SourceMapLine[]; -export declare function decode(mappings: string): SourceMapMappings; -export declare function encode(decoded: SourceMapMappings): string; -export declare function encode(decoded: Readonly): string; -//# sourceMappingURL=sourcemap-codec.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map deleted file mode 100644 index 7123d52..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-codec.d.ts","sourceRoot":"","sources":["../src/sourcemap-codec.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GACxB,CAAC,MAAM,CAAC,GACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AAEhD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAiD1D;AAUD,wBAAgB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC3D,wBAAgB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts deleted file mode 100644 index 199fb9f..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts +++ /dev/null @@ -1,9 +0,0 @@ -export { decodeOriginalScopes, encodeOriginalScopes, decodeGeneratedRanges, encodeGeneratedRanges, } from './scopes.mts'; -export type { OriginalScope, GeneratedRange, CallSite, BindingExpressionRange } from './scopes.mts'; -export type SourceMapSegment = [number] | [number, number, number, number] | [number, number, number, number, number]; -export type SourceMapLine = SourceMapSegment[]; -export type SourceMapMappings = SourceMapLine[]; -export declare function decode(mappings: string): SourceMapMappings; -export declare function encode(decoded: SourceMapMappings): string; -export declare function encode(decoded: Readonly): string; -//# sourceMappingURL=sourcemap-codec.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map b/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map deleted file mode 100644 index 7123d52..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-codec.d.ts","sourceRoot":"","sources":["../src/sourcemap-codec.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,UAAU,CAAC;AAClB,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEhG,MAAM,MAAM,gBAAgB,GACxB,CAAC,MAAM,CAAC,GACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7C,MAAM,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,aAAa,EAAE,CAAC;AAEhD,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAiD1D;AAUD,wBAAgB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC3D,wBAAgB,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts deleted file mode 100644 index 62faceb..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts +++ /dev/null @@ -1,16 +0,0 @@ -export declare class StringWriter { - pos: number; - private out; - private buffer; - write(v: number): void; - flush(): string; -} -export declare class StringReader { - pos: number; - private buffer; - constructor(buffer: string); - next(): number; - peek(): number; - indexOf(char: string): number; -} -//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map deleted file mode 100644 index d3602da..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAuBA,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,MAAM,CAA6B;IAE3C,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAStB,KAAK,IAAI,MAAM;CAIhB;AAED,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,QAAgB,MAAM,CAAS;gBAEnB,MAAM,EAAE,MAAM;IAI1B,IAAI,IAAI,MAAM;IAId,IAAI,IAAI,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAK9B"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts deleted file mode 100644 index 62faceb..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts +++ /dev/null @@ -1,16 +0,0 @@ -export declare class StringWriter { - pos: number; - private out; - private buffer; - write(v: number): void; - flush(): string; -} -export declare class StringReader { - pos: number; - private buffer; - constructor(buffer: string); - next(): number; - peek(): number; - indexOf(char: string): number; -} -//# sourceMappingURL=strings.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map b/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map deleted file mode 100644 index d3602da..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../src/strings.ts"],"names":[],"mappings":"AAuBA,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,MAAM,CAA6B;IAE3C,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAStB,KAAK,IAAI,MAAM;CAIhB;AAED,qBAAa,YAAY;IACvB,GAAG,SAAK;IACR,QAAgB,MAAM,CAAS;gBAEnB,MAAM,EAAE,MAAM;IAI1B,IAAI,IAAI,MAAM;IAId,IAAI,IAAI,MAAM;IAId,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;CAK9B"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts deleted file mode 100644 index dbd6602..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts +++ /dev/null @@ -1,7 +0,0 @@ -import type { StringReader, StringWriter } from './strings.cts'; -export declare const comma: number; -export declare const semicolon: number; -export declare function decodeInteger(reader: StringReader, relative: number): number; -export declare function encodeInteger(builder: StringWriter, num: number, relative: number): number; -export declare function hasMoreVlq(reader: StringReader, max: number): boolean; -//# sourceMappingURL=vlq.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map deleted file mode 100644 index 6fdc356..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vlq.d.ts","sourceRoot":"","sources":["../src/vlq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,eAAO,MAAM,KAAK,QAAoB,CAAC;AACvC,eAAO,MAAM,SAAS,QAAoB,CAAC;AAY3C,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoB5E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY1F;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,WAG3D"} \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts deleted file mode 100644 index 2c739bc..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts +++ /dev/null @@ -1,7 +0,0 @@ -import type { StringReader, StringWriter } from './strings.mts'; -export declare const comma: number; -export declare const semicolon: number; -export declare function decodeInteger(reader: StringReader, relative: number): number; -export declare function encodeInteger(builder: StringWriter, num: number, relative: number): number; -export declare function hasMoreVlq(reader: StringReader, max: number): boolean; -//# sourceMappingURL=vlq.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map b/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map deleted file mode 100644 index 6fdc356..0000000 --- a/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"vlq.d.ts","sourceRoot":"","sources":["../src/vlq.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAE5D,eAAO,MAAM,KAAK,QAAoB,CAAC;AACvC,eAAO,MAAM,SAAS,QAAoB,CAAC;AAY3C,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAoB5E;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAY1F;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,WAG3D"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/LICENSE b/node_modules/@jridgewell/trace-mapping/LICENSE deleted file mode 100644 index 1f6ce94..0000000 --- a/node_modules/@jridgewell/trace-mapping/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright 2024 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 9fc0ed0..0000000 --- a/node_modules/@jridgewell/trace-mapping/README.md +++ /dev/null @@ -1,348 +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, - isIgnored, -} from '@jridgewell/trace-mapping'; - -const tracer = new TraceMap({ - version: 3, - sources: ['input.js'], - sourcesContent: ['content of input.js'], - names: ['foo'], - mappings: 'KAyCIA', - ignoreList: [], -}); - -// 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, -}); - -const ignored = isIgnored(tracer, 'input.js'); -assert.equal(ignored, false); -``` - -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 v20.10.0 - -amp.js.map - 45120 segments - -Memory Usage: -trace-mapping decoded 414164 bytes -trace-mapping encoded 6274352 bytes -source-map-js 10968904 bytes -source-map-0.6.1 17587160 bytes -source-map-0.8.0 8812155 bytes -Chrome dev tools 8672912 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 205 ops/sec ±0.19% (88 runs sampled) -trace-mapping: encoded JSON input x 405 ops/sec ±1.47% (88 runs sampled) -trace-mapping: decoded Object input x 4,645 ops/sec ±0.15% (98 runs sampled) -trace-mapping: encoded Object input x 458 ops/sec ±1.63% (91 runs sampled) -source-map-js: encoded Object input x 75.48 ops/sec ±1.64% (67 runs sampled) -source-map-0.6.1: encoded Object input x 39.37 ops/sec ±1.44% (53 runs sampled) -Chrome dev tools: encoded Object input x 150 ops/sec ±1.76% (79 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed (random): -trace-mapping: decoded originalPositionFor x 44,946 ops/sec ±0.16% (99 runs sampled) -trace-mapping: encoded originalPositionFor x 37,995 ops/sec ±1.81% (89 runs sampled) -source-map-js: encoded originalPositionFor x 9,230 ops/sec ±1.36% (93 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 8,057 ops/sec ±0.84% (96 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 28,198 ops/sec ±1.12% (91 runs sampled) -Chrome dev tools: encoded originalPositionFor x 46,276 ops/sec ±1.35% (95 runs sampled) -Fastest is Chrome dev tools: encoded originalPositionFor - -Trace speed (ascending): -trace-mapping: decoded originalPositionFor x 204,406 ops/sec ±0.19% (97 runs sampled) -trace-mapping: encoded originalPositionFor x 196,695 ops/sec ±0.24% (99 runs sampled) -source-map-js: encoded originalPositionFor x 11,948 ops/sec ±0.94% (99 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 10,730 ops/sec ±0.36% (100 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 51,427 ops/sec ±0.21% (98 runs sampled) -Chrome dev tools: encoded originalPositionFor x 162,615 ops/sec ±0.18% (98 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -babel.min.js.map - 347793 segments - -Memory Usage: -trace-mapping decoded 18504 bytes -trace-mapping encoded 35428008 bytes -source-map-js 51676808 bytes -source-map-0.6.1 63367136 bytes -source-map-0.8.0 43158400 bytes -Chrome dev tools 50721552 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 17.82 ops/sec ±6.35% (35 runs sampled) -trace-mapping: encoded JSON input x 31.57 ops/sec ±7.50% (43 runs sampled) -trace-mapping: decoded Object input x 867 ops/sec ±0.74% (94 runs sampled) -trace-mapping: encoded Object input x 33.83 ops/sec ±7.66% (46 runs sampled) -source-map-js: encoded Object input x 6.58 ops/sec ±3.31% (20 runs sampled) -source-map-0.6.1: encoded Object input x 4.23 ops/sec ±3.43% (15 runs sampled) -Chrome dev tools: encoded Object input x 22.14 ops/sec ±3.79% (41 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed (random): -trace-mapping: decoded originalPositionFor x 78,234 ops/sec ±1.48% (29 runs sampled) -trace-mapping: encoded originalPositionFor x 60,761 ops/sec ±1.35% (21 runs sampled) -source-map-js: encoded originalPositionFor x 51,448 ops/sec ±2.17% (89 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 47,221 ops/sec ±1.99% (15 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 84,002 ops/sec ±1.45% (27 runs sampled) -Chrome dev tools: encoded originalPositionFor x 106,457 ops/sec ±1.38% (37 runs sampled) -Fastest is Chrome dev tools: encoded originalPositionFor - -Trace speed (ascending): -trace-mapping: decoded originalPositionFor x 930,943 ops/sec ±0.25% (99 runs sampled) -trace-mapping: encoded originalPositionFor x 843,545 ops/sec ±0.34% (97 runs sampled) -source-map-js: encoded originalPositionFor x 114,510 ops/sec ±1.37% (36 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 87,412 ops/sec ±0.72% (92 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 197,709 ops/sec ±0.89% (59 runs sampled) -Chrome dev tools: encoded originalPositionFor x 688,983 ops/sec ±0.33% (98 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -preact.js.map - 1992 segments - -Memory Usage: -trace-mapping decoded 33136 bytes -trace-mapping encoded 254240 bytes -source-map-js 837488 bytes -source-map-0.6.1 961928 bytes -source-map-0.8.0 54384 bytes -Chrome dev tools 709680 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 3,709 ops/sec ±0.13% (99 runs sampled) -trace-mapping: encoded JSON input x 6,447 ops/sec ±0.22% (101 runs sampled) -trace-mapping: decoded Object input x 83,062 ops/sec ±0.23% (100 runs sampled) -trace-mapping: encoded Object input x 14,980 ops/sec ±0.28% (100 runs sampled) -source-map-js: encoded Object input x 2,544 ops/sec ±0.16% (99 runs sampled) -source-map-0.6.1: encoded Object input x 1,221 ops/sec ±0.37% (97 runs sampled) -Chrome dev tools: encoded Object input x 4,241 ops/sec ±0.39% (93 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed (random): -trace-mapping: decoded originalPositionFor x 91,028 ops/sec ±0.14% (94 runs sampled) -trace-mapping: encoded originalPositionFor x 84,348 ops/sec ±0.26% (98 runs sampled) -source-map-js: encoded originalPositionFor x 26,998 ops/sec ±0.23% (98 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 18,049 ops/sec ±0.26% (100 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 41,916 ops/sec ±0.28% (98 runs sampled) -Chrome dev tools: encoded originalPositionFor x 88,616 ops/sec ±0.14% (98 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - -Trace speed (ascending): -trace-mapping: decoded originalPositionFor x 319,960 ops/sec ±0.16% (100 runs sampled) -trace-mapping: encoded originalPositionFor x 302,153 ops/sec ±0.18% (100 runs sampled) -source-map-js: encoded originalPositionFor x 35,574 ops/sec ±0.19% (100 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 19,943 ops/sec ±0.12% (101 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 54,648 ops/sec ±0.20% (99 runs sampled) -Chrome dev tools: encoded originalPositionFor x 278,319 ops/sec ±0.17% (102 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -react.js.map - 5726 segments - -Memory Usage: -trace-mapping decoded 10872 bytes -trace-mapping encoded 681512 bytes -source-map-js 2563944 bytes -source-map-0.6.1 2150864 bytes -source-map-0.8.0 88680 bytes -Chrome dev tools 1149576 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 1,887 ops/sec ±0.28% (99 runs sampled) -trace-mapping: encoded JSON input x 4,749 ops/sec ±0.48% (97 runs sampled) -trace-mapping: decoded Object input x 74,236 ops/sec ±0.11% (99 runs sampled) -trace-mapping: encoded Object input x 5,752 ops/sec ±0.38% (100 runs sampled) -source-map-js: encoded Object input x 806 ops/sec ±0.19% (97 runs sampled) -source-map-0.6.1: encoded Object input x 418 ops/sec ±0.33% (94 runs sampled) -Chrome dev tools: encoded Object input x 1,524 ops/sec ±0.57% (92 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed (random): -trace-mapping: decoded originalPositionFor x 620,201 ops/sec ±0.33% (96 runs sampled) -trace-mapping: encoded originalPositionFor x 579,548 ops/sec ±0.35% (97 runs sampled) -source-map-js: encoded originalPositionFor x 230,983 ops/sec ±0.62% (54 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 158,145 ops/sec ±0.80% (46 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 343,801 ops/sec ±0.55% (96 runs sampled) -Chrome dev tools: encoded originalPositionFor x 659,649 ops/sec ±0.49% (98 runs sampled) -Fastest is Chrome dev tools: encoded originalPositionFor - -Trace speed (ascending): -trace-mapping: decoded originalPositionFor x 2,368,079 ops/sec ±0.32% (98 runs sampled) -trace-mapping: encoded originalPositionFor x 2,134,039 ops/sec ±2.72% (87 runs sampled) -source-map-js: encoded originalPositionFor x 290,120 ops/sec ±2.49% (82 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 187,613 ops/sec ±0.86% (49 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 479,569 ops/sec ±0.65% (96 runs sampled) -Chrome dev tools: encoded originalPositionFor x 2,048,414 ops/sec ±0.24% (98 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - - -*** - - -vscode.map - 2141001 segments - -Memory Usage: -trace-mapping decoded 5206584 bytes -trace-mapping encoded 208370336 bytes -source-map-js 278493008 bytes -source-map-0.6.1 391564048 bytes -source-map-0.8.0 257508787 bytes -Chrome dev tools 291053000 bytes -Smallest memory usage is trace-mapping decoded - -Init speed: -trace-mapping: decoded JSON input x 1.63 ops/sec ±33.88% (9 runs sampled) -trace-mapping: encoded JSON input x 3.29 ops/sec ±36.13% (13 runs sampled) -trace-mapping: decoded Object input x 103 ops/sec ±0.93% (77 runs sampled) -trace-mapping: encoded Object input x 5.42 ops/sec ±28.54% (19 runs sampled) -source-map-js: encoded Object input x 1.07 ops/sec ±13.84% (7 runs sampled) -source-map-0.6.1: encoded Object input x 0.60 ops/sec ±2.43% (6 runs sampled) -Chrome dev tools: encoded Object input x 2.61 ops/sec ±22.00% (11 runs sampled) -Fastest is trace-mapping: decoded Object input - -Trace speed (random): -trace-mapping: decoded originalPositionFor x 257,019 ops/sec ±0.97% (93 runs sampled) -trace-mapping: encoded originalPositionFor x 179,163 ops/sec ±0.83% (92 runs sampled) -source-map-js: encoded originalPositionFor x 73,337 ops/sec ±1.35% (87 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 38,797 ops/sec ±1.66% (88 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 107,758 ops/sec ±1.94% (45 runs sampled) -Chrome dev tools: encoded originalPositionFor x 188,550 ops/sec ±1.85% (79 runs sampled) -Fastest is trace-mapping: decoded originalPositionFor - -Trace speed (ascending): -trace-mapping: decoded originalPositionFor x 447,621 ops/sec ±3.64% (94 runs sampled) -trace-mapping: encoded originalPositionFor x 323,698 ops/sec ±5.20% (88 runs sampled) -source-map-js: encoded originalPositionFor x 78,387 ops/sec ±1.69% (89 runs sampled) -source-map-0.6.1: encoded originalPositionFor x 41,016 ops/sec ±3.01% (25 runs sampled) -source-map-0.8.0: encoded originalPositionFor x 124,204 ops/sec ±0.90% (92 runs sampled) -Chrome dev tools: encoded originalPositionFor x 230,087 ops/sec ±2.61% (93 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 73a95c7..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs +++ /dev/null @@ -1,493 +0,0 @@ -// src/trace-mapping.ts -import { encode, decode } from "@jridgewell/sourcemap-codec"; - -// src/resolve.ts -import resolveUri from "@jridgewell/resolve-uri"; - -// src/strip-filename.ts -function stripFilename(path) { - if (!path) return ""; - const index = path.lastIndexOf("/"); - return path.slice(0, index + 1); -} - -// src/resolve.ts -function resolver(mapUrl, sourceRoot) { - const from = stripFilename(mapUrl); - const prefix = sourceRoot ? sourceRoot + "/" : ""; - return (source) => resolveUri(prefix + (source || ""), from); -} - -// src/sourcemap-segment.ts -var COLUMN = 0; -var SOURCES_INDEX = 1; -var SOURCE_LINE = 2; -var SOURCE_COLUMN = 3; -var NAMES_INDEX = 4; -var REV_GENERATED_LINE = 1; -var REV_GENERATED_COLUMN = 2; - -// src/sort.ts -function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) return mappings; - 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]; -} - -// src/by-source.ts -function buildBySources(decoded, memos) { - const sources = memos.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]; - if (seg.length === 1) continue; - const sourceIndex2 = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - const source = sources[sourceIndex2]; - const segs = source[sourceLine] || (source[sourceLine] = []); - segs.push([sourceColumn, i, seg[COLUMN]]); - } - } - for (let i = 0; i < sources.length; i++) { - const source = sources[i]; - for (let j = 0; j < source.length; j++) { - const line = source[j]; - if (line) line.sort(sortComparator); - } - } - return sources; -} - -// src/binary-search.ts -var found = false; -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 - }; -} -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) { - low = lastIndex === -1 ? 0 : lastIndex; - } else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return state.lastIndex = binarySearch(haystack, needle, low, high); -} - -// src/types.ts -function parse(map) { - return typeof map === "string" ? JSON.parse(map) : map; -} - -// src/flatten-map.ts -var FlattenMap = function(map, mapUrl) { - const parsed = parse(map); - if (!("sections" in parsed)) { - return new TraceMap(parsed, mapUrl); - } - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - const ignoreList = []; - recurse( - parsed, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - 0, - 0, - Infinity, - Infinity - ); - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - ignoreList - }; - return presortedDecodedMap(joined); -}; -function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, 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, - ignoreList, - lineOffset + offset.line, - columnOffset + offset.column, - sl, - sc - ); - } -} -function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { - const parsed = parse(input); - if ("sections" in parsed) return recurse(...arguments); - const map = new TraceMap(parsed, mapUrl); - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = 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); - if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); - for (let i = 0; i < decoded.length; i++) { - const lineI = lineOffset + i; - if (lineI > stopLine) return; - const out = getLine(mappings, lineI); - 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 (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]; -} - -// src/trace-mapping.ts -var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; -var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; -var LEAST_UPPER_BOUND = -1; -var GREATEST_LOWER_BOUND = 1; -var TraceMap = class { - constructor(map, mapUrl) { - const isString = typeof map === "string"; - if (!isString && map._decodedMemo) return map; - const parsed = parse(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; - this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; - const resolve = resolver(mapUrl, sourceRoot); - this.resolvedSources = sources.map(resolve); - const { mappings } = parsed; - if (typeof mappings === "string") { - this._encoded = mappings; - this._decoded = void 0; - } else if (Array.isArray(mappings)) { - this._encoded = void 0; - this._decoded = maybeSort(mappings, isString); - } else if (parsed.sections) { - throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); - } else { - throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); - } - this._decodedMemo = memoizedState(); - this._bySources = void 0; - this._bySourceMemos = void 0; - } -}; -function cast(map) { - return map; -} -function encodedMappings(map) { - var _a, _b; - return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = encode(cast(map)._decoded); -} -function decodedMappings(map) { - var _a; - return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded)); -} -function traceSegment(map, line, column) { - const decoded = decodedMappings(map); - if (line >= decoded.length) return null; - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(map)._decodedMemo, - line, - column, - GREATEST_LOWER_BOUND - ); - return index === -1 ? null : segments[index]; -} -function originalPositionFor(map, needle) { - let { line, column, bias } = needle; - line--; - if (line < 0) throw new Error(LINE_GTR_ZERO); - if (column < 0) throw new Error(COL_GTR_EQ_ZERO); - const decoded = decodedMappings(map); - if (line >= decoded.length) return OMapping(null, null, null, null); - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(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 - ); -} -function generatedPositionFor(map, needle) { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); -} -function allGeneratedPositionsFor(map, needle) { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); -} -function 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 - }); - } - } -} -function sourceIndex(map, source) { - const { sources, resolvedSources } = map; - let index = sources.indexOf(source); - if (index === -1) index = resolvedSources.indexOf(source); - return index; -} -function sourceContentFor(map, source) { - const { sourcesContent } = map; - if (sourcesContent == null) return null; - const index = sourceIndex(map, source); - return index === -1 ? null : sourcesContent[index]; -} -function isIgnored(map, source) { - const { ignoreList } = map; - if (ignoreList == null) return false; - const index = sourceIndex(map, source); - return index === -1 ? false : ignoreList.includes(index); -} -function presortedDecodedMap(map, mapUrl) { - const tracer = new TraceMap(clone(map, []), mapUrl); - cast(tracer)._decoded = map.mappings; - return tracer; -} -function decodedMap(map) { - return clone(map, decodedMappings(map)); -} -function encodedMap(map) { - return clone(map, encodedMappings(map)); -} -function clone(map, mappings) { - return { - version: map.version, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings, - ignoreList: map.ignoreList || map.x_google_ignoreList - }; -} -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); - if (!found && bias === LEAST_UPPER_BOUND) min++; - if (min === -1 || min === segments.length) return []; - const matchedColumn = found ? column : segments[min][COLUMN]; - 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; -} -function generatedPosition(map, source, line, column, bias, all) { - var _a, _b; - 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 sourceIndex2 = sources.indexOf(source); - if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source); - if (sourceIndex2 === -1) return all ? [] : GMapping(null, null); - const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState)); - const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos)); - const segments = generated[sourceIndex2][line]; - if (segments == null) return all ? [] : GMapping(null, null); - const memo = bySourceMemos[sourceIndex2]; - 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]); -} -export { - FlattenMap as AnyMap, - FlattenMap, - GREATEST_LOWER_BOUND, - LEAST_UPPER_BOUND, - TraceMap, - allGeneratedPositionsFor, - decodedMap, - decodedMappings, - eachMapping, - encodedMap, - encodedMappings, - generatedPositionFor, - isIgnored, - 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 a789581..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["../src/trace-mapping.ts", "../src/resolve.ts", "../src/strip-filename.ts", "../src/sourcemap-segment.ts", "../src/sort.ts", "../src/by-source.ts", "../src/binary-search.ts", "../src/types.ts", "../src/flatten-map.ts"], - "mappings": ";AAAA,SAAS,QAAQ,cAAc;;;ACA/B,OAAO,gBAAgB;;;ACGR,SAAR,cAA+B,MAAyC;AAC7E,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,QAAQ,KAAK,YAAY,GAAG;AAClC,SAAO,KAAK,MAAM,GAAG,QAAQ,CAAC;AAChC;;;ADHe,SAAR,SACL,QACA,YACS;AACT,QAAM,OAAO,cAAc,MAAM;AAIjC,QAAM,SAAS,aAAa,aAAa,MAAM;AAE/C,SAAO,CAAC,WAAW,WAAW,UAAU,UAAU,KAAK,IAAI;AAC7D;;;AEAO,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;AAEpB,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;;;AClBrB,SAAR,UACL,UACA,OACsB;AACtB,QAAM,gBAAgB,wBAAwB,UAAU,CAAC;AACzD,MAAI,kBAAkB,SAAS,OAAQ,QAAO;AAI9C,MAAI,CAAC,MAAO,YAAW,SAAS,MAAM;AAEtC,WAAS,IAAI,eAAe,IAAI,SAAS,QAAQ,IAAI,wBAAwB,UAAU,IAAI,CAAC,GAAG;AAC7F,aAAS,CAAC,IAAI,aAAa,SAAS,CAAC,GAAG,KAAK;AAAA,EAC/C;AACA,SAAO;AACT;AAEA,SAAS,wBAAwB,UAAgC,OAAuB;AACtF,WAAS,IAAI,OAAO,IAAI,SAAS,QAAQ,KAAK;AAC5C,QAAI,CAAC,SAAS,SAAS,CAAC,CAAC,EAAG,QAAO;AAAA,EACrC;AACA,SAAO,SAAS;AAClB;AAEA,SAAS,SAAS,MAAmC;AACnD,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,KAAK,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC,EAAE,MAAM,GAAG;AACzC,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,aAAa,MAA0B,OAAoC;AAClF,MAAI,CAAC,MAAO,QAAO,KAAK,MAAM;AAC9B,SAAO,KAAK,KAAK,cAAc;AACjC;AAEO,SAAS,eAA4D,GAAM,GAAc;AAC9F,SAAO,EAAE,MAAM,IAAI,EAAE,MAAM;AAC7B;;;ACnCe,SAAR,eACL,SACA,OACU;AACV,QAAM,UAAoB,MAAM,IAAI,MAAM,CAAC,CAAC;AAE5C,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,UAAI,IAAI,WAAW,EAAG;AAEtB,YAAMA,eAAc,IAAI,aAAa;AACrC,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AAEtC,YAAM,SAAS,QAAQA,YAAW;AAClC,YAAM,OAAQ,4CAAuB,CAAC;AACtC,WAAK,KAAK,CAAC,cAAc,GAAG,IAAI,MAAM,CAAC,CAAC;AAAA,IAC1C;AAAA,EACF;AAEA,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,SAAS,QAAQ,CAAC;AACxB,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,YAAM,OAAO,OAAO,CAAC;AACrB,UAAI,KAAM,MAAK,KAAK,cAAc;AAAA,IACpC;AAAA,EACF;AAEA,SAAO;AACT;;;AC/BO,IAAI,QAAQ;AAkBZ,SAAS,aACd,UACA,QACA,KACA,MACQ;AACR,SAAO,OAAO,MAAM;AAClB,UAAM,MAAM,OAAQ,OAAO,OAAQ;AACnC,UAAM,MAAM,SAAS,GAAG,EAAE,MAAM,IAAI;AAEpC,QAAI,QAAQ,GAAG;AACb,cAAQ;AACR,aAAO;AAAA,IACT;AAEA,QAAI,MAAM,GAAG;AACX,YAAM,MAAM;AAAA,IACd,OAAO;AACL,aAAO,MAAM;AAAA,IACf;AAAA,EACF;AAEA,UAAQ;AACR,SAAO,MAAM;AACf;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,IAAI,SAAS,QAAQ,QAAQ,KAAK;AACxD,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,gBAA2B;AACzC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AACF;AAMO,SAAS,qBACd,UACA,QACA,OACA,KACQ;AACR,QAAM,EAAE,SAAS,YAAY,UAAU,IAAI;AAE3C,MAAI,MAAM;AACV,MAAI,OAAO,SAAS,SAAS;AAC7B,MAAI,QAAQ,SAAS;AACnB,QAAI,WAAW,YAAY;AACzB,cAAQ,cAAc,MAAM,SAAS,SAAS,EAAE,MAAM,MAAM;AAC5D,aAAO;AAAA,IACT;AAEA,QAAI,UAAU,YAAY;AAExB,YAAM,cAAc,KAAK,IAAI;AAAA,IAC/B,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,UAAU;AAChB,QAAM,aAAa;AAEnB,SAAQ,MAAM,YAAY,aAAa,UAAU,QAAQ,KAAK,IAAI;AACpE;;;ACHO,SAAS,MAAS,KAA4B;AACnD,SAAO,OAAO,QAAQ,WAAW,KAAK,MAAM,GAAG,IAAK;AACtD;;;ACvFO,IAAM,aAAyB,SAAU,KAAK,QAAQ;AAC3D,QAAM,SAAS,MAAM,GAA8B;AAEnD,MAAI,EAAE,cAAc,SAAS;AAC3B,WAAO,IAAI,SAAS,QAA2D,MAAM;AAAA,EACvF;AAEA,QAAM,WAAiC,CAAC;AACxC,QAAM,UAAoB,CAAC;AAC3B,QAAM,iBAAoC,CAAC;AAC3C,QAAM,QAAkB,CAAC;AACzB,QAAM,aAAuB,CAAC;AAE9B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,SAA2B;AAAA,IAC/B,SAAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,oBAAoB,MAAM;AACnC;AAEA,SAAS,QACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,EAAE,SAAS,IAAI;AACrB,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,EAAE,KAAK,OAAO,IAAI,SAAS,CAAC;AAElC,QAAI,KAAK;AACT,QAAI,KAAK;AACT,QAAI,IAAI,IAAI,SAAS,QAAQ;AAC3B,YAAM,aAAa,SAAS,IAAI,CAAC,EAAE;AACnC,WAAK,KAAK,IAAI,UAAU,aAAa,WAAW,IAAI;AAEpD,UAAI,OAAO,UAAU;AACnB,aAAK,KAAK,IAAI,YAAY,eAAe,WAAW,MAAM;AAAA,MAC5D,WAAW,KAAK,UAAU;AACxB,aAAK,eAAe,WAAW;AAAA,MACjC;AAAA,IACF;AAEA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,OAAO;AAAA,MACpB,eAAe,OAAO;AAAA,MACtB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,WACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,SAAS,MAAM,KAAK;AAC1B,MAAI,cAAc,OAAQ,QAAO,QAAQ,GAAI,SAAmD;AAEhG,QAAM,MAAM,IAAI,SAAS,QAAQ,MAAM;AACvC,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,cAAc,MAAM;AAC1B,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,iBAAiB,gBAAgB,UAAU,YAAY,QAAQ,IAAI;AAE3E,SAAO,SAAS,eAAe;AAC/B,SAAO,OAAO,IAAI,KAAK;AAEvB,MAAI,SAAU,QAAO,gBAAgB,QAAQ;AAAA,MACxC,UAAS,IAAI,GAAG,IAAI,gBAAgB,QAAQ,IAAK,gBAAe,KAAK,IAAI;AAE9E,MAAI,QAAS,UAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,IAAK,YAAW,KAAK,QAAQ,CAAC,IAAI,aAAa;AAEhG,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,QAAQ,aAAa;AAM3B,QAAI,QAAQ,SAAU;AAItB,UAAM,MAAM,QAAQ,UAAU,KAAK;AAGnC,UAAM,UAAU,MAAM,IAAI,eAAe;AAEzC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,YAAM,SAAS,UAAU,IAAI,MAAM;AAInC,UAAI,UAAU,YAAY,UAAU,WAAY;AAEhD,UAAI,IAAI,WAAW,GAAG;AACpB,YAAI,KAAK,CAAC,MAAM,CAAC;AACjB;AAAA,MACF;AAEA,YAAM,eAAe,gBAAgB,IAAI,aAAa;AACtD,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AACtC,UAAI;AAAA,QACF,IAAI,WAAW,IACX,CAAC,QAAQ,cAAc,YAAY,YAAY,IAC/C,CAAC,QAAQ,cAAc,YAAY,cAAc,cAAc,IAAI,WAAW,CAAC;AAAA,MACrF;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,OAAU,KAAU,OAAY;AACvC,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,KAAK,MAAM,CAAC,CAAC;AAC1D;AAEA,SAAS,QAAW,KAAY,OAAoB;AAClD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,IAAK,KAAI,CAAC,IAAI,CAAC;AACpD,SAAO,IAAI,KAAK;AAClB;;;ARhHA,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AAEjB,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAI7B,IAAM,WAAN,MAAoC;AAAA,EAkBzC,YAAY,KAAyB,QAAwB;AAC3D,UAAM,WAAW,OAAO,QAAQ;AAChC,QAAI,CAAC,YAAa,IAAyC,aAAc,QAAO;AAEhF,UAAM,SAAS,MAAM,GAAwC;AAE7D,UAAM,EAAE,SAAS,MAAM,OAAO,YAAY,SAAS,eAAe,IAAI;AACtE,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,QAAQ,SAAS,CAAC;AACvB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,iBAAiB;AACtB,SAAK,aAAa,OAAO,cAAe,OAAkB,uBAAuB;AAEjF,UAAM,UAAU,SAAS,QAAQ,UAAU;AAC3C,SAAK,kBAAkB,QAAQ,IAAI,OAAO;AAE1C,UAAM,EAAE,SAAS,IAAI;AACrB,QAAI,OAAO,aAAa,UAAU;AAChC,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB,WAAW,MAAM,QAAQ,QAAQ,GAAG;AAClC,WAAK,WAAW;AAChB,WAAK,WAAW,UAAU,UAAU,QAAQ;AAAA,IAC9C,WAAY,OAAyC,UAAU;AAC7D,YAAM,IAAI,MAAM,4EAA4E;AAAA,IAC9F,OAAO;AACL,YAAM,IAAI,MAAM,uBAAuB,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IACjE;AAEA,SAAK,eAAe,cAAc;AAClC,SAAK,aAAa;AAClB,SAAK,iBAAiB;AAAA,EACxB;AACF;AAMA,SAAS,KAAK,KAAyB;AACrC,SAAO;AACT;AAKO,SAAS,gBAAgB,KAA6C;AAzJ7E;AA0JE,UAAQ,gBAAK,GAAG,GAAE,aAAV,eAAU,WAAa,OAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAKO,SAAS,gBAAgB,KAAuD;AAhKvF;AAiKE,UAAQ,UAAK,GAAG,GAAE,aAAV,GAAU,WAAa,OAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAMO,SAAS,aACd,KACA,MACA,QACmC;AACnC,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO;AAEnC,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,UAAU,KAAK,OAAO,SAAS,KAAK;AAC7C;AAOO,SAAS,oBACd,KACA,QAC0C;AAC1C,MAAI,EAAE,MAAM,QAAQ,KAAK,IAAI;AAC7B;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAElE,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AAEA,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAExD,QAAM,UAAU,SAAS,KAAK;AAC9B,MAAI,QAAQ,WAAW,EAAG,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAEhE,QAAM,EAAE,OAAO,gBAAgB,IAAI;AACnC,SAAO;AAAA,IACL,gBAAgB,QAAQ,aAAa,CAAC;AAAA,IACtC,QAAQ,WAAW,IAAI;AAAA,IACvB,QAAQ,aAAa;AAAA,IACrB,QAAQ,WAAW,IAAI,MAAM,QAAQ,WAAW,CAAC,IAAI;AAAA,EACvD;AACF;AAKO,SAAS,qBACd,KACA,QAC4C;AAC5C,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AACvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,sBAAsB,KAAK;AACzF;AAKO,SAAS,yBAAyB,KAAe,QAA0C;AAChG,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AAEvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,mBAAmB,IAAI;AACrF;AAKO,SAAS,YAAY,KAAe,IAA0C;AACnF,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,OAAO,gBAAgB,IAAI;AAEnC,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,gBAAgB,IAAI;AAC1B,YAAM,kBAAkB,IAAI,CAAC;AAC7B,UAAI,SAAS;AACb,UAAI,eAAe;AACnB,UAAI,iBAAiB;AACrB,UAAI,OAAO;AACX,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,gBAAgB,IAAI,CAAC,CAAC;AAC/B,uBAAe,IAAI,CAAC,IAAI;AACxB,yBAAiB,IAAI,CAAC;AAAA,MACxB;AACA,UAAI,IAAI,WAAW,EAAG,QAAO,MAAM,IAAI,CAAC,CAAC;AAEzC,SAAG;AAAA,QACD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAgB;AAAA,IAClB;AAAA,EACF;AACF;AAEA,SAAS,YAAY,KAAe,QAAwB;AAC1D,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAI,QAAQ,QAAQ,QAAQ,MAAM;AAClC,MAAI,UAAU,GAAI,SAAQ,gBAAgB,QAAQ,MAAM;AACxD,SAAO;AACT;AAKO,SAAS,iBAAiB,KAAe,QAA+B;AAC7E,QAAM,EAAE,eAAe,IAAI;AAC3B,MAAI,kBAAkB,KAAM,QAAO;AACnC,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,OAAO,eAAe,KAAK;AACnD;AAKO,SAAS,UAAU,KAAe,QAAyB;AAChE,QAAM,EAAE,WAAW,IAAI;AACvB,MAAI,cAAc,KAAM,QAAO;AAC/B,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,QAAQ,WAAW,SAAS,KAAK;AACzD;AAMO,SAAS,oBAAoB,KAAuB,QAA2B;AACpF,QAAM,SAAS,IAAI,SAAS,MAAM,KAAK,CAAC,CAAC,GAAG,MAAM;AAClD,OAAK,MAAM,EAAE,WAAW,IAAI;AAC5B,SAAO;AACT;AAMO,SAAS,WACd,KACkF;AAClF,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAMO,SAAS,WAAW,KAAiC;AAC1D,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAEA,SAAS,MACP,KACA,UACwD;AACxD,SAAO;AAAA,IACL,SAAS,IAAI;AAAA,IACb,MAAM,IAAI;AAAA,IACV,OAAO,IAAI;AAAA,IACX,YAAY,IAAI;AAAA,IAChB,SAAS,IAAI;AAAA,IACb,gBAAgB,IAAI;AAAA,IACpB;AAAA,IACA,YAAY,IAAI,cAAe,IAAe;AAAA,EAChD;AACF;AASA,SAAS,SACP,QACA,MACA,QACA,MAC0C;AAC1C,SAAO,EAAE,QAAQ,MAAM,QAAQ,KAAK;AACtC;AAIA,SAAS,SACP,MACA,QAC4C;AAC5C,SAAO,EAAE,MAAM,OAAO;AACxB;AAgBA,SAAS,qBACP,UACA,MACA,MACA,QACA,MACQ;AACR,MAAI,QAAQ,qBAAqB,UAAU,QAAQ,MAAM,IAAI;AAC7D,MAAI,OAAS;AACX,aAAS,SAAS,oBAAoB,aAAa,YAAY,UAAU,QAAQ,KAAK;AAAA,EACxF,WAAW,SAAS,kBAAmB;AAEvC,MAAI,UAAU,MAAM,UAAU,SAAS,OAAQ,QAAO;AACtD,SAAO;AACT;AAEA,SAAS,wBACP,UACA,MACA,MACA,QACA,MACoB;AACpB,MAAI,MAAM,qBAAqB,UAAU,MAAM,MAAM,QAAQ,oBAAoB;AAQjF,MAAI,CAAC,SAAW,SAAS,kBAAmB;AAE5C,MAAI,QAAQ,MAAM,QAAQ,SAAS,OAAQ,QAAO,CAAC;AAKnD,QAAM,gBAAgB,QAAU,SAAS,SAAS,GAAG,EAAE,MAAM;AAG7D,MAAI,CAAC,MAAS,OAAM,WAAW,UAAU,eAAe,GAAG;AAC3D,QAAM,MAAM,WAAW,UAAU,eAAe,GAAG;AAEnD,QAAM,SAAS,CAAC;AAChB,SAAO,OAAO,KAAK,OAAO;AACxB,UAAM,UAAU,SAAS,GAAG;AAC5B,WAAO,KAAK,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC,CAAC;AAAA,EACtF;AACA,SAAO;AACT;AAkBA,SAAS,kBACP,KACA,QACA,MACA,QACA,MACA,KACiE;AA5dnE;AA6dE;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAIC,eAAc,QAAQ,QAAQ,MAAM;AACxC,MAAIA,iBAAgB,GAAI,CAAAA,eAAc,gBAAgB,QAAQ,MAAM;AACpE,MAAIA,iBAAgB,GAAI,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE7D,QAAM,iBAAiB,UAAK,GAAG,GAAE,mBAAV,GAAU,iBAAmB,QAAQ,IAAI,aAAa;AAC7E,QAAM,aAAa,UAAK,GAAG,GAAE,eAAV,GAAU,aAAe,eAAe,gBAAgB,GAAG,GAAG,aAAa;AAE9F,QAAM,WAAW,UAAUA,YAAW,EAAE,IAAI;AAC5C,MAAI,YAAY,KAAM,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE3D,QAAM,OAAO,cAAcA,YAAW;AAEtC,MAAI,IAAK,QAAO,wBAAwB,UAAU,MAAM,MAAM,QAAQ,IAAI;AAE1E,QAAM,QAAQ,qBAAqB,UAAU,MAAM,MAAM,QAAQ,IAAI;AACrE,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,IAAI;AAE5C,QAAM,UAAU,SAAS,KAAK;AAC9B,SAAO,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC;AAChF;", - "names": ["sourceIndex", "sourceIndex"] -} diff --git a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js b/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js deleted file mode 100644 index 0387ae3..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js +++ /dev/null @@ -1,559 +0,0 @@ -(function (global, factory) { - if (typeof exports === 'object' && typeof module !== 'undefined') { - factory(module, require('@jridgewell/resolve-uri'), require('@jridgewell/sourcemap-codec')); - module.exports = def(module); - } else if (typeof define === 'function' && define.amd) { - define(['module', '@jridgewell/resolve-uri', '@jridgewell/sourcemap-codec'], function(mod) { - factory.apply(this, arguments); - mod.exports = def(mod); - }); - } else { - const mod = { exports: {} }; - factory(mod, global.resolveURI, global.sourcemapCodec); - global = typeof globalThis !== 'undefined' ? globalThis : global || self; - global.traceMapping = def(mod); - } - function def(m) { return 'default' in m.exports ? m.exports.default : m.exports; } -})(this, (function (module, require_resolveURI, require_sourcemapCodec) { -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// umd:@jridgewell/sourcemap-codec -var require_sourcemap_codec = __commonJS({ - "umd:@jridgewell/sourcemap-codec"(exports, module2) { - module2.exports = require_sourcemapCodec; - } -}); - -// umd:@jridgewell/resolve-uri -var require_resolve_uri = __commonJS({ - "umd:@jridgewell/resolve-uri"(exports, module2) { - module2.exports = require_resolveURI; - } -}); - -// src/trace-mapping.ts -var trace_mapping_exports = {}; -__export(trace_mapping_exports, { - AnyMap: () => FlattenMap, - FlattenMap: () => FlattenMap, - GREATEST_LOWER_BOUND: () => GREATEST_LOWER_BOUND, - LEAST_UPPER_BOUND: () => LEAST_UPPER_BOUND, - TraceMap: () => TraceMap, - allGeneratedPositionsFor: () => allGeneratedPositionsFor, - decodedMap: () => decodedMap, - decodedMappings: () => decodedMappings, - eachMapping: () => eachMapping, - encodedMap: () => encodedMap, - encodedMappings: () => encodedMappings, - generatedPositionFor: () => generatedPositionFor, - isIgnored: () => isIgnored, - originalPositionFor: () => originalPositionFor, - presortedDecodedMap: () => presortedDecodedMap, - sourceContentFor: () => sourceContentFor, - traceSegment: () => traceSegment -}); -module.exports = __toCommonJS(trace_mapping_exports); -var import_sourcemap_codec = __toESM(require_sourcemap_codec()); - -// src/resolve.ts -var import_resolve_uri = __toESM(require_resolve_uri()); - -// src/strip-filename.ts -function stripFilename(path) { - if (!path) return ""; - const index = path.lastIndexOf("/"); - return path.slice(0, index + 1); -} - -// src/resolve.ts -function resolver(mapUrl, sourceRoot) { - const from = stripFilename(mapUrl); - const prefix = sourceRoot ? sourceRoot + "/" : ""; - return (source) => (0, import_resolve_uri.default)(prefix + (source || ""), from); -} - -// src/sourcemap-segment.ts -var COLUMN = 0; -var SOURCES_INDEX = 1; -var SOURCE_LINE = 2; -var SOURCE_COLUMN = 3; -var NAMES_INDEX = 4; -var REV_GENERATED_LINE = 1; -var REV_GENERATED_COLUMN = 2; - -// src/sort.ts -function maybeSort(mappings, owned) { - const unsortedIndex = nextUnsortedSegmentLine(mappings, 0); - if (unsortedIndex === mappings.length) return mappings; - 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]; -} - -// src/by-source.ts -function buildBySources(decoded, memos) { - const sources = memos.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]; - if (seg.length === 1) continue; - const sourceIndex2 = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - const source = sources[sourceIndex2]; - const segs = source[sourceLine] || (source[sourceLine] = []); - segs.push([sourceColumn, i, seg[COLUMN]]); - } - } - for (let i = 0; i < sources.length; i++) { - const source = sources[i]; - for (let j = 0; j < source.length; j++) { - const line = source[j]; - if (line) line.sort(sortComparator); - } - } - return sources; -} - -// src/binary-search.ts -var found = false; -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 - }; -} -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) { - low = lastIndex === -1 ? 0 : lastIndex; - } else { - high = lastIndex; - } - } - state.lastKey = key; - state.lastNeedle = needle; - return state.lastIndex = binarySearch(haystack, needle, low, high); -} - -// src/types.ts -function parse(map) { - return typeof map === "string" ? JSON.parse(map) : map; -} - -// src/flatten-map.ts -var FlattenMap = function(map, mapUrl) { - const parsed = parse(map); - if (!("sections" in parsed)) { - return new TraceMap(parsed, mapUrl); - } - const mappings = []; - const sources = []; - const sourcesContent = []; - const names = []; - const ignoreList = []; - recurse( - parsed, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - 0, - 0, - Infinity, - Infinity - ); - const joined = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - ignoreList - }; - return presortedDecodedMap(joined); -}; -function recurse(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, 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, - ignoreList, - lineOffset + offset.line, - columnOffset + offset.column, - sl, - sc - ); - } -} -function addSection(input, mapUrl, mappings, sources, sourcesContent, names, ignoreList, lineOffset, columnOffset, stopLine, stopColumn) { - const parsed = parse(input); - if ("sections" in parsed) return recurse(...arguments); - const map = new TraceMap(parsed, mapUrl); - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = 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); - if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); - for (let i = 0; i < decoded.length; i++) { - const lineI = lineOffset + i; - if (lineI > stopLine) return; - const out = getLine(mappings, lineI); - 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 (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]; -} - -// src/trace-mapping.ts -var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)"; -var COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)"; -var LEAST_UPPER_BOUND = -1; -var GREATEST_LOWER_BOUND = 1; -var TraceMap = class { - constructor(map, mapUrl) { - const isString = typeof map === "string"; - if (!isString && map._decodedMemo) return map; - const parsed = parse(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; - this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0; - const resolve = resolver(mapUrl, sourceRoot); - this.resolvedSources = sources.map(resolve); - const { mappings } = parsed; - if (typeof mappings === "string") { - this._encoded = mappings; - this._decoded = void 0; - } else if (Array.isArray(mappings)) { - this._encoded = void 0; - this._decoded = maybeSort(mappings, isString); - } else if (parsed.sections) { - throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); - } else { - throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); - } - this._decodedMemo = memoizedState(); - this._bySources = void 0; - this._bySourceMemos = void 0; - } -}; -function cast(map) { - return map; -} -function encodedMappings(map) { - var _a, _b; - return (_b = (_a = cast(map))._encoded) != null ? _b : _a._encoded = (0, import_sourcemap_codec.encode)(cast(map)._decoded); -} -function decodedMappings(map) { - var _a; - return (_a = cast(map))._decoded || (_a._decoded = (0, import_sourcemap_codec.decode)(cast(map)._encoded)); -} -function traceSegment(map, line, column) { - const decoded = decodedMappings(map); - if (line >= decoded.length) return null; - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(map)._decodedMemo, - line, - column, - GREATEST_LOWER_BOUND - ); - return index === -1 ? null : segments[index]; -} -function originalPositionFor(map, needle) { - let { line, column, bias } = needle; - line--; - if (line < 0) throw new Error(LINE_GTR_ZERO); - if (column < 0) throw new Error(COL_GTR_EQ_ZERO); - const decoded = decodedMappings(map); - if (line >= decoded.length) return OMapping(null, null, null, null); - const segments = decoded[line]; - const index = traceSegmentInternal( - segments, - cast(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 - ); -} -function generatedPositionFor(map, needle) { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); -} -function allGeneratedPositionsFor(map, needle) { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); -} -function 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 - }); - } - } -} -function sourceIndex(map, source) { - const { sources, resolvedSources } = map; - let index = sources.indexOf(source); - if (index === -1) index = resolvedSources.indexOf(source); - return index; -} -function sourceContentFor(map, source) { - const { sourcesContent } = map; - if (sourcesContent == null) return null; - const index = sourceIndex(map, source); - return index === -1 ? null : sourcesContent[index]; -} -function isIgnored(map, source) { - const { ignoreList } = map; - if (ignoreList == null) return false; - const index = sourceIndex(map, source); - return index === -1 ? false : ignoreList.includes(index); -} -function presortedDecodedMap(map, mapUrl) { - const tracer = new TraceMap(clone(map, []), mapUrl); - cast(tracer)._decoded = map.mappings; - return tracer; -} -function decodedMap(map) { - return clone(map, decodedMappings(map)); -} -function encodedMap(map) { - return clone(map, encodedMappings(map)); -} -function clone(map, mappings) { - return { - version: map.version, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings, - ignoreList: map.ignoreList || map.x_google_ignoreList - }; -} -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); - if (!found && bias === LEAST_UPPER_BOUND) min++; - if (min === -1 || min === segments.length) return []; - const matchedColumn = found ? column : segments[min][COLUMN]; - 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; -} -function generatedPosition(map, source, line, column, bias, all) { - var _a, _b; - 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 sourceIndex2 = sources.indexOf(source); - if (sourceIndex2 === -1) sourceIndex2 = resolvedSources.indexOf(source); - if (sourceIndex2 === -1) return all ? [] : GMapping(null, null); - const bySourceMemos = (_a = cast(map))._bySourceMemos || (_a._bySourceMemos = sources.map(memoizedState)); - const generated = (_b = cast(map))._bySources || (_b._bySources = buildBySources(decodedMappings(map), bySourceMemos)); - const segments = generated[sourceIndex2][line]; - if (segments == null) return all ? [] : GMapping(null, null); - const memo = bySourceMemos[sourceIndex2]; - 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]); -} -})); -//# 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 68b0c77..0000000 --- a/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map +++ /dev/null @@ -1,6 +0,0 @@ -{ - "version": 3, - "sources": ["umd:@jridgewell/sourcemap-codec", "umd:@jridgewell/resolve-uri", "../src/trace-mapping.ts", "../src/resolve.ts", "../src/strip-filename.ts", "../src/sourcemap-segment.ts", "../src/sort.ts", "../src/by-source.ts", "../src/binary-search.ts", "../src/types.ts", "../src/flatten-map.ts"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,6CAAAA,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA,yCAAAC,SAAA;AAAA,IAAAA,QAAO,UAAU;AAAA;AAAA;;;ACAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA+B;;;ACA/B,yBAAuB;;;ACGR,SAAR,cAA+B,MAAyC;AAC7E,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,QAAQ,KAAK,YAAY,GAAG;AAClC,SAAO,KAAK,MAAM,GAAG,QAAQ,CAAC;AAChC;;;ADHe,SAAR,SACL,QACA,YACS;AACT,QAAM,OAAO,cAAc,MAAM;AAIjC,QAAM,SAAS,aAAa,aAAa,MAAM;AAE/C,SAAO,CAAC,eAAW,mBAAAC,SAAW,UAAU,UAAU,KAAK,IAAI;AAC7D;;;AEAO,IAAM,SAAS;AACf,IAAM,gBAAgB;AACtB,IAAM,cAAc;AACpB,IAAM,gBAAgB;AACtB,IAAM,cAAc;AAEpB,IAAM,qBAAqB;AAC3B,IAAM,uBAAuB;;;AClBrB,SAAR,UACL,UACA,OACsB;AACtB,QAAM,gBAAgB,wBAAwB,UAAU,CAAC;AACzD,MAAI,kBAAkB,SAAS,OAAQ,QAAO;AAI9C,MAAI,CAAC,MAAO,YAAW,SAAS,MAAM;AAEtC,WAAS,IAAI,eAAe,IAAI,SAAS,QAAQ,IAAI,wBAAwB,UAAU,IAAI,CAAC,GAAG;AAC7F,aAAS,CAAC,IAAI,aAAa,SAAS,CAAC,GAAG,KAAK;AAAA,EAC/C;AACA,SAAO;AACT;AAEA,SAAS,wBAAwB,UAAgC,OAAuB;AACtF,WAAS,IAAI,OAAO,IAAI,SAAS,QAAQ,KAAK;AAC5C,QAAI,CAAC,SAAS,SAAS,CAAC,CAAC,EAAG,QAAO;AAAA,EACrC;AACA,SAAO,SAAS;AAClB;AAEA,SAAS,SAAS,MAAmC;AACnD,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,KAAK,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC,EAAE,MAAM,GAAG;AACzC,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,SAAS,aAAa,MAA0B,OAAoC;AAClF,MAAI,CAAC,MAAO,QAAO,KAAK,MAAM;AAC9B,SAAO,KAAK,KAAK,cAAc;AACjC;AAEO,SAAS,eAA4D,GAAM,GAAc;AAC9F,SAAO,EAAE,MAAM,IAAI,EAAE,MAAM;AAC7B;;;ACnCe,SAAR,eACL,SACA,OACU;AACV,QAAM,UAAoB,MAAM,IAAI,MAAM,CAAC,CAAC;AAE5C,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,UAAI,IAAI,WAAW,EAAG;AAEtB,YAAMC,eAAc,IAAI,aAAa;AACrC,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AAEtC,YAAM,SAAS,QAAQA,YAAW;AAClC,YAAM,OAAQ,4CAAuB,CAAC;AACtC,WAAK,KAAK,CAAC,cAAc,GAAG,IAAI,MAAM,CAAC,CAAC;AAAA,IAC1C;AAAA,EACF;AAEA,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,SAAS,QAAQ,CAAC;AACxB,aAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,YAAM,OAAO,OAAO,CAAC;AACrB,UAAI,KAAM,MAAK,KAAK,cAAc;AAAA,IACpC;AAAA,EACF;AAEA,SAAO;AACT;;;AC/BO,IAAI,QAAQ;AAkBZ,SAAS,aACd,UACA,QACA,KACA,MACQ;AACR,SAAO,OAAO,MAAM;AAClB,UAAM,MAAM,OAAQ,OAAO,OAAQ;AACnC,UAAM,MAAM,SAAS,GAAG,EAAE,MAAM,IAAI;AAEpC,QAAI,QAAQ,GAAG;AACb,cAAQ;AACR,aAAO;AAAA,IACT;AAEA,QAAI,MAAM,GAAG;AACX,YAAM,MAAM;AAAA,IACd,OAAO;AACL,aAAO,MAAM;AAAA,IACf;AAAA,EACF;AAEA,UAAQ;AACR,SAAO,MAAM;AACf;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,IAAI,SAAS,QAAQ,QAAQ,KAAK;AACxD,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,WACd,UACA,QACA,OACQ;AACR,WAAS,IAAI,QAAQ,GAAG,KAAK,GAAG,QAAQ,KAAK;AAC3C,QAAI,SAAS,CAAC,EAAE,MAAM,MAAM,OAAQ;AAAA,EACtC;AACA,SAAO;AACT;AAEO,SAAS,gBAA2B;AACzC,SAAO;AAAA,IACL,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AACF;AAMO,SAAS,qBACd,UACA,QACA,OACA,KACQ;AACR,QAAM,EAAE,SAAS,YAAY,UAAU,IAAI;AAE3C,MAAI,MAAM;AACV,MAAI,OAAO,SAAS,SAAS;AAC7B,MAAI,QAAQ,SAAS;AACnB,QAAI,WAAW,YAAY;AACzB,cAAQ,cAAc,MAAM,SAAS,SAAS,EAAE,MAAM,MAAM;AAC5D,aAAO;AAAA,IACT;AAEA,QAAI,UAAU,YAAY;AAExB,YAAM,cAAc,KAAK,IAAI;AAAA,IAC/B,OAAO;AACL,aAAO;AAAA,IACT;AAAA,EACF;AACA,QAAM,UAAU;AAChB,QAAM,aAAa;AAEnB,SAAQ,MAAM,YAAY,aAAa,UAAU,QAAQ,KAAK,IAAI;AACpE;;;ACHO,SAAS,MAAS,KAA4B;AACnD,SAAO,OAAO,QAAQ,WAAW,KAAK,MAAM,GAAG,IAAK;AACtD;;;ACvFO,IAAM,aAAyB,SAAU,KAAK,QAAQ;AAC3D,QAAM,SAAS,MAAM,GAA8B;AAEnD,MAAI,EAAE,cAAc,SAAS;AAC3B,WAAO,IAAI,SAAS,QAA2D,MAAM;AAAA,EACvF;AAEA,QAAM,WAAiC,CAAC;AACxC,QAAM,UAAoB,CAAC;AAC3B,QAAM,iBAAoC,CAAC;AAC3C,QAAM,QAAkB,CAAC;AACzB,QAAM,aAAuB,CAAC;AAE9B;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,SAA2B;AAAA,IAC/B,SAAS;AAAA,IACT,MAAM,OAAO;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,oBAAoB,MAAM;AACnC;AAEA,SAAS,QACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,EAAE,SAAS,IAAI;AACrB,WAAS,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;AACxC,UAAM,EAAE,KAAK,OAAO,IAAI,SAAS,CAAC;AAElC,QAAI,KAAK;AACT,QAAI,KAAK;AACT,QAAI,IAAI,IAAI,SAAS,QAAQ;AAC3B,YAAM,aAAa,SAAS,IAAI,CAAC,EAAE;AACnC,WAAK,KAAK,IAAI,UAAU,aAAa,WAAW,IAAI;AAEpD,UAAI,OAAO,UAAU;AACnB,aAAK,KAAK,IAAI,YAAY,eAAe,WAAW,MAAM;AAAA,MAC5D,WAAW,KAAK,UAAU;AACxB,aAAK,eAAe,WAAW;AAAA,MACjC;AAAA,IACF;AAEA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,OAAO;AAAA,MACpB,eAAe,OAAO;AAAA,MACtB;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,WACP,OACA,QACA,UACA,SACA,gBACA,OACA,YACA,YACA,cACA,UACA,YACA;AACA,QAAM,SAAS,MAAM,KAAK;AAC1B,MAAI,cAAc,OAAQ,QAAO,QAAQ,GAAI,SAAmD;AAEhG,QAAM,MAAM,IAAI,SAAS,QAAQ,MAAM;AACvC,QAAM,gBAAgB,QAAQ;AAC9B,QAAM,cAAc,MAAM;AAC1B,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,iBAAiB,gBAAgB,UAAU,YAAY,QAAQ,IAAI;AAE3E,SAAO,SAAS,eAAe;AAC/B,SAAO,OAAO,IAAI,KAAK;AAEvB,MAAI,SAAU,QAAO,gBAAgB,QAAQ;AAAA,MACxC,UAAS,IAAI,GAAG,IAAI,gBAAgB,QAAQ,IAAK,gBAAe,KAAK,IAAI;AAE9E,MAAI,QAAS,UAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,IAAK,YAAW,KAAK,QAAQ,CAAC,IAAI,aAAa;AAEhG,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,QAAQ,aAAa;AAM3B,QAAI,QAAQ,SAAU;AAItB,UAAM,MAAM,QAAQ,UAAU,KAAK;AAGnC,UAAM,UAAU,MAAM,IAAI,eAAe;AAEzC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAClB,YAAM,SAAS,UAAU,IAAI,MAAM;AAInC,UAAI,UAAU,YAAY,UAAU,WAAY;AAEhD,UAAI,IAAI,WAAW,GAAG;AACpB,YAAI,KAAK,CAAC,MAAM,CAAC;AACjB;AAAA,MACF;AAEA,YAAM,eAAe,gBAAgB,IAAI,aAAa;AACtD,YAAM,aAAa,IAAI,WAAW;AAClC,YAAM,eAAe,IAAI,aAAa;AACtC,UAAI;AAAA,QACF,IAAI,WAAW,IACX,CAAC,QAAQ,cAAc,YAAY,YAAY,IAC/C,CAAC,QAAQ,cAAc,YAAY,cAAc,cAAc,IAAI,WAAW,CAAC;AAAA,MACrF;AAAA,IACF;AAAA,EACF;AACF;AAEA,SAAS,OAAU,KAAU,OAAY;AACvC,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,IAAK,KAAI,KAAK,MAAM,CAAC,CAAC;AAC1D;AAEA,SAAS,QAAW,KAAY,OAAoB;AAClD,WAAS,IAAI,IAAI,QAAQ,KAAK,OAAO,IAAK,KAAI,CAAC,IAAI,CAAC;AACpD,SAAO,IAAI,KAAK;AAClB;;;ARhHA,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AAEjB,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAI7B,IAAM,WAAN,MAAoC;AAAA,EAkBzC,YAAY,KAAyB,QAAwB;AAC3D,UAAM,WAAW,OAAO,QAAQ;AAChC,QAAI,CAAC,YAAa,IAAyC,aAAc,QAAO;AAEhF,UAAM,SAAS,MAAM,GAAwC;AAE7D,UAAM,EAAE,SAAS,MAAM,OAAO,YAAY,SAAS,eAAe,IAAI;AACtE,SAAK,UAAU;AACf,SAAK,OAAO;AACZ,SAAK,QAAQ,SAAS,CAAC;AACvB,SAAK,aAAa;AAClB,SAAK,UAAU;AACf,SAAK,iBAAiB;AACtB,SAAK,aAAa,OAAO,cAAe,OAAkB,uBAAuB;AAEjF,UAAM,UAAU,SAAS,QAAQ,UAAU;AAC3C,SAAK,kBAAkB,QAAQ,IAAI,OAAO;AAE1C,UAAM,EAAE,SAAS,IAAI;AACrB,QAAI,OAAO,aAAa,UAAU;AAChC,WAAK,WAAW;AAChB,WAAK,WAAW;AAAA,IAClB,WAAW,MAAM,QAAQ,QAAQ,GAAG;AAClC,WAAK,WAAW;AAChB,WAAK,WAAW,UAAU,UAAU,QAAQ;AAAA,IAC9C,WAAY,OAAyC,UAAU;AAC7D,YAAM,IAAI,MAAM,4EAA4E;AAAA,IAC9F,OAAO;AACL,YAAM,IAAI,MAAM,uBAAuB,KAAK,UAAU,MAAM,CAAC,EAAE;AAAA,IACjE;AAEA,SAAK,eAAe,cAAc;AAClC,SAAK,aAAa;AAClB,SAAK,iBAAiB;AAAA,EACxB;AACF;AAMA,SAAS,KAAK,KAAyB;AACrC,SAAO;AACT;AAKO,SAAS,gBAAgB,KAA6C;AAzJ7E;AA0JE,UAAQ,gBAAK,GAAG,GAAE,aAAV,eAAU,eAAa,+BAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAKO,SAAS,gBAAgB,KAAuD;AAhKvF;AAiKE,UAAQ,UAAK,GAAG,GAAE,aAAV,GAAU,eAAa,+BAAO,KAAK,GAAG,EAAE,QAAS;AAC3D;AAMO,SAAS,aACd,KACA,MACA,QACmC;AACnC,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO;AAEnC,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,SAAO,UAAU,KAAK,OAAO,SAAS,KAAK;AAC7C;AAOO,SAAS,oBACd,KACA,QAC0C;AAC1C,MAAI,EAAE,MAAM,QAAQ,KAAK,IAAI;AAC7B;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,UAAU,gBAAgB,GAAG;AAInC,MAAI,QAAQ,QAAQ,OAAQ,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAElE,QAAM,WAAW,QAAQ,IAAI;AAC7B,QAAM,QAAQ;AAAA,IACZ;AAAA,IACA,KAAK,GAAG,EAAE;AAAA,IACV;AAAA,IACA;AAAA,IACA,QAAQ;AAAA,EACV;AAEA,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAExD,QAAM,UAAU,SAAS,KAAK;AAC9B,MAAI,QAAQ,WAAW,EAAG,QAAO,SAAS,MAAM,MAAM,MAAM,IAAI;AAEhE,QAAM,EAAE,OAAO,gBAAgB,IAAI;AACnC,SAAO;AAAA,IACL,gBAAgB,QAAQ,aAAa,CAAC;AAAA,IACtC,QAAQ,WAAW,IAAI;AAAA,IACvB,QAAQ,aAAa;AAAA,IACrB,QAAQ,WAAW,IAAI,MAAM,QAAQ,WAAW,CAAC,IAAI;AAAA,EACvD;AACF;AAKO,SAAS,qBACd,KACA,QAC4C;AAC5C,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AACvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,sBAAsB,KAAK;AACzF;AAKO,SAAS,yBAAyB,KAAe,QAA0C;AAChG,QAAM,EAAE,QAAQ,MAAM,QAAQ,KAAK,IAAI;AAEvC,SAAO,kBAAkB,KAAK,QAAQ,MAAM,QAAQ,QAAQ,mBAAmB,IAAI;AACrF;AAKO,SAAS,YAAY,KAAe,IAA0C;AACnF,QAAM,UAAU,gBAAgB,GAAG;AACnC,QAAM,EAAE,OAAO,gBAAgB,IAAI;AAEnC,WAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK;AACvC,UAAM,OAAO,QAAQ,CAAC;AACtB,aAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,YAAM,MAAM,KAAK,CAAC;AAElB,YAAM,gBAAgB,IAAI;AAC1B,YAAM,kBAAkB,IAAI,CAAC;AAC7B,UAAI,SAAS;AACb,UAAI,eAAe;AACnB,UAAI,iBAAiB;AACrB,UAAI,OAAO;AACX,UAAI,IAAI,WAAW,GAAG;AACpB,iBAAS,gBAAgB,IAAI,CAAC,CAAC;AAC/B,uBAAe,IAAI,CAAC,IAAI;AACxB,yBAAiB,IAAI,CAAC;AAAA,MACxB;AACA,UAAI,IAAI,WAAW,EAAG,QAAO,MAAM,IAAI,CAAC,CAAC;AAEzC,SAAG;AAAA,QACD;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAgB;AAAA,IAClB;AAAA,EACF;AACF;AAEA,SAAS,YAAY,KAAe,QAAwB;AAC1D,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAI,QAAQ,QAAQ,QAAQ,MAAM;AAClC,MAAI,UAAU,GAAI,SAAQ,gBAAgB,QAAQ,MAAM;AACxD,SAAO;AACT;AAKO,SAAS,iBAAiB,KAAe,QAA+B;AAC7E,QAAM,EAAE,eAAe,IAAI;AAC3B,MAAI,kBAAkB,KAAM,QAAO;AACnC,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,OAAO,eAAe,KAAK;AACnD;AAKO,SAAS,UAAU,KAAe,QAAyB;AAChE,QAAM,EAAE,WAAW,IAAI;AACvB,MAAI,cAAc,KAAM,QAAO;AAC/B,QAAM,QAAQ,YAAY,KAAK,MAAM;AACrC,SAAO,UAAU,KAAK,QAAQ,WAAW,SAAS,KAAK;AACzD;AAMO,SAAS,oBAAoB,KAAuB,QAA2B;AACpF,QAAM,SAAS,IAAI,SAAS,MAAM,KAAK,CAAC,CAAC,GAAG,MAAM;AAClD,OAAK,MAAM,EAAE,WAAW,IAAI;AAC5B,SAAO;AACT;AAMO,SAAS,WACd,KACkF;AAClF,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAMO,SAAS,WAAW,KAAiC;AAC1D,SAAO,MAAM,KAAK,gBAAgB,GAAG,CAAC;AACxC;AAEA,SAAS,MACP,KACA,UACwD;AACxD,SAAO;AAAA,IACL,SAAS,IAAI;AAAA,IACb,MAAM,IAAI;AAAA,IACV,OAAO,IAAI;AAAA,IACX,YAAY,IAAI;AAAA,IAChB,SAAS,IAAI;AAAA,IACb,gBAAgB,IAAI;AAAA,IACpB;AAAA,IACA,YAAY,IAAI,cAAe,IAAe;AAAA,EAChD;AACF;AASA,SAAS,SACP,QACA,MACA,QACA,MAC0C;AAC1C,SAAO,EAAE,QAAQ,MAAM,QAAQ,KAAK;AACtC;AAIA,SAAS,SACP,MACA,QAC4C;AAC5C,SAAO,EAAE,MAAM,OAAO;AACxB;AAgBA,SAAS,qBACP,UACA,MACA,MACA,QACA,MACQ;AACR,MAAI,QAAQ,qBAAqB,UAAU,QAAQ,MAAM,IAAI;AAC7D,MAAI,OAAS;AACX,aAAS,SAAS,oBAAoB,aAAa,YAAY,UAAU,QAAQ,KAAK;AAAA,EACxF,WAAW,SAAS,kBAAmB;AAEvC,MAAI,UAAU,MAAM,UAAU,SAAS,OAAQ,QAAO;AACtD,SAAO;AACT;AAEA,SAAS,wBACP,UACA,MACA,MACA,QACA,MACoB;AACpB,MAAI,MAAM,qBAAqB,UAAU,MAAM,MAAM,QAAQ,oBAAoB;AAQjF,MAAI,CAAC,SAAW,SAAS,kBAAmB;AAE5C,MAAI,QAAQ,MAAM,QAAQ,SAAS,OAAQ,QAAO,CAAC;AAKnD,QAAM,gBAAgB,QAAU,SAAS,SAAS,GAAG,EAAE,MAAM;AAG7D,MAAI,CAAC,MAAS,OAAM,WAAW,UAAU,eAAe,GAAG;AAC3D,QAAM,MAAM,WAAW,UAAU,eAAe,GAAG;AAEnD,QAAM,SAAS,CAAC;AAChB,SAAO,OAAO,KAAK,OAAO;AACxB,UAAM,UAAU,SAAS,GAAG;AAC5B,WAAO,KAAK,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC,CAAC;AAAA,EACtF;AACA,SAAO;AACT;AAkBA,SAAS,kBACP,KACA,QACA,MACA,QACA,MACA,KACiE;AA5dnE;AA6dE;AACA,MAAI,OAAO,EAAG,OAAM,IAAI,MAAM,aAAa;AAC3C,MAAI,SAAS,EAAG,OAAM,IAAI,MAAM,eAAe;AAE/C,QAAM,EAAE,SAAS,gBAAgB,IAAI;AACrC,MAAIC,eAAc,QAAQ,QAAQ,MAAM;AACxC,MAAIA,iBAAgB,GAAI,CAAAA,eAAc,gBAAgB,QAAQ,MAAM;AACpE,MAAIA,iBAAgB,GAAI,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE7D,QAAM,iBAAiB,UAAK,GAAG,GAAE,mBAAV,GAAU,iBAAmB,QAAQ,IAAI,aAAa;AAC7E,QAAM,aAAa,UAAK,GAAG,GAAE,eAAV,GAAU,aAAe,eAAe,gBAAgB,GAAG,GAAG,aAAa;AAE9F,QAAM,WAAW,UAAUA,YAAW,EAAE,IAAI;AAC5C,MAAI,YAAY,KAAM,QAAO,MAAM,CAAC,IAAI,SAAS,MAAM,IAAI;AAE3D,QAAM,OAAO,cAAcA,YAAW;AAEtC,MAAI,IAAK,QAAO,wBAAwB,UAAU,MAAM,MAAM,QAAQ,IAAI;AAE1E,QAAM,QAAQ,qBAAqB,UAAU,MAAM,MAAM,QAAQ,IAAI;AACrE,MAAI,UAAU,GAAI,QAAO,SAAS,MAAM,IAAI;AAE5C,QAAM,UAAU,SAAS,KAAK;AAC9B,SAAO,SAAS,QAAQ,kBAAkB,IAAI,GAAG,QAAQ,oBAAoB,CAAC;AAChF;", - "names": ["module", "module", "resolveUri", "sourceIndex", "sourceIndex"] -} diff --git a/node_modules/@jridgewell/trace-mapping/package.json b/node_modules/@jridgewell/trace-mapping/package.json deleted file mode 100644 index 9d3a1c0..0000000 --- a/node_modules/@jridgewell/trace-mapping/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@jridgewell/trace-mapping", - "version": "0.3.31", - "description": "Trace the original position through a source map", - "keywords": [ - "source", - "map" - ], - "main": "dist/trace-mapping.umd.js", - "module": "dist/trace-mapping.mjs", - "types": "types/trace-mapping.d.cts", - "files": [ - "dist", - "src", - "types" - ], - "exports": { - ".": [ - { - "import": { - "types": "./types/trace-mapping.d.mts", - "default": "./dist/trace-mapping.mjs" - }, - "default": { - "types": "./types/trace-mapping.d.cts", - "default": "./dist/trace-mapping.umd.js" - } - }, - "./dist/trace-mapping.umd.js" - ], - "./package.json": "./package.json" - }, - "scripts": { - "benchmark": "run-s build:code benchmark:*", - "benchmark:install": "cd benchmark && npm install", - "benchmark:only": "node --expose-gc benchmark/index.mjs", - "build": "run-s -n build:code build:types", - "build:code": "node ../../esbuild.mjs trace-mapping.ts", - "build:types": "run-s build:types:force build:types:emit build:types:mts", - "build:types:force": "rimraf tsconfig.build.tsbuildinfo", - "build:types:emit": "tsc --project tsconfig.build.json", - "build:types:mts": "node ../../mts-types.mjs", - "clean": "run-s -n clean:code clean:types", - "clean:code": "tsc --build --clean tsconfig.build.json", - "clean:types": "rimraf dist types", - "test": "run-s -n test:types test:only test:format", - "test:format": "prettier --check '{src,test}/**/*.ts'", - "test:only": "mocha", - "test:types": "eslint '{src,test}/**/*.ts'", - "lint": "run-s -n lint:types lint:format", - "lint:format": "npm run test:format -- --write", - "lint:types": "npm run test:types -- --fix", - "prepublishOnly": "npm run-s -n build test" - }, - "homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping", - "repository": { - "type": "git", - "url": "git+https://github.com/jridgewell/sourcemaps.git", - "directory": "packages/trace-mapping" - }, - "author": "Justin Ridgewell ", - "license": "MIT", - "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" - } -} diff --git a/node_modules/@jridgewell/trace-mapping/src/binary-search.ts b/node_modules/@jridgewell/trace-mapping/src/binary-search.ts deleted file mode 100644 index c1144ad..0000000 --- a/node_modules/@jridgewell/trace-mapping/src/binary-search.ts +++ /dev/null @@ -1,115 +0,0 @@ -import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; -import { COLUMN } from './sourcemap-segment'; - -export type MemoState = { - lastKey: number; - lastNeedle: number; - lastIndex: number; -}; - -export 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]); - * ``` - */ -export function binarySearch( - haystack: SourceMapSegment[] | ReverseSegment[], - needle: number, - low: number, - high: number, -): number { - 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; -} - -export function upperBound( - haystack: SourceMapSegment[] | ReverseSegment[], - needle: number, - index: number, -): number { - for (let i = index + 1; i < haystack.length; index = i++) { - if (haystack[i][COLUMN] !== needle) break; - } - return index; -} - -export function lowerBound( - haystack: SourceMapSegment[] | ReverseSegment[], - needle: number, - index: number, -): number { - for (let i = index - 1; i >= 0; index = i--) { - if (haystack[i][COLUMN] !== needle) break; - } - return index; -} - -export function memoizedState(): MemoState { - 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. - */ -export function memoizedBinarySearch( - haystack: SourceMapSegment[] | ReverseSegment[], - needle: number, - state: MemoState, - key: number, -): number { - 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)); -} diff --git a/node_modules/@jridgewell/trace-mapping/src/by-source.ts b/node_modules/@jridgewell/trace-mapping/src/by-source.ts deleted file mode 100644 index 1da6af0..0000000 --- a/node_modules/@jridgewell/trace-mapping/src/by-source.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { COLUMN, SOURCES_INDEX, SOURCE_LINE, SOURCE_COLUMN } from './sourcemap-segment'; -import { sortComparator } from './sort'; - -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; - -export type Source = ReverseSegment[][]; - -// Rebuilds the original source files, with mappings that are ordered by source line/column instead -// of generated line/column. -export default function buildBySources( - decoded: readonly SourceMapSegment[][], - memos: unknown[], -): Source[] { - const sources: Source[] = memos.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]; - if (seg.length === 1) continue; - - const sourceIndex = seg[SOURCES_INDEX]; - const sourceLine = seg[SOURCE_LINE]; - const sourceColumn = seg[SOURCE_COLUMN]; - - const source = sources[sourceIndex]; - const segs = (source[sourceLine] ||= []); - segs.push([sourceColumn, i, seg[COLUMN]]); - } - } - - for (let i = 0; i < sources.length; i++) { - const source = sources[i]; - for (let j = 0; j < source.length; j++) { - const line = source[j]; - if (line) line.sort(sortComparator); - } - } - - return sources; -} diff --git a/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts b/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts deleted file mode 100644 index 61ac40c..0000000 --- a/node_modules/@jridgewell/trace-mapping/src/flatten-map.ts +++ /dev/null @@ -1,192 +0,0 @@ -import { TraceMap, presortedDecodedMap, decodedMappings } from './trace-mapping'; -import { - COLUMN, - SOURCES_INDEX, - SOURCE_LINE, - SOURCE_COLUMN, - NAMES_INDEX, -} from './sourcemap-segment'; -import { parse } from './types'; - -import type { - DecodedSourceMap, - DecodedSourceMapXInput, - EncodedSourceMapXInput, - SectionedSourceMapXInput, - SectionedSourceMapInput, - SectionXInput, - Ro, -} from './types'; -import type { SourceMapSegment } from './sourcemap-segment'; - -type FlattenMap = { - new (map: Ro, mapUrl?: string | null): TraceMap; - (map: Ro, mapUrl?: string | null): TraceMap; -}; - -export const FlattenMap: FlattenMap = function (map, mapUrl) { - const parsed = parse(map as SectionedSourceMapInput); - - if (!('sections' in parsed)) { - return new TraceMap(parsed as DecodedSourceMapXInput | EncodedSourceMapXInput, mapUrl); - } - - const mappings: SourceMapSegment[][] = []; - const sources: string[] = []; - const sourcesContent: (string | null)[] = []; - const names: string[] = []; - const ignoreList: number[] = []; - - recurse( - parsed, - mapUrl, - mappings, - sources, - sourcesContent, - names, - ignoreList, - 0, - 0, - Infinity, - Infinity, - ); - - const joined: DecodedSourceMap = { - version: 3, - file: parsed.file, - names, - sources, - sourcesContent, - mappings, - ignoreList, - }; - - return presortedDecodedMap(joined); -} as FlattenMap; - -function recurse( - input: SectionedSourceMapXInput, - mapUrl: string | null | undefined, - mappings: SourceMapSegment[][], - sources: string[], - sourcesContent: (string | null)[], - names: string[], - ignoreList: number[], - lineOffset: number, - columnOffset: number, - stopLine: number, - stopColumn: number, -) { - 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, - ignoreList, - lineOffset + offset.line, - columnOffset + offset.column, - sl, - sc, - ); - } -} - -function addSection( - input: SectionXInput['map'], - mapUrl: string | null | undefined, - mappings: SourceMapSegment[][], - sources: string[], - sourcesContent: (string | null)[], - names: string[], - ignoreList: number[], - lineOffset: number, - columnOffset: number, - stopLine: number, - stopColumn: number, -) { - const parsed = parse(input); - if ('sections' in parsed) return recurse(...(arguments as unknown as Parameters)); - - const map = new TraceMap(parsed, mapUrl); - const sourcesOffset = sources.length; - const namesOffset = names.length; - const decoded = decodedMappings(map); - const { resolvedSources, sourcesContent: contents, ignoreList: ignores } = 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); - - if (ignores) for (let i = 0; i < ignores.length; i++) ignoreList.push(ignores[i] + sourcesOffset); - - 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: T[], other: T[]) { - for (let i = 0; i < other.length; i++) arr.push(other[i]); -} - -function getLine(arr: T[][], index: number): T[] { - for (let i = arr.length; i <= index; i++) arr[i] = []; - return arr[index]; -} diff --git a/node_modules/@jridgewell/trace-mapping/src/resolve.ts b/node_modules/@jridgewell/trace-mapping/src/resolve.ts deleted file mode 100644 index 30bfa3b..0000000 --- a/node_modules/@jridgewell/trace-mapping/src/resolve.ts +++ /dev/null @@ -1,16 +0,0 @@ -import resolveUri from '@jridgewell/resolve-uri'; -import stripFilename from './strip-filename'; - -type Resolve = (source: string | null) => string; -export default function resolver( - mapUrl: string | null | undefined, - sourceRoot: string | undefined, -): Resolve { - const from = stripFilename(mapUrl); - // The sourceRoot 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 - const prefix = sourceRoot ? sourceRoot + '/' : ''; - - return (source) => resolveUri(prefix + (source || ''), from); -} diff --git a/node_modules/@jridgewell/trace-mapping/src/sort.ts b/node_modules/@jridgewell/trace-mapping/src/sort.ts deleted file mode 100644 index 5d016cb..0000000 --- a/node_modules/@jridgewell/trace-mapping/src/sort.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { COLUMN } from './sourcemap-segment'; - -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment'; - -export default function maybeSort( - mappings: SourceMapSegment[][], - owned: boolean, -): SourceMapSegment[][] { - 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: SourceMapSegment[][], start: number): number { - for (let i = start; i < mappings.length; i++) { - if (!isSorted(mappings[i])) return i; - } - return mappings.length; -} - -function isSorted(line: SourceMapSegment[]): boolean { - for (let j = 1; j < line.length; j++) { - if (line[j][COLUMN] < line[j - 1][COLUMN]) { - return false; - } - } - return true; -} - -function sortSegments(line: SourceMapSegment[], owned: boolean): SourceMapSegment[] { - if (!owned) line = line.slice(); - return line.sort(sortComparator); -} - -export function sortComparator(a: T, b: T): number { - return a[COLUMN] - b[COLUMN]; -} diff --git a/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts b/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts deleted file mode 100644 index 94f1b6a..0000000 --- a/node_modules/@jridgewell/trace-mapping/src/sourcemap-segment.ts +++ /dev/null @@ -1,23 +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 const COLUMN = 0; -export const SOURCES_INDEX = 1; -export const SOURCE_LINE = 2; -export const SOURCE_COLUMN = 3; -export const NAMES_INDEX = 4; - -export const REV_GENERATED_LINE = 1; -export const REV_GENERATED_COLUMN = 2; diff --git a/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts b/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts deleted file mode 100644 index 2c88980..0000000 --- a/node_modules/@jridgewell/trace-mapping/src/strip-filename.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Removes everything after the last "/", but leaves the slash. - */ -export default function stripFilename(path: string | undefined | null): string { - if (!path) return ''; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); -} diff --git a/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts b/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts deleted file mode 100644 index 0b793d5..0000000 --- a/node_modules/@jridgewell/trace-mapping/src/trace-mapping.ts +++ /dev/null @@ -1,502 +0,0 @@ -import { encode, decode } from '@jridgewell/sourcemap-codec'; - -import resolver from './resolve'; -import maybeSort from './sort'; -import buildBySources from './by-source'; -import { - memoizedState, - memoizedBinarySearch, - upperBound, - lowerBound, - found as bsFound, -} from './binary-search'; -import { - COLUMN, - SOURCES_INDEX, - SOURCE_LINE, - SOURCE_COLUMN, - NAMES_INDEX, - REV_GENERATED_LINE, - REV_GENERATED_COLUMN, -} from './sourcemap-segment'; -import { parse } from './types'; - -import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment'; -import type { - SourceMapV3, - DecodedSourceMap, - EncodedSourceMap, - InvalidOriginalMapping, - OriginalMapping, - InvalidGeneratedMapping, - GeneratedMapping, - SourceMapInput, - Needle, - SourceNeedle, - SourceMap, - EachMapping, - Bias, - XInput, - SectionedSourceMap, - Ro, -} from './types'; -import type { Source } from './by-source'; -import type { MemoState } from './binary-search'; - -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, - XInput, - EncodedSourceMapXInput, - DecodedSourceMapXInput, - SectionedSourceMapXInput, - SectionXInput, -} from './types'; - -interface PublicMap { - _encoded: TraceMap['_encoded']; - _decoded: TraceMap['_decoded']; - _decodedMemo: TraceMap['_decodedMemo']; - _bySources: TraceMap['_bySources']; - _bySourceMemos: TraceMap['_bySourceMemos']; -} - -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)'; - -export const LEAST_UPPER_BOUND = -1; -export const GREATEST_LOWER_BOUND = 1; - -export { FlattenMap, FlattenMap as AnyMap } from './flatten-map'; - -export class TraceMap implements SourceMap { - declare version: SourceMapV3['version']; - declare file: SourceMapV3['file']; - declare names: SourceMapV3['names']; - declare sourceRoot: SourceMapV3['sourceRoot']; - declare sources: SourceMapV3['sources']; - declare sourcesContent: SourceMapV3['sourcesContent']; - declare ignoreList: SourceMapV3['ignoreList']; - - declare resolvedSources: string[]; - declare private _encoded: string | undefined; - - declare private _decoded: SourceMapSegment[][] | undefined; - declare private _decodedMemo: MemoState; - - declare private _bySources: Source[] | undefined; - declare private _bySourceMemos: MemoState[] | undefined; - - constructor(map: Ro, mapUrl?: string | null) { - const isString = typeof map === 'string'; - if (!isString && (map as unknown as { _decodedMemo: any })._decodedMemo) return map as TraceMap; - - const parsed = parse(map as Exclude); - - 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; - this.ignoreList = parsed.ignoreList || (parsed as XInput).x_google_ignoreList || undefined; - - const resolve = resolver(mapUrl, sourceRoot); - this.resolvedSources = sources.map(resolve); - - const { mappings } = parsed; - if (typeof mappings === 'string') { - this._encoded = mappings; - this._decoded = undefined; - } else if (Array.isArray(mappings)) { - this._encoded = undefined; - this._decoded = maybeSort(mappings, isString); - } else if ((parsed as unknown as SectionedSourceMap).sections) { - throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`); - } else { - throw new Error(`invalid source map: ${JSON.stringify(parsed)}`); - } - - this._decodedMemo = memoizedState(); - this._bySources = undefined; - this._bySourceMemos = undefined; - } -} - -/** - * Typescript doesn't allow friend access to private fields, so this just casts the map into a type - * with public access modifiers. - */ -function cast(map: unknown): PublicMap { - return map as any; -} - -/** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ -export function encodedMappings(map: TraceMap): EncodedSourceMap['mappings'] { - return (cast(map)._encoded ??= encode(cast(map)._decoded!)); -} - -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -export function decodedMappings(map: TraceMap): Readonly { - return (cast(map)._decoded ||= decode(cast(map)._encoded!)); -} - -/** - * 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 function traceSegment( - map: TraceMap, - line: number, - column: number, -): Readonly | null { - 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, - cast(map)._decodedMemo, - line, - column, - GREATEST_LOWER_BOUND, - ); - - return index === -1 ? null : segments[index]; -} - -/** - * 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 function originalPositionFor( - map: TraceMap, - needle: Needle, -): OriginalMapping | InvalidOriginalMapping { - let { line, column, bias } = needle; - 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, - cast(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, - ); -} - -/** - * Finds the generated line/column position of the provided source/line/column source position. - */ -export function generatedPositionFor( - map: TraceMap, - needle: SourceNeedle, -): GeneratedMapping | InvalidGeneratedMapping { - const { source, line, column, bias } = needle; - return generatedPosition(map, source, line, column, bias || GREATEST_LOWER_BOUND, false); -} - -/** - * Finds all generated line/column positions of the provided source/line/column source position. - */ -export function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[] { - const { source, line, column, bias } = needle; - // SourceMapConsumer uses LEAST_UPPER_BOUND for some reason, so we follow suit. - return generatedPosition(map, source, line, column, bias || LEAST_UPPER_BOUND, true); -} - -/** - * Iterates each mapping in generated position order. - */ -export function eachMapping(map: TraceMap, cb: (mapping: EachMapping) => void): void { - 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, - } as EachMapping); - } - } -} - -function sourceIndex(map: TraceMap, source: string): number { - const { sources, resolvedSources } = map; - let index = sources.indexOf(source); - if (index === -1) index = resolvedSources.indexOf(source); - return index; -} - -/** - * Retrieves the source content for a particular source, if its found. Returns null if not. - */ -export function sourceContentFor(map: TraceMap, source: string): string | null { - const { sourcesContent } = map; - if (sourcesContent == null) return null; - const index = sourceIndex(map, source); - return index === -1 ? null : sourcesContent[index]; -} - -/** - * Determines if the source is marked to ignore by the source map. - */ -export function isIgnored(map: TraceMap, source: string): boolean { - const { ignoreList } = map; - if (ignoreList == null) return false; - const index = sourceIndex(map, source); - return index === -1 ? false : ignoreList.includes(index); -} - -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -export function presortedDecodedMap(map: DecodedSourceMap, mapUrl?: string): TraceMap { - const tracer = new TraceMap(clone(map, []), mapUrl); - cast(tracer)._decoded = map.mappings; - return tracer; -} - -/** - * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export function decodedMap( - map: TraceMap, -): Omit & { mappings: readonly SourceMapSegment[][] } { - return clone(map, decodedMappings(map)); -} - -/** - * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects - * a sourcemap, or to JSON.stringify. - */ -export function encodedMap(map: TraceMap): EncodedSourceMap { - return clone(map, encodedMappings(map)); -} - -function clone( - map: TraceMap | DecodedSourceMap, - mappings: T, -): T extends string ? EncodedSourceMap : DecodedSourceMap { - return { - version: map.version, - file: map.file, - names: map.names, - sourceRoot: map.sourceRoot, - sources: map.sources, - sourcesContent: map.sourcesContent, - mappings, - ignoreList: map.ignoreList || (map as XInput).x_google_ignoreList, - } as any; -} - -function OMapping(source: null, line: null, column: null, name: null): InvalidOriginalMapping; -function OMapping( - source: string, - line: number, - column: number, - name: string | null, -): OriginalMapping; -function OMapping( - source: string | null, - line: number | null, - column: number | null, - name: string | null, -): OriginalMapping | InvalidOriginalMapping { - return { source, line, column, name } as any; -} - -function GMapping(line: null, column: null): InvalidGeneratedMapping; -function GMapping(line: number, column: number): GeneratedMapping; -function GMapping( - line: number | null, - column: number | null, -): GeneratedMapping | InvalidGeneratedMapping { - return { line, column } as any; -} - -function traceSegmentInternal( - segments: SourceMapSegment[], - memo: MemoState, - line: number, - column: number, - bias: Bias, -): number; -function traceSegmentInternal( - segments: ReverseSegment[], - memo: MemoState, - line: number, - column: number, - bias: Bias, -): number; -function traceSegmentInternal( - segments: SourceMapSegment[] | ReverseSegment[], - memo: MemoState, - line: number, - column: number, - bias: Bias, -): number { - let index = memoizedBinarySearch(segments, column, memo, line); - if (bsFound) { - 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: ReverseSegment[], - memo: MemoState, - line: number, - column: number, - bias: Bias, -): GeneratedMapping[] { - 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 (!bsFound && 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 = bsFound ? column : segments[min][COLUMN]; - - // The binary search is not guaranteed to find the lower bound when a match wasn't found. - if (!bsFound) 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; -} - -function generatedPosition( - map: TraceMap, - source: string, - line: number, - column: number, - bias: Bias, - all: false, -): GeneratedMapping | InvalidGeneratedMapping; -function generatedPosition( - map: TraceMap, - source: string, - line: number, - column: number, - bias: Bias, - all: true, -): GeneratedMapping[]; -function generatedPosition( - map: TraceMap, - source: string, - line: number, - column: number, - bias: Bias, - all: boolean, -): GeneratedMapping | InvalidGeneratedMapping | GeneratedMapping[] { - 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 bySourceMemos = (cast(map)._bySourceMemos ||= sources.map(memoizedState)); - const generated = (cast(map)._bySources ||= buildBySources(decodedMappings(map), bySourceMemos)); - - const segments = generated[sourceIndex][line]; - if (segments == null) return all ? [] : GMapping(null, null); - - const memo = 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]); -} diff --git a/node_modules/@jridgewell/trace-mapping/src/types.ts b/node_modules/@jridgewell/trace-mapping/src/types.ts deleted file mode 100644 index 730a61f..0000000 --- a/node_modules/@jridgewell/trace-mapping/src/types.ts +++ /dev/null @@ -1,114 +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; - ignoreList?: number[]; -} - -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 XInput = { x_google_ignoreList?: SourceMapV3['ignoreList'] }; -export type EncodedSourceMapXInput = EncodedSourceMap & XInput; -export type DecodedSourceMapXInput = DecodedSourceMap & XInput; -export type SectionedSourceMapXInput = Omit & { - sections: SectionXInput[]; -}; -export type SectionXInput = Omit & { - map: SectionedSourceMapInput; -}; - -export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; -export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; - -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 abstract class SourceMap { - declare version: SourceMapV3['version']; - declare file: SourceMapV3['file']; - declare names: SourceMapV3['names']; - declare sourceRoot: SourceMapV3['sourceRoot']; - declare sources: SourceMapV3['sources']; - declare sourcesContent: SourceMapV3['sourcesContent']; - declare resolvedSources: SourceMapV3['sources']; - declare ignoreList: SourceMapV3['ignoreList']; -} - -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 function parse(map: T): Exclude { - return typeof map === 'string' ? JSON.parse(map) : (map as Exclude); -} diff --git a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts deleted file mode 100644 index b7bb85c..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts +++ /dev/null @@ -1,33 +0,0 @@ -import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.cts'; -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; -//# sourceMappingURL=binary-search.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map deleted file mode 100644 index 648e84c..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../src/binary-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,IAAI,KAAK,SAAQ,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAmBR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,aAAa,IAAI,SAAS,CAMzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAsBR"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts deleted file mode 100644 index 19e1e6b..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts +++ /dev/null @@ -1,33 +0,0 @@ -import type { SourceMapSegment, ReverseSegment } from './sourcemap-segment.mts'; -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; -//# sourceMappingURL=binary-search.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map deleted file mode 100644 index 648e84c..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"binary-search.d.ts","sourceRoot":"","sources":["../src/binary-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG5E,MAAM,MAAM,SAAS,GAAG;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,IAAI,KAAK,SAAQ,CAAC;AAEzB;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,GACX,MAAM,CAmBR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,UAAU,CACxB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,GACZ,MAAM,CAKR;AAED,wBAAgB,aAAa,IAAI,SAAS,CAMzC;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,gBAAgB,EAAE,GAAG,cAAc,EAAE,EAC/C,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,MAAM,GACV,MAAM,CAsBR"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts b/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts deleted file mode 100644 index da49693..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.cts'; -export type Source = ReverseSegment[][]; -export = function buildBySources(decoded: readonly SourceMapSegment[][], memos: unknown[]): Source[]; -//# sourceMappingURL=by-source.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map deleted file mode 100644 index 32d2a7a..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/by-source.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"by-source.d.ts","sourceRoot":"","sources":["../src/by-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,cAAc,EAAE,EAAE,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EAAE,EACtC,KAAK,EAAE,OAAO,EAAE,GACf,MAAM,EAAE,CA4BV"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts b/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts deleted file mode 100644 index f361049..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts'; -export type Source = ReverseSegment[][]; -export default function buildBySources(decoded: readonly SourceMapSegment[][], memos: unknown[]): Source[]; -//# sourceMappingURL=by-source.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map deleted file mode 100644 index 32d2a7a..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"by-source.d.ts","sourceRoot":"","sources":["../src/by-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,cAAc,EAAE,EAAE,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,cAAc,CACpC,OAAO,EAAE,SAAS,gBAAgB,EAAE,EAAE,EACtC,KAAK,EAAE,OAAO,EAAE,GACf,MAAM,EAAE,CA4BV"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts deleted file mode 100644 index 433d849..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts +++ /dev/null @@ -1,9 +0,0 @@ -import { TraceMap } from './trace-mapping.cts'; -import type { SectionedSourceMapInput, Ro } from './types.cts'; -type FlattenMap = { - new (map: Ro, mapUrl?: string | null): TraceMap; - (map: Ro, mapUrl?: string | null): TraceMap; -}; -export declare const FlattenMap: FlattenMap; -export {}; -//# sourceMappingURL=flatten-map.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map deleted file mode 100644 index 994b208..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"flatten-map.d.ts","sourceRoot":"","sources":["../src/flatten-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,iBAAiB,CAAC;AAUjF,OAAO,KAAK,EAKV,uBAAuB,EAEvB,EAAE,EACH,MAAM,SAAS,CAAC;AAGjB,KAAK,UAAU,GAAG;IAChB,KAAK,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;IACzE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAsCV,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts deleted file mode 100644 index 444a1be..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts +++ /dev/null @@ -1,9 +0,0 @@ -import { TraceMap } from './trace-mapping.mts'; -import type { SectionedSourceMapInput, Ro } from './types.mts'; -type FlattenMap = { - new (map: Ro, mapUrl?: string | null): TraceMap; - (map: Ro, mapUrl?: string | null): TraceMap; -}; -export declare const FlattenMap: FlattenMap; -export {}; -//# sourceMappingURL=flatten-map.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map deleted file mode 100644 index 994b208..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"flatten-map.d.ts","sourceRoot":"","sources":["../src/flatten-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,iBAAiB,CAAC;AAUjF,OAAO,KAAK,EAKV,uBAAuB,EAEvB,EAAE,EACH,MAAM,SAAS,CAAC;AAGjB,KAAK,UAAU,GAAG;IAChB,KAAK,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;IACzE,CAAC,GAAG,EAAE,EAAE,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAC;CACtE,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAsCV,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts b/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts deleted file mode 100644 index 62aeedb..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts +++ /dev/null @@ -1,4 +0,0 @@ -type Resolve = (source: string | null) => string; -export = function resolver(mapUrl: string | null | undefined, sourceRoot: string | undefined): Resolve; -export {}; -//# sourceMappingURL=resolve.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map deleted file mode 100644 index 9f155ac..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/resolve.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AACjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAQT"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts b/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts deleted file mode 100644 index e2798a1..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts +++ /dev/null @@ -1,4 +0,0 @@ -type Resolve = (source: string | null) => string; -export default function resolver(mapUrl: string | null | undefined, sourceRoot: string | undefined): Resolve; -export {}; -//# sourceMappingURL=resolve.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map deleted file mode 100644 index 9f155ac..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA,KAAK,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAC;AACjD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,UAAU,EAAE,MAAM,GAAG,SAAS,GAC7B,OAAO,CAQT"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sort.d.cts b/node_modules/@jridgewell/trace-mapping/types/sort.d.cts deleted file mode 100644 index aa14c12..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/sort.d.cts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.cts'; -export = function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; -export declare function sortComparator(a: T, b: T): number; -//# sourceMappingURL=sort.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map deleted file mode 100644 index 48b8e67..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/sort.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAC9B,KAAK,EAAE,OAAO,GACb,gBAAgB,EAAE,EAAE,CAYtB;AAuBD,wBAAgB,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAE9F"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sort.d.mts b/node_modules/@jridgewell/trace-mapping/types/sort.d.mts deleted file mode 100644 index c5b94e6..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/sort.d.mts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ReverseSegment, SourceMapSegment } from './sourcemap-segment.mts'; -export default function maybeSort(mappings: SourceMapSegment[][], owned: boolean): SourceMapSegment[][]; -export declare function sortComparator(a: T, b: T): number; -//# sourceMappingURL=sort.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map deleted file mode 100644 index 48b8e67..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/sort.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5E,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAC9B,KAAK,EAAE,OAAO,GACb,gBAAgB,EAAE,EAAE,CAYtB;AAuBD,wBAAgB,cAAc,CAAC,CAAC,SAAS,gBAAgB,GAAG,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,MAAM,CAE9F"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts deleted file mode 100644 index 8d3cabc..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts +++ /dev/null @@ -1,17 +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 {}; -//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map deleted file mode 100644 index 0c94a46..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,KAAK,aAAa,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts deleted file mode 100644 index 8d3cabc..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts +++ /dev/null @@ -1,17 +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 {}; -//# sourceMappingURL=sourcemap-segment.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map deleted file mode 100644 index 0c94a46..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"sourcemap-segment.d.ts","sourceRoot":"","sources":["../src/sourcemap-segment.ts"],"names":[],"mappings":"AAAA,KAAK,eAAe,GAAG,MAAM,CAAC;AAC9B,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AACzB,KAAK,YAAY,GAAG,MAAM,CAAC;AAC3B,KAAK,UAAU,GAAG,MAAM,CAAC;AAEzB,KAAK,aAAa,GAAG,MAAM,CAAC;AAE5B,MAAM,MAAM,gBAAgB,GACxB,CAAC,eAAe,CAAC,GACjB,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,CAAC,GACzD,CAAC,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC;AAE1E,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC;AAE5E,eAAO,MAAM,MAAM,IAAI,CAAC;AACxB,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,aAAa,IAAI,CAAC;AAC/B,eAAO,MAAM,WAAW,IAAI,CAAC;AAE7B,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts deleted file mode 100644 index 8b3c0e9..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Removes everything after the last "/", but leaves the slash. - */ -export = function stripFilename(path: string | undefined | null): string; -//# sourceMappingURL=strip-filename.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map deleted file mode 100644 index 17a25da..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strip-filename.d.ts","sourceRoot":"","sources":["../src/strip-filename.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAI7E"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts deleted file mode 100644 index cbbaee0..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Removes everything after the last "/", but leaves the slash. - */ -export default function stripFilename(path: string | undefined | null): string; -//# sourceMappingURL=strip-filename.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map deleted file mode 100644 index 17a25da..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"strip-filename.d.ts","sourceRoot":"","sources":["../src/strip-filename.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAI7E"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts deleted file mode 100644 index a40f305..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts +++ /dev/null @@ -1,80 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.cts'; -import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping, Ro } from './types.cts'; -export type { SourceMapSegment } from './sourcemap-segment.cts'; -export type { SourceMap, DecodedSourceMap, EncodedSourceMap, Section, SectionedSourceMap, SourceMapV3, Bias, EachMapping, GeneratedMapping, InvalidGeneratedMapping, InvalidOriginalMapping, Needle, OriginalMapping, OriginalMapping as Mapping, SectionedSourceMapInput, SourceMapInput, SourceNeedle, XInput, EncodedSourceMapXInput, DecodedSourceMapXInput, SectionedSourceMapXInput, SectionXInput, } from './types.cts'; -export declare const LEAST_UPPER_BOUND = -1; -export declare const GREATEST_LOWER_BOUND = 1; -export { FlattenMap, FlattenMap as AnyMap } from './flatten-map.cts'; -export declare class TraceMap implements SourceMap { - version: SourceMapV3['version']; - file: SourceMapV3['file']; - names: SourceMapV3['names']; - sourceRoot: SourceMapV3['sourceRoot']; - sources: SourceMapV3['sources']; - sourcesContent: SourceMapV3['sourcesContent']; - ignoreList: SourceMapV3['ignoreList']; - resolvedSources: string[]; - private _encoded; - private _decoded; - private _decodedMemo; - private _bySources; - private _bySourceMemos; - constructor(map: Ro, mapUrl?: string | null); -} -/** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ -export declare function encodedMappings(map: TraceMap): EncodedSourceMap['mappings']; -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -export declare function 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 function 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 function originalPositionFor(map: TraceMap, needle: Needle): OriginalMapping | InvalidOriginalMapping; -/** - * Finds the generated line/column position of the provided source/line/column source position. - */ -export declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping | InvalidGeneratedMapping; -/** - * Finds all generated line/column positions of the provided source/line/column source position. - */ -export declare function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[]; -/** - * Iterates each mapping in generated position order. - */ -export declare function 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 function sourceContentFor(map: TraceMap, source: string): string | null; -/** - * Determines if the source is marked to ignore by the source map. - */ -export declare function isIgnored(map: TraceMap, source: string): boolean; -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -export declare function 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 function 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 function encodedMap(map: TraceMap): EncodedSourceMap; -//# sourceMappingURL=trace-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map deleted file mode 100644 index b5a874c..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trace-mapping.d.ts","sourceRoot":"","sources":["../src/trace-mapping.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EAIX,EAAE,EACH,MAAM,SAAS,CAAC;AAIjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,EACN,eAAe,EACf,eAAe,IAAI,OAAO,EAC1B,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,GACd,MAAM,SAAS,CAAC;AAajB,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjE,qBAAa,QAAS,YAAW,SAAS;IAChC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IAEtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAClC,QAAgB,QAAQ,CAAqB;IAE7C,QAAgB,QAAQ,CAAmC;IAC3D,QAAgB,YAAY,CAAY;IAExC,QAAgB,UAAU,CAAuB;IACjD,QAAgB,cAAc,CAA0B;gBAE5C,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;CAmC5D;AAUD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAE3E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAErF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAiBnC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,sBAAsB,CAiC1C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,YAAY,GACnB,gBAAgB,GAAG,uBAAuB,CAG5C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAIhG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAgCnF;AASD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAIpF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,QAAQ,GACZ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAA;CAAE,CAElF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAE1D"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts deleted file mode 100644 index bc2ff0f..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts +++ /dev/null @@ -1,80 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.mts'; -import type { SourceMapV3, DecodedSourceMap, EncodedSourceMap, InvalidOriginalMapping, OriginalMapping, InvalidGeneratedMapping, GeneratedMapping, SourceMapInput, Needle, SourceNeedle, SourceMap, EachMapping, Ro } from './types.mts'; -export type { SourceMapSegment } from './sourcemap-segment.mts'; -export type { SourceMap, DecodedSourceMap, EncodedSourceMap, Section, SectionedSourceMap, SourceMapV3, Bias, EachMapping, GeneratedMapping, InvalidGeneratedMapping, InvalidOriginalMapping, Needle, OriginalMapping, OriginalMapping as Mapping, SectionedSourceMapInput, SourceMapInput, SourceNeedle, XInput, EncodedSourceMapXInput, DecodedSourceMapXInput, SectionedSourceMapXInput, SectionXInput, } from './types.mts'; -export declare const LEAST_UPPER_BOUND = -1; -export declare const GREATEST_LOWER_BOUND = 1; -export { FlattenMap, FlattenMap as AnyMap } from './flatten-map.mts'; -export declare class TraceMap implements SourceMap { - version: SourceMapV3['version']; - file: SourceMapV3['file']; - names: SourceMapV3['names']; - sourceRoot: SourceMapV3['sourceRoot']; - sources: SourceMapV3['sources']; - sourcesContent: SourceMapV3['sourcesContent']; - ignoreList: SourceMapV3['ignoreList']; - resolvedSources: string[]; - private _encoded; - private _decoded; - private _decodedMemo; - private _bySources; - private _bySourceMemos; - constructor(map: Ro, mapUrl?: string | null); -} -/** - * Returns the encoded (VLQ string) form of the SourceMap's mappings field. - */ -export declare function encodedMappings(map: TraceMap): EncodedSourceMap['mappings']; -/** - * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field. - */ -export declare function 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 function 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 function originalPositionFor(map: TraceMap, needle: Needle): OriginalMapping | InvalidOriginalMapping; -/** - * Finds the generated line/column position of the provided source/line/column source position. - */ -export declare function generatedPositionFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping | InvalidGeneratedMapping; -/** - * Finds all generated line/column positions of the provided source/line/column source position. - */ -export declare function allGeneratedPositionsFor(map: TraceMap, needle: SourceNeedle): GeneratedMapping[]; -/** - * Iterates each mapping in generated position order. - */ -export declare function 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 function sourceContentFor(map: TraceMap, source: string): string | null; -/** - * Determines if the source is marked to ignore by the source map. - */ -export declare function isIgnored(map: TraceMap, source: string): boolean; -/** - * A helper that skips sorting of the input map's mappings array, which can be expensive for larger - * maps. - */ -export declare function 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 function 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 function encodedMap(map: TraceMap): EncodedSourceMap; -//# sourceMappingURL=trace-mapping.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map deleted file mode 100644 index b5a874c..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"trace-mapping.d.ts","sourceRoot":"","sources":["../src/trace-mapping.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,uBAAuB,EACvB,gBAAgB,EAChB,cAAc,EACd,MAAM,EACN,YAAY,EACZ,SAAS,EACT,WAAW,EAIX,EAAE,EACH,MAAM,SAAS,CAAC;AAIjB,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,YAAY,EACV,SAAS,EACT,gBAAgB,EAChB,gBAAgB,EAChB,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,IAAI,EACJ,WAAW,EACX,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,EACtB,MAAM,EACN,eAAe,EACf,eAAe,IAAI,OAAO,EAC1B,uBAAuB,EACvB,cAAc,EACd,YAAY,EACZ,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,aAAa,GACd,MAAM,SAAS,CAAC;AAajB,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,UAAU,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAEjE,qBAAa,QAAS,YAAW,SAAS;IAChC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IAEtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAClC,QAAgB,QAAQ,CAAqB;IAE7C,QAAgB,QAAQ,CAAmC;IAC3D,QAAgB,YAAY,CAAY;IAExC,QAAgB,UAAU,CAAuB;IACjD,QAAgB,cAAc,CAA0B;gBAE5C,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;CAmC5D;AAUD;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAE3E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAErF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,GAAG,EAAE,QAAQ,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,GACb,QAAQ,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAiBnC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,MAAM,GACb,eAAe,GAAG,sBAAsB,CAiC1C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,QAAQ,EACb,MAAM,EAAE,YAAY,GACnB,gBAAgB,GAAG,uBAAuB,CAG5C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,GAAG,gBAAgB,EAAE,CAIhG;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,GAAG,IAAI,CAgCnF;AASD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAKhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,QAAQ,CAIpF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,QAAQ,GACZ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,GAAG;IAAE,QAAQ,EAAE,SAAS,gBAAgB,EAAE,EAAE,CAAA;CAAE,CAElF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAE1D"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/types.d.cts b/node_modules/@jridgewell/trace-mapping/types/types.d.cts deleted file mode 100644 index 729c2c3..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/types.d.cts +++ /dev/null @@ -1,107 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.cts'; -import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping.cts'; -export interface SourceMapV3 { - file?: string | null; - names: string[]; - sourceRoot?: string; - sources: (string | null)[]; - sourcesContent?: (string | null)[]; - version: 3; - ignoreList?: number[]; -} -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 XInput = { - x_google_ignoreList?: SourceMapV3['ignoreList']; -}; -export type EncodedSourceMapXInput = EncodedSourceMap & XInput; -export type DecodedSourceMapXInput = DecodedSourceMap & XInput; -export type SectionedSourceMapXInput = Omit & { - sections: SectionXInput[]; -}; -export type SectionXInput = Omit & { - map: SectionedSourceMapInput; -}; -export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; -export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; -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']; - ignoreList: SourceMapV3['ignoreList']; -} -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 declare function parse(map: T): Exclude; -export {}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map b/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map deleted file mode 100644 index 9224783..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/types.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;CAC/D;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,OAAO,oBAAoB,GAAG,OAAO,iBAAiB,CAAC;AAE1E,MAAM,MAAM,MAAM,GAAG;IAAE,mBAAmB,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAAG;IAC5E,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG;IACjD,GAAG,EAAE,uBAAuB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,QAAQ,CAAC;AACjG,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,wBAAwB,CAAC;AAEhF,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,WAAW,GACnB;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,IAAI,CAAC;IACb,YAAY,EAAE,IAAI,CAAC;IACnB,cAAc,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEN,8BAAsB,SAAS;IACrB,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,EAAE,CAAC,CAAC,IACd,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACpB,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GACvD,CAAC,SAAS,MAAM,GACd,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACrD,CAAC,CAAC;AACV,KAAK,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEvD,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAEnD"} \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/types.d.mts b/node_modules/@jridgewell/trace-mapping/types/types.d.mts deleted file mode 100644 index a26d186..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/types.d.mts +++ /dev/null @@ -1,107 +0,0 @@ -import type { SourceMapSegment } from './sourcemap-segment.mts'; -import type { GREATEST_LOWER_BOUND, LEAST_UPPER_BOUND, TraceMap } from './trace-mapping.mts'; -export interface SourceMapV3 { - file?: string | null; - names: string[]; - sourceRoot?: string; - sources: (string | null)[]; - sourcesContent?: (string | null)[]; - version: 3; - ignoreList?: number[]; -} -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 XInput = { - x_google_ignoreList?: SourceMapV3['ignoreList']; -}; -export type EncodedSourceMapXInput = EncodedSourceMap & XInput; -export type DecodedSourceMapXInput = DecodedSourceMap & XInput; -export type SectionedSourceMapXInput = Omit & { - sections: SectionXInput[]; -}; -export type SectionXInput = Omit & { - map: SectionedSourceMapInput; -}; -export type SourceMapInput = string | EncodedSourceMapXInput | DecodedSourceMapXInput | TraceMap; -export type SectionedSourceMapInput = SourceMapInput | SectionedSourceMapXInput; -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']; - ignoreList: SourceMapV3['ignoreList']; -} -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 declare function parse(map: T): Exclude; -export {}; -//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map b/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map deleted file mode 100644 index 9224783..0000000 --- a/node_modules/@jridgewell/trace-mapping/types/types.d.mts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEzF,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IAC3B,cAAc,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACnC,OAAO,EAAE,CAAC,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,QAAQ,EAAE,gBAAgB,EAAE,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;CAC/D;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,OAAO,EAAE,CAAC,CAAC;CACZ;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AACF,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,IAAI,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG,OAAO,oBAAoB,GAAG,OAAO,iBAAiB,CAAC;AAE1E,MAAM,MAAM,MAAM,GAAG;IAAE,mBAAmB,CAAC,EAAE,WAAW,CAAC,YAAY,CAAC,CAAA;CAAE,CAAC;AACzE,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAC/D,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,GAAG;IAC5E,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG;IACjD,GAAG,EAAE,uBAAuB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,sBAAsB,GAAG,sBAAsB,GAAG,QAAQ,CAAC;AACjG,MAAM,MAAM,uBAAuB,GAAG,cAAc,GAAG,wBAAwB,CAAC;AAEhF,MAAM,MAAM,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzF,MAAM,MAAM,WAAW,GACnB;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,IAAI,CAAC;IACb,YAAY,EAAE,IAAI,CAAC;IACnB,cAAc,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB,CAAC;AAEN,8BAAsB,SAAS;IACrB,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC1B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC5B,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;IACtC,OAAO,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IAChC,cAAc,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC9C,eAAe,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,UAAU,EAAE,WAAW,CAAC,YAAY,CAAC,CAAC;CAC/C;AAED,MAAM,MAAM,EAAE,CAAC,CAAC,IACd,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GACpB,CAAC,EAAE,GAAG,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GACvD,CAAC,SAAS,MAAM,GACd,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GACrD,CAAC,CAAC;AACV,KAAK,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,KAAK,QAAQ,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC;AAEvD,wBAAgB,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAEnD"} \ No newline at end of file diff --git a/node_modules/@nodelib/fs.scandir/LICENSE b/node_modules/@nodelib/fs.scandir/LICENSE deleted file mode 100644 index 65a9994..0000000 --- a/node_modules/@nodelib/fs.scandir/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -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/@nodelib/fs.scandir/README.md b/node_modules/@nodelib/fs.scandir/README.md deleted file mode 100644 index e0b218b..0000000 --- a/node_modules/@nodelib/fs.scandir/README.md +++ /dev/null @@ -1,171 +0,0 @@ -# @nodelib/fs.scandir - -> List files and directories inside the specified directory. - -## :bulb: Highlights - -The package is aimed at obtaining information about entries in the directory. - -* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). -* :gear: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type. See [`old` and `modern` mode](#old-and-modern-mode). -* :link: Can safely work with broken symbolic links. - -## Install - -```console -npm install @nodelib/fs.scandir -``` - -## Usage - -```ts -import * as fsScandir from '@nodelib/fs.scandir'; - -fsScandir.scandir('path', (error, stats) => { /* … */ }); -``` - -## API - -### .scandir(path, [optionsOrSettings], callback) - -Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path with standard callback-style. - -```ts -fsScandir.scandir('path', (error, entries) => { /* … */ }); -fsScandir.scandir('path', {}, (error, entries) => { /* … */ }); -fsScandir.scandir('path', new fsScandir.Settings(), (error, entries) => { /* … */ }); -``` - -### .scandirSync(path, [optionsOrSettings]) - -Returns an array of plain objects ([`Entry`](#entry)) with information about entry for provided path. - -```ts -const entries = fsScandir.scandirSync('path'); -const entries = fsScandir.scandirSync('path', {}); -const entries = fsScandir.scandirSync(('path', new fsScandir.Settings()); -``` - -#### path - -* Required: `true` -* Type: `string | Buffer | URL` - -A path to a file. If a URL is provided, it must use the `file:` protocol. - -#### optionsOrSettings - -* Required: `false` -* Type: `Options | Settings` -* Default: An instance of `Settings` class - -An [`Options`](#options) object or an instance of [`Settings`](#settingsoptions) class. - -> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. - -### Settings([options]) - -A class of full settings of the package. - -```ts -const settings = new fsScandir.Settings({ followSymbolicLinks: false }); - -const entries = fsScandir.scandirSync('path', settings); -``` - -## Entry - -* `name` — The name of the entry (`unknown.txt`). -* `path` — The path of the entry relative to call directory (`root/unknown.txt`). -* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. On Node.js below 10.10 will be emulated by [`DirentFromStats`](./src/utils/fs.ts) class. -* `stats` (optional) — An instance of `fs.Stats` class. - -For example, the `scandir` call for `tools` directory with one directory inside: - -```ts -{ - dirent: Dirent { name: 'typedoc', /* … */ }, - name: 'typedoc', - path: 'tools/typedoc' -} -``` - -## Options - -### stats - -* Type: `boolean` -* Default: `false` - -Adds an instance of `fs.Stats` class to the [`Entry`](#entry). - -> :book: Always use `fs.readdir` without the `withFileTypes` option. ??TODO?? - -### followSymbolicLinks - -* Type: `boolean` -* Default: `false` - -Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. - -### `throwErrorOnBrokenSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Throw an error when symbolic link is broken if `true` or safely use `lstat` call if `false`. - -### `pathSegmentSeparator` - -* Type: `string` -* Default: `path.sep` - -By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. - -### `fs` - -* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) -* Default: A default FS methods - -By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. - -```ts -interface FileSystemAdapter { - lstat?: typeof fs.lstat; - stat?: typeof fs.stat; - lstatSync?: typeof fs.lstatSync; - statSync?: typeof fs.statSync; - readdir?: typeof fs.readdir; - readdirSync?: typeof fs.readdirSync; -} - -const settings = new fsScandir.Settings({ - fs: { lstat: fakeLstat } -}); -``` - -## `old` and `modern` mode - -This package has two modes that are used depending on the environment and parameters of use. - -### old - -* Node.js below `10.10` or when the `stats` option is enabled - -When working in the old mode, the directory is read first (`fs.readdir`), then the type of entries is determined (`fs.lstat` and/or `fs.stat` for symbolic links). - -### modern - -* Node.js 10.10+ and the `stats` option is disabled - -In the modern mode, reading the directory (`fs.readdir` with the `withFileTypes` option) is combined with obtaining information about its entries. An additional call for symbolic links (`fs.stat`) is still present. - -This mode makes fewer calls to the file system. It's faster. - -## Changelog - -See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. - -## License - -This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts deleted file mode 100644 index 827f1db..0000000 --- a/node_modules/@nodelib/fs.scandir/out/adapters/fs.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type * as fsStat from '@nodelib/fs.stat'; -import type { Dirent, ErrnoException } from '../types'; -export interface ReaddirAsynchronousMethod { - (filepath: string, options: { - withFileTypes: true; - }, callback: (error: ErrnoException | null, files: Dirent[]) => void): void; - (filepath: string, callback: (error: ErrnoException | null, files: string[]) => void): void; -} -export interface ReaddirSynchronousMethod { - (filepath: string, options: { - withFileTypes: true; - }): Dirent[]; - (filepath: string): string[]; -} -export declare type FileSystemAdapter = fsStat.FileSystemAdapter & { - readdir: ReaddirAsynchronousMethod; - readdirSync: ReaddirSynchronousMethod; -}; -export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; -export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/adapters/fs.js b/node_modules/@nodelib/fs.scandir/out/adapters/fs.js deleted file mode 100644 index f0fe022..0000000 --- a/node_modules/@nodelib/fs.scandir/out/adapters/fs.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; -const fs = require("fs"); -exports.FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - stat: fs.stat, - lstatSync: fs.lstatSync, - statSync: fs.statSync, - readdir: fs.readdir, - readdirSync: fs.readdirSync -}; -function createFileSystemAdapter(fsMethods) { - if (fsMethods === undefined) { - return exports.FILE_SYSTEM_ADAPTER; - } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); -} -exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.d.ts b/node_modules/@nodelib/fs.scandir/out/constants.d.ts deleted file mode 100644 index 33f1749..0000000 --- a/node_modules/@nodelib/fs.scandir/out/constants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/** - * IS `true` for Node.js 10.10 and greater. - */ -export declare const IS_SUPPORT_READDIR_WITH_FILE_TYPES: boolean; diff --git a/node_modules/@nodelib/fs.scandir/out/constants.js b/node_modules/@nodelib/fs.scandir/out/constants.js deleted file mode 100644 index 7e3d441..0000000 --- a/node_modules/@nodelib/fs.scandir/out/constants.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0; -const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.'); -if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) { - throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`); -} -const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10); -const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10); -const SUPPORTED_MAJOR_VERSION = 10; -const SUPPORTED_MINOR_VERSION = 10; -const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION; -const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION; -/** - * IS `true` for Node.js 10.10 and greater. - */ -exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR; diff --git a/node_modules/@nodelib/fs.scandir/out/index.d.ts b/node_modules/@nodelib/fs.scandir/out/index.d.ts deleted file mode 100644 index b9da83e..0000000 --- a/node_modules/@nodelib/fs.scandir/out/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod } from './adapters/fs'; -import * as async from './providers/async'; -import Settings, { Options } from './settings'; -import type { Dirent, Entry } from './types'; -declare type AsyncCallback = async.AsyncCallback; -declare function scandir(path: string, callback: AsyncCallback): void; -declare function scandir(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; -declare namespace scandir { - function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; -} -declare function scandirSync(path: string, optionsOrSettings?: Options | Settings): Entry[]; -export { scandir, scandirSync, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, ReaddirAsynchronousMethod, ReaddirSynchronousMethod, Options }; diff --git a/node_modules/@nodelib/fs.scandir/out/index.js b/node_modules/@nodelib/fs.scandir/out/index.js deleted file mode 100644 index 99c70d3..0000000 --- a/node_modules/@nodelib/fs.scandir/out/index.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Settings = exports.scandirSync = exports.scandir = void 0; -const async = require("./providers/async"); -const sync = require("./providers/sync"); -const settings_1 = require("./settings"); -exports.Settings = settings_1.default; -function scandir(path, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - async.read(path, getSettings(), optionsOrSettingsOrCallback); - return; - } - async.read(path, getSettings(optionsOrSettingsOrCallback), callback); -} -exports.scandir = scandir; -function scandirSync(path, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path, settings); -} -exports.scandirSync = scandirSync; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); -} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts deleted file mode 100644 index 5829676..0000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/async.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/// -import type Settings from '../settings'; -import type { Entry } from '../types'; -export declare type AsyncCallback = (error: NodeJS.ErrnoException, entries: Entry[]) => void; -export declare function read(directory: string, settings: Settings, callback: AsyncCallback): void; -export declare function readdirWithFileTypes(directory: string, settings: Settings, callback: AsyncCallback): void; -export declare function readdir(directory: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/async.js b/node_modules/@nodelib/fs.scandir/out/providers/async.js deleted file mode 100644 index e8e2f0a..0000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/async.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; -const fsStat = require("@nodelib/fs.stat"); -const rpl = require("run-parallel"); -const constants_1 = require("../constants"); -const utils = require("../utils"); -const common = require("./common"); -function read(directory, settings, callback) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - readdirWithFileTypes(directory, settings, callback); - return; - } - readdir(directory, settings, callback); -} -exports.read = read; -function readdirWithFileTypes(directory, settings, callback) { - settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => { - if (readdirError !== null) { - callFailureCallback(callback, readdirError); - return; - } - const entries = dirents.map((dirent) => ({ - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - })); - if (!settings.followSymbolicLinks) { - callSuccessCallback(callback, entries); - return; - } - const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings)); - rpl(tasks, (rplError, rplEntries) => { - if (rplError !== null) { - callFailureCallback(callback, rplError); - return; - } - callSuccessCallback(callback, rplEntries); - }); - }); -} -exports.readdirWithFileTypes = readdirWithFileTypes; -function makeRplTaskEntry(entry, settings) { - return (done) => { - if (!entry.dirent.isSymbolicLink()) { - done(null, entry); - return; - } - settings.fs.stat(entry.path, (statError, stats) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - done(statError); - return; - } - done(null, entry); - return; - } - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - done(null, entry); - }); - }; -} -function readdir(directory, settings, callback) { - settings.fs.readdir(directory, (readdirError, names) => { - if (readdirError !== null) { - callFailureCallback(callback, readdirError); - return; - } - const tasks = names.map((name) => { - const path = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - return (done) => { - fsStat.stat(path, settings.fsStatSettings, (error, stats) => { - if (error !== null) { - done(error); - return; - } - const entry = { - name, - path, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - done(null, entry); - }); - }; - }); - rpl(tasks, (rplError, entries) => { - if (rplError !== null) { - callFailureCallback(callback, rplError); - return; - } - callSuccessCallback(callback, entries); - }); - }); -} -exports.readdir = readdir; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, result) { - callback(null, result); -} diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts deleted file mode 100644 index 2b4d08b..0000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/common.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/common.js b/node_modules/@nodelib/fs.scandir/out/providers/common.js deleted file mode 100644 index 8724cb5..0000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/common.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.joinPathSegments = void 0; -function joinPathSegments(a, b, separator) { - /** - * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). - */ - if (a.endsWith(separator)) { - return a + b; - } - return a + separator + b; -} -exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts b/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts deleted file mode 100644 index e05c8f0..0000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/sync.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type Settings from '../settings'; -import type { Entry } from '../types'; -export declare function read(directory: string, settings: Settings): Entry[]; -export declare function readdirWithFileTypes(directory: string, settings: Settings): Entry[]; -export declare function readdir(directory: string, settings: Settings): Entry[]; diff --git a/node_modules/@nodelib/fs.scandir/out/providers/sync.js b/node_modules/@nodelib/fs.scandir/out/providers/sync.js deleted file mode 100644 index 146db34..0000000 --- a/node_modules/@nodelib/fs.scandir/out/providers/sync.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.readdir = exports.readdirWithFileTypes = exports.read = void 0; -const fsStat = require("@nodelib/fs.stat"); -const constants_1 = require("../constants"); -const utils = require("../utils"); -const common = require("./common"); -function read(directory, settings) { - if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) { - return readdirWithFileTypes(directory, settings); - } - return readdir(directory, settings); -} -exports.read = read; -function readdirWithFileTypes(directory, settings) { - const dirents = settings.fs.readdirSync(directory, { withFileTypes: true }); - return dirents.map((dirent) => { - const entry = { - dirent, - name: dirent.name, - path: common.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator) - }; - if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) { - try { - const stats = settings.fs.statSync(entry.path); - entry.dirent = utils.fs.createDirentFromStats(entry.name, stats); - } - catch (error) { - if (settings.throwErrorOnBrokenSymbolicLink) { - throw error; - } - } - } - return entry; - }); -} -exports.readdirWithFileTypes = readdirWithFileTypes; -function readdir(directory, settings) { - const names = settings.fs.readdirSync(directory); - return names.map((name) => { - const entryPath = common.joinPathSegments(directory, name, settings.pathSegmentSeparator); - const stats = fsStat.statSync(entryPath, settings.fsStatSettings); - const entry = { - name, - path: entryPath, - dirent: utils.fs.createDirentFromStats(name, stats) - }; - if (settings.stats) { - entry.stats = stats; - } - return entry; - }); -} -exports.readdir = readdir; diff --git a/node_modules/@nodelib/fs.scandir/out/settings.d.ts b/node_modules/@nodelib/fs.scandir/out/settings.d.ts deleted file mode 100644 index a0db115..0000000 --- a/node_modules/@nodelib/fs.scandir/out/settings.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import * as fsStat from '@nodelib/fs.stat'; -import * as fs from './adapters/fs'; -export interface Options { - followSymbolicLinks?: boolean; - fs?: Partial; - pathSegmentSeparator?: string; - stats?: boolean; - throwErrorOnBrokenSymbolicLink?: boolean; -} -export default class Settings { - private readonly _options; - readonly followSymbolicLinks: boolean; - readonly fs: fs.FileSystemAdapter; - readonly pathSegmentSeparator: string; - readonly stats: boolean; - readonly throwErrorOnBrokenSymbolicLink: boolean; - readonly fsStatSettings: fsStat.Settings; - constructor(_options?: Options); - private _getValue; -} diff --git a/node_modules/@nodelib/fs.scandir/out/settings.js b/node_modules/@nodelib/fs.scandir/out/settings.js deleted file mode 100644 index 15a3e8c..0000000 --- a/node_modules/@nodelib/fs.scandir/out/settings.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = require("path"); -const fsStat = require("@nodelib/fs.stat"); -const fs = require("./adapters/fs"); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false); - this.fs = fs.createFileSystemAdapter(this._options.fs); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); - this.stats = this._getValue(this._options.stats, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - this.fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this.followSymbolicLinks, - fs: this.fs, - throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } -} -exports.default = Settings; diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.d.ts b/node_modules/@nodelib/fs.scandir/out/types/index.d.ts deleted file mode 100644 index f326c5e..0000000 --- a/node_modules/@nodelib/fs.scandir/out/types/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// -import type * as fs from 'fs'; -export interface Entry { - dirent: Dirent; - name: string; - path: string; - stats?: Stats; -} -export declare type Stats = fs.Stats; -export declare type ErrnoException = NodeJS.ErrnoException; -export interface Dirent { - isBlockDevice: () => boolean; - isCharacterDevice: () => boolean; - isDirectory: () => boolean; - isFIFO: () => boolean; - isFile: () => boolean; - isSocket: () => boolean; - isSymbolicLink: () => boolean; - name: string; -} diff --git a/node_modules/@nodelib/fs.scandir/out/types/index.js b/node_modules/@nodelib/fs.scandir/out/types/index.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/@nodelib/fs.scandir/out/types/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts deleted file mode 100644 index bb863f1..0000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/fs.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Dirent, Stats } from '../types'; -export declare function createDirentFromStats(name: string, stats: Stats): Dirent; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/fs.js b/node_modules/@nodelib/fs.scandir/out/utils/fs.js deleted file mode 100644 index ace7c74..0000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/fs.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createDirentFromStats = void 0; -class DirentFromStats { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } -} -function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); -} -exports.createDirentFromStats = createDirentFromStats; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts b/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts deleted file mode 100644 index 1b41954..0000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import * as fs from './fs'; -export { fs }; diff --git a/node_modules/@nodelib/fs.scandir/out/utils/index.js b/node_modules/@nodelib/fs.scandir/out/utils/index.js deleted file mode 100644 index f5de129..0000000 --- a/node_modules/@nodelib/fs.scandir/out/utils/index.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.fs = void 0; -const fs = require("./fs"); -exports.fs = fs; diff --git a/node_modules/@nodelib/fs.scandir/package.json b/node_modules/@nodelib/fs.scandir/package.json deleted file mode 100644 index d3a8924..0000000 --- a/node_modules/@nodelib/fs.scandir/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@nodelib/fs.scandir", - "version": "2.1.5", - "description": "List files and directories inside the specified directory", - "license": "MIT", - "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.scandir", - "keywords": [ - "NodeLib", - "fs", - "FileSystem", - "file system", - "scandir", - "readdir", - "dirent" - ], - "engines": { - "node": ">= 8" - }, - "files": [ - "out/**", - "!out/**/*.map", - "!out/**/*.spec.*" - ], - "main": "out/index.js", - "typings": "out/index.d.ts", - "scripts": { - "clean": "rimraf {tsconfig.tsbuildinfo,out}", - "lint": "eslint \"src/**/*.ts\" --cache", - "compile": "tsc -b .", - "compile:watch": "tsc -p . --watch --sourceMap", - "test": "mocha \"out/**/*.spec.js\" -s 0", - "build": "npm run clean && npm run compile && npm run lint && npm test", - "watch": "npm run clean && npm run compile:watch" - }, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "devDependencies": { - "@nodelib/fs.macchiato": "1.0.4", - "@types/run-parallel": "^1.1.0" - }, - "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" -} diff --git a/node_modules/@nodelib/fs.stat/LICENSE b/node_modules/@nodelib/fs.stat/LICENSE deleted file mode 100644 index 65a9994..0000000 --- a/node_modules/@nodelib/fs.stat/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -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/@nodelib/fs.stat/README.md b/node_modules/@nodelib/fs.stat/README.md deleted file mode 100644 index 686f047..0000000 --- a/node_modules/@nodelib/fs.stat/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# @nodelib/fs.stat - -> Get the status of a file with some features. - -## :bulb: Highlights - -Wrapper around standard method `fs.lstat` and `fs.stat` with some features. - -* :beginner: Normally follows symbolic link. -* :gear: Can safely work with broken symbolic link. - -## Install - -```console -npm install @nodelib/fs.stat -``` - -## Usage - -```ts -import * as fsStat from '@nodelib/fs.stat'; - -fsStat.stat('path', (error, stats) => { /* … */ }); -``` - -## API - -### .stat(path, [optionsOrSettings], callback) - -Returns an instance of `fs.Stats` class for provided path with standard callback-style. - -```ts -fsStat.stat('path', (error, stats) => { /* … */ }); -fsStat.stat('path', {}, (error, stats) => { /* … */ }); -fsStat.stat('path', new fsStat.Settings(), (error, stats) => { /* … */ }); -``` - -### .statSync(path, [optionsOrSettings]) - -Returns an instance of `fs.Stats` class for provided path. - -```ts -const stats = fsStat.stat('path'); -const stats = fsStat.stat('path', {}); -const stats = fsStat.stat('path', new fsStat.Settings()); -``` - -#### path - -* Required: `true` -* Type: `string | Buffer | URL` - -A path to a file. If a URL is provided, it must use the `file:` protocol. - -#### optionsOrSettings - -* Required: `false` -* Type: `Options | Settings` -* Default: An instance of `Settings` class - -An [`Options`](#options) object or an instance of [`Settings`](#settings) class. - -> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. - -### Settings([options]) - -A class of full settings of the package. - -```ts -const settings = new fsStat.Settings({ followSymbolicLink: false }); - -const stats = fsStat.stat('path', settings); -``` - -## Options - -### `followSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Follow symbolic link or not. Call `fs.stat` on symbolic link if `true`. - -### `markSymbolicLink` - -* Type: `boolean` -* Default: `false` - -Mark symbolic link by setting the return value of `isSymbolicLink` function to always `true` (even after `fs.stat`). - -> :book: Can be used if you want to know what is hidden behind a symbolic link, but still continue to know that it is a symbolic link. - -### `throwErrorOnBrokenSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. - -### `fs` - -* Type: [`FileSystemAdapter`](./src/adapters/fs.ts) -* Default: A default FS methods - -By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. - -```ts -interface FileSystemAdapter { - lstat?: typeof fs.lstat; - stat?: typeof fs.stat; - lstatSync?: typeof fs.lstatSync; - statSync?: typeof fs.statSync; -} - -const settings = new fsStat.Settings({ - fs: { lstat: fakeLstat } -}); -``` - -## Changelog - -See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. - -## License - -This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts b/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts deleted file mode 100644 index 3af759c..0000000 --- a/node_modules/@nodelib/fs.stat/out/adapters/fs.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/// -import * as fs from 'fs'; -import type { ErrnoException } from '../types'; -export declare type StatAsynchronousMethod = (path: string, callback: (error: ErrnoException | null, stats: fs.Stats) => void) => void; -export declare type StatSynchronousMethod = (path: string) => fs.Stats; -export interface FileSystemAdapter { - lstat: StatAsynchronousMethod; - stat: StatAsynchronousMethod; - lstatSync: StatSynchronousMethod; - statSync: StatSynchronousMethod; -} -export declare const FILE_SYSTEM_ADAPTER: FileSystemAdapter; -export declare function createFileSystemAdapter(fsMethods?: Partial): FileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/adapters/fs.js b/node_modules/@nodelib/fs.stat/out/adapters/fs.js deleted file mode 100644 index 8dc08c8..0000000 --- a/node_modules/@nodelib/fs.stat/out/adapters/fs.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0; -const fs = require("fs"); -exports.FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - stat: fs.stat, - lstatSync: fs.lstatSync, - statSync: fs.statSync -}; -function createFileSystemAdapter(fsMethods) { - if (fsMethods === undefined) { - return exports.FILE_SYSTEM_ADAPTER; - } - return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods); -} -exports.createFileSystemAdapter = createFileSystemAdapter; diff --git a/node_modules/@nodelib/fs.stat/out/index.d.ts b/node_modules/@nodelib/fs.stat/out/index.d.ts deleted file mode 100644 index f95db99..0000000 --- a/node_modules/@nodelib/fs.stat/out/index.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod } from './adapters/fs'; -import * as async from './providers/async'; -import Settings, { Options } from './settings'; -import type { Stats } from './types'; -declare type AsyncCallback = async.AsyncCallback; -declare function stat(path: string, callback: AsyncCallback): void; -declare function stat(path: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; -declare namespace stat { - function __promisify__(path: string, optionsOrSettings?: Options | Settings): Promise; -} -declare function statSync(path: string, optionsOrSettings?: Options | Settings): Stats; -export { Settings, stat, statSync, AsyncCallback, FileSystemAdapter, StatAsynchronousMethod, StatSynchronousMethod, Options, Stats }; diff --git a/node_modules/@nodelib/fs.stat/out/index.js b/node_modules/@nodelib/fs.stat/out/index.js deleted file mode 100644 index b23f751..0000000 --- a/node_modules/@nodelib/fs.stat/out/index.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.statSync = exports.stat = exports.Settings = void 0; -const async = require("./providers/async"); -const sync = require("./providers/sync"); -const settings_1 = require("./settings"); -exports.Settings = settings_1.default; -function stat(path, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - async.read(path, getSettings(), optionsOrSettingsOrCallback); - return; - } - async.read(path, getSettings(optionsOrSettingsOrCallback), callback); -} -exports.stat = stat; -function statSync(path, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - return sync.read(path, settings); -} -exports.statSync = statSync; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); -} diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts b/node_modules/@nodelib/fs.stat/out/providers/async.d.ts deleted file mode 100644 index 85423ce..0000000 --- a/node_modules/@nodelib/fs.stat/out/providers/async.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type Settings from '../settings'; -import type { ErrnoException, Stats } from '../types'; -export declare type AsyncCallback = (error: ErrnoException, stats: Stats) => void; -export declare function read(path: string, settings: Settings, callback: AsyncCallback): void; diff --git a/node_modules/@nodelib/fs.stat/out/providers/async.js b/node_modules/@nodelib/fs.stat/out/providers/async.js deleted file mode 100644 index 983ff0e..0000000 --- a/node_modules/@nodelib/fs.stat/out/providers/async.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.read = void 0; -function read(path, settings, callback) { - settings.fs.lstat(path, (lstatError, lstat) => { - if (lstatError !== null) { - callFailureCallback(callback, lstatError); - return; - } - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - callSuccessCallback(callback, lstat); - return; - } - settings.fs.stat(path, (statError, stat) => { - if (statError !== null) { - if (settings.throwErrorOnBrokenSymbolicLink) { - callFailureCallback(callback, statError); - return; - } - callSuccessCallback(callback, lstat); - return; - } - if (settings.markSymbolicLink) { - stat.isSymbolicLink = () => true; - } - callSuccessCallback(callback, stat); - }); - }); -} -exports.read = read; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, result) { - callback(null, result); -} diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts b/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts deleted file mode 100644 index 428c3d7..0000000 --- a/node_modules/@nodelib/fs.stat/out/providers/sync.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type Settings from '../settings'; -import type { Stats } from '../types'; -export declare function read(path: string, settings: Settings): Stats; diff --git a/node_modules/@nodelib/fs.stat/out/providers/sync.js b/node_modules/@nodelib/fs.stat/out/providers/sync.js deleted file mode 100644 index 1521c36..0000000 --- a/node_modules/@nodelib/fs.stat/out/providers/sync.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.read = void 0; -function read(path, settings) { - const lstat = settings.fs.lstatSync(path); - if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) { - return lstat; - } - try { - const stat = settings.fs.statSync(path); - if (settings.markSymbolicLink) { - stat.isSymbolicLink = () => true; - } - return stat; - } - catch (error) { - if (!settings.throwErrorOnBrokenSymbolicLink) { - return lstat; - } - throw error; - } -} -exports.read = read; diff --git a/node_modules/@nodelib/fs.stat/out/settings.d.ts b/node_modules/@nodelib/fs.stat/out/settings.d.ts deleted file mode 100644 index f4b3d44..0000000 --- a/node_modules/@nodelib/fs.stat/out/settings.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import * as fs from './adapters/fs'; -export interface Options { - followSymbolicLink?: boolean; - fs?: Partial; - markSymbolicLink?: boolean; - throwErrorOnBrokenSymbolicLink?: boolean; -} -export default class Settings { - private readonly _options; - readonly followSymbolicLink: boolean; - readonly fs: fs.FileSystemAdapter; - readonly markSymbolicLink: boolean; - readonly throwErrorOnBrokenSymbolicLink: boolean; - constructor(_options?: Options); - private _getValue; -} diff --git a/node_modules/@nodelib/fs.stat/out/settings.js b/node_modules/@nodelib/fs.stat/out/settings.js deleted file mode 100644 index 111ec09..0000000 --- a/node_modules/@nodelib/fs.stat/out/settings.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const fs = require("./adapters/fs"); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true); - this.fs = fs.createFileSystemAdapter(this._options.fs); - this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } -} -exports.default = Settings; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.d.ts b/node_modules/@nodelib/fs.stat/out/types/index.d.ts deleted file mode 100644 index 74c08ed..0000000 --- a/node_modules/@nodelib/fs.stat/out/types/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -import type * as fs from 'fs'; -export declare type Stats = fs.Stats; -export declare type ErrnoException = NodeJS.ErrnoException; diff --git a/node_modules/@nodelib/fs.stat/out/types/index.js b/node_modules/@nodelib/fs.stat/out/types/index.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/@nodelib/fs.stat/out/types/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.stat/package.json b/node_modules/@nodelib/fs.stat/package.json deleted file mode 100644 index f2540c2..0000000 --- a/node_modules/@nodelib/fs.stat/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "@nodelib/fs.stat", - "version": "2.0.5", - "description": "Get the status of a file with some features", - "license": "MIT", - "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.stat", - "keywords": [ - "NodeLib", - "fs", - "FileSystem", - "file system", - "stat" - ], - "engines": { - "node": ">= 8" - }, - "files": [ - "out/**", - "!out/**/*.map", - "!out/**/*.spec.*" - ], - "main": "out/index.js", - "typings": "out/index.d.ts", - "scripts": { - "clean": "rimraf {tsconfig.tsbuildinfo,out}", - "lint": "eslint \"src/**/*.ts\" --cache", - "compile": "tsc -b .", - "compile:watch": "tsc -p . --watch --sourceMap", - "test": "mocha \"out/**/*.spec.js\" -s 0", - "build": "npm run clean && npm run compile && npm run lint && npm test", - "watch": "npm run clean && npm run compile:watch" - }, - "devDependencies": { - "@nodelib/fs.macchiato": "1.0.4" - }, - "gitHead": "d6a7960d5281d3dd5f8e2efba49bb552d090f562" -} diff --git a/node_modules/@nodelib/fs.walk/LICENSE b/node_modules/@nodelib/fs.walk/LICENSE deleted file mode 100644 index 65a9994..0000000 --- a/node_modules/@nodelib/fs.walk/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -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/@nodelib/fs.walk/README.md b/node_modules/@nodelib/fs.walk/README.md deleted file mode 100644 index 6ccc08d..0000000 --- a/node_modules/@nodelib/fs.walk/README.md +++ /dev/null @@ -1,215 +0,0 @@ -# @nodelib/fs.walk - -> A library for efficiently walking a directory recursively. - -## :bulb: Highlights - -* :moneybag: Returns useful information: `name`, `path`, `dirent` and `stats` (optional). -* :rocket: On Node.js 10.10+ uses the mechanism without additional calls to determine the entry type for performance reasons. See [`old` and `modern` mode](https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode). -* :gear: Built-in directories/files and error filtering system. -* :link: Can safely work with broken symbolic links. - -## Install - -```console -npm install @nodelib/fs.walk -``` - -## Usage - -```ts -import * as fsWalk from '@nodelib/fs.walk'; - -fsWalk.walk('path', (error, entries) => { /* … */ }); -``` - -## API - -### .walk(path, [optionsOrSettings], callback) - -Reads the directory recursively and asynchronously. Requires a callback function. - -> :book: If you want to use the Promise API, use `util.promisify`. - -```ts -fsWalk.walk('path', (error, entries) => { /* … */ }); -fsWalk.walk('path', {}, (error, entries) => { /* … */ }); -fsWalk.walk('path', new fsWalk.Settings(), (error, entries) => { /* … */ }); -``` - -### .walkStream(path, [optionsOrSettings]) - -Reads the directory recursively and asynchronously. [Readable Stream](https://nodejs.org/dist/latest-v12.x/docs/api/stream.html#stream_readable_streams) is used as a provider. - -```ts -const stream = fsWalk.walkStream('path'); -const stream = fsWalk.walkStream('path', {}); -const stream = fsWalk.walkStream('path', new fsWalk.Settings()); -``` - -### .walkSync(path, [optionsOrSettings]) - -Reads the directory recursively and synchronously. Returns an array of entries. - -```ts -const entries = fsWalk.walkSync('path'); -const entries = fsWalk.walkSync('path', {}); -const entries = fsWalk.walkSync('path', new fsWalk.Settings()); -``` - -#### path - -* Required: `true` -* Type: `string | Buffer | URL` - -A path to a file. If a URL is provided, it must use the `file:` protocol. - -#### optionsOrSettings - -* Required: `false` -* Type: `Options | Settings` -* Default: An instance of `Settings` class - -An [`Options`](#options) object or an instance of [`Settings`](#settings) class. - -> :book: When you pass a plain object, an instance of the `Settings` class will be created automatically. If you plan to call the method frequently, use a pre-created instance of the `Settings` class. - -### Settings([options]) - -A class of full settings of the package. - -```ts -const settings = new fsWalk.Settings({ followSymbolicLinks: true }); - -const entries = fsWalk.walkSync('path', settings); -``` - -## Entry - -* `name` — The name of the entry (`unknown.txt`). -* `path` — The path of the entry relative to call directory (`root/unknown.txt`). -* `dirent` — An instance of [`fs.Dirent`](./src/types/index.ts) class. -* [`stats`] — An instance of `fs.Stats` class. - -## Options - -### basePath - -* Type: `string` -* Default: `undefined` - -By default, all paths are built relative to the root path. You can use this option to set custom root path. - -In the example below we read the files from the `root` directory, but in the results the root path will be `custom`. - -```ts -fsWalk.walkSync('root'); // → ['root/file.txt'] -fsWalk.walkSync('root', { basePath: 'custom' }); // → ['custom/file.txt'] -``` - -### concurrency - -* Type: `number` -* Default: `Infinity` - -The maximum number of concurrent calls to `fs.readdir`. - -> :book: The higher the number, the higher performance and the load on the File System. If you want to read in quiet mode, set the value to `4 * os.cpus().length` (4 is default size of [thread pool work scheduling](http://docs.libuv.org/en/v1.x/threadpool.html#thread-pool-work-scheduling)). - -### deepFilter - -* Type: [`DeepFilterFunction`](./src/settings.ts) -* Default: `undefined` - -A function that indicates whether the directory will be read deep or not. - -```ts -// Skip all directories that starts with `node_modules` -const filter: DeepFilterFunction = (entry) => !entry.path.startsWith('node_modules'); -``` - -### entryFilter - -* Type: [`EntryFilterFunction`](./src/settings.ts) -* Default: `undefined` - -A function that indicates whether the entry will be included to results or not. - -```ts -// Exclude all `.js` files from results -const filter: EntryFilterFunction = (entry) => !entry.name.endsWith('.js'); -``` - -### errorFilter - -* Type: [`ErrorFilterFunction`](./src/settings.ts) -* Default: `undefined` - -A function that allows you to skip errors that occur when reading directories. - -For example, you can skip `ENOENT` errors if required: - -```ts -// Skip all ENOENT errors -const filter: ErrorFilterFunction = (error) => error.code == 'ENOENT'; -``` - -### stats - -* Type: `boolean` -* Default: `false` - -Adds an instance of `fs.Stats` class to the [`Entry`](#entry). - -> :book: Always use `fs.readdir` with additional `fs.lstat/fs.stat` calls to determine the entry type. - -### followSymbolicLinks - -* Type: `boolean` -* Default: `false` - -Follow symbolic links or not. Call `fs.stat` on symbolic link if `true`. - -### `throwErrorOnBrokenSymbolicLink` - -* Type: `boolean` -* Default: `true` - -Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. - -### `pathSegmentSeparator` - -* Type: `string` -* Default: `path.sep` - -By default, this package uses the correct path separator for your OS (`\` on Windows, `/` on Unix-like systems). But you can set this option to any separator character(s) that you want to use instead. - -### `fs` - -* Type: `FileSystemAdapter` -* Default: A default FS methods - -By default, the built-in Node.js module (`fs`) is used to work with the file system. You can replace any method with your own. - -```ts -interface FileSystemAdapter { - lstat: typeof fs.lstat; - stat: typeof fs.stat; - lstatSync: typeof fs.lstatSync; - statSync: typeof fs.statSync; - readdir: typeof fs.readdir; - readdirSync: typeof fs.readdirSync; -} - -const settings = new fsWalk.Settings({ - fs: { lstat: fakeLstat } -}); -``` - -## Changelog - -See the [Releases section of our GitHub project](https://github.com/nodelib/nodelib/releases) for changelog for each release version. - -## License - -This software is released under the terms of the MIT license. diff --git a/node_modules/@nodelib/fs.walk/out/index.d.ts b/node_modules/@nodelib/fs.walk/out/index.d.ts deleted file mode 100644 index 8864c7b..0000000 --- a/node_modules/@nodelib/fs.walk/out/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -import type { Readable } from 'stream'; -import type { Dirent, FileSystemAdapter } from '@nodelib/fs.scandir'; -import { AsyncCallback } from './providers/async'; -import Settings, { DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction, Options } from './settings'; -import type { Entry } from './types'; -declare function walk(directory: string, callback: AsyncCallback): void; -declare function walk(directory: string, optionsOrSettings: Options | Settings, callback: AsyncCallback): void; -declare namespace walk { - function __promisify__(directory: string, optionsOrSettings?: Options | Settings): Promise; -} -declare function walkSync(directory: string, optionsOrSettings?: Options | Settings): Entry[]; -declare function walkStream(directory: string, optionsOrSettings?: Options | Settings): Readable; -export { walk, walkSync, walkStream, Settings, AsyncCallback, Dirent, Entry, FileSystemAdapter, Options, DeepFilterFunction, EntryFilterFunction, ErrorFilterFunction }; diff --git a/node_modules/@nodelib/fs.walk/out/index.js b/node_modules/@nodelib/fs.walk/out/index.js deleted file mode 100644 index 1520787..0000000 --- a/node_modules/@nodelib/fs.walk/out/index.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.Settings = exports.walkStream = exports.walkSync = exports.walk = void 0; -const async_1 = require("./providers/async"); -const stream_1 = require("./providers/stream"); -const sync_1 = require("./providers/sync"); -const settings_1 = require("./settings"); -exports.Settings = settings_1.default; -function walk(directory, optionsOrSettingsOrCallback, callback) { - if (typeof optionsOrSettingsOrCallback === 'function') { - new async_1.default(directory, getSettings()).read(optionsOrSettingsOrCallback); - return; - } - new async_1.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback); -} -exports.walk = walk; -function walkSync(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new sync_1.default(directory, settings); - return provider.read(); -} -exports.walkSync = walkSync; -function walkStream(directory, optionsOrSettings) { - const settings = getSettings(optionsOrSettings); - const provider = new stream_1.default(directory, settings); - return provider.read(); -} -exports.walkStream = walkStream; -function getSettings(settingsOrOptions = {}) { - if (settingsOrOptions instanceof settings_1.default) { - return settingsOrOptions; - } - return new settings_1.default(settingsOrOptions); -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts b/node_modules/@nodelib/fs.walk/out/providers/async.d.ts deleted file mode 100644 index 0f6717d..0000000 --- a/node_modules/@nodelib/fs.walk/out/providers/async.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import AsyncReader from '../readers/async'; -import type Settings from '../settings'; -import type { Entry, Errno } from '../types'; -export declare type AsyncCallback = (error: Errno, entries: Entry[]) => void; -export default class AsyncProvider { - private readonly _root; - private readonly _settings; - protected readonly _reader: AsyncReader; - private readonly _storage; - constructor(_root: string, _settings: Settings); - read(callback: AsyncCallback): void; -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/async.js b/node_modules/@nodelib/fs.walk/out/providers/async.js deleted file mode 100644 index 51d3be5..0000000 --- a/node_modules/@nodelib/fs.walk/out/providers/async.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const async_1 = require("../readers/async"); -class AsyncProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._storage = []; - } - read(callback) { - this._reader.onError((error) => { - callFailureCallback(callback, error); - }); - this._reader.onEntry((entry) => { - this._storage.push(entry); - }); - this._reader.onEnd(() => { - callSuccessCallback(callback, this._storage); - }); - this._reader.read(); - } -} -exports.default = AsyncProvider; -function callFailureCallback(callback, error) { - callback(error); -} -function callSuccessCallback(callback, entries) { - callback(null, entries); -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts b/node_modules/@nodelib/fs.walk/out/providers/index.d.ts deleted file mode 100644 index 874f60c..0000000 --- a/node_modules/@nodelib/fs.walk/out/providers/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import AsyncProvider from './async'; -import StreamProvider from './stream'; -import SyncProvider from './sync'; -export { AsyncProvider, StreamProvider, SyncProvider }; diff --git a/node_modules/@nodelib/fs.walk/out/providers/index.js b/node_modules/@nodelib/fs.walk/out/providers/index.js deleted file mode 100644 index 4c2529c..0000000 --- a/node_modules/@nodelib/fs.walk/out/providers/index.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SyncProvider = exports.StreamProvider = exports.AsyncProvider = void 0; -const async_1 = require("./async"); -exports.AsyncProvider = async_1.default; -const stream_1 = require("./stream"); -exports.StreamProvider = stream_1.default; -const sync_1 = require("./sync"); -exports.SyncProvider = sync_1.default; diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts b/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts deleted file mode 100644 index 294185f..0000000 --- a/node_modules/@nodelib/fs.walk/out/providers/stream.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/// -import { Readable } from 'stream'; -import AsyncReader from '../readers/async'; -import type Settings from '../settings'; -export default class StreamProvider { - private readonly _root; - private readonly _settings; - protected readonly _reader: AsyncReader; - protected readonly _stream: Readable; - constructor(_root: string, _settings: Settings); - read(): Readable; -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/stream.js b/node_modules/@nodelib/fs.walk/out/providers/stream.js deleted file mode 100644 index 51298b0..0000000 --- a/node_modules/@nodelib/fs.walk/out/providers/stream.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = require("stream"); -const async_1 = require("../readers/async"); -class StreamProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new async_1.default(this._root, this._settings); - this._stream = new stream_1.Readable({ - objectMode: true, - read: () => { }, - destroy: () => { - if (!this._reader.isDestroyed) { - this._reader.destroy(); - } - } - }); - } - read() { - this._reader.onError((error) => { - this._stream.emit('error', error); - }); - this._reader.onEntry((entry) => { - this._stream.push(entry); - }); - this._reader.onEnd(() => { - this._stream.push(null); - }); - this._reader.read(); - return this._stream; - } -} -exports.default = StreamProvider; diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts deleted file mode 100644 index 551c42e..0000000 --- a/node_modules/@nodelib/fs.walk/out/providers/sync.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import SyncReader from '../readers/sync'; -import type Settings from '../settings'; -import type { Entry } from '../types'; -export default class SyncProvider { - private readonly _root; - private readonly _settings; - protected readonly _reader: SyncReader; - constructor(_root: string, _settings: Settings); - read(): Entry[]; -} diff --git a/node_modules/@nodelib/fs.walk/out/providers/sync.js b/node_modules/@nodelib/fs.walk/out/providers/sync.js deleted file mode 100644 index faab6ca..0000000 --- a/node_modules/@nodelib/fs.walk/out/providers/sync.js +++ /dev/null @@ -1,14 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const sync_1 = require("../readers/sync"); -class SyncProvider { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._reader = new sync_1.default(this._root, this._settings); - } - read() { - return this._reader.read(); - } -} -exports.default = SyncProvider; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.d.ts b/node_modules/@nodelib/fs.walk/out/readers/async.d.ts deleted file mode 100644 index 9acf4e6..0000000 --- a/node_modules/@nodelib/fs.walk/out/readers/async.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/// -import { EventEmitter } from 'events'; -import * as fsScandir from '@nodelib/fs.scandir'; -import type Settings from '../settings'; -import type { Entry, Errno } from '../types'; -import Reader from './reader'; -declare type EntryEventCallback = (entry: Entry) => void; -declare type ErrorEventCallback = (error: Errno) => void; -declare type EndEventCallback = () => void; -export default class AsyncReader extends Reader { - protected readonly _settings: Settings; - protected readonly _scandir: typeof fsScandir.scandir; - protected readonly _emitter: EventEmitter; - private readonly _queue; - private _isFatalError; - private _isDestroyed; - constructor(_root: string, _settings: Settings); - read(): EventEmitter; - get isDestroyed(): boolean; - destroy(): void; - onEntry(callback: EntryEventCallback): void; - onError(callback: ErrorEventCallback): void; - onEnd(callback: EndEventCallback): void; - private _pushToQueue; - private _worker; - private _handleError; - private _handleEntry; - private _emitEntry; -} -export {}; diff --git a/node_modules/@nodelib/fs.walk/out/readers/async.js b/node_modules/@nodelib/fs.walk/out/readers/async.js deleted file mode 100644 index ebe8dd5..0000000 --- a/node_modules/@nodelib/fs.walk/out/readers/async.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const events_1 = require("events"); -const fsScandir = require("@nodelib/fs.scandir"); -const fastq = require("fastq"); -const common = require("./common"); -const reader_1 = require("./reader"); -class AsyncReader extends reader_1.default { - constructor(_root, _settings) { - super(_root, _settings); - this._settings = _settings; - this._scandir = fsScandir.scandir; - this._emitter = new events_1.EventEmitter(); - this._queue = fastq(this._worker.bind(this), this._settings.concurrency); - this._isFatalError = false; - this._isDestroyed = false; - this._queue.drain = () => { - if (!this._isFatalError) { - this._emitter.emit('end'); - } - }; - } - read() { - this._isFatalError = false; - this._isDestroyed = false; - setImmediate(() => { - this._pushToQueue(this._root, this._settings.basePath); - }); - return this._emitter; - } - get isDestroyed() { - return this._isDestroyed; - } - destroy() { - if (this._isDestroyed) { - throw new Error('The reader is already destroyed'); - } - this._isDestroyed = true; - this._queue.killAndDrain(); - } - onEntry(callback) { - this._emitter.on('entry', callback); - } - onError(callback) { - this._emitter.once('error', callback); - } - onEnd(callback) { - this._emitter.once('end', callback); - } - _pushToQueue(directory, base) { - const queueItem = { directory, base }; - this._queue.push(queueItem, (error) => { - if (error !== null) { - this._handleError(error); - } - }); - } - _worker(item, done) { - this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => { - if (error !== null) { - done(error, undefined); - return; - } - for (const entry of entries) { - this._handleEntry(entry, item.base); - } - done(null, undefined); - }); - } - _handleError(error) { - if (this._isDestroyed || !common.isFatalError(this._settings, error)) { - return; - } - this._isFatalError = true; - this._isDestroyed = true; - this._emitter.emit('error', error); - } - _handleEntry(entry, base) { - if (this._isDestroyed || this._isFatalError) { - return; - } - const fullpath = entry.path; - if (base !== undefined) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._emitEntry(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); - } - } - _emitEntry(entry) { - this._emitter.emit('entry', entry); - } -} -exports.default = AsyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.d.ts b/node_modules/@nodelib/fs.walk/out/readers/common.d.ts deleted file mode 100644 index 5985f97..0000000 --- a/node_modules/@nodelib/fs.walk/out/readers/common.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { FilterFunction } from '../settings'; -import type Settings from '../settings'; -import type { Errno } from '../types'; -export declare function isFatalError(settings: Settings, error: Errno): boolean; -export declare function isAppliedFilter(filter: FilterFunction | null, value: T): boolean; -export declare function replacePathSegmentSeparator(filepath: string, separator: string): string; -export declare function joinPathSegments(a: string, b: string, separator: string): string; diff --git a/node_modules/@nodelib/fs.walk/out/readers/common.js b/node_modules/@nodelib/fs.walk/out/readers/common.js deleted file mode 100644 index a93572f..0000000 --- a/node_modules/@nodelib/fs.walk/out/readers/common.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.joinPathSegments = exports.replacePathSegmentSeparator = exports.isAppliedFilter = exports.isFatalError = void 0; -function isFatalError(settings, error) { - if (settings.errorFilter === null) { - return true; - } - return !settings.errorFilter(error); -} -exports.isFatalError = isFatalError; -function isAppliedFilter(filter, value) { - return filter === null || filter(value); -} -exports.isAppliedFilter = isAppliedFilter; -function replacePathSegmentSeparator(filepath, separator) { - return filepath.split(/[/\\]/).join(separator); -} -exports.replacePathSegmentSeparator = replacePathSegmentSeparator; -function joinPathSegments(a, b, separator) { - if (a === '') { - return b; - } - /** - * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`). - */ - if (a.endsWith(separator)) { - return a + b; - } - return a + separator + b; -} -exports.joinPathSegments = joinPathSegments; diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts b/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts deleted file mode 100644 index e1f383b..0000000 --- a/node_modules/@nodelib/fs.walk/out/readers/reader.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type Settings from '../settings'; -export default class Reader { - protected readonly _root: string; - protected readonly _settings: Settings; - constructor(_root: string, _settings: Settings); -} diff --git a/node_modules/@nodelib/fs.walk/out/readers/reader.js b/node_modules/@nodelib/fs.walk/out/readers/reader.js deleted file mode 100644 index 782f07c..0000000 --- a/node_modules/@nodelib/fs.walk/out/readers/reader.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const common = require("./common"); -class Reader { - constructor(_root, _settings) { - this._root = _root; - this._settings = _settings; - this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator); - } -} -exports.default = Reader; diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts b/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts deleted file mode 100644 index af41033..0000000 --- a/node_modules/@nodelib/fs.walk/out/readers/sync.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import * as fsScandir from '@nodelib/fs.scandir'; -import type { Entry } from '../types'; -import Reader from './reader'; -export default class SyncReader extends Reader { - protected readonly _scandir: typeof fsScandir.scandirSync; - private readonly _storage; - private readonly _queue; - read(): Entry[]; - private _pushToQueue; - private _handleQueue; - private _handleDirectory; - private _handleError; - private _handleEntry; - private _pushToStorage; -} diff --git a/node_modules/@nodelib/fs.walk/out/readers/sync.js b/node_modules/@nodelib/fs.walk/out/readers/sync.js deleted file mode 100644 index 9a8d5a6..0000000 --- a/node_modules/@nodelib/fs.walk/out/readers/sync.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const fsScandir = require("@nodelib/fs.scandir"); -const common = require("./common"); -const reader_1 = require("./reader"); -class SyncReader extends reader_1.default { - constructor() { - super(...arguments); - this._scandir = fsScandir.scandirSync; - this._storage = []; - this._queue = new Set(); - } - read() { - this._pushToQueue(this._root, this._settings.basePath); - this._handleQueue(); - return this._storage; - } - _pushToQueue(directory, base) { - this._queue.add({ directory, base }); - } - _handleQueue() { - for (const item of this._queue.values()) { - this._handleDirectory(item.directory, item.base); - } - } - _handleDirectory(directory, base) { - try { - const entries = this._scandir(directory, this._settings.fsScandirSettings); - for (const entry of entries) { - this._handleEntry(entry, base); - } - } - catch (error) { - this._handleError(error); - } - } - _handleError(error) { - if (!common.isFatalError(this._settings, error)) { - return; - } - throw error; - } - _handleEntry(entry, base) { - const fullpath = entry.path; - if (base !== undefined) { - entry.path = common.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator); - } - if (common.isAppliedFilter(this._settings.entryFilter, entry)) { - this._pushToStorage(entry); - } - if (entry.dirent.isDirectory() && common.isAppliedFilter(this._settings.deepFilter, entry)) { - this._pushToQueue(fullpath, base === undefined ? undefined : entry.path); - } - } - _pushToStorage(entry) { - this._storage.push(entry); - } -} -exports.default = SyncReader; diff --git a/node_modules/@nodelib/fs.walk/out/settings.d.ts b/node_modules/@nodelib/fs.walk/out/settings.d.ts deleted file mode 100644 index d1c4b45..0000000 --- a/node_modules/@nodelib/fs.walk/out/settings.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -import * as fsScandir from '@nodelib/fs.scandir'; -import type { Entry, Errno } from './types'; -export declare type FilterFunction = (value: T) => boolean; -export declare type DeepFilterFunction = FilterFunction; -export declare type EntryFilterFunction = FilterFunction; -export declare type ErrorFilterFunction = FilterFunction; -export interface Options { - basePath?: string; - concurrency?: number; - deepFilter?: DeepFilterFunction; - entryFilter?: EntryFilterFunction; - errorFilter?: ErrorFilterFunction; - followSymbolicLinks?: boolean; - fs?: Partial; - pathSegmentSeparator?: string; - stats?: boolean; - throwErrorOnBrokenSymbolicLink?: boolean; -} -export default class Settings { - private readonly _options; - readonly basePath?: string; - readonly concurrency: number; - readonly deepFilter: DeepFilterFunction | null; - readonly entryFilter: EntryFilterFunction | null; - readonly errorFilter: ErrorFilterFunction | null; - readonly pathSegmentSeparator: string; - readonly fsScandirSettings: fsScandir.Settings; - constructor(_options?: Options); - private _getValue; -} diff --git a/node_modules/@nodelib/fs.walk/out/settings.js b/node_modules/@nodelib/fs.walk/out/settings.js deleted file mode 100644 index d7a85c8..0000000 --- a/node_modules/@nodelib/fs.walk/out/settings.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = require("path"); -const fsScandir = require("@nodelib/fs.scandir"); -class Settings { - constructor(_options = {}) { - this._options = _options; - this.basePath = this._getValue(this._options.basePath, undefined); - this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY); - this.deepFilter = this._getValue(this._options.deepFilter, null); - this.entryFilter = this._getValue(this._options.entryFilter, null); - this.errorFilter = this._getValue(this._options.errorFilter, null); - this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep); - this.fsScandirSettings = new fsScandir.Settings({ - followSymbolicLinks: this._options.followSymbolicLinks, - fs: this._options.fs, - pathSegmentSeparator: this._options.pathSegmentSeparator, - stats: this._options.stats, - throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink - }); - } - _getValue(option, value) { - return option !== null && option !== void 0 ? option : value; - } -} -exports.default = Settings; diff --git a/node_modules/@nodelib/fs.walk/out/types/index.d.ts b/node_modules/@nodelib/fs.walk/out/types/index.d.ts deleted file mode 100644 index 6ee9bd3..0000000 --- a/node_modules/@nodelib/fs.walk/out/types/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/// -import type * as scandir from '@nodelib/fs.scandir'; -export declare type Entry = scandir.Entry; -export declare type Errno = NodeJS.ErrnoException; -export interface QueueItem { - directory: string; - base?: string; -} diff --git a/node_modules/@nodelib/fs.walk/out/types/index.js b/node_modules/@nodelib/fs.walk/out/types/index.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/@nodelib/fs.walk/out/types/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/@nodelib/fs.walk/package.json b/node_modules/@nodelib/fs.walk/package.json deleted file mode 100644 index 86bfce4..0000000 --- a/node_modules/@nodelib/fs.walk/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@nodelib/fs.walk", - "version": "1.2.8", - "description": "A library for efficiently walking a directory recursively", - "license": "MIT", - "repository": "https://github.com/nodelib/nodelib/tree/master/packages/fs/fs.walk", - "keywords": [ - "NodeLib", - "fs", - "FileSystem", - "file system", - "walk", - "scanner", - "crawler" - ], - "engines": { - "node": ">= 8" - }, - "files": [ - "out/**", - "!out/**/*.map", - "!out/**/*.spec.*", - "!out/**/tests/**" - ], - "main": "out/index.js", - "typings": "out/index.d.ts", - "scripts": { - "clean": "rimraf {tsconfig.tsbuildinfo,out}", - "lint": "eslint \"src/**/*.ts\" --cache", - "compile": "tsc -b .", - "compile:watch": "tsc -p . --watch --sourceMap", - "test": "mocha \"out/**/*.spec.js\" -s 0", - "build": "npm run clean && npm run compile && npm run lint && npm test", - "watch": "npm run clean && npm run compile:watch" - }, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "devDependencies": { - "@nodelib/fs.macchiato": "1.0.4" - }, - "gitHead": "1e5bad48565da2b06b8600e744324ea240bf49d8" -} diff --git a/node_modules/any-promise/.jshintrc b/node_modules/any-promise/.jshintrc deleted file mode 100644 index 979105e..0000000 --- a/node_modules/any-promise/.jshintrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "node":true, - "strict":true -} diff --git a/node_modules/any-promise/.npmignore b/node_modules/any-promise/.npmignore deleted file mode 100644 index 1354abc..0000000 --- a/node_modules/any-promise/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -.git* -test/ -test-browser/ -build/ -.travis.yml -*.swp -Makefile diff --git a/node_modules/any-promise/LICENSE b/node_modules/any-promise/LICENSE deleted file mode 100644 index 9187fe5..0000000 --- a/node_modules/any-promise/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2014-2016 Kevin Beaty - -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/any-promise/README.md b/node_modules/any-promise/README.md deleted file mode 100644 index 174bea4..0000000 --- a/node_modules/any-promise/README.md +++ /dev/null @@ -1,161 +0,0 @@ -## Any Promise - -[![Build Status](https://secure.travis-ci.org/kevinbeaty/any-promise.svg)](http://travis-ci.org/kevinbeaty/any-promise) - -Let your library support any ES 2015 (ES6) compatible `Promise` and leave the choice to application authors. The application can *optionally* register its preferred `Promise` implementation and it will be exported when requiring `any-promise` from library code. - -If no preference is registered, defaults to the global `Promise` for newer Node.js versions. The browser version defaults to the window `Promise`, so polyfill or register as necessary. - -### Usage with global Promise: - -Assuming the global `Promise` is the desired implementation: - -```bash -# Install any libraries depending on any-promise -$ npm install mz -``` - -The installed libraries will use global Promise by default. - -```js -// in library -var Promise = require('any-promise') // the global Promise - -function promiseReturningFunction(){ - return new Promise(function(resolve, reject){...}) -} -``` - -### Usage with registration: - -Assuming `bluebird` is the desired Promise implementation: - -```bash -# Install preferred promise library -$ npm install bluebird -# Install any-promise to allow registration -$ npm install any-promise -# Install any libraries you would like to use depending on any-promise -$ npm install mz -``` - -Register your preference in the application entry point before any other `require` of packages that load `any-promise`: - -```javascript -// top of application index.js or other entry point -require('any-promise/register/bluebird') - -// -or- Equivalent to above, but allows customization of Promise library -require('any-promise/register')('bluebird', {Promise: require('bluebird')}) -``` - -Now that the implementation is registered, you can use any package depending on `any-promise`: - - -```javascript -var fsp = require('mz/fs') // mz/fs will use registered bluebird promises -var Promise = require('any-promise') // the registered bluebird promise -``` - -It is safe to call `register` multiple times, but it must always be with the same implementation. - -Again, registration is *optional*. It should only be called by the application user if overriding the global `Promise` implementation is desired. - -### Optional Application Registration - -As an application author, you can *optionally* register a preferred `Promise` implementation on application startup (before any call to `require('any-promise')`: - -You must register your preference before any call to `require('any-promise')` (by you or required packages), and only one implementation can be registered. Typically, this registration would occur at the top of the application entry point. - - -#### Registration shortcuts - -If you are using a known `Promise` implementation, you can register your preference with a shortcut: - - -```js -require('any-promise/register/bluebird') -// -or- -import 'any-promise/register/q'; -``` - -Shortcut registration is the preferred registration method as it works in the browser and Node.js. It is also convenient for using with `import` and many test runners, that offer a `--require` flag: - -``` -$ ava --require=any-promise/register/bluebird test.js -``` - -Current known implementations include `bluebird`, `q`, `when`, `rsvp`, `es6-promise`, `promise`, `native-promise-only`, `pinkie`, `vow` and `lie`. If you are not using a known implementation, you can use another registration method described below. - - -#### Basic Registration - -As an alternative to registration shortcuts, you can call the `register` function with the preferred `Promise` implementation. The benefit of this approach is that a `Promise` library can be required by name without being a known implementation. This approach does NOT work in the browser. To use `any-promise` in the browser use either registration shortcuts or specify the `Promise` constructor using advanced registration (see below). - -```javascript -require('any-promise/register')('when') -// -or- require('any-promise/register')('any other ES6 compatible library (known or otherwise)') -``` - -This registration method will try to detect the `Promise` constructor from requiring the specified implementation. If you would like to specify your own constructor, see advanced registration. - - -#### Advanced Registration - -To use the browser version, you should either install a polyfill or explicitly register the `Promise` constructor: - -```javascript -require('any-promise/register')('bluebird', {Promise: require('bluebird')}) -``` - -This could also be used for registering a custom `Promise` implementation or subclass. - -Your preference will be registered globally, allowing a single registration even if multiple versions of `any-promise` are installed in the NPM dependency tree or are using multiple bundled JavaScript files in the browser. You can bypass this global registration in options: - - -```javascript -require('../register')('es6-promise', {Promise: require('es6-promise').Promise, global: false}) -``` - -### Library Usage - -To use any `Promise` constructor, simply require it: - -```javascript -var Promise = require('any-promise'); - -return Promise - .all([xf, f, init, coll]) - .then(fn); - - -return new Promise(function(resolve, reject){ - try { - resolve(item); - } catch(e){ - reject(e); - } -}); - -``` - -Except noted below, libraries using `any-promise` should only use [documented](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) functions as there is no guarantee which implementation will be chosen by the application author. Libraries should never call `register`, only the application user should call if desired. - - -#### Advanced Library Usage - -If your library needs to branch code based on the registered implementation, you can retrieve it using `var impl = require('any-promise/implementation')`, where `impl` will be the package name (`"bluebird"`, `"when"`, etc.) if registered, `"global.Promise"` if using the global version on Node.js, or `"window.Promise"` if using the browser version. You should always include a default case, as there is no guarantee what package may be registered. - - -### Support for old Node.js versions - -Node.js versions prior to `v0.12` may have contained buggy versions of the global `Promise`. For this reason, the global `Promise` is not loaded automatically for these old versions. If using `any-promise` in Node.js versions versions `<= v0.12`, the user should register a desired implementation. - -If an implementation is not registered, `any-promise` will attempt to discover an installed `Promise` implementation. If no implementation can be found, an error will be thrown on `require('any-promise')`. While the auto-discovery usually avoids errors, it is non-deterministic. It is recommended that the user always register a preferred implementation for older Node.js versions. - -This auto-discovery is only available for Node.jS versions prior to `v0.12`. Any newer versions will always default to the global `Promise` implementation. - -### Related - -- [any-observable](https://github.com/sindresorhus/any-observable) - `any-promise` for Observables. - diff --git a/node_modules/any-promise/implementation.d.ts b/node_modules/any-promise/implementation.d.ts deleted file mode 100644 index c331a56..0000000 --- a/node_modules/any-promise/implementation.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare var implementation: string; - -export = implementation; diff --git a/node_modules/any-promise/implementation.js b/node_modules/any-promise/implementation.js deleted file mode 100644 index a45ae94..0000000 --- a/node_modules/any-promise/implementation.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./register')().implementation diff --git a/node_modules/any-promise/index.d.ts b/node_modules/any-promise/index.d.ts deleted file mode 100644 index 9f646c5..0000000 --- a/node_modules/any-promise/index.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -declare class Promise implements Promise.Thenable { - /** - * If you call resolve in the body of the callback passed to the constructor, - * your promise is fulfilled with result object passed to resolve. - * If you call reject your promise is rejected with the object passed to resolve. - * For consistency and debugging (eg stack traces), obj should be an instanceof Error. - * Any errors thrown in the constructor callback will be implicitly passed to reject(). - */ - constructor (callback: (resolve : (value?: R | Promise.Thenable) => void, reject: (error?: any) => void) => void); - - /** - * onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects. - * Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called. - * Both callbacks have a single parameter , the fulfillment value or rejection reason. - * "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve. - * If an error is thrown in the callback, the returned promise rejects with that error. - * - * @param onFulfilled called when/if "promise" resolves - * @param onRejected called when/if "promise" rejects - */ - then (onFulfilled?: (value: R) => U | Promise.Thenable, onRejected?: (error: any) => U | Promise.Thenable): Promise; - then (onFulfilled?: (value: R) => U | Promise.Thenable, onRejected?: (error: any) => void): Promise; - - /** - * Sugar for promise.then(undefined, onRejected) - * - * @param onRejected called when/if "promise" rejects - */ - catch (onRejected?: (error: any) => U | Promise.Thenable): Promise; - - /** - * Make a new promise from the thenable. - * A thenable is promise-like in as far as it has a "then" method. - */ - static resolve (): Promise; - static resolve (value: R | Promise.Thenable): Promise; - - /** - * Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error - */ - static reject (error: any): Promise; - - /** - * Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects. - * the array passed to all can be a mixture of promise-like objects and other objects. - * The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value. - */ - static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable, T8 | Promise.Thenable, T9 | Promise.Thenable, T10 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; - static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable, T8 | Promise.Thenable, T9 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; - static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable, T8 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; - static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable, T7 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; - static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable, T6 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5, T6]>; - static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable , T5 | Promise.Thenable]): Promise<[T1, T2, T3, T4, T5]>; - static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable, T4 | Promise.Thenable ]): Promise<[T1, T2, T3, T4]>; - static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable, T3 | Promise.Thenable]): Promise<[T1, T2, T3]>; - static all (values: [T1 | Promise.Thenable, T2 | Promise.Thenable]): Promise<[T1, T2]>; - static all (values: [T1 | Promise.Thenable]): Promise<[T1]>; - static all (values: Array>): Promise; - - /** - * Make a Promise that fulfills when any item fulfills, and rejects if any item rejects. - */ - static race (promises: (R | Promise.Thenable)[]): Promise; -} - -declare namespace Promise { - export interface Thenable { - then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => U | Thenable): Thenable; - then (onFulfilled?: (value: R) => U | Thenable, onRejected?: (error: any) => void): Thenable; - } -} - -export = Promise; diff --git a/node_modules/any-promise/index.js b/node_modules/any-promise/index.js deleted file mode 100644 index 74b8548..0000000 --- a/node_modules/any-promise/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./register')().Promise diff --git a/node_modules/any-promise/loader.js b/node_modules/any-promise/loader.js deleted file mode 100644 index e164914..0000000 --- a/node_modules/any-promise/loader.js +++ /dev/null @@ -1,78 +0,0 @@ -"use strict" - // global key for user preferred registration -var REGISTRATION_KEY = '@@any-promise/REGISTRATION', - // Prior registration (preferred or detected) - registered = null - -/** - * Registers the given implementation. An implementation must - * be registered prior to any call to `require("any-promise")`, - * typically on application load. - * - * If called with no arguments, will return registration in - * following priority: - * - * For Node.js: - * - * 1. Previous registration - * 2. global.Promise if node.js version >= 0.12 - * 3. Auto detected promise based on first sucessful require of - * known promise libraries. Note this is a last resort, as the - * loaded library is non-deterministic. node.js >= 0.12 will - * always use global.Promise over this priority list. - * 4. Throws error. - * - * For Browser: - * - * 1. Previous registration - * 2. window.Promise - * 3. Throws error. - * - * Options: - * - * Promise: Desired Promise constructor - * global: Boolean - Should the registration be cached in a global variable to - * allow cross dependency/bundle registration? (default true) - */ -module.exports = function(root, loadImplementation){ - return function register(implementation, opts){ - implementation = implementation || null - opts = opts || {} - // global registration unless explicitly {global: false} in options (default true) - var registerGlobal = opts.global !== false; - - // load any previous global registration - if(registered === null && registerGlobal){ - registered = root[REGISTRATION_KEY] || null - } - - if(registered !== null - && implementation !== null - && registered.implementation !== implementation){ - // Throw error if attempting to redefine implementation - throw new Error('any-promise already defined as "'+registered.implementation+ - '". You can only register an implementation before the first '+ - ' call to require("any-promise") and an implementation cannot be changed') - } - - if(registered === null){ - // use provided implementation - if(implementation !== null && typeof opts.Promise !== 'undefined'){ - registered = { - Promise: opts.Promise, - implementation: implementation - } - } else { - // require implementation if implementation is specified but not provided - registered = loadImplementation(implementation) - } - - if(registerGlobal){ - // register preference globally in case multiple installations - root[REGISTRATION_KEY] = registered - } - } - - return registered - } -} diff --git a/node_modules/any-promise/optional.js b/node_modules/any-promise/optional.js deleted file mode 100644 index f388942..0000000 --- a/node_modules/any-promise/optional.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -try { - module.exports = require('./register')().Promise || null -} catch(e) { - module.exports = null -} diff --git a/node_modules/any-promise/package.json b/node_modules/any-promise/package.json deleted file mode 100644 index 5baf14c..0000000 --- a/node_modules/any-promise/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "any-promise", - "version": "1.3.0", - "description": "Resolve any installed ES6 compatible promise", - "main": "index.js", - "typings": "index.d.ts", - "browser": { - "./register.js": "./register-shim.js" - }, - "scripts": { - "test": "ava" - }, - "repository": { - "type": "git", - "url": "https://github.com/kevinbeaty/any-promise" - }, - "keywords": [ - "promise", - "es6" - ], - "author": "Kevin Beaty", - "license": "MIT", - "bugs": { - "url": "https://github.com/kevinbeaty/any-promise/issues" - }, - "homepage": "http://github.com/kevinbeaty/any-promise", - "dependencies": {}, - "devDependencies": { - "ava": "^0.14.0", - "bluebird": "^3.0.0", - "es6-promise": "^3.0.0", - "is-promise": "^2.0.0", - "lie": "^3.0.0", - "mocha": "^2.0.0", - "native-promise-only": "^0.8.0", - "phantomjs-prebuilt": "^2.0.0", - "pinkie": "^2.0.0", - "promise": "^7.0.0", - "q": "^1.0.0", - "rsvp": "^3.0.0", - "vow": "^0.4.0", - "when": "^3.0.0", - "zuul": "^3.0.0" - } -} diff --git a/node_modules/any-promise/register-shim.js b/node_modules/any-promise/register-shim.js deleted file mode 100644 index 9049405..0000000 --- a/node_modules/any-promise/register-shim.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict"; -module.exports = require('./loader')(window, loadImplementation) - -/** - * Browser specific loadImplementation. Always uses `window.Promise` - * - * To register a custom implementation, must register with `Promise` option. - */ -function loadImplementation(){ - if(typeof window.Promise === 'undefined'){ - throw new Error("any-promise browser requires a polyfill or explicit registration"+ - " e.g: require('any-promise/register/bluebird')") - } - return { - Promise: window.Promise, - implementation: 'window.Promise' - } -} diff --git a/node_modules/any-promise/register.d.ts b/node_modules/any-promise/register.d.ts deleted file mode 100644 index 97f2fc0..0000000 --- a/node_modules/any-promise/register.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import Promise = require('./index'); - -declare function register (module?: string, options?: register.Options): register.Register; - -declare namespace register { - export interface Register { - Promise: typeof Promise; - implementation: string; - } - - export interface Options { - Promise?: typeof Promise; - global?: boolean - } -} - -export = register; diff --git a/node_modules/any-promise/register.js b/node_modules/any-promise/register.js deleted file mode 100644 index 255c6e2..0000000 --- a/node_modules/any-promise/register.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict" -module.exports = require('./loader')(global, loadImplementation); - -/** - * Node.js version of loadImplementation. - * - * Requires the given implementation and returns the registration - * containing {Promise, implementation} - * - * If implementation is undefined or global.Promise, loads it - * Otherwise uses require - */ -function loadImplementation(implementation){ - var impl = null - - if(shouldPreferGlobalPromise(implementation)){ - // if no implementation or env specified use global.Promise - impl = { - Promise: global.Promise, - implementation: 'global.Promise' - } - } else if(implementation){ - // if implementation specified, require it - var lib = require(implementation) - impl = { - Promise: lib.Promise || lib, - implementation: implementation - } - } else { - // try to auto detect implementation. This is non-deterministic - // and should prefer other branches, but this is our last chance - // to load something without throwing error - impl = tryAutoDetect() - } - - if(impl === null){ - throw new Error('Cannot find any-promise implementation nor'+ - ' global.Promise. You must install polyfill or call'+ - ' require("any-promise/register") with your preferred'+ - ' implementation, e.g. require("any-promise/register/bluebird")'+ - ' on application load prior to any require("any-promise").') - } - - return impl -} - -/** - * Determines if the global.Promise should be preferred if an implementation - * has not been registered. - */ -function shouldPreferGlobalPromise(implementation){ - if(implementation){ - return implementation === 'global.Promise' - } else if(typeof global.Promise !== 'undefined'){ - // Load global promise if implementation not specified - // Versions < 0.11 did not have global Promise - // Do not use for version < 0.12 as version 0.11 contained buggy versions - var version = (/v(\d+)\.(\d+)\.(\d+)/).exec(process.version) - return !(version && +version[1] == 0 && +version[2] < 12) - } - - // do not have global.Promise or another implementation was specified - return false -} - -/** - * Look for common libs as last resort there is no guarantee that - * this will return a desired implementation or even be deterministic. - * The priority is also nearly arbitrary. We are only doing this - * for older versions of Node.js <0.12 that do not have a reasonable - * global.Promise implementation and we the user has not registered - * the preference. This preserves the behavior of any-promise <= 0.1 - * and may be deprecated or removed in the future - */ -function tryAutoDetect(){ - var libs = [ - "es6-promise", - "promise", - "native-promise-only", - "bluebird", - "rsvp", - "when", - "q", - "pinkie", - "lie", - "vow"] - var i = 0, len = libs.length - for(; i < len; i++){ - try { - return loadImplementation(libs[i]) - } catch(e){} - } - return null -} diff --git a/node_modules/any-promise/register/bluebird.d.ts b/node_modules/any-promise/register/bluebird.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/node_modules/any-promise/register/bluebird.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/node_modules/any-promise/register/bluebird.js b/node_modules/any-promise/register/bluebird.js deleted file mode 100644 index de0f87e..0000000 --- a/node_modules/any-promise/register/bluebird.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -require('../register')('bluebird', {Promise: require('bluebird')}) diff --git a/node_modules/any-promise/register/es6-promise.d.ts b/node_modules/any-promise/register/es6-promise.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/node_modules/any-promise/register/es6-promise.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/node_modules/any-promise/register/es6-promise.js b/node_modules/any-promise/register/es6-promise.js deleted file mode 100644 index 59bd55b..0000000 --- a/node_modules/any-promise/register/es6-promise.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -require('../register')('es6-promise', {Promise: require('es6-promise').Promise}) diff --git a/node_modules/any-promise/register/lie.d.ts b/node_modules/any-promise/register/lie.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/node_modules/any-promise/register/lie.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/node_modules/any-promise/register/lie.js b/node_modules/any-promise/register/lie.js deleted file mode 100644 index 7d305ca..0000000 --- a/node_modules/any-promise/register/lie.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -require('../register')('lie', {Promise: require('lie')}) diff --git a/node_modules/any-promise/register/native-promise-only.d.ts b/node_modules/any-promise/register/native-promise-only.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/node_modules/any-promise/register/native-promise-only.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/node_modules/any-promise/register/native-promise-only.js b/node_modules/any-promise/register/native-promise-only.js deleted file mode 100644 index 70a5a5e..0000000 --- a/node_modules/any-promise/register/native-promise-only.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -require('../register')('native-promise-only', {Promise: require('native-promise-only')}) diff --git a/node_modules/any-promise/register/pinkie.d.ts b/node_modules/any-promise/register/pinkie.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/node_modules/any-promise/register/pinkie.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/node_modules/any-promise/register/pinkie.js b/node_modules/any-promise/register/pinkie.js deleted file mode 100644 index caaf98a..0000000 --- a/node_modules/any-promise/register/pinkie.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -require('../register')('pinkie', {Promise: require('pinkie')}) diff --git a/node_modules/any-promise/register/promise.d.ts b/node_modules/any-promise/register/promise.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/node_modules/any-promise/register/promise.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/node_modules/any-promise/register/promise.js b/node_modules/any-promise/register/promise.js deleted file mode 100644 index 746620d..0000000 --- a/node_modules/any-promise/register/promise.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -require('../register')('promise', {Promise: require('promise')}) diff --git a/node_modules/any-promise/register/q.d.ts b/node_modules/any-promise/register/q.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/node_modules/any-promise/register/q.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/node_modules/any-promise/register/q.js b/node_modules/any-promise/register/q.js deleted file mode 100644 index 0fc633a..0000000 --- a/node_modules/any-promise/register/q.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -require('../register')('q', {Promise: require('q').Promise}) diff --git a/node_modules/any-promise/register/rsvp.d.ts b/node_modules/any-promise/register/rsvp.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/node_modules/any-promise/register/rsvp.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/node_modules/any-promise/register/rsvp.js b/node_modules/any-promise/register/rsvp.js deleted file mode 100644 index 02b1318..0000000 --- a/node_modules/any-promise/register/rsvp.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -require('../register')('rsvp', {Promise: require('rsvp').Promise}) diff --git a/node_modules/any-promise/register/vow.d.ts b/node_modules/any-promise/register/vow.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/node_modules/any-promise/register/vow.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/node_modules/any-promise/register/vow.js b/node_modules/any-promise/register/vow.js deleted file mode 100644 index 5b6868c..0000000 --- a/node_modules/any-promise/register/vow.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -require('../register')('vow', {Promise: require('vow').Promise}) diff --git a/node_modules/any-promise/register/when.d.ts b/node_modules/any-promise/register/when.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/node_modules/any-promise/register/when.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/node_modules/any-promise/register/when.js b/node_modules/any-promise/register/when.js deleted file mode 100644 index d91c13d..0000000 --- a/node_modules/any-promise/register/when.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; -require('../register')('when', {Promise: require('when').Promise}) diff --git a/node_modules/anymatch/LICENSE b/node_modules/anymatch/LICENSE deleted file mode 100644 index 491766c..0000000 --- a/node_modules/anymatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com) - -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/anymatch/README.md b/node_modules/anymatch/README.md deleted file mode 100644 index 1dd67f5..0000000 --- a/node_modules/anymatch/README.md +++ /dev/null @@ -1,87 +0,0 @@ -anymatch [![Build Status](https://travis-ci.org/micromatch/anymatch.svg?branch=master)](https://travis-ci.org/micromatch/anymatch) [![Coverage Status](https://img.shields.io/coveralls/micromatch/anymatch.svg?branch=master)](https://coveralls.io/r/micromatch/anymatch?branch=master) -====== -Javascript module to match a string against a regular expression, glob, string, -or function that takes the string as an argument and returns a truthy or falsy -value. The matcher can also be an array of any or all of these. Useful for -allowing a very flexible user-defined config to define things like file paths. - -__Note: This module has Bash-parity, please be aware that Windows-style backslashes are not supported as separators. See https://github.com/micromatch/micromatch#backslashes for more information.__ - - -Usage ------ -```sh -npm install anymatch -``` - -#### anymatch(matchers, testString, [returnIndex], [options]) -* __matchers__: (_Array|String|RegExp|Function_) -String to be directly matched, string with glob patterns, regular expression -test, function that takes the testString as an argument and returns a truthy -value if it should be matched, or an array of any number and mix of these types. -* __testString__: (_String|Array_) The string to test against the matchers. If -passed as an array, the first element of the array will be used as the -`testString` for non-function matchers, while the entire array will be applied -as the arguments for function matchers. -* __options__: (_Object_ [optional]_) Any of the [picomatch](https://github.com/micromatch/picomatch#options) options. - * __returnIndex__: (_Boolean [optional]_) If true, return the array index of -the first matcher that that testString matched, or -1 if no match, instead of a -boolean result. - -```js -const anymatch = require('anymatch'); - -const matchers = [ 'path/to/file.js', 'path/anyjs/**/*.js', /foo.js$/, string => string.includes('bar') && string.length > 10 ] ; - -anymatch(matchers, 'path/to/file.js'); // true -anymatch(matchers, 'path/anyjs/baz.js'); // true -anymatch(matchers, 'path/to/foo.js'); // true -anymatch(matchers, 'path/to/bar.js'); // true -anymatch(matchers, 'bar.js'); // false - -// returnIndex = true -anymatch(matchers, 'foo.js', {returnIndex: true}); // 2 -anymatch(matchers, 'path/anyjs/foo.js', {returnIndex: true}); // 1 - -// any picomatc - -// using globs to match directories and their children -anymatch('node_modules', 'node_modules'); // true -anymatch('node_modules', 'node_modules/somelib/index.js'); // false -anymatch('node_modules/**', 'node_modules/somelib/index.js'); // true -anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // false -anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true - -const matcher = anymatch(matchers); -['foo.js', 'bar.js'].filter(matcher); // [ 'foo.js' ] -anymatch master* ❯ - -``` - -#### anymatch(matchers) -You can also pass in only your matcher(s) to get a curried function that has -already been bound to the provided matching criteria. This can be used as an -`Array#filter` callback. - -```js -var matcher = anymatch(matchers); - -matcher('path/to/file.js'); // true -matcher('path/anyjs/baz.js', true); // 1 - -['foo.js', 'bar.js'].filter(matcher); // ['foo.js'] -``` - -Changelog ----------- -[See release notes page on GitHub](https://github.com/micromatch/anymatch/releases) - -- **v3.0:** Removed `startIndex` and `endIndex` arguments. Node 8.x-only. -- **v2.0:** [micromatch](https://github.com/jonschlinkert/micromatch) moves away from minimatch-parity and inline with Bash. This includes handling backslashes differently (see https://github.com/micromatch/micromatch#backslashes for more information). -- **v1.2:** anymatch uses [micromatch](https://github.com/jonschlinkert/micromatch) -for glob pattern matching. Issues with glob pattern matching should be -reported directly to the [micromatch issue tracker](https://github.com/jonschlinkert/micromatch/issues). - -License -------- -[ISC](https://raw.github.com/micromatch/anymatch/master/LICENSE) diff --git a/node_modules/anymatch/index.d.ts b/node_modules/anymatch/index.d.ts deleted file mode 100644 index 3ef7eaa..0000000 --- a/node_modules/anymatch/index.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -type AnymatchFn = (testString: string) => boolean; -type AnymatchPattern = string|RegExp|AnymatchFn; -type AnymatchMatcher = AnymatchPattern|AnymatchPattern[] -type AnymatchTester = { - (testString: string|any[], returnIndex: true): number; - (testString: string|any[]): boolean; -} - -type PicomatchOptions = {dot: boolean}; - -declare const anymatch: { - (matchers: AnymatchMatcher): AnymatchTester; - (matchers: AnymatchMatcher, testString: null, returnIndex: true | PicomatchOptions): AnymatchTester; - (matchers: AnymatchMatcher, testString: string|any[], returnIndex: true | PicomatchOptions): number; - (matchers: AnymatchMatcher, testString: string|any[]): boolean; -} - -export {AnymatchMatcher as Matcher} -export {AnymatchTester as Tester} -export default anymatch diff --git a/node_modules/anymatch/index.js b/node_modules/anymatch/index.js deleted file mode 100644 index 8eb73e9..0000000 --- a/node_modules/anymatch/index.js +++ /dev/null @@ -1,104 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, "__esModule", { value: true }); - -const picomatch = require('picomatch'); -const normalizePath = require('normalize-path'); - -/** - * @typedef {(testString: string) => boolean} AnymatchFn - * @typedef {string|RegExp|AnymatchFn} AnymatchPattern - * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher - */ -const BANG = '!'; -const DEFAULT_OPTIONS = {returnIndex: false}; -const arrify = (item) => Array.isArray(item) ? item : [item]; - -/** - * @param {AnymatchPattern} matcher - * @param {object} options - * @returns {AnymatchFn} - */ -const createPattern = (matcher, options) => { - if (typeof matcher === 'function') { - return matcher; - } - if (typeof matcher === 'string') { - const glob = picomatch(matcher, options); - return (string) => matcher === string || glob(string); - } - if (matcher instanceof RegExp) { - return (string) => matcher.test(string); - } - return (string) => false; -}; - -/** - * @param {Array} patterns - * @param {Array} negPatterns - * @param {String|Array} args - * @param {Boolean} returnIndex - * @returns {boolean|number} - */ -const matchPatterns = (patterns, negPatterns, args, returnIndex) => { - const isList = Array.isArray(args); - const _path = isList ? args[0] : args; - if (!isList && typeof _path !== 'string') { - throw new TypeError('anymatch: second argument must be a string: got ' + - Object.prototype.toString.call(_path)) - } - const path = normalizePath(_path, false); - - for (let index = 0; index < negPatterns.length; index++) { - const nglob = negPatterns[index]; - if (nglob(path)) { - return returnIndex ? -1 : false; - } - } - - const applied = isList && [path].concat(args.slice(1)); - for (let index = 0; index < patterns.length; index++) { - const pattern = patterns[index]; - if (isList ? pattern(...applied) : pattern(path)) { - return returnIndex ? index : true; - } - } - - return returnIndex ? -1 : false; -}; - -/** - * @param {AnymatchMatcher} matchers - * @param {Array|string} testString - * @param {object} options - * @returns {boolean|number|Function} - */ -const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => { - if (matchers == null) { - throw new TypeError('anymatch: specify first argument'); - } - const opts = typeof options === 'boolean' ? {returnIndex: options} : options; - const returnIndex = opts.returnIndex || false; - - // Early cache for matchers. - const mtchers = arrify(matchers); - const negatedGlobs = mtchers - .filter(item => typeof item === 'string' && item.charAt(0) === BANG) - .map(item => item.slice(1)) - .map(item => picomatch(item, opts)); - const patterns = mtchers - .filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG)) - .map(matcher => createPattern(matcher, opts)); - - if (testString == null) { - return (testString, ri = false) => { - const returnIndex = typeof ri === 'boolean' ? ri : false; - return matchPatterns(patterns, negatedGlobs, testString, returnIndex); - } - } - - return matchPatterns(patterns, negatedGlobs, testString, returnIndex); -}; - -anymatch.default = anymatch; -module.exports = anymatch; diff --git a/node_modules/anymatch/package.json b/node_modules/anymatch/package.json deleted file mode 100644 index 2cb2307..0000000 --- a/node_modules/anymatch/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "anymatch", - "version": "3.1.3", - "description": "Matches strings against configurable strings, globs, regular expressions, and/or functions", - "files": [ - "index.js", - "index.d.ts" - ], - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "author": { - "name": "Elan Shanker", - "url": "https://github.com/es128" - }, - "license": "ISC", - "homepage": "https://github.com/micromatch/anymatch", - "repository": { - "type": "git", - "url": "https://github.com/micromatch/anymatch" - }, - "keywords": [ - "match", - "any", - "string", - "file", - "fs", - "list", - "glob", - "regex", - "regexp", - "regular", - "expression", - "function" - ], - "scripts": { - "test": "nyc mocha", - "mocha": "mocha" - }, - "devDependencies": { - "mocha": "^6.1.3", - "nyc": "^14.0.0" - }, - "engines": { - "node": ">= 8" - } -} diff --git a/node_modules/arg/LICENSE.md b/node_modules/arg/LICENSE.md deleted file mode 100644 index b708f87..0000000 --- a/node_modules/arg/LICENSE.md +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2021 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/arg/README.md b/node_modules/arg/README.md deleted file mode 100644 index 6501df5..0000000 --- a/node_modules/arg/README.md +++ /dev/null @@ -1,317 +0,0 @@ -# Arg - -`arg` is an unopinionated, no-frills CLI argument parser. - -## Installation - -```bash -npm install arg -``` - -## Usage - -`arg()` takes either 1 or 2 arguments: - -1. Command line specification object (see below) -2. Parse options (_Optional_, defaults to `{permissive: false, argv: process.argv.slice(2), stopAtPositional: false}`) - -It returns an object with any values present on the command-line (missing options are thus -missing from the resulting object). Arg performs no validation/requirement checking - we -leave that up to the application. - -All parameters that aren't consumed by options (commonly referred to as "extra" parameters) -are added to `result._`, which is _always_ an array (even if no extra parameters are passed, -in which case an empty array is returned). - -```javascript -const arg = require('arg'); - -// `options` is an optional parameter -const args = arg( - spec, - (options = { permissive: false, argv: process.argv.slice(2) }) -); -``` - -For example: - -```console -$ node ./hello.js --verbose -vvv --port=1234 -n 'My name' foo bar --tag qux --tag=qix -- --foobar -``` - -```javascript -// hello.js -const arg = require('arg'); - -const args = arg({ - // Types - '--help': Boolean, - '--version': Boolean, - '--verbose': arg.COUNT, // Counts the number of times --verbose is passed - '--port': Number, // --port or --port= - '--name': String, // --name or --name= - '--tag': [String], // --tag or --tag= - - // Aliases - '-v': '--verbose', - '-n': '--name', // -n ; result is stored in --name - '--label': '--name' // --label or --label=; - // result is stored in --name -}); - -console.log(args); -/* -{ - _: ["foo", "bar", "--foobar"], - '--port': 1234, - '--verbose': 4, - '--name': "My name", - '--tag': ["qux", "qix"] -} -*/ -``` - -The values for each key=>value pair is either a type (function or [function]) or a string (indicating an alias). - -- In the case of a function, the string value of the argument's value is passed to it, - and the return value is used as the ultimate value. - -- In the case of an array, the only element _must_ be a type function. Array types indicate - that the argument may be passed multiple times, and as such the resulting value in the returned - object is an array with all of the values that were passed using the specified flag. - -- In the case of a string, an alias is established. If a flag is passed that matches the _key_, - then the _value_ is substituted in its place. - -Type functions are passed three arguments: - -1. The parameter value (always a string) -2. The parameter name (e.g. `--label`) -3. The previous value for the destination (useful for reduce-like operations or for supporting `-v` multiple times, etc.) - -This means the built-in `String`, `Number`, and `Boolean` type constructors "just work" as type functions. - -Note that `Boolean` and `[Boolean]` have special treatment - an option argument is _not_ consumed or passed, but instead `true` is -returned. These options are called "flags". - -For custom handlers that wish to behave as flags, you may pass the function through `arg.flag()`: - -```javascript -const arg = require('arg'); - -const argv = [ - '--foo', - 'bar', - '-ff', - 'baz', - '--foo', - '--foo', - 'qux', - '-fff', - 'qix' -]; - -function myHandler(value, argName, previousValue) { - /* `value` is always `true` */ - return 'na ' + (previousValue || 'batman!'); -} - -const args = arg( - { - '--foo': arg.flag(myHandler), - '-f': '--foo' - }, - { - argv - } -); - -console.log(args); -/* -{ - _: ['bar', 'baz', 'qux', 'qix'], - '--foo': 'na na na na na na na na batman!' -} -*/ -``` - -As well, `arg` supplies a helper argument handler called `arg.COUNT`, which equivalent to a `[Boolean]` argument's `.length` -property - effectively counting the number of times the boolean flag, denoted by the key, is passed on the command line.. -For example, this is how you could implement `ssh`'s multiple levels of verbosity (`-vvvv` being the most verbose). - -```javascript -const arg = require('arg'); - -const argv = ['-AAAA', '-BBBB']; - -const args = arg( - { - '-A': arg.COUNT, - '-B': [Boolean] - }, - { - argv - } -); - -console.log(args); -/* -{ - _: [], - '-A': 4, - '-B': [true, true, true, true] -} -*/ -``` - -### Options - -If a second parameter is specified and is an object, it specifies parsing options to modify the behavior of `arg()`. - -#### `argv` - -If you have already sliced or generated a number of raw arguments to be parsed (as opposed to letting `arg` -slice them from `process.argv`) you may specify them in the `argv` option. - -For example: - -```javascript -const args = arg( - { - '--foo': String - }, - { - argv: ['hello', '--foo', 'world'] - } -); -``` - -results in: - -```javascript -const args = { - _: ['hello'], - '--foo': 'world' -}; -``` - -#### `permissive` - -When `permissive` set to `true`, `arg` will push any unknown arguments -onto the "extra" argument array (`result._`) instead of throwing an error about -an unknown flag. - -For example: - -```javascript -const arg = require('arg'); - -const argv = [ - '--foo', - 'hello', - '--qux', - 'qix', - '--bar', - '12345', - 'hello again' -]; - -const args = arg( - { - '--foo': String, - '--bar': Number - }, - { - argv, - permissive: true - } -); -``` - -results in: - -```javascript -const args = { - _: ['--qux', 'qix', 'hello again'], - '--foo': 'hello', - '--bar': 12345 -}; -``` - -#### `stopAtPositional` - -When `stopAtPositional` is set to `true`, `arg` will halt parsing at the first -positional argument. - -For example: - -```javascript -const arg = require('arg'); - -const argv = ['--foo', 'hello', '--bar']; - -const args = arg( - { - '--foo': Boolean, - '--bar': Boolean - }, - { - argv, - stopAtPositional: true - } -); -``` - -results in: - -```javascript -const args = { - _: ['hello', '--bar'], - '--foo': true -}; -``` - -### Errors - -Some errors that `arg` throws provide a `.code` property in order to aid in recovering from user error, or to -differentiate between user error and developer error (bug). - -##### ARG_UNKNOWN_OPTION - -If an unknown option (not defined in the spec object) is passed, an error with code `ARG_UNKNOWN_OPTION` will be thrown: - -```js -// cli.js -try { - require('arg')({ '--hi': String }); -} catch (err) { - if (err.code === 'ARG_UNKNOWN_OPTION') { - console.log(err.message); - } else { - throw err; - } -} -``` - -```shell -node cli.js --extraneous true -Unknown or unexpected option: --extraneous -``` - -# FAQ - -A few questions and answers that have been asked before: - -### How do I require an argument with `arg`? - -Do the assertion yourself, such as: - -```javascript -const args = arg({ '--name': String }); - -if (!args['--name']) throw new Error('missing required argument: --name'); -``` - -# License - -Released under the [MIT License](LICENSE.md). diff --git a/node_modules/arg/index.d.ts b/node_modules/arg/index.d.ts deleted file mode 100644 index 44f9f35..0000000 --- a/node_modules/arg/index.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -declare function arg( - spec: T, - options?: arg.Options -): arg.Result; - -declare namespace arg { - export const flagSymbol: unique symbol; - - export function flag(fn: T): T & { [arg.flagSymbol]: true }; - - export const COUNT: Handler & { [arg.flagSymbol]: true }; - - export type Handler = ( - value: string, - name: string, - previousValue?: T - ) => T; - - export class ArgError extends Error { - constructor(message: string, code: string); - - code: string; - } - - export interface Spec { - [key: string]: string | Handler | [Handler]; - } - - export type Result = { _: string[] } & { - [K in keyof T]?: T[K] extends Handler - ? ReturnType - : T[K] extends [Handler] - ? Array> - : never; - }; - - export interface Options { - argv?: string[]; - permissive?: boolean; - stopAtPositional?: boolean; - } -} - -export = arg; diff --git a/node_modules/arg/index.js b/node_modules/arg/index.js deleted file mode 100644 index 3f60f4c..0000000 --- a/node_modules/arg/index.js +++ /dev/null @@ -1,195 +0,0 @@ -const flagSymbol = Symbol('arg flag'); - -class ArgError extends Error { - constructor(msg, code) { - super(msg); - this.name = 'ArgError'; - this.code = code; - - Object.setPrototypeOf(this, ArgError.prototype); - } -} - -function arg( - opts, - { - argv = process.argv.slice(2), - permissive = false, - stopAtPositional = false - } = {} -) { - if (!opts) { - throw new ArgError( - 'argument specification object is required', - 'ARG_CONFIG_NO_SPEC' - ); - } - - const result = { _: [] }; - - const aliases = {}; - const handlers = {}; - - for (const key of Object.keys(opts)) { - if (!key) { - throw new ArgError( - 'argument key cannot be an empty string', - 'ARG_CONFIG_EMPTY_KEY' - ); - } - - if (key[0] !== '-') { - throw new ArgError( - `argument key must start with '-' but found: '${key}'`, - 'ARG_CONFIG_NONOPT_KEY' - ); - } - - if (key.length === 1) { - throw new ArgError( - `argument key must have a name; singular '-' keys are not allowed: ${key}`, - 'ARG_CONFIG_NONAME_KEY' - ); - } - - if (typeof opts[key] === 'string') { - aliases[key] = opts[key]; - continue; - } - - let type = opts[key]; - let isFlag = false; - - if ( - Array.isArray(type) && - type.length === 1 && - typeof type[0] === 'function' - ) { - const [fn] = type; - type = (value, name, prev = []) => { - prev.push(fn(value, name, prev[prev.length - 1])); - return prev; - }; - isFlag = fn === Boolean || fn[flagSymbol] === true; - } else if (typeof type === 'function') { - isFlag = type === Boolean || type[flagSymbol] === true; - } else { - throw new ArgError( - `type missing or not a function or valid array type: ${key}`, - 'ARG_CONFIG_VAD_TYPE' - ); - } - - if (key[1] !== '-' && key.length > 2) { - throw new ArgError( - `short argument keys (with a single hyphen) must have only one character: ${key}`, - 'ARG_CONFIG_SHORTOPT_TOOLONG' - ); - } - - handlers[key] = [type, isFlag]; - } - - for (let i = 0, len = argv.length; i < len; i++) { - const wholeArg = argv[i]; - - if (stopAtPositional && result._.length > 0) { - result._ = result._.concat(argv.slice(i)); - break; - } - - if (wholeArg === '--') { - result._ = result._.concat(argv.slice(i + 1)); - break; - } - - if (wholeArg.length > 1 && wholeArg[0] === '-') { - /* eslint-disable operator-linebreak */ - const separatedArguments = - wholeArg[1] === '-' || wholeArg.length === 2 - ? [wholeArg] - : wholeArg - .slice(1) - .split('') - .map((a) => `-${a}`); - /* eslint-enable operator-linebreak */ - - for (let j = 0; j < separatedArguments.length; j++) { - const arg = separatedArguments[j]; - const [originalArgName, argStr] = - arg[1] === '-' ? arg.split(/=(.*)/, 2) : [arg, undefined]; - - let argName = originalArgName; - while (argName in aliases) { - argName = aliases[argName]; - } - - if (!(argName in handlers)) { - if (permissive) { - result._.push(arg); - continue; - } else { - throw new ArgError( - `unknown or unexpected option: ${originalArgName}`, - 'ARG_UNKNOWN_OPTION' - ); - } - } - - const [type, isFlag] = handlers[argName]; - - if (!isFlag && j + 1 < separatedArguments.length) { - throw new ArgError( - `option requires argument (but was followed by another short argument): ${originalArgName}`, - 'ARG_MISSING_REQUIRED_SHORTARG' - ); - } - - if (isFlag) { - result[argName] = type(true, argName, result[argName]); - } else if (argStr === undefined) { - if ( - argv.length < i + 2 || - (argv[i + 1].length > 1 && - argv[i + 1][0] === '-' && - !( - argv[i + 1].match(/^-?\d*(\.(?=\d))?\d*$/) && - (type === Number || - // eslint-disable-next-line no-undef - (typeof BigInt !== 'undefined' && type === BigInt)) - )) - ) { - const extended = - originalArgName === argName ? '' : ` (alias for ${argName})`; - throw new ArgError( - `option requires argument: ${originalArgName}${extended}`, - 'ARG_MISSING_REQUIRED_LONGARG' - ); - } - - result[argName] = type(argv[i + 1], argName, result[argName]); - ++i; - } else { - result[argName] = type(argStr, argName, result[argName]); - } - } - } else { - result._.push(wholeArg); - } - } - - return result; -} - -arg.flag = (fn) => { - fn[flagSymbol] = true; - return fn; -}; - -// Utility types -arg.COUNT = arg.flag((v, name, existingCount) => (existingCount || 0) + 1); - -// Expose error class -arg.ArgError = ArgError; - -module.exports = arg; diff --git a/node_modules/arg/package.json b/node_modules/arg/package.json deleted file mode 100644 index 47368d7..0000000 --- a/node_modules/arg/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "arg", - "version": "5.0.2", - "description": "Unopinionated, no-frills CLI argument parser", - "main": "index.js", - "types": "index.d.ts", - "repository": "vercel/arg", - "author": "Josh Junon ", - "license": "MIT", - "files": [ - "index.js", - "index.d.ts" - ], - "scripts": { - "test": "WARN_EXIT=1 jest --coverage -w 2" - }, - "devDependencies": { - "chai": "^4.1.1", - "jest": "^27.0.6", - "prettier": "^2.3.2" - }, - "prettier": { - "arrowParens": "always", - "singleQuote": true, - "tabWidth": 2, - "trailingComma": "none" - } -} diff --git a/node_modules/binary-extensions/binary-extensions.json b/node_modules/binary-extensions/binary-extensions.json deleted file mode 100644 index ac08048..0000000 --- a/node_modules/binary-extensions/binary-extensions.json +++ /dev/null @@ -1,263 +0,0 @@ -[ - "3dm", - "3ds", - "3g2", - "3gp", - "7z", - "a", - "aac", - "adp", - "afdesign", - "afphoto", - "afpub", - "ai", - "aif", - "aiff", - "alz", - "ape", - "apk", - "appimage", - "ar", - "arj", - "asf", - "au", - "avi", - "bak", - "baml", - "bh", - "bin", - "bk", - "bmp", - "btif", - "bz2", - "bzip2", - "cab", - "caf", - "cgm", - "class", - "cmx", - "cpio", - "cr2", - "cur", - "dat", - "dcm", - "deb", - "dex", - "djvu", - "dll", - "dmg", - "dng", - "doc", - "docm", - "docx", - "dot", - "dotm", - "dra", - "DS_Store", - "dsk", - "dts", - "dtshd", - "dvb", - "dwg", - "dxf", - "ecelp4800", - "ecelp7470", - "ecelp9600", - "egg", - "eol", - "eot", - "epub", - "exe", - "f4v", - "fbs", - "fh", - "fla", - "flac", - "flatpak", - "fli", - "flv", - "fpx", - "fst", - "fvt", - "g3", - "gh", - "gif", - "graffle", - "gz", - "gzip", - "h261", - "h263", - "h264", - "icns", - "ico", - "ief", - "img", - "ipa", - "iso", - "jar", - "jpeg", - "jpg", - "jpgv", - "jpm", - "jxr", - "key", - "ktx", - "lha", - "lib", - "lvp", - "lz", - "lzh", - "lzma", - "lzo", - "m3u", - "m4a", - "m4v", - "mar", - "mdi", - "mht", - "mid", - "midi", - "mj2", - "mka", - "mkv", - "mmr", - "mng", - "mobi", - "mov", - "movie", - "mp3", - "mp4", - "mp4a", - "mpeg", - "mpg", - "mpga", - "mxu", - "nef", - "npx", - "numbers", - "nupkg", - "o", - "odp", - "ods", - "odt", - "oga", - "ogg", - "ogv", - "otf", - "ott", - "pages", - "pbm", - "pcx", - "pdb", - "pdf", - "pea", - "pgm", - "pic", - "png", - "pnm", - "pot", - "potm", - "potx", - "ppa", - "ppam", - "ppm", - "pps", - "ppsm", - "ppsx", - "ppt", - "pptm", - "pptx", - "psd", - "pya", - "pyc", - "pyo", - "pyv", - "qt", - "rar", - "ras", - "raw", - "resources", - "rgb", - "rip", - "rlc", - "rmf", - "rmvb", - "rpm", - "rtf", - "rz", - "s3m", - "s7z", - "scpt", - "sgi", - "shar", - "snap", - "sil", - "sketch", - "slk", - "smv", - "snk", - "so", - "stl", - "suo", - "sub", - "swf", - "tar", - "tbz", - "tbz2", - "tga", - "tgz", - "thmx", - "tif", - "tiff", - "tlz", - "ttc", - "ttf", - "txz", - "udf", - "uvh", - "uvi", - "uvm", - "uvp", - "uvs", - "uvu", - "viv", - "vob", - "war", - "wav", - "wax", - "wbmp", - "wdp", - "weba", - "webm", - "webp", - "whl", - "wim", - "wm", - "wma", - "wmv", - "wmx", - "woff", - "woff2", - "wrm", - "wvx", - "xbm", - "xif", - "xla", - "xlam", - "xls", - "xlsb", - "xlsm", - "xlsx", - "xlt", - "xltm", - "xltx", - "xm", - "xmind", - "xpi", - "xpm", - "xwd", - "xz", - "z", - "zip", - "zipx" -] diff --git a/node_modules/binary-extensions/binary-extensions.json.d.ts b/node_modules/binary-extensions/binary-extensions.json.d.ts deleted file mode 100644 index 94a248c..0000000 --- a/node_modules/binary-extensions/binary-extensions.json.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const binaryExtensionsJson: readonly string[]; - -export = binaryExtensionsJson; diff --git a/node_modules/binary-extensions/index.d.ts b/node_modules/binary-extensions/index.d.ts deleted file mode 100644 index f469ac5..0000000 --- a/node_modules/binary-extensions/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** -List of binary file extensions. - -@example -``` -import binaryExtensions = require('binary-extensions'); - -console.log(binaryExtensions); -//=> ['3ds', '3g2', …] -``` -*/ -declare const binaryExtensions: readonly string[]; - -export = binaryExtensions; diff --git a/node_modules/binary-extensions/index.js b/node_modules/binary-extensions/index.js deleted file mode 100644 index d46e468..0000000 --- a/node_modules/binary-extensions/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./binary-extensions.json'); diff --git a/node_modules/binary-extensions/license b/node_modules/binary-extensions/license deleted file mode 100644 index 5493a1a..0000000 --- a/node_modules/binary-extensions/license +++ /dev/null @@ -1,10 +0,0 @@ -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) -Copyright (c) Paul Miller (https://paulmillr.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/binary-extensions/package.json b/node_modules/binary-extensions/package.json deleted file mode 100644 index 4710c33..0000000 --- a/node_modules/binary-extensions/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "binary-extensions", - "version": "2.3.0", - "description": "List of binary file extensions", - "license": "MIT", - "repository": "sindresorhus/binary-extensions", - "funding": "https://github.com/sponsors/sindresorhus", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "https://sindresorhus.com" - }, - "sideEffects": false, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts", - "binary-extensions.json", - "binary-extensions.json.d.ts" - ], - "keywords": [ - "binary", - "extensions", - "extension", - "file", - "json", - "list", - "array" - ], - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/binary-extensions/readme.md b/node_modules/binary-extensions/readme.md deleted file mode 100644 index 88519b3..0000000 --- a/node_modules/binary-extensions/readme.md +++ /dev/null @@ -1,25 +0,0 @@ -# binary-extensions - -> List of binary file extensions - -The list is just a [JSON file](binary-extensions.json) and can be used anywhere. - -## Install - -```sh -npm install binary-extensions -``` - -## Usage - -```js -const binaryExtensions = require('binary-extensions'); - -console.log(binaryExtensions); -//=> ['3ds', '3g2', …] -``` - -## Related - -- [is-binary-path](https://github.com/sindresorhus/is-binary-path) - Check if a filepath is a binary file -- [text-extensions](https://github.com/sindresorhus/text-extensions) - List of text file extensions diff --git a/node_modules/braces/LICENSE b/node_modules/braces/LICENSE deleted file mode 100644 index 9af4a67..0000000 --- a/node_modules/braces/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-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/braces/README.md b/node_modules/braces/README.md deleted file mode 100644 index f59dd60..0000000 --- a/node_modules/braces/README.md +++ /dev/null @@ -1,586 +0,0 @@ -# braces [![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/braces.svg?style=flat)](https://www.npmjs.com/package/braces) [![NPM monthly downloads](https://img.shields.io/npm/dm/braces.svg?style=flat)](https://npmjs.org/package/braces) [![NPM total downloads](https://img.shields.io/npm/dt/braces.svg?style=flat)](https://npmjs.org/package/braces) [![Linux Build Status](https://img.shields.io/travis/micromatch/braces.svg?style=flat&label=Travis)](https://travis-ci.org/micromatch/braces) - -> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed. - -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 braces -``` - -## v3.0.0 Released!! - -See the [changelog](CHANGELOG.md) for details. - -## Why use braces? - -Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters. - -- **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests) -- **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity. -- **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up. -- **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written). -- **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)). -- [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']` -- [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']` -- [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']` -- [Supports escaping](#escaping) - To prevent evaluation of special characters. - -## Usage - -The main export is a function that takes one or more brace `patterns` and `options`. - -```js -const braces = require('braces'); -// braces(patterns[, options]); - -console.log(braces(['{01..05}', '{a..e}'])); -//=> ['(0[1-5])', '([a-e])'] - -console.log(braces(['{01..05}', '{a..e}'], { expand: true })); -//=> ['01', '02', '03', '04', '05', 'a', 'b', 'c', 'd', 'e'] -``` - -### Brace Expansion vs. Compilation - -By default, brace patterns are compiled into strings that are optimized for creating regular expressions and matching. - -**Compiled** - -```js -console.log(braces('a/{x,y,z}/b')); -//=> ['a/(x|y|z)/b'] -console.log(braces(['a/{01..20}/b', 'a/{1..5}/b'])); -//=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ] -``` - -**Expanded** - -Enable brace expansion by setting the `expand` option to true, or by using [braces.expand()](#expand) (returns an array similar to what you'd expect from Bash, or `echo {1..5}`, or [minimatch](https://github.com/isaacs/minimatch)): - -```js -console.log(braces('a/{x,y,z}/b', { expand: true })); -//=> ['a/x/b', 'a/y/b', 'a/z/b'] - -console.log(braces.expand('{01..10}')); -//=> ['01','02','03','04','05','06','07','08','09','10'] -``` - -### Lists - -Expand lists (like Bash "sets"): - -```js -console.log(braces('a/{foo,bar,baz}/*.js')); -//=> ['a/(foo|bar|baz)/*.js'] - -console.log(braces.expand('a/{foo,bar,baz}/*.js')); -//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js'] -``` - -### Sequences - -Expand ranges of characters (like Bash "sequences"): - -```js -console.log(braces.expand('{1..3}')); // ['1', '2', '3'] -console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b'] -console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c'] -console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c'] - -// supports zero-padded ranges -console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b'] -console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b'] -``` - -See [fill-range](https://github.com/jonschlinkert/fill-range) for all available range-expansion options. - -### Steppped ranges - -Steps, or increments, may be used with ranges: - -```js -console.log(braces.expand('{2..10..2}')); -//=> ['2', '4', '6', '8', '10'] - -console.log(braces('{2..10..2}')); -//=> ['(2|4|6|8|10)'] -``` - -When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion. - -### Nesting - -Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved. - -**"Expanded" braces** - -```js -console.log(braces.expand('a{b,c,/{x,y}}/e')); -//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e'] - -console.log(braces.expand('a/{x,{1..5},y}/c')); -//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c'] -``` - -**"Optimized" braces** - -```js -console.log(braces('a{b,c,/{x,y}}/e')); -//=> ['a(b|c|/(x|y))/e'] - -console.log(braces('a/{x,{1..5},y}/c')); -//=> ['a/(x|([1-5])|y)/c'] -``` - -### Escaping - -**Escaping braces** - -A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_: - -```js -console.log(braces.expand('a\\{d,c,b}e')); -//=> ['a{d,c,b}e'] - -console.log(braces.expand('a{d,c,b\\}e')); -//=> ['a{d,c,b}e'] -``` - -**Escaping commas** - -Commas inside braces may also be escaped: - -```js -console.log(braces.expand('a{b\\,c}d')); -//=> ['a{b,c}d'] - -console.log(braces.expand('a{d\\,c,b}e')); -//=> ['ad,ce', 'abe'] -``` - -**Single items** - -Following bash conventions, a brace pattern is also not expanded when it contains a single character: - -```js -console.log(braces.expand('a{b}c')); -//=> ['a{b}c'] -``` - -## Options - -### options.maxLength - -**Type**: `Number` - -**Default**: `10,000` - -**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera. - -```js -console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error -``` - -### options.expand - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: Generate an "expanded" brace pattern (alternatively you can use the `braces.expand()` method, which does the same thing). - -```js -console.log(braces('a/{b,c}/d', { expand: true })); -//=> [ 'a/b/d', 'a/c/d' ] -``` - -### options.nodupes - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: Remove duplicates from the returned array. - -### options.rangeLimit - -**Type**: `Number` - -**Default**: `1000` - -**Description**: To prevent malicious patterns from being passed by users, an error is thrown when `braces.expand()` is used or `options.expand` is true and the generated range will exceed the `rangeLimit`. - -You can customize `options.rangeLimit` or set it to `Inifinity` to disable this altogether. - -**Examples** - -```js -// pattern exceeds the "rangeLimit", so it's optimized automatically -console.log(braces.expand('{1..1000}')); -//=> ['([1-9]|[1-9][0-9]{1,2}|1000)'] - -// pattern does not exceed "rangeLimit", so it's NOT optimized -console.log(braces.expand('{1..100}')); -//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100'] -``` - -### options.transform - -**Type**: `Function` - -**Default**: `undefined` - -**Description**: Customize range expansion. - -**Example: Transforming non-numeric values** - -```js -const alpha = braces.expand('x/{a..e}/y', { - transform(value, index) { - // When non-numeric values are passed, "value" is a character code. - return 'foo/' + String.fromCharCode(value) + '-' + index; - }, -}); -console.log(alpha); -//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ] -``` - -**Example: Transforming numeric values** - -```js -const numeric = braces.expand('{1..5}', { - transform(value) { - // when numeric values are passed, "value" is a number - return 'foo/' + value * 2; - }, -}); -console.log(numeric); -//=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ] -``` - -### options.quantifiers - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times. - -Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists) - -The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists. - -**Examples** - -```js -const braces = require('braces'); -console.log(braces('a/b{1,3}/{x,y,z}')); -//=> [ 'a/b(1|3)/(x|y|z)' ] -console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true })); -//=> [ 'a/b{1,3}/(x|y|z)' ] -console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true, expand: true })); -//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ] -``` - -### options.keepEscaping - -**Type**: `Boolean` - -**Default**: `undefined` - -**Description**: Do not strip backslashes that were used for escaping from the result. - -## What is "brace expansion"? - -Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs). - -In addition to "expansion", braces are also used for matching. In other words: - -- [brace expansion](#brace-expansion) is for generating new lists -- [brace matching](#brace-matching) is for filtering existing lists - -
-More about brace expansion (click to expand) - -There are two main types of brace expansion: - -1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}` -2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges". - -Here are some example brace patterns to illustrate how they work: - -**Sets** - -``` -{a,b,c} => a b c -{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2 -``` - -**Sequences** - -``` -{1..9} => 1 2 3 4 5 6 7 8 9 -{4..-4} => 4 3 2 1 0 -1 -2 -3 -4 -{1..20..3} => 1 4 7 10 13 16 19 -{a..j} => a b c d e f g h i j -{j..a} => j i h g f e d c b a -{a..z..3} => a d g j m p s v y -``` - -**Combination** - -Sets and sequences can be mixed together or used along with any other strings. - -``` -{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3 -foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar -``` - -The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases. - -## Brace matching - -In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching. - -For example, the pattern `foo/{1..3}/bar` would match any of following strings: - -``` -foo/1/bar -foo/2/bar -foo/3/bar -``` - -But not: - -``` -baz/1/qux -baz/2/qux -baz/3/qux -``` - -Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings: - -``` -foo/1/bar -foo/2/bar -foo/3/bar -baz/1/qux -baz/2/qux -baz/3/qux -``` - -## Brace matching pitfalls - -Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of. - -### tldr - -**"brace bombs"** - -- brace expansion can eat up a huge amount of processing resources -- as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially -- users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!) - -For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section. - -### The solution - -Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries. - -### Geometric complexity - -At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`. - -For example, the following sets demonstrate quadratic (`O(n^2)`) complexity: - -``` -{1,2}{3,4} => (2X2) => 13 14 23 24 -{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246 -``` - -But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity: - -``` -{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248 - 249 257 258 259 267 268 269 347 348 349 357 - 358 359 367 368 369 -``` - -Now, imagine how this complexity grows given that each element is a n-tuple: - -``` -{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB) -{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB) -``` - -Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control. - -**More information** - -Interested in learning more about brace expansion? - -- [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion) -- [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion) -- [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) - -
- -## Performance - -Braces is not only screaming fast, it's also more accurate the other brace expansion libraries. - -### Better algorithms - -Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_. - -Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently. - -**The proof is in the numbers** - -Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively. - -| **Pattern** | **braces** | **[minimatch][]** | -| --------------------------- | ------------------- | ---------------------------- | -| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs) | N/A (freezes) | -| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) | -| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) | -| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) | -| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) | -| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) | -| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) | -| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) | -| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) | -| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) | -| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) | -| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) | -| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) | -| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) | -| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) | -| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) | -| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) | - -### Faster algorithms - -When you need expansion, braces is still much faster. - -_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_ - -| **Pattern** | **braces** | **[minimatch][]** | -| --------------- | --------------------------- | ---------------------------- | -| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) | -| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) | -| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) | -| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) | -| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) | -| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) | -| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) | -| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) | - -If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js). - -## Benchmarks - -### Running benchmarks - -Install dev dependencies: - -```bash -npm i -d && npm benchmark -``` - -### Latest results - -Braces is more accurate, without sacrificing performance. - -```bash -● expand - range (expanded) - braces x 53,167 ops/sec ±0.12% (102 runs sampled) - minimatch x 11,378 ops/sec ±0.10% (102 runs sampled) -● expand - range (optimized for regex) - braces x 373,442 ops/sec ±0.04% (100 runs sampled) - minimatch x 3,262 ops/sec ±0.18% (100 runs sampled) -● expand - nested ranges (expanded) - braces x 33,921 ops/sec ±0.09% (99 runs sampled) - minimatch x 10,855 ops/sec ±0.28% (100 runs sampled) -● expand - nested ranges (optimized for regex) - braces x 287,479 ops/sec ±0.52% (98 runs sampled) - minimatch x 3,219 ops/sec ±0.28% (101 runs sampled) -● expand - set (expanded) - braces x 238,243 ops/sec ±0.19% (97 runs sampled) - minimatch x 538,268 ops/sec ±0.31% (96 runs sampled) -● expand - set (optimized for regex) - braces x 321,844 ops/sec ±0.10% (97 runs sampled) - minimatch x 140,600 ops/sec ±0.15% (100 runs sampled) -● expand - nested sets (expanded) - braces x 165,371 ops/sec ±0.42% (96 runs sampled) - minimatch x 337,720 ops/sec ±0.28% (100 runs sampled) -● expand - nested sets (optimized for regex) - braces x 242,948 ops/sec ±0.12% (99 runs sampled) - minimatch x 87,403 ops/sec ±0.79% (96 runs sampled) -``` - -## 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 -``` - -
- -### Contributors - -| **Commits** | **Contributor** | -| ----------- | ------------------------------------------------------------- | -| 197 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [doowb](https://github.com/doowb) | -| 1 | [es128](https://github.com/es128) | -| 1 | [eush77](https://github.com/eush77) | -| 1 | [hemanth](https://github.com/hemanth) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### 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 08, 2019._ diff --git a/node_modules/braces/index.js b/node_modules/braces/index.js deleted file mode 100644 index d222c13..0000000 --- a/node_modules/braces/index.js +++ /dev/null @@ -1,170 +0,0 @@ -'use strict'; - -const stringify = require('./lib/stringify'); -const compile = require('./lib/compile'); -const expand = require('./lib/expand'); -const parse = require('./lib/parse'); - -/** - * Expand the given pattern or create a regex-compatible string. - * - * ```js - * const braces = require('braces'); - * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] - * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] - * ``` - * @param {String} `str` - * @param {Object} `options` - * @return {String} - * @api public - */ - -const braces = (input, options = {}) => { - let output = []; - - if (Array.isArray(input)) { - for (const pattern of input) { - const result = braces.create(pattern, options); - if (Array.isArray(result)) { - output.push(...result); - } else { - output.push(result); - } - } - } else { - output = [].concat(braces.create(input, options)); - } - - if (options && options.expand === true && options.nodupes === true) { - output = [...new Set(output)]; - } - return output; -}; - -/** - * Parse the given `str` with the given `options`. - * - * ```js - * // braces.parse(pattern, [, options]); - * const ast = braces.parse('a/{b,c}/d'); - * console.log(ast); - * ``` - * @param {String} pattern Brace pattern to parse - * @param {Object} options - * @return {Object} Returns an AST - * @api public - */ - -braces.parse = (input, options = {}) => parse(input, options); - -/** - * Creates a braces string from an AST, or an AST node. - * - * ```js - * const braces = require('braces'); - * let ast = braces.parse('foo/{a,b}/bar'); - * console.log(stringify(ast.nodes[2])); //=> '{a,b}' - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.stringify = (input, options = {}) => { - if (typeof input === 'string') { - return stringify(braces.parse(input, options), options); - } - return stringify(input, options); -}; - -/** - * Compiles a brace pattern into a regex-compatible, optimized string. - * This method is called by the main [braces](#braces) function by default. - * - * ```js - * const braces = require('braces'); - * console.log(braces.compile('a/{b,c}/d')); - * //=> ['a/(b|c)/d'] - * ``` - * @param {String} `input` Brace pattern or AST. - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.compile = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } - return compile(input, options); -}; - -/** - * Expands a brace pattern into an array. This method is called by the - * main [braces](#braces) function when `options.expand` is true. Before - * using this method it's recommended that you read the [performance notes](#performance)) - * and advantages of using [.compile](#compile) instead. - * - * ```js - * const braces = require('braces'); - * console.log(braces.expand('a/{b,c}/d')); - * //=> ['a/b/d', 'a/c/d']; - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.expand = (input, options = {}) => { - if (typeof input === 'string') { - input = braces.parse(input, options); - } - - let result = expand(input, options); - - // filter out empty strings if specified - if (options.noempty === true) { - result = result.filter(Boolean); - } - - // filter out duplicates if specified - if (options.nodupes === true) { - result = [...new Set(result)]; - } - - return result; -}; - -/** - * Processes a brace pattern and returns either an expanded array - * (if `options.expand` is true), a highly optimized regex-compatible string. - * This method is called by the main [braces](#braces) function. - * - * ```js - * const braces = require('braces'); - * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) - * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' - * ``` - * @param {String} `pattern` Brace pattern - * @param {Object} `options` - * @return {Array} Returns an array of expanded values. - * @api public - */ - -braces.create = (input, options = {}) => { - if (input === '' || input.length < 3) { - return [input]; - } - - return options.expand !== true - ? braces.compile(input, options) - : braces.expand(input, options); -}; - -/** - * Expose "braces" - */ - -module.exports = braces; diff --git a/node_modules/braces/lib/compile.js b/node_modules/braces/lib/compile.js deleted file mode 100644 index dce69be..0000000 --- a/node_modules/braces/lib/compile.js +++ /dev/null @@ -1,60 +0,0 @@ -'use strict'; - -const fill = require('fill-range'); -const utils = require('./utils'); - -const compile = (ast, options = {}) => { - const walk = (node, parent = {}) => { - const invalidBlock = utils.isInvalidBrace(parent); - const invalidNode = node.invalid === true && options.escapeInvalid === true; - const invalid = invalidBlock === true || invalidNode === true; - const prefix = options.escapeInvalid === true ? '\\' : ''; - let output = ''; - - if (node.isOpen === true) { - return prefix + node.value; - } - - if (node.isClose === true) { - console.log('node.isClose', prefix, node.value); - return prefix + node.value; - } - - if (node.type === 'open') { - return invalid ? prefix + node.value : '('; - } - - if (node.type === 'close') { - return invalid ? prefix + node.value : ')'; - } - - if (node.type === 'comma') { - return node.prev.type === 'comma' ? '' : invalid ? node.value : '|'; - } - - if (node.value) { - return node.value; - } - - if (node.nodes && node.ranges > 0) { - const args = utils.reduce(node.nodes); - const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); - - if (range.length !== 0) { - return args.length > 1 && range.length > 1 ? `(${range})` : range; - } - } - - if (node.nodes) { - for (const child of node.nodes) { - output += walk(child, node); - } - } - - return output; - }; - - return walk(ast); -}; - -module.exports = compile; diff --git a/node_modules/braces/lib/constants.js b/node_modules/braces/lib/constants.js deleted file mode 100644 index 2bb3b88..0000000 --- a/node_modules/braces/lib/constants.js +++ /dev/null @@ -1,57 +0,0 @@ -'use strict'; - -module.exports = { - MAX_LENGTH: 10000, - - // Digits - CHAR_0: '0', /* 0 */ - CHAR_9: '9', /* 9 */ - - // Alphabet chars. - CHAR_UPPERCASE_A: 'A', /* A */ - CHAR_LOWERCASE_A: 'a', /* a */ - CHAR_UPPERCASE_Z: 'Z', /* Z */ - CHAR_LOWERCASE_Z: 'z', /* z */ - - CHAR_LEFT_PARENTHESES: '(', /* ( */ - CHAR_RIGHT_PARENTHESES: ')', /* ) */ - - CHAR_ASTERISK: '*', /* * */ - - // Non-alphabetic chars. - CHAR_AMPERSAND: '&', /* & */ - CHAR_AT: '@', /* @ */ - CHAR_BACKSLASH: '\\', /* \ */ - CHAR_BACKTICK: '`', /* ` */ - CHAR_CARRIAGE_RETURN: '\r', /* \r */ - CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ - CHAR_COLON: ':', /* : */ - CHAR_COMMA: ',', /* , */ - CHAR_DOLLAR: '$', /* . */ - CHAR_DOT: '.', /* . */ - CHAR_DOUBLE_QUOTE: '"', /* " */ - CHAR_EQUAL: '=', /* = */ - CHAR_EXCLAMATION_MARK: '!', /* ! */ - CHAR_FORM_FEED: '\f', /* \f */ - CHAR_FORWARD_SLASH: '/', /* / */ - CHAR_HASH: '#', /* # */ - CHAR_HYPHEN_MINUS: '-', /* - */ - CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ - CHAR_LEFT_CURLY_BRACE: '{', /* { */ - CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ - CHAR_LINE_FEED: '\n', /* \n */ - CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ - CHAR_PERCENT: '%', /* % */ - CHAR_PLUS: '+', /* + */ - CHAR_QUESTION_MARK: '?', /* ? */ - CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ - CHAR_RIGHT_CURLY_BRACE: '}', /* } */ - CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ - CHAR_SEMICOLON: ';', /* ; */ - CHAR_SINGLE_QUOTE: '\'', /* ' */ - CHAR_SPACE: ' ', /* */ - CHAR_TAB: '\t', /* \t */ - CHAR_UNDERSCORE: '_', /* _ */ - CHAR_VERTICAL_LINE: '|', /* | */ - CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ -}; diff --git a/node_modules/braces/lib/expand.js b/node_modules/braces/lib/expand.js deleted file mode 100644 index 35b2c41..0000000 --- a/node_modules/braces/lib/expand.js +++ /dev/null @@ -1,113 +0,0 @@ -'use strict'; - -const fill = require('fill-range'); -const stringify = require('./stringify'); -const utils = require('./utils'); - -const append = (queue = '', stash = '', enclose = false) => { - const result = []; - - queue = [].concat(queue); - stash = [].concat(stash); - - if (!stash.length) return queue; - if (!queue.length) { - return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; - } - - for (const item of queue) { - if (Array.isArray(item)) { - for (const value of item) { - result.push(append(value, stash, enclose)); - } - } else { - for (let ele of stash) { - if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; - result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); - } - } - } - return utils.flatten(result); -}; - -const expand = (ast, options = {}) => { - const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit; - - const walk = (node, parent = {}) => { - node.queue = []; - - let p = parent; - let q = parent.queue; - - while (p.type !== 'brace' && p.type !== 'root' && p.parent) { - p = p.parent; - q = p.queue; - } - - if (node.invalid || node.dollar) { - q.push(append(q.pop(), stringify(node, options))); - return; - } - - if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { - q.push(append(q.pop(), ['{}'])); - return; - } - - if (node.nodes && node.ranges > 0) { - const args = utils.reduce(node.nodes); - - if (utils.exceedsLimit(...args, options.step, rangeLimit)) { - throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); - } - - let range = fill(...args, options); - if (range.length === 0) { - range = stringify(node, options); - } - - q.push(append(q.pop(), range)); - node.nodes = []; - return; - } - - const enclose = utils.encloseBrace(node); - let queue = node.queue; - let block = node; - - while (block.type !== 'brace' && block.type !== 'root' && block.parent) { - block = block.parent; - queue = block.queue; - } - - for (let i = 0; i < node.nodes.length; i++) { - const child = node.nodes[i]; - - if (child.type === 'comma' && node.type === 'brace') { - if (i === 1) queue.push(''); - queue.push(''); - continue; - } - - if (child.type === 'close') { - q.push(append(q.pop(), queue, enclose)); - continue; - } - - if (child.value && child.type !== 'open') { - queue.push(append(queue.pop(), child.value)); - continue; - } - - if (child.nodes) { - walk(child, node); - } - } - - return queue; - }; - - return utils.flatten(walk(ast)); -}; - -module.exports = expand; diff --git a/node_modules/braces/lib/parse.js b/node_modules/braces/lib/parse.js deleted file mode 100644 index 3a6988e..0000000 --- a/node_modules/braces/lib/parse.js +++ /dev/null @@ -1,331 +0,0 @@ -'use strict'; - -const stringify = require('./stringify'); - -/** - * Constants - */ - -const { - MAX_LENGTH, - CHAR_BACKSLASH, /* \ */ - CHAR_BACKTICK, /* ` */ - CHAR_COMMA, /* , */ - CHAR_DOT, /* . */ - CHAR_LEFT_PARENTHESES, /* ( */ - CHAR_RIGHT_PARENTHESES, /* ) */ - CHAR_LEFT_CURLY_BRACE, /* { */ - CHAR_RIGHT_CURLY_BRACE, /* } */ - CHAR_LEFT_SQUARE_BRACKET, /* [ */ - CHAR_RIGHT_SQUARE_BRACKET, /* ] */ - CHAR_DOUBLE_QUOTE, /* " */ - CHAR_SINGLE_QUOTE, /* ' */ - CHAR_NO_BREAK_SPACE, - CHAR_ZERO_WIDTH_NOBREAK_SPACE -} = require('./constants'); - -/** - * parse - */ - -const parse = (input, options = {}) => { - if (typeof input !== 'string') { - throw new TypeError('Expected a string'); - } - - const opts = options || {}; - const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; - if (input.length > max) { - throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); - } - - const ast = { type: 'root', input, nodes: [] }; - const stack = [ast]; - let block = ast; - let prev = ast; - let brackets = 0; - const length = input.length; - let index = 0; - let depth = 0; - let value; - - /** - * Helpers - */ - - const advance = () => input[index++]; - const push = node => { - if (node.type === 'text' && prev.type === 'dot') { - prev.type = 'text'; - } - - if (prev && prev.type === 'text' && node.type === 'text') { - prev.value += node.value; - return; - } - - block.nodes.push(node); - node.parent = block; - node.prev = prev; - prev = node; - return node; - }; - - push({ type: 'bos' }); - - while (index < length) { - block = stack[stack.length - 1]; - value = advance(); - - /** - * Invalid chars - */ - - if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { - continue; - } - - /** - * Escaped chars - */ - - if (value === CHAR_BACKSLASH) { - push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); - continue; - } - - /** - * Right square bracket (literal): ']' - */ - - if (value === CHAR_RIGHT_SQUARE_BRACKET) { - push({ type: 'text', value: '\\' + value }); - continue; - } - - /** - * Left square bracket: '[' - */ - - if (value === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - - let next; - - while (index < length && (next = advance())) { - value += next; - - if (next === CHAR_LEFT_SQUARE_BRACKET) { - brackets++; - continue; - } - - if (next === CHAR_BACKSLASH) { - value += advance(); - continue; - } - - if (next === CHAR_RIGHT_SQUARE_BRACKET) { - brackets--; - - if (brackets === 0) { - break; - } - } - } - - push({ type: 'text', value }); - continue; - } - - /** - * Parentheses - */ - - if (value === CHAR_LEFT_PARENTHESES) { - block = push({ type: 'paren', nodes: [] }); - stack.push(block); - push({ type: 'text', value }); - continue; - } - - if (value === CHAR_RIGHT_PARENTHESES) { - if (block.type !== 'paren') { - push({ type: 'text', value }); - continue; - } - block = stack.pop(); - push({ type: 'text', value }); - block = stack[stack.length - 1]; - continue; - } - - /** - * Quotes: '|"|` - */ - - if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { - const open = value; - let next; - - if (options.keepQuotes !== true) { - value = ''; - } - - while (index < length && (next = advance())) { - if (next === CHAR_BACKSLASH) { - value += next + advance(); - continue; - } - - if (next === open) { - if (options.keepQuotes === true) value += next; - break; - } - - value += next; - } - - push({ type: 'text', value }); - continue; - } - - /** - * Left curly brace: '{' - */ - - if (value === CHAR_LEFT_CURLY_BRACE) { - depth++; - - const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; - const brace = { - type: 'brace', - open: true, - close: false, - dollar, - depth, - commas: 0, - ranges: 0, - nodes: [] - }; - - block = push(brace); - stack.push(block); - push({ type: 'open', value }); - continue; - } - - /** - * Right curly brace: '}' - */ - - if (value === CHAR_RIGHT_CURLY_BRACE) { - if (block.type !== 'brace') { - push({ type: 'text', value }); - continue; - } - - const type = 'close'; - block = stack.pop(); - block.close = true; - - push({ type, value }); - depth--; - - block = stack[stack.length - 1]; - continue; - } - - /** - * Comma: ',' - */ - - if (value === CHAR_COMMA && depth > 0) { - if (block.ranges > 0) { - block.ranges = 0; - const open = block.nodes.shift(); - block.nodes = [open, { type: 'text', value: stringify(block) }]; - } - - push({ type: 'comma', value }); - block.commas++; - continue; - } - - /** - * Dot: '.' - */ - - if (value === CHAR_DOT && depth > 0 && block.commas === 0) { - const siblings = block.nodes; - - if (depth === 0 || siblings.length === 0) { - push({ type: 'text', value }); - continue; - } - - if (prev.type === 'dot') { - block.range = []; - prev.value += value; - prev.type = 'range'; - - if (block.nodes.length !== 3 && block.nodes.length !== 5) { - block.invalid = true; - block.ranges = 0; - prev.type = 'text'; - continue; - } - - block.ranges++; - block.args = []; - continue; - } - - if (prev.type === 'range') { - siblings.pop(); - - const before = siblings[siblings.length - 1]; - before.value += prev.value + value; - prev = before; - block.ranges--; - continue; - } - - push({ type: 'dot', value }); - continue; - } - - /** - * Text - */ - - push({ type: 'text', value }); - } - - // Mark imbalanced braces and brackets as invalid - do { - block = stack.pop(); - - if (block.type !== 'root') { - block.nodes.forEach(node => { - if (!node.nodes) { - if (node.type === 'open') node.isOpen = true; - if (node.type === 'close') node.isClose = true; - if (!node.nodes) node.type = 'text'; - node.invalid = true; - } - }); - - // get the location of the block on parent.nodes (block's siblings) - const parent = stack[stack.length - 1]; - const index = parent.nodes.indexOf(block); - // replace the (invalid) block with it's nodes - parent.nodes.splice(index, 1, ...block.nodes); - } - } while (stack.length > 0); - - push({ type: 'eos' }); - return ast; -}; - -module.exports = parse; diff --git a/node_modules/braces/lib/stringify.js b/node_modules/braces/lib/stringify.js deleted file mode 100644 index 8bcf872..0000000 --- a/node_modules/braces/lib/stringify.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict'; - -const utils = require('./utils'); - -module.exports = (ast, options = {}) => { - const stringify = (node, parent = {}) => { - const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); - const invalidNode = node.invalid === true && options.escapeInvalid === true; - let output = ''; - - if (node.value) { - if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { - return '\\' + node.value; - } - return node.value; - } - - if (node.value) { - return node.value; - } - - if (node.nodes) { - for (const child of node.nodes) { - output += stringify(child); - } - } - return output; - }; - - return stringify(ast); -}; - diff --git a/node_modules/braces/lib/utils.js b/node_modules/braces/lib/utils.js deleted file mode 100644 index d19311f..0000000 --- a/node_modules/braces/lib/utils.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict'; - -exports.isInteger = num => { - if (typeof num === 'number') { - return Number.isInteger(num); - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isInteger(Number(num)); - } - return false; -}; - -/** - * Find a node of the given type - */ - -exports.find = (node, type) => node.nodes.find(node => node.type === type); - -/** - * Find a node of the given type - */ - -exports.exceedsLimit = (min, max, step = 1, limit) => { - if (limit === false) return false; - if (!exports.isInteger(min) || !exports.isInteger(max)) return false; - return ((Number(max) - Number(min)) / Number(step)) >= limit; -}; - -/** - * Escape the given node with '\\' before node.value - */ - -exports.escapeNode = (block, n = 0, type) => { - const node = block.nodes[n]; - if (!node) return; - - if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { - if (node.escaped !== true) { - node.value = '\\' + node.value; - node.escaped = true; - } - } -}; - -/** - * Returns true if the given brace node should be enclosed in literal braces - */ - -exports.encloseBrace = node => { - if (node.type !== 'brace') return false; - if ((node.commas >> 0 + node.ranges >> 0) === 0) { - node.invalid = true; - return true; - } - return false; -}; - -/** - * Returns true if a brace node is invalid. - */ - -exports.isInvalidBrace = block => { - if (block.type !== 'brace') return false; - if (block.invalid === true || block.dollar) return true; - if ((block.commas >> 0 + block.ranges >> 0) === 0) { - block.invalid = true; - return true; - } - if (block.open !== true || block.close !== true) { - block.invalid = true; - return true; - } - return false; -}; - -/** - * Returns true if a node is an open or close node - */ - -exports.isOpenOrClose = node => { - if (node.type === 'open' || node.type === 'close') { - return true; - } - return node.open === true || node.close === true; -}; - -/** - * Reduce an array of text nodes. - */ - -exports.reduce = nodes => nodes.reduce((acc, node) => { - if (node.type === 'text') acc.push(node.value); - if (node.type === 'range') node.type = 'text'; - return acc; -}, []); - -/** - * Flatten an array - */ - -exports.flatten = (...args) => { - const result = []; - - const flat = arr => { - for (let i = 0; i < arr.length; i++) { - const ele = arr[i]; - - if (Array.isArray(ele)) { - flat(ele); - continue; - } - - if (ele !== undefined) { - result.push(ele); - } - } - return result; - }; - - flat(args); - return result; -}; diff --git a/node_modules/braces/package.json b/node_modules/braces/package.json deleted file mode 100644 index c3c056e..0000000 --- a/node_modules/braces/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "braces", - "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.", - "version": "3.0.3", - "homepage": "https://github.com/micromatch/braces", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Brian Woodward (https://twitter.com/doowb)", - "Elan Shanker (https://github.com/es128)", - "Eugene Sharygin (https://github.com/eush77)", - "hemanth.hm (http://h3manth.com)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)" - ], - "repository": "micromatch/braces", - "bugs": { - "url": "https://github.com/micromatch/braces/issues" - }, - "license": "MIT", - "files": [ - "index.js", - "lib" - ], - "main": "index.js", - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "mocha", - "benchmark": "node benchmark" - }, - "dependencies": { - "fill-range": "^7.1.1" - }, - "devDependencies": { - "ansi-colors": "^3.2.4", - "bash-path": "^2.0.1", - "gulp-format-md": "^2.0.0", - "mocha": "^6.1.1" - }, - "keywords": [ - "alpha", - "alphabetical", - "bash", - "brace", - "braces", - "expand", - "expansion", - "filepath", - "fill", - "fs", - "glob", - "globbing", - "letter", - "match", - "matches", - "matching", - "number", - "numerical", - "path", - "range", - "ranges", - "sh" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "lint": { - "reflinks": true - }, - "plugins": [ - "gulp-format-md" - ] - } -} diff --git a/node_modules/camelcase-css/README.md b/node_modules/camelcase-css/README.md deleted file mode 100644 index caaa817..0000000 --- a/node_modules/camelcase-css/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# camelcase-css [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] - -> Convert a kebab-cased CSS property into a camelCased DOM property. - - -## Installation -[Node.js](http://nodejs.org/) `>= 6` is required. Type this at the command line: -```shell -npm install camelcase-css -``` - - -## Usage -```js -const camelCaseCSS = require('camelcase-css'); - -camelCaseCSS('-webkit-border-radius'); //-> WebkitBorderRadius -camelCaseCSS('-moz-border-radius'); //-> MozBorderRadius -camelCaseCSS('-ms-border-radius'); //-> msBorderRadius -camelCaseCSS('border-radius'); //-> borderRadius -``` - - -[npm-image]: https://img.shields.io/npm/v/camelcase-css.svg -[npm-url]: https://npmjs.org/package/camelcase-css -[travis-image]: https://img.shields.io/travis/stevenvachon/camelcase-css.svg -[travis-url]: https://travis-ci.org/stevenvachon/camelcase-css diff --git a/node_modules/camelcase-css/index-es5.js b/node_modules/camelcase-css/index-es5.js deleted file mode 100644 index 48ef078..0000000 --- a/node_modules/camelcase-css/index-es5.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; - -var pattern = /-(\w|$)/g; - -var callback = function callback(dashChar, char) { - return char.toUpperCase(); -}; - -var camelCaseCSS = function camelCaseCSS(property) { - property = property.toLowerCase(); - - // NOTE :: IE8's "styleFloat" is intentionally not supported - if (property === "float") { - return "cssFloat"; - } - // Microsoft vendor-prefixes are uniquely cased - else if (property.charCodeAt(0) === 45&& property.charCodeAt(1) === 109&& property.charCodeAt(2) === 115&& property.charCodeAt(3) === 45) { - return property.substr(1).replace(pattern, callback); - } else { - return property.replace(pattern, callback); - } -}; - -module.exports = camelCaseCSS; diff --git a/node_modules/camelcase-css/index.js b/node_modules/camelcase-css/index.js deleted file mode 100644 index c9d1f1b..0000000 --- a/node_modules/camelcase-css/index.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -const pattern = /-(\w|$)/g; - -const callback = (dashChar, char) => char.toUpperCase(); - - - -const camelCaseCSS = property => -{ - property = property.toLowerCase(); - - // NOTE :: IE8's "styleFloat" is intentionally not supported - if (property === "float") - { - return "cssFloat"; - } - // Microsoft vendor-prefixes are uniquely cased - else if (property.startsWith("-ms-")) - { - return property.substr(1).replace(pattern, callback); - } - else - { - return property.replace(pattern, callback); - } -}; - - - -module.exports = camelCaseCSS; diff --git a/node_modules/camelcase-css/license b/node_modules/camelcase-css/license deleted file mode 100644 index b760007..0000000 --- a/node_modules/camelcase-css/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Steven Vachon (svachon.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/camelcase-css/package.json b/node_modules/camelcase-css/package.json deleted file mode 100644 index 61dc51a..0000000 --- a/node_modules/camelcase-css/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "camelcase-css", - "description": "Convert a kebab-cased CSS property into a camelCased DOM property.", - "version": "2.0.1", - "license": "MIT", - "author": "Steven Vachon (https://www.svachon.com/)", - "repository": "stevenvachon/camelcase-css", - "browser": "index-es5.js", - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-core": "^6.26.3", - "babel-plugin-optimize-starts-with": "^1.0.1", - "babel-preset-env": "^1.7.0", - "chai": "^4.1.2", - "mocha": "^5.2.0" - }, - "engines": { - "node": ">= 6" - }, - "scripts": { - "pretest": "babel index.js --out-file=index-es5.js --presets=env --plugins=optimize-starts-with", - "test": "mocha test.js --check-leaks --bail" - }, - "files": [ - "index.js", - "index-es5.js" - ], - "keywords": [ - "camelcase", - "case", - "css", - "dom" - ] -} diff --git a/node_modules/chokidar/LICENSE b/node_modules/chokidar/LICENSE deleted file mode 100644 index fa9162b..0000000 --- a/node_modules/chokidar/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker - -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/chokidar/README.md b/node_modules/chokidar/README.md deleted file mode 100644 index 8e25dec..0000000 --- a/node_modules/chokidar/README.md +++ /dev/null @@ -1,308 +0,0 @@ -# Chokidar [![Weekly downloads](https://img.shields.io/npm/dw/chokidar.svg)](https://github.com/paulmillr/chokidar) [![Yearly downloads](https://img.shields.io/npm/dy/chokidar.svg)](https://github.com/paulmillr/chokidar) - -> Minimal and efficient cross-platform file watching library - -[![NPM](https://nodei.co/npm/chokidar.png)](https://www.npmjs.com/package/chokidar) - -## Why? - -Node.js `fs.watch`: - -* Doesn't report filenames on MacOS. -* Doesn't report events at all when using editors like Sublime on MacOS. -* Often reports events twice. -* Emits most changes as `rename`. -* Does not provide an easy way to recursively watch file trees. -* Does not support recursive watching on Linux. - -Node.js `fs.watchFile`: - -* Almost as bad at event handling. -* Also does not provide any recursive watching. -* Results in high CPU utilization. - -Chokidar resolves these problems. - -Initially made for **[Brunch](https://brunch.io/)** (an ultra-swift web app build tool), it is now used in -[Microsoft's Visual Studio Code](https://github.com/microsoft/vscode), -[gulp](https://github.com/gulpjs/gulp/), -[karma](https://karma-runner.github.io/), -[PM2](https://github.com/Unitech/PM2), -[browserify](http://browserify.org/), -[webpack](https://webpack.github.io/), -[BrowserSync](https://www.browsersync.io/), -and [many others](https://www.npmjs.com/browse/depended/chokidar). -It has proven itself in production environments. - -Version 3 is out! Check out our blog post about it: [Chokidar 3: How to save 32TB of traffic every week](https://paulmillr.com/posts/chokidar-3-save-32tb-of-traffic/) - -## How? - -Chokidar does still rely on the Node.js core `fs` module, but when using -`fs.watch` and `fs.watchFile` for watching, it normalizes the events it -receives, often checking for truth by getting file stats and/or dir contents. - -On MacOS, chokidar by default uses a native extension exposing the Darwin -`FSEvents` API. This provides very efficient recursive watching compared with -implementations like `kqueue` available on most \*nix platforms. Chokidar still -does have to do some work to normalize the events received that way as well. - -On most other platforms, the `fs.watch`-based implementation is the default, which -avoids polling and keeps CPU usage down. Be advised that chokidar will initiate -watchers recursively for everything within scope of the paths that have been -specified, so be judicious about not wasting system resources by watching much -more than needed. - -## Getting started - -Install with npm: - -```sh -npm install chokidar -``` - -Then `require` and use it in your code: - -```javascript -const chokidar = require('chokidar'); - -// One-liner for current directory -chokidar.watch('.').on('all', (event, path) => { - console.log(event, path); -}); -``` - -## API - -```javascript -// Example of a more typical implementation structure - -// Initialize watcher. -const watcher = chokidar.watch('file, dir, glob, or array', { - ignored: /(^|[\/\\])\../, // ignore dotfiles - persistent: true -}); - -// Something to use when events are received. -const log = console.log.bind(console); -// Add event listeners. -watcher - .on('add', path => log(`File ${path} has been added`)) - .on('change', path => log(`File ${path} has been changed`)) - .on('unlink', path => log(`File ${path} has been removed`)); - -// More possible events. -watcher - .on('addDir', path => log(`Directory ${path} has been added`)) - .on('unlinkDir', path => log(`Directory ${path} has been removed`)) - .on('error', error => log(`Watcher error: ${error}`)) - .on('ready', () => log('Initial scan complete. Ready for changes')) - .on('raw', (event, path, details) => { // internal - log('Raw event info:', event, path, details); - }); - -// 'add', 'addDir' and 'change' events also receive stat() results as second -// argument when available: https://nodejs.org/api/fs.html#fs_class_fs_stats -watcher.on('change', (path, stats) => { - if (stats) console.log(`File ${path} changed size to ${stats.size}`); -}); - -// Watch new files. -watcher.add('new-file'); -watcher.add(['new-file-2', 'new-file-3', '**/other-file*']); - -// Get list of actual paths being watched on the filesystem -var watchedPaths = watcher.getWatched(); - -// Un-watch some files. -await watcher.unwatch('new-file*'); - -// Stop watching. -// The method is async! -watcher.close().then(() => console.log('closed')); - -// Full list of options. See below for descriptions. -// Do not use this example! -chokidar.watch('file', { - persistent: true, - - ignored: '*.txt', - ignoreInitial: false, - followSymlinks: true, - cwd: '.', - disableGlobbing: false, - - usePolling: false, - interval: 100, - binaryInterval: 300, - alwaysStat: false, - depth: 99, - awaitWriteFinish: { - stabilityThreshold: 2000, - pollInterval: 100 - }, - - ignorePermissionErrors: false, - atomic: true // or a custom 'atomicity delay', in milliseconds (default 100) -}); - -``` - -`chokidar.watch(paths, [options])` - -* `paths` (string or array of strings). Paths to files, dirs to be watched -recursively, or glob patterns. - - Note: globs must not contain windows separators (`\`), - because that's how they work by the standard — - you'll need to replace them with forward slashes (`/`). - - Note 2: for additional glob documentation, check out low-level - library: [picomatch](https://github.com/micromatch/picomatch). -* `options` (object) Options object as defined below: - -#### Persistence - -* `persistent` (default: `true`). Indicates whether the process -should continue to run as long as files are being watched. If set to -`false` when using `fsevents` to watch, no more events will be emitted -after `ready`, even if the process continues to run. - -#### Path filtering - -* `ignored` ([anymatch](https://github.com/es128/anymatch)-compatible definition) -Defines files/paths to be ignored. The whole relative or absolute path is -tested, not just filename. If a function with two arguments is provided, it -gets called twice per path - once with a single argument (the path), second -time with two arguments (the path and the -[`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) -object of that path). -* `ignoreInitial` (default: `false`). If set to `false` then `add`/`addDir` events are also emitted for matching paths while -instantiating the watching as chokidar discovers these file paths (before the `ready` event). -* `followSymlinks` (default: `true`). When `false`, only the -symlinks themselves will be watched for changes instead of following -the link references and bubbling events through the link's path. -* `cwd` (no default). The base directory from which watch `paths` are to be -derived. Paths emitted with events will be relative to this. -* `disableGlobbing` (default: `false`). If set to `true` then the strings passed to `.watch()` and `.add()` are treated as -literal path names, even if they look like globs. - -#### Performance - -* `usePolling` (default: `false`). -Whether to use fs.watchFile (backed by polling), or fs.watch. If polling -leads to high CPU utilization, consider setting this to `false`. It is -typically necessary to **set this to `true` to successfully watch files over -a network**, and it may be necessary to successfully watch files in other -non-standard situations. Setting to `true` explicitly on MacOS overrides the -`useFsEvents` default. You may also set the CHOKIDAR_USEPOLLING env variable -to true (1) or false (0) in order to override this option. -* _Polling-specific settings_ (effective when `usePolling: true`) - * `interval` (default: `100`). Interval of file system polling, in milliseconds. You may also - set the CHOKIDAR_INTERVAL env variable to override this option. - * `binaryInterval` (default: `300`). Interval of file system - polling for binary files. - ([see list of binary extensions](https://github.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json)) -* `useFsEvents` (default: `true` on MacOS). Whether to use the -`fsevents` watching interface if available. When set to `true` explicitly -and `fsevents` is available this supercedes the `usePolling` setting. When -set to `false` on MacOS, `usePolling: true` becomes the default. -* `alwaysStat` (default: `false`). If relying upon the -[`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) -object that may get passed with `add`, `addDir`, and `change` events, set -this to `true` to ensure it is provided even in cases where it wasn't -already available from the underlying watch events. -* `depth` (default: `undefined`). If set, limits how many levels of -subdirectories will be traversed. -* `awaitWriteFinish` (default: `false`). -By default, the `add` event will fire when a file first appears on disk, before -the entire file has been written. Furthermore, in some cases some `change` -events will be emitted while the file is being written. In some cases, -especially when watching for large files there will be a need to wait for the -write operation to finish before responding to a file creation or modification. -Setting `awaitWriteFinish` to `true` (or a truthy value) will poll file size, -holding its `add` and `change` events until the size does not change for a -configurable amount of time. The appropriate duration setting is heavily -dependent on the OS and hardware. For accurate detection this parameter should -be relatively high, making file watching much less responsive. -Use with caution. - * *`options.awaitWriteFinish` can be set to an object in order to adjust - timing params:* - * `awaitWriteFinish.stabilityThreshold` (default: 2000). Amount of time in - milliseconds for a file size to remain constant before emitting its event. - * `awaitWriteFinish.pollInterval` (default: 100). File size polling interval, in milliseconds. - -#### Errors - -* `ignorePermissionErrors` (default: `false`). Indicates whether to watch files -that don't have read permissions if possible. If watching fails due to `EPERM` -or `EACCES` with this set to `true`, the errors will be suppressed silently. -* `atomic` (default: `true` if `useFsEvents` and `usePolling` are `false`). -Automatically filters out artifacts that occur when using editors that use -"atomic writes" instead of writing directly to the source file. If a file is -re-added within 100 ms of being deleted, Chokidar emits a `change` event -rather than `unlink` then `add`. If the default of 100 ms does not work well -for you, you can override it by setting `atomic` to a custom value, in -milliseconds. - -### Methods & Events - -`chokidar.watch()` produces an instance of `FSWatcher`. Methods of `FSWatcher`: - -* `.add(path / paths)`: Add files, directories, or glob patterns for tracking. -Takes an array of strings or just one string. -* `.on(event, callback)`: Listen for an FS event. -Available events: `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `ready`, -`raw`, `error`. -Additionally `all` is available which gets emitted with the underlying event -name and path for every event other than `ready`, `raw`, and `error`. `raw` is internal, use it carefully. -* `.unwatch(path / paths)`: Stop watching files, directories, or glob patterns. -Takes an array of strings or just one string. -* `.close()`: **async** Removes all listeners from watched files. Asynchronous, returns Promise. Use with `await` to ensure bugs don't happen. -* `.getWatched()`: Returns an object representing all the paths on the file -system being watched by this `FSWatcher` instance. The object's keys are all the -directories (using absolute paths unless the `cwd` option was used), and the -values are arrays of the names of the items contained in each directory. - -## CLI - -If you need a CLI interface for your file watching, check out -[chokidar-cli](https://github.com/open-cli-tools/chokidar-cli), allowing you to -execute a command on each change, or get a stdio stream of change events. - -## Install Troubleshooting - -* `npm WARN optional dep failed, continuing fsevents@n.n.n` - * This message is normal part of how `npm` handles optional dependencies and is - not indicative of a problem. Even if accompanied by other related error messages, - Chokidar should function properly. - -* `TypeError: fsevents is not a constructor` - * Update chokidar by doing `rm -rf node_modules package-lock.json yarn.lock && npm install`, or update your dependency that uses chokidar. - -* Chokidar is producing `ENOSP` error on Linux, like this: - * `bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this shell` - `Error: watch /home/ ENOSPC` - * This means Chokidar ran out of file handles and you'll need to increase their count by executing the following command in Terminal: - `echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p` - -## Changelog - -For more detailed changelog, see [`full_changelog.md`](.github/full_changelog.md). -- **v3.5 (Jan 6, 2021):** Support for ARM Macs with Apple Silicon. Fixes for deleted symlinks. -- **v3.4 (Apr 26, 2020):** Support for directory-based symlinks. Fixes for macos file replacement. -- **v3.3 (Nov 2, 2019):** `FSWatcher#close()` method became async. That fixes IO race conditions related to close method. -- **v3.2 (Oct 1, 2019):** Improve Linux RAM usage by 50%. Race condition fixes. Windows glob fixes. Improve stability by using tight range of dependency versions. -- **v3.1 (Sep 16, 2019):** dotfiles are no longer filtered out by default. Use `ignored` option if needed. Improve initial Linux scan time by 50%. -- **v3 (Apr 30, 2019):** massive CPU & RAM consumption improvements; reduces deps / package size by a factor of 17x and bumps Node.js requirement to v8.16 and higher. -- **v2 (Dec 29, 2017):** Globs are now posix-style-only; without windows support. Tons of bugfixes. -- **v1 (Apr 7, 2015):** Glob support, symlink support, tons of bugfixes. Node 0.8+ is supported -- **v0.1 (Apr 20, 2012):** Initial release, extracted from [Brunch](https://github.com/brunch/brunch/blob/9847a065aea300da99bd0753f90354cde9de1261/src/helpers.coffee#L66) - -## Also - -Why was chokidar named this way? What's the meaning behind it? - ->Chowkidar is a transliteration of a Hindi word meaning 'watchman, gatekeeper', चौकीदार. This ultimately comes from Sanskrit _ चतुष्क_ (crossway, quadrangle, consisting-of-four). This word is also used in other languages like Urdu as (چوکیدار) which is widely used in Pakistan and India. - -## License - -MIT (c) Paul Miller (), see [LICENSE](LICENSE) file. diff --git a/node_modules/chokidar/index.js b/node_modules/chokidar/index.js deleted file mode 100644 index 8752893..0000000 --- a/node_modules/chokidar/index.js +++ /dev/null @@ -1,973 +0,0 @@ -'use strict'; - -const { EventEmitter } = require('events'); -const fs = require('fs'); -const sysPath = require('path'); -const { promisify } = require('util'); -const readdirp = require('readdirp'); -const anymatch = require('anymatch').default; -const globParent = require('glob-parent'); -const isGlob = require('is-glob'); -const braces = require('braces'); -const normalizePath = require('normalize-path'); - -const NodeFsHandler = require('./lib/nodefs-handler'); -const FsEventsHandler = require('./lib/fsevents-handler'); -const { - EV_ALL, - EV_READY, - EV_ADD, - EV_CHANGE, - EV_UNLINK, - EV_ADD_DIR, - EV_UNLINK_DIR, - EV_RAW, - EV_ERROR, - - STR_CLOSE, - STR_END, - - BACK_SLASH_RE, - DOUBLE_SLASH_RE, - SLASH_OR_BACK_SLASH_RE, - DOT_RE, - REPLACER_RE, - - SLASH, - SLASH_SLASH, - BRACE_START, - BANG, - ONE_DOT, - TWO_DOTS, - GLOBSTAR, - SLASH_GLOBSTAR, - ANYMATCH_OPTS, - STRING_TYPE, - FUNCTION_TYPE, - EMPTY_STR, - EMPTY_FN, - - isWindows, - isMacos, - isIBMi -} = require('./lib/constants'); - -const stat = promisify(fs.stat); -const readdir = promisify(fs.readdir); - -/** - * @typedef {String} Path - * @typedef {'all'|'add'|'addDir'|'change'|'unlink'|'unlinkDir'|'raw'|'error'|'ready'} EventName - * @typedef {'readdir'|'watch'|'add'|'remove'|'change'} ThrottleType - */ - -/** - * - * @typedef {Object} WatchHelpers - * @property {Boolean} followSymlinks - * @property {'stat'|'lstat'} statMethod - * @property {Path} path - * @property {Path} watchPath - * @property {Function} entryPath - * @property {Boolean} hasGlob - * @property {Object} globFilter - * @property {Function} filterPath - * @property {Function} filterDir - */ - -const arrify = (value = []) => Array.isArray(value) ? value : [value]; -const flatten = (list, result = []) => { - list.forEach(item => { - if (Array.isArray(item)) { - flatten(item, result); - } else { - result.push(item); - } - }); - return result; -}; - -const unifyPaths = (paths_) => { - /** - * @type {Array} - */ - const paths = flatten(arrify(paths_)); - if (!paths.every(p => typeof p === STRING_TYPE)) { - throw new TypeError(`Non-string provided as watch path: ${paths}`); - } - return paths.map(normalizePathToUnix); -}; - -// If SLASH_SLASH occurs at the beginning of path, it is not replaced -// because "//StoragePC/DrivePool/Movies" is a valid network path -const toUnix = (string) => { - let str = string.replace(BACK_SLASH_RE, SLASH); - let prepend = false; - if (str.startsWith(SLASH_SLASH)) { - prepend = true; - } - while (str.match(DOUBLE_SLASH_RE)) { - str = str.replace(DOUBLE_SLASH_RE, SLASH); - } - if (prepend) { - str = SLASH + str; - } - return str; -}; - -// Our version of upath.normalize -// TODO: this is not equal to path-normalize module - investigate why -const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path))); - -const normalizeIgnored = (cwd = EMPTY_STR) => (path) => { - if (typeof path !== STRING_TYPE) return path; - return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path)); -}; - -const getAbsolutePath = (path, cwd) => { - if (sysPath.isAbsolute(path)) { - return path; - } - if (path.startsWith(BANG)) { - return BANG + sysPath.join(cwd, path.slice(1)); - } - return sysPath.join(cwd, path); -}; - -const undef = (opts, key) => opts[key] === undefined; - -/** - * Directory entry. - * @property {Path} path - * @property {Set} items - */ -class DirEntry { - /** - * @param {Path} dir - * @param {Function} removeWatcher - */ - constructor(dir, removeWatcher) { - this.path = dir; - this._removeWatcher = removeWatcher; - /** @type {Set} */ - this.items = new Set(); - } - - add(item) { - const {items} = this; - if (!items) return; - if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item); - } - - async remove(item) { - const {items} = this; - if (!items) return; - items.delete(item); - if (items.size > 0) return; - - const dir = this.path; - try { - await readdir(dir); - } catch (err) { - if (this._removeWatcher) { - this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir)); - } - } - } - - has(item) { - const {items} = this; - if (!items) return; - return items.has(item); - } - - /** - * @returns {Array} - */ - getChildren() { - const {items} = this; - if (!items) return; - return [...items.values()]; - } - - dispose() { - this.items.clear(); - delete this.path; - delete this._removeWatcher; - delete this.items; - Object.freeze(this); - } -} - -const STAT_METHOD_F = 'stat'; -const STAT_METHOD_L = 'lstat'; -class WatchHelper { - constructor(path, watchPath, follow, fsw) { - this.fsw = fsw; - this.path = path = path.replace(REPLACER_RE, EMPTY_STR); - this.watchPath = watchPath; - this.fullWatchPath = sysPath.resolve(watchPath); - this.hasGlob = watchPath !== path; - /** @type {object|boolean} */ - if (path === EMPTY_STR) this.hasGlob = false; - this.globSymlink = this.hasGlob && follow ? undefined : false; - this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false; - this.dirParts = this.getDirParts(path); - this.dirParts.forEach((parts) => { - if (parts.length > 1) parts.pop(); - }); - this.followSymlinks = follow; - this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L; - } - - checkGlobSymlink(entry) { - // only need to resolve once - // first entry should always have entry.parentDir === EMPTY_STR - if (this.globSymlink === undefined) { - this.globSymlink = entry.fullParentDir === this.fullWatchPath ? - false : {realPath: entry.fullParentDir, linkPath: this.fullWatchPath}; - } - - if (this.globSymlink) { - return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath); - } - - return entry.fullPath; - } - - entryPath(entry) { - return sysPath.join(this.watchPath, - sysPath.relative(this.watchPath, this.checkGlobSymlink(entry)) - ); - } - - filterPath(entry) { - const {stats} = entry; - if (stats && stats.isSymbolicLink()) return this.filterDir(entry); - const resolvedPath = this.entryPath(entry); - const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? - this.globFilter(resolvedPath) : true; - return matchesGlob && - this.fsw._isntIgnored(resolvedPath, stats) && - this.fsw._hasReadPermissions(stats); - } - - getDirParts(path) { - if (!this.hasGlob) return []; - const parts = []; - const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path]; - expandedPath.forEach((path) => { - parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE)); - }); - return parts; - } - - filterDir(entry) { - if (this.hasGlob) { - const entryParts = this.getDirParts(this.checkGlobSymlink(entry)); - let globstar = false; - this.unmatchedGlob = !this.dirParts.some((parts) => { - return parts.every((part, i) => { - if (part === GLOBSTAR) globstar = true; - return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS); - }); - }); - } - return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats); - } -} - -/** - * Watches files & directories for changes. Emitted events: - * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error` - * - * new FSWatcher() - * .add(directories) - * .on('add', path => log('File', path, 'was added')) - */ -class FSWatcher extends EventEmitter { -// Not indenting methods for history sake; for now. -constructor(_opts) { - super(); - - const opts = {}; - if (_opts) Object.assign(opts, _opts); // for frozen objects - - /** @type {Map} */ - this._watched = new Map(); - /** @type {Map} */ - this._closers = new Map(); - /** @type {Set} */ - this._ignoredPaths = new Set(); - - /** @type {Map} */ - this._throttled = new Map(); - - /** @type {Map} */ - this._symlinkPaths = new Map(); - - this._streams = new Set(); - this.closed = false; - - // Set up default options. - if (undef(opts, 'persistent')) opts.persistent = true; - if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false; - if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false; - if (undef(opts, 'interval')) opts.interval = 100; - if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300; - if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false; - opts.enableBinaryInterval = opts.binaryInterval !== opts.interval; - - // Enable fsevents on OS X when polling isn't explicitly enabled. - if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling; - - // If we can't use fsevents, ensure the options reflect it's disabled. - const canUseFsEvents = FsEventsHandler.canUse(); - if (!canUseFsEvents) opts.useFsEvents = false; - - // Use polling on Mac if not using fsevents. - // Other platforms use non-polling fs_watch. - if (undef(opts, 'usePolling') && !opts.useFsEvents) { - opts.usePolling = isMacos; - } - - // Always default to polling on IBM i because fs.watch() is not available on IBM i. - if(isIBMi) { - opts.usePolling = true; - } - - // Global override (useful for end-developers that need to force polling for all - // instances of chokidar, regardless of usage/dependency depth) - const envPoll = process.env.CHOKIDAR_USEPOLLING; - if (envPoll !== undefined) { - const envLower = envPoll.toLowerCase(); - - if (envLower === 'false' || envLower === '0') { - opts.usePolling = false; - } else if (envLower === 'true' || envLower === '1') { - opts.usePolling = true; - } else { - opts.usePolling = !!envLower; - } - } - const envInterval = process.env.CHOKIDAR_INTERVAL; - if (envInterval) { - opts.interval = Number.parseInt(envInterval, 10); - } - - // Editor atomic write normalization enabled by default with fs.watch - if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents; - if (opts.atomic) this._pendingUnlinks = new Map(); - - if (undef(opts, 'followSymlinks')) opts.followSymlinks = true; - - if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false; - if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {}; - const awf = opts.awaitWriteFinish; - if (awf) { - if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000; - if (!awf.pollInterval) awf.pollInterval = 100; - this._pendingWrites = new Map(); - } - if (opts.ignored) opts.ignored = arrify(opts.ignored); - - let readyCalls = 0; - this._emitReady = () => { - readyCalls++; - if (readyCalls >= this._readyCount) { - this._emitReady = EMPTY_FN; - this._readyEmitted = true; - // use process.nextTick to allow time for listener to be bound - process.nextTick(() => this.emit(EV_READY)); - } - }; - this._emitRaw = (...args) => this.emit(EV_RAW, ...args); - this._readyEmitted = false; - this.options = opts; - - // Initialize with proper watcher. - if (opts.useFsEvents) { - this._fsEventsHandler = new FsEventsHandler(this); - } else { - this._nodeFsHandler = new NodeFsHandler(this); - } - - // You’re frozen when your heart’s not open. - Object.freeze(opts); -} - -// Public methods - -/** - * Adds paths to be watched on an existing FSWatcher instance - * @param {Path|Array} paths_ - * @param {String=} _origAdd private; for handling non-existent paths to be watched - * @param {Boolean=} _internal private; indicates a non-user add - * @returns {FSWatcher} for chaining - */ -add(paths_, _origAdd, _internal) { - const {cwd, disableGlobbing} = this.options; - this.closed = false; - let paths = unifyPaths(paths_); - if (cwd) { - paths = paths.map((path) => { - const absPath = getAbsolutePath(path, cwd); - - // Check `path` instead of `absPath` because the cwd portion can't be a glob - if (disableGlobbing || !isGlob(path)) { - return absPath; - } - return normalizePath(absPath); - }); - } - - // set aside negated glob strings - paths = paths.filter((path) => { - if (path.startsWith(BANG)) { - this._ignoredPaths.add(path.slice(1)); - return false; - } - - // if a path is being added that was previously ignored, stop ignoring it - this._ignoredPaths.delete(path); - this._ignoredPaths.delete(path + SLASH_GLOBSTAR); - - // reset the cached userIgnored anymatch fn - // to make ignoredPaths changes effective - this._userIgnored = undefined; - - return true; - }); - - if (this.options.useFsEvents && this._fsEventsHandler) { - if (!this._readyCount) this._readyCount = paths.length; - if (this.options.persistent) this._readyCount += paths.length; - paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path)); - } else { - if (!this._readyCount) this._readyCount = 0; - this._readyCount += paths.length; - Promise.all( - paths.map(async path => { - const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd); - if (res) this._emitReady(); - return res; - }) - ).then(results => { - if (this.closed) return; - results.filter(item => item).forEach(item => { - this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); - }); - }); - } - - return this; -} - -/** - * Close watchers or start ignoring events from specified paths. - * @param {Path|Array} paths_ - string or array of strings, file/directory paths and/or globs - * @returns {FSWatcher} for chaining -*/ -unwatch(paths_) { - if (this.closed) return this; - const paths = unifyPaths(paths_); - const {cwd} = this.options; - - paths.forEach((path) => { - // convert to absolute path unless relative path already matches - if (!sysPath.isAbsolute(path) && !this._closers.has(path)) { - if (cwd) path = sysPath.join(cwd, path); - path = sysPath.resolve(path); - } - - this._closePath(path); - - this._ignoredPaths.add(path); - if (this._watched.has(path)) { - this._ignoredPaths.add(path + SLASH_GLOBSTAR); - } - - // reset the cached userIgnored anymatch fn - // to make ignoredPaths changes effective - this._userIgnored = undefined; - }); - - return this; -} - -/** - * Close watchers and remove all listeners from watched paths. - * @returns {Promise}. -*/ -close() { - if (this.closed) return this._closePromise; - this.closed = true; - - // Memory management. - this.removeAllListeners(); - const closers = []; - this._closers.forEach(closerList => closerList.forEach(closer => { - const promise = closer(); - if (promise instanceof Promise) closers.push(promise); - })); - this._streams.forEach(stream => stream.destroy()); - this._userIgnored = undefined; - this._readyCount = 0; - this._readyEmitted = false; - this._watched.forEach(dirent => dirent.dispose()); - ['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => { - this[`_${key}`].clear(); - }); - - this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve(); - return this._closePromise; -} - -/** - * Expose list of watched paths - * @returns {Object} for chaining -*/ -getWatched() { - const watchList = {}; - this._watched.forEach((entry, dir) => { - const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir; - watchList[key || ONE_DOT] = entry.getChildren().sort(); - }); - return watchList; -} - -emitWithAll(event, args) { - this.emit(...args); - if (event !== EV_ERROR) this.emit(EV_ALL, ...args); -} - -// Common helpers -// -------------- - -/** - * Normalize and emit events. - * Calling _emit DOES NOT MEAN emit() would be called! - * @param {EventName} event Type of event - * @param {Path} path File or directory path - * @param {*=} val1 arguments to be passed with event - * @param {*=} val2 - * @param {*=} val3 - * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag - */ -async _emit(event, path, val1, val2, val3) { - if (this.closed) return; - - const opts = this.options; - if (isWindows) path = sysPath.normalize(path); - if (opts.cwd) path = sysPath.relative(opts.cwd, path); - /** @type Array */ - const args = [event, path]; - if (val3 !== undefined) args.push(val1, val2, val3); - else if (val2 !== undefined) args.push(val1, val2); - else if (val1 !== undefined) args.push(val1); - - const awf = opts.awaitWriteFinish; - let pw; - if (awf && (pw = this._pendingWrites.get(path))) { - pw.lastChange = new Date(); - return this; - } - - if (opts.atomic) { - if (event === EV_UNLINK) { - this._pendingUnlinks.set(path, args); - setTimeout(() => { - this._pendingUnlinks.forEach((entry, path) => { - this.emit(...entry); - this.emit(EV_ALL, ...entry); - this._pendingUnlinks.delete(path); - }); - }, typeof opts.atomic === 'number' ? opts.atomic : 100); - return this; - } - if (event === EV_ADD && this._pendingUnlinks.has(path)) { - event = args[0] = EV_CHANGE; - this._pendingUnlinks.delete(path); - } - } - - if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) { - const awfEmit = (err, stats) => { - if (err) { - event = args[0] = EV_ERROR; - args[1] = err; - this.emitWithAll(event, args); - } else if (stats) { - // if stats doesn't exist the file must have been deleted - if (args.length > 2) { - args[2] = stats; - } else { - args.push(stats); - } - this.emitWithAll(event, args); - } - }; - - this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit); - return this; - } - - if (event === EV_CHANGE) { - const isThrottled = !this._throttle(EV_CHANGE, path, 50); - if (isThrottled) return this; - } - - if (opts.alwaysStat && val1 === undefined && - (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE) - ) { - const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path; - let stats; - try { - stats = await stat(fullPath); - } catch (err) {} - // Suppress event when fs_stat fails, to avoid sending undefined 'stat' - if (!stats || this.closed) return; - args.push(stats); - } - this.emitWithAll(event, args); - - return this; -} - -/** - * Common handler for errors - * @param {Error} error - * @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag - */ -_handleError(error) { - const code = error && error.code; - if (error && code !== 'ENOENT' && code !== 'ENOTDIR' && - (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES')) - ) { - this.emit(EV_ERROR, error); - } - return error || this.closed; -} - -/** - * Helper utility for throttling - * @param {ThrottleType} actionType type being throttled - * @param {Path} path being acted upon - * @param {Number} timeout duration of time to suppress duplicate actions - * @returns {Object|false} tracking object or false if action should be suppressed - */ -_throttle(actionType, path, timeout) { - if (!this._throttled.has(actionType)) { - this._throttled.set(actionType, new Map()); - } - - /** @type {Map} */ - const action = this._throttled.get(actionType); - /** @type {Object} */ - const actionPath = action.get(path); - - if (actionPath) { - actionPath.count++; - return false; - } - - let timeoutObject; - const clear = () => { - const item = action.get(path); - const count = item ? item.count : 0; - action.delete(path); - clearTimeout(timeoutObject); - if (item) clearTimeout(item.timeoutObject); - return count; - }; - timeoutObject = setTimeout(clear, timeout); - const thr = {timeoutObject, clear, count: 0}; - action.set(path, thr); - return thr; -} - -_incrReadyCount() { - return this._readyCount++; -} - -/** - * Awaits write operation to finish. - * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback. - * @param {Path} path being acted upon - * @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished - * @param {EventName} event - * @param {Function} awfEmit Callback to be called when ready for event to be emitted. - */ -_awaitWriteFinish(path, threshold, event, awfEmit) { - let timeoutHandler; - - let fullPath = path; - if (this.options.cwd && !sysPath.isAbsolute(path)) { - fullPath = sysPath.join(this.options.cwd, path); - } - - const now = new Date(); - - const awaitWriteFinish = (prevStat) => { - fs.stat(fullPath, (err, curStat) => { - if (err || !this._pendingWrites.has(path)) { - if (err && err.code !== 'ENOENT') awfEmit(err); - return; - } - - const now = Number(new Date()); - - if (prevStat && curStat.size !== prevStat.size) { - this._pendingWrites.get(path).lastChange = now; - } - const pw = this._pendingWrites.get(path); - const df = now - pw.lastChange; - - if (df >= threshold) { - this._pendingWrites.delete(path); - awfEmit(undefined, curStat); - } else { - timeoutHandler = setTimeout( - awaitWriteFinish, - this.options.awaitWriteFinish.pollInterval, - curStat - ); - } - }); - }; - - if (!this._pendingWrites.has(path)) { - this._pendingWrites.set(path, { - lastChange: now, - cancelWait: () => { - this._pendingWrites.delete(path); - clearTimeout(timeoutHandler); - return event; - } - }); - timeoutHandler = setTimeout( - awaitWriteFinish, - this.options.awaitWriteFinish.pollInterval - ); - } -} - -_getGlobIgnored() { - return [...this._ignoredPaths.values()]; -} - -/** - * Determines whether user has asked to ignore this path. - * @param {Path} path filepath or dir - * @param {fs.Stats=} stats result of fs.stat - * @returns {Boolean} - */ -_isIgnored(path, stats) { - if (this.options.atomic && DOT_RE.test(path)) return true; - if (!this._userIgnored) { - const {cwd} = this.options; - const ign = this.options.ignored; - - const ignored = ign && ign.map(normalizeIgnored(cwd)); - const paths = arrify(ignored) - .filter((path) => typeof path === STRING_TYPE && !isGlob(path)) - .map((path) => path + SLASH_GLOBSTAR); - const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths); - this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS); - } - - return this._userIgnored([path, stats]); -} - -_isntIgnored(path, stat) { - return !this._isIgnored(path, stat); -} - -/** - * Provides a set of common helpers and properties relating to symlink and glob handling. - * @param {Path} path file, directory, or glob pattern being watched - * @param {Number=} depth at any depth > 0, this isn't a glob - * @returns {WatchHelper} object containing helpers for this path - */ -_getWatchHelpers(path, depth) { - const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path); - const follow = this.options.followSymlinks; - - return new WatchHelper(path, watchPath, follow, this); -} - -// Directory helpers -// ----------------- - -/** - * Provides directory tracking objects - * @param {String} directory path of the directory - * @returns {DirEntry} the directory's tracking object - */ -_getWatchedDir(directory) { - if (!this._boundRemove) this._boundRemove = this._remove.bind(this); - const dir = sysPath.resolve(directory); - if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove)); - return this._watched.get(dir); -} - -// File helpers -// ------------ - -/** - * Check for read permissions. - * Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405 - * @param {fs.Stats} stats - object, result of fs_stat - * @returns {Boolean} indicates whether the file can be read -*/ -_hasReadPermissions(stats) { - if (this.options.ignorePermissionErrors) return true; - - // stats.mode may be bigint - const md = stats && Number.parseInt(stats.mode, 10); - const st = md & 0o777; - const it = Number.parseInt(st.toString(8)[0], 10); - return Boolean(4 & it); -} - -/** - * Handles emitting unlink events for - * files and directories, and via recursion, for - * files and directories within directories that are unlinked - * @param {String} directory within which the following item is located - * @param {String} item base path of item/directory - * @returns {void} -*/ -_remove(directory, item, isDirectory) { - // if what is being deleted is a directory, get that directory's paths - // for recursive deleting and cleaning of watched object - // if it is not a directory, nestedDirectoryChildren will be empty array - const path = sysPath.join(directory, item); - const fullPath = sysPath.resolve(path); - isDirectory = isDirectory != null - ? isDirectory - : this._watched.has(path) || this._watched.has(fullPath); - - // prevent duplicate handling in case of arriving here nearly simultaneously - // via multiple paths (such as _handleFile and _handleDir) - if (!this._throttle('remove', path, 100)) return; - - // if the only watched file is removed, watch for its return - if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) { - this.add(directory, item, true); - } - - // This will create a new entry in the watched object in either case - // so we got to do the directory check beforehand - const wp = this._getWatchedDir(path); - const nestedDirectoryChildren = wp.getChildren(); - - // Recursively remove children directories / files. - nestedDirectoryChildren.forEach(nested => this._remove(path, nested)); - - // Check if item was on the watched list and remove it - const parent = this._getWatchedDir(directory); - const wasTracked = parent.has(item); - parent.remove(item); - - // Fixes issue #1042 -> Relative paths were detected and added as symlinks - // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612), - // but never removed from the map in case the path was deleted. - // This leads to an incorrect state if the path was recreated: - // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553 - if (this._symlinkPaths.has(fullPath)) { - this._symlinkPaths.delete(fullPath); - } - - // If we wait for this file to be fully written, cancel the wait. - let relPath = path; - if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path); - if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) { - const event = this._pendingWrites.get(relPath).cancelWait(); - if (event === EV_ADD) return; - } - - // The Entry will either be a directory that just got removed - // or a bogus entry to a file, in either case we have to remove it - this._watched.delete(path); - this._watched.delete(fullPath); - const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK; - if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path); - - // Avoid conflicts if we later create another file with the same name - if (!this.options.useFsEvents) { - this._closePath(path); - } -} - -/** - * Closes all watchers for a path - * @param {Path} path - */ -_closePath(path) { - this._closeFile(path) - const dir = sysPath.dirname(path); - this._getWatchedDir(dir).remove(sysPath.basename(path)); -} - -/** - * Closes only file-specific watchers - * @param {Path} path - */ -_closeFile(path) { - const closers = this._closers.get(path); - if (!closers) return; - closers.forEach(closer => closer()); - this._closers.delete(path); -} - -/** - * - * @param {Path} path - * @param {Function} closer - */ -_addPathCloser(path, closer) { - if (!closer) return; - let list = this._closers.get(path); - if (!list) { - list = []; - this._closers.set(path, list); - } - list.push(closer); -} - -_readdirp(root, opts) { - if (this.closed) return; - const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts}; - let stream = readdirp(root, options); - this._streams.add(stream); - stream.once(STR_CLOSE, () => { - stream = undefined; - }); - stream.once(STR_END, () => { - if (stream) { - this._streams.delete(stream); - stream = undefined; - } - }); - return stream; -} - -} - -// Export FSWatcher class -exports.FSWatcher = FSWatcher; - -/** - * Instantiates watcher with paths to be tracked. - * @param {String|Array} paths file/directory paths and/or globs - * @param {Object=} options chokidar opts - * @returns an instance of FSWatcher for chaining. - */ -const watch = (paths, options) => { - const watcher = new FSWatcher(options); - watcher.add(paths); - return watcher; -}; - -exports.watch = watch; diff --git a/node_modules/chokidar/lib/constants.js b/node_modules/chokidar/lib/constants.js deleted file mode 100644 index 4743865..0000000 --- a/node_modules/chokidar/lib/constants.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict'; - -const {sep} = require('path'); -const {platform} = process; -const os = require('os'); - -exports.EV_ALL = 'all'; -exports.EV_READY = 'ready'; -exports.EV_ADD = 'add'; -exports.EV_CHANGE = 'change'; -exports.EV_ADD_DIR = 'addDir'; -exports.EV_UNLINK = 'unlink'; -exports.EV_UNLINK_DIR = 'unlinkDir'; -exports.EV_RAW = 'raw'; -exports.EV_ERROR = 'error'; - -exports.STR_DATA = 'data'; -exports.STR_END = 'end'; -exports.STR_CLOSE = 'close'; - -exports.FSEVENT_CREATED = 'created'; -exports.FSEVENT_MODIFIED = 'modified'; -exports.FSEVENT_DELETED = 'deleted'; -exports.FSEVENT_MOVED = 'moved'; -exports.FSEVENT_CLONED = 'cloned'; -exports.FSEVENT_UNKNOWN = 'unknown'; -exports.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1; -exports.FSEVENT_TYPE_FILE = 'file'; -exports.FSEVENT_TYPE_DIRECTORY = 'directory'; -exports.FSEVENT_TYPE_SYMLINK = 'symlink'; - -exports.KEY_LISTENERS = 'listeners'; -exports.KEY_ERR = 'errHandlers'; -exports.KEY_RAW = 'rawEmitters'; -exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW]; - -exports.DOT_SLASH = `.${sep}`; - -exports.BACK_SLASH_RE = /\\/g; -exports.DOUBLE_SLASH_RE = /\/\//; -exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/; -exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; -exports.REPLACER_RE = /^\.[/\\]/; - -exports.SLASH = '/'; -exports.SLASH_SLASH = '//'; -exports.BRACE_START = '{'; -exports.BANG = '!'; -exports.ONE_DOT = '.'; -exports.TWO_DOTS = '..'; -exports.STAR = '*'; -exports.GLOBSTAR = '**'; -exports.ROOT_GLOBSTAR = '/**/*'; -exports.SLASH_GLOBSTAR = '/**'; -exports.DIR_SUFFIX = 'Dir'; -exports.ANYMATCH_OPTS = {dot: true}; -exports.STRING_TYPE = 'string'; -exports.FUNCTION_TYPE = 'function'; -exports.EMPTY_STR = ''; -exports.EMPTY_FN = () => {}; -exports.IDENTITY_FN = val => val; - -exports.isWindows = platform === 'win32'; -exports.isMacos = platform === 'darwin'; -exports.isLinux = platform === 'linux'; -exports.isIBMi = os.type() === 'OS400'; diff --git a/node_modules/chokidar/lib/fsevents-handler.js b/node_modules/chokidar/lib/fsevents-handler.js deleted file mode 100644 index fe29393..0000000 --- a/node_modules/chokidar/lib/fsevents-handler.js +++ /dev/null @@ -1,526 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const sysPath = require('path'); -const { promisify } = require('util'); - -let fsevents; -try { - fsevents = require('fsevents'); -} catch (error) { - if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error); -} - -if (fsevents) { - // TODO: real check - const mtch = process.version.match(/v(\d+)\.(\d+)/); - if (mtch && mtch[1] && mtch[2]) { - const maj = Number.parseInt(mtch[1], 10); - const min = Number.parseInt(mtch[2], 10); - if (maj === 8 && min < 16) { - fsevents = undefined; - } - } -} - -const { - EV_ADD, - EV_CHANGE, - EV_ADD_DIR, - EV_UNLINK, - EV_ERROR, - STR_DATA, - STR_END, - FSEVENT_CREATED, - FSEVENT_MODIFIED, - FSEVENT_DELETED, - FSEVENT_MOVED, - // FSEVENT_CLONED, - FSEVENT_UNKNOWN, - FSEVENT_FLAG_MUST_SCAN_SUBDIRS, - FSEVENT_TYPE_FILE, - FSEVENT_TYPE_DIRECTORY, - FSEVENT_TYPE_SYMLINK, - - ROOT_GLOBSTAR, - DIR_SUFFIX, - DOT_SLASH, - FUNCTION_TYPE, - EMPTY_FN, - IDENTITY_FN -} = require('./constants'); - -const Depth = (value) => isNaN(value) ? {} : {depth: value}; - -const stat = promisify(fs.stat); -const lstat = promisify(fs.lstat); -const realpath = promisify(fs.realpath); - -const statMethods = { stat, lstat }; - -/** - * @typedef {String} Path - */ - -/** - * @typedef {Object} FsEventsWatchContainer - * @property {Set} listeners - * @property {Function} rawEmitter - * @property {{stop: Function}} watcher - */ - -// fsevents instance helper functions -/** - * Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances) - * @type {Map} - */ -const FSEventsWatchers = new Map(); - -// Threshold of duplicate path prefixes at which to start -// consolidating going forward -const consolidateThreshhold = 10; - -const wrongEventFlags = new Set([ - 69888, 70400, 71424, 72704, 73472, 131328, 131840, 262912 -]); - -/** - * Instantiates the fsevents interface - * @param {Path} path path to be watched - * @param {Function} callback called when fsevents is bound and ready - * @returns {{stop: Function}} new fsevents instance - */ -const createFSEventsInstance = (path, callback) => { - const stop = fsevents.watch(path, callback); - return {stop}; -}; - -/** - * Instantiates the fsevents interface or binds listeners to an existing one covering - * the same file tree. - * @param {Path} path - to be watched - * @param {Path} realPath - real path for symlinks - * @param {Function} listener - called when fsevents emits events - * @param {Function} rawEmitter - passes data to listeners of the 'raw' event - * @returns {Function} closer - */ -function setFSEventsListener(path, realPath, listener, rawEmitter) { - let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath; - - const parentPath = sysPath.dirname(watchPath); - let cont = FSEventsWatchers.get(watchPath); - - // If we've accumulated a substantial number of paths that - // could have been consolidated by watching one directory - // above the current one, create a watcher on the parent - // path instead, so that we do consolidate going forward. - if (couldConsolidate(parentPath)) { - watchPath = parentPath; - } - - const resolvedPath = sysPath.resolve(path); - const hasSymlink = resolvedPath !== realPath; - - const filteredListener = (fullPath, flags, info) => { - if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath); - if ( - fullPath === resolvedPath || - !fullPath.indexOf(resolvedPath + sysPath.sep) - ) listener(fullPath, flags, info); - }; - - // check if there is already a watcher on a parent path - // modifies `watchPath` to the parent path when it finds a match - let watchedParent = false; - for (const watchedPath of FSEventsWatchers.keys()) { - if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) { - watchPath = watchedPath; - cont = FSEventsWatchers.get(watchPath); - watchedParent = true; - break; - } - } - - if (cont || watchedParent) { - cont.listeners.add(filteredListener); - } else { - cont = { - listeners: new Set([filteredListener]), - rawEmitter, - watcher: createFSEventsInstance(watchPath, (fullPath, flags) => { - if (!cont.listeners.size) return; - if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return; - const info = fsevents.getInfo(fullPath, flags); - cont.listeners.forEach(list => { - list(fullPath, flags, info); - }); - - cont.rawEmitter(info.event, fullPath, info); - }) - }; - FSEventsWatchers.set(watchPath, cont); - } - - // removes this instance's listeners and closes the underlying fsevents - // instance if there are no more listeners left - return () => { - const lst = cont.listeners; - - lst.delete(filteredListener); - if (!lst.size) { - FSEventsWatchers.delete(watchPath); - if (cont.watcher) return cont.watcher.stop().then(() => { - cont.rawEmitter = cont.watcher = undefined; - Object.freeze(cont); - }); - } - }; -} - -// Decide whether or not we should start a new higher-level -// parent watcher -const couldConsolidate = (path) => { - let count = 0; - for (const watchPath of FSEventsWatchers.keys()) { - if (watchPath.indexOf(path) === 0) { - count++; - if (count >= consolidateThreshhold) { - return true; - } - } - } - - return false; -}; - -// returns boolean indicating whether fsevents can be used -const canUse = () => fsevents && FSEventsWatchers.size < 128; - -// determines subdirectory traversal levels from root to path -const calcDepth = (path, root) => { - let i = 0; - while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++; - return i; -}; - -// returns boolean indicating whether the fsevents' event info has the same type -// as the one returned by fs.stat -const sameTypes = (info, stats) => ( - info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || - info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || - info.type === FSEVENT_TYPE_FILE && stats.isFile() -) - -/** - * @mixin - */ -class FsEventsHandler { - -/** - * @param {import('../index').FSWatcher} fsw - */ -constructor(fsw) { - this.fsw = fsw; -} -checkIgnored(path, stats) { - const ipaths = this.fsw._ignoredPaths; - if (this.fsw._isIgnored(path, stats)) { - ipaths.add(path); - if (stats && stats.isDirectory()) { - ipaths.add(path + ROOT_GLOBSTAR); - } - return true; - } - - ipaths.delete(path); - ipaths.delete(path + ROOT_GLOBSTAR); -} - -addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) { - const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD; - this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts); -} - -async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) { - try { - const stats = await stat(path) - if (this.fsw.closed) return; - if (sameTypes(info, stats)) { - this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); - } else { - this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); - } - } catch (error) { - if (error.code === 'EACCES') { - this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); - } else { - this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); - } - } -} - -handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) { - if (this.fsw.closed || this.checkIgnored(path)) return; - - if (event === EV_UNLINK) { - const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY - // suppress unlink events on never before seen files - if (isDirectory || watchedDir.has(item)) { - this.fsw._remove(parent, item, isDirectory); - } - } else { - if (event === EV_ADD) { - // track new directories - if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path); - - if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) { - // push symlinks back to the top of the stack to get handled - const curDepth = opts.depth === undefined ? - undefined : calcDepth(fullPath, realPath) + 1; - return this._addToFsEvents(path, false, true, curDepth); - } - - // track new paths - // (other than symlinks being followed, which will be tracked soon) - this.fsw._getWatchedDir(parent).add(item); - } - /** - * @type {'add'|'addDir'|'unlink'|'unlinkDir'} - */ - const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event; - this.fsw._emit(eventName, path); - if (eventName === EV_ADD_DIR) this._addToFsEvents(path, false, true); - } -} - -/** - * Handle symlinks encountered during directory scan - * @param {String} watchPath - file/dir path to be watched with fsevents - * @param {String} realPath - real path (in case of symlinks) - * @param {Function} transform - path transformer - * @param {Function} globFilter - path filter in case a glob pattern was provided - * @returns {Function} closer for the watcher instance -*/ -_watchWithFsEvents(watchPath, realPath, transform, globFilter) { - if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return; - const opts = this.fsw.options; - const watchCallback = async (fullPath, flags, info) => { - if (this.fsw.closed) return; - if ( - opts.depth !== undefined && - calcDepth(fullPath, realPath) > opts.depth - ) return; - const path = transform(sysPath.join( - watchPath, sysPath.relative(watchPath, fullPath) - )); - if (globFilter && !globFilter(path)) return; - // ensure directories are tracked - const parent = sysPath.dirname(path); - const item = sysPath.basename(path); - const watchedDir = this.fsw._getWatchedDir( - info.type === FSEVENT_TYPE_DIRECTORY ? path : parent - ); - - // correct for wrong events emitted - if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) { - if (typeof opts.ignored === FUNCTION_TYPE) { - let stats; - try { - stats = await stat(path); - } catch (error) {} - if (this.fsw.closed) return; - if (this.checkIgnored(path, stats)) return; - if (sameTypes(info, stats)) { - this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); - } else { - this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); - } - } else { - this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); - } - } else { - switch (info.event) { - case FSEVENT_CREATED: - case FSEVENT_MODIFIED: - return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); - case FSEVENT_DELETED: - case FSEVENT_MOVED: - return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); - } - } - }; - - const closer = setFSEventsListener( - watchPath, - realPath, - watchCallback, - this.fsw._emitRaw - ); - - this.fsw._emitReady(); - return closer; -} - -/** - * Handle symlinks encountered during directory scan - * @param {String} linkPath path to symlink - * @param {String} fullPath absolute path to the symlink - * @param {Function} transform pre-existing path transformer - * @param {Number} curDepth level of subdirectories traversed to where symlink is - * @returns {Promise} - */ -async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) { - // don't follow the same symlink more than once - if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return; - - this.fsw._symlinkPaths.set(fullPath, true); - this.fsw._incrReadyCount(); - - try { - const linkTarget = await realpath(linkPath); - if (this.fsw.closed) return; - if (this.fsw._isIgnored(linkTarget)) { - return this.fsw._emitReady(); - } - - this.fsw._incrReadyCount(); - - // add the linkTarget for watching with a wrapper for transform - // that causes emitted paths to incorporate the link's path - this._addToFsEvents(linkTarget || linkPath, (path) => { - let aliasedPath = linkPath; - if (linkTarget && linkTarget !== DOT_SLASH) { - aliasedPath = path.replace(linkTarget, linkPath); - } else if (path !== DOT_SLASH) { - aliasedPath = sysPath.join(linkPath, path); - } - return transform(aliasedPath); - }, false, curDepth); - } catch(error) { - if (this.fsw._handleError(error)) { - return this.fsw._emitReady(); - } - } -} - -/** - * - * @param {Path} newPath - * @param {fs.Stats} stats - */ -emitAdd(newPath, stats, processPath, opts, forceAdd) { - const pp = processPath(newPath); - const isDir = stats.isDirectory(); - const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp)); - const base = sysPath.basename(pp); - - // ensure empty dirs get tracked - if (isDir) this.fsw._getWatchedDir(pp); - if (dirObj.has(base)) return; - dirObj.add(base); - - if (!opts.ignoreInitial || forceAdd === true) { - this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats); - } -} - -initWatch(realPath, path, wh, processPath) { - if (this.fsw.closed) return; - const closer = this._watchWithFsEvents( - wh.watchPath, - sysPath.resolve(realPath || wh.watchPath), - processPath, - wh.globFilter - ); - this.fsw._addPathCloser(path, closer); -} - -/** - * Handle added path with fsevents - * @param {String} path file/dir path or glob pattern - * @param {Function|Boolean=} transform converts working path to what the user expects - * @param {Boolean=} forceAdd ensure add is emitted - * @param {Number=} priorDepth Level of subdirectories already traversed. - * @returns {Promise} - */ -async _addToFsEvents(path, transform, forceAdd, priorDepth) { - if (this.fsw.closed) { - return; - } - const opts = this.fsw.options; - const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN; - - const wh = this.fsw._getWatchHelpers(path); - - // evaluate what is at the path we're being asked to watch - try { - const stats = await statMethods[wh.statMethod](wh.watchPath); - if (this.fsw.closed) return; - if (this.fsw._isIgnored(wh.watchPath, stats)) { - throw null; - } - if (stats.isDirectory()) { - // emit addDir unless this is a glob parent - if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd); - - // don't recurse further if it would exceed depth setting - if (priorDepth && priorDepth > opts.depth) return; - - // scan the contents of the dir - this.fsw._readdirp(wh.watchPath, { - fileFilter: entry => wh.filterPath(entry), - directoryFilter: entry => wh.filterDir(entry), - ...Depth(opts.depth - (priorDepth || 0)) - }).on(STR_DATA, (entry) => { - // need to check filterPath on dirs b/c filterDir is less restrictive - if (this.fsw.closed) { - return; - } - if (entry.stats.isDirectory() && !wh.filterPath(entry)) return; - - const joinedPath = sysPath.join(wh.watchPath, entry.path); - const {fullPath} = entry; - - if (wh.followSymlinks && entry.stats.isSymbolicLink()) { - // preserve the current depth here since it can't be derived from - // real paths past the symlink - const curDepth = opts.depth === undefined ? - undefined : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1; - - this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth); - } else { - this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd); - } - }).on(EV_ERROR, EMPTY_FN).on(STR_END, () => { - this.fsw._emitReady(); - }); - } else { - this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd); - this.fsw._emitReady(); - } - } catch (error) { - if (!error || this.fsw._handleError(error)) { - // TODO: Strange thing: "should not choke on an ignored watch path" will be failed without 2 ready calls -__- - this.fsw._emitReady(); - this.fsw._emitReady(); - } - } - - if (opts.persistent && forceAdd !== true) { - if (typeof transform === FUNCTION_TYPE) { - // realpath has already been resolved - this.initWatch(undefined, path, wh, processPath); - } else { - let realPath; - try { - realPath = await realpath(wh.watchPath); - } catch (e) {} - this.initWatch(realPath, path, wh, processPath); - } - } -} - -} - -module.exports = FsEventsHandler; -module.exports.canUse = canUse; diff --git a/node_modules/chokidar/lib/nodefs-handler.js b/node_modules/chokidar/lib/nodefs-handler.js deleted file mode 100644 index 199cfe9..0000000 --- a/node_modules/chokidar/lib/nodefs-handler.js +++ /dev/null @@ -1,654 +0,0 @@ -'use strict'; - -const fs = require('fs'); -const sysPath = require('path'); -const { promisify } = require('util'); -const isBinaryPath = require('is-binary-path'); -const { - isWindows, - isLinux, - EMPTY_FN, - EMPTY_STR, - KEY_LISTENERS, - KEY_ERR, - KEY_RAW, - HANDLER_KEYS, - EV_CHANGE, - EV_ADD, - EV_ADD_DIR, - EV_ERROR, - STR_DATA, - STR_END, - BRACE_START, - STAR -} = require('./constants'); - -const THROTTLE_MODE_WATCH = 'watch'; - -const open = promisify(fs.open); -const stat = promisify(fs.stat); -const lstat = promisify(fs.lstat); -const close = promisify(fs.close); -const fsrealpath = promisify(fs.realpath); - -const statMethods = { lstat, stat }; - -// TODO: emit errors properly. Example: EMFILE on Macos. -const foreach = (val, fn) => { - if (val instanceof Set) { - val.forEach(fn); - } else { - fn(val); - } -}; - -const addAndConvert = (main, prop, item) => { - let container = main[prop]; - if (!(container instanceof Set)) { - main[prop] = container = new Set([container]); - } - container.add(item); -}; - -const clearItem = cont => key => { - const set = cont[key]; - if (set instanceof Set) { - set.clear(); - } else { - delete cont[key]; - } -}; - -const delFromSet = (main, prop, item) => { - const container = main[prop]; - if (container instanceof Set) { - container.delete(item); - } else if (container === item) { - delete main[prop]; - } -}; - -const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val; - -/** - * @typedef {String} Path - */ - -// fs_watch helpers - -// object to hold per-process fs_watch instances -// (may be shared across chokidar FSWatcher instances) - -/** - * @typedef {Object} FsWatchContainer - * @property {Set} listeners - * @property {Set} errHandlers - * @property {Set} rawEmitters - * @property {fs.FSWatcher=} watcher - * @property {Boolean=} watcherUnusable - */ - -/** - * @type {Map} - */ -const FsWatchInstances = new Map(); - -/** - * Instantiates the fs_watch interface - * @param {String} path to be watched - * @param {Object} options to be passed to fs_watch - * @param {Function} listener main event handler - * @param {Function} errHandler emits info about errors - * @param {Function} emitRaw emits raw event data - * @returns {fs.FSWatcher} new fsevents instance - */ -function createFsWatchInstance(path, options, listener, errHandler, emitRaw) { - const handleEvent = (rawEvent, evPath) => { - listener(path); - emitRaw(rawEvent, evPath, {watchedPath: path}); - - // emit based on events occurring for files from a directory's watcher in - // case the file's watcher misses it (and rely on throttling to de-dupe) - if (evPath && path !== evPath) { - fsWatchBroadcast( - sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath) - ); - } - }; - try { - return fs.watch(path, options, handleEvent); - } catch (error) { - errHandler(error); - } -} - -/** - * Helper for passing fs_watch event data to a collection of listeners - * @param {Path} fullPath absolute path bound to fs_watch instance - * @param {String} type listener type - * @param {*=} val1 arguments to be passed to listeners - * @param {*=} val2 - * @param {*=} val3 - */ -const fsWatchBroadcast = (fullPath, type, val1, val2, val3) => { - const cont = FsWatchInstances.get(fullPath); - if (!cont) return; - foreach(cont[type], (listener) => { - listener(val1, val2, val3); - }); -}; - -/** - * Instantiates the fs_watch interface or binds listeners - * to an existing one covering the same file system entry - * @param {String} path - * @param {String} fullPath absolute path - * @param {Object} options to be passed to fs_watch - * @param {Object} handlers container for event listener functions - */ -const setFsWatchListener = (path, fullPath, options, handlers) => { - const {listener, errHandler, rawEmitter} = handlers; - let cont = FsWatchInstances.get(fullPath); - - /** @type {fs.FSWatcher=} */ - let watcher; - if (!options.persistent) { - watcher = createFsWatchInstance( - path, options, listener, errHandler, rawEmitter - ); - return watcher.close.bind(watcher); - } - if (cont) { - addAndConvert(cont, KEY_LISTENERS, listener); - addAndConvert(cont, KEY_ERR, errHandler); - addAndConvert(cont, KEY_RAW, rawEmitter); - } else { - watcher = createFsWatchInstance( - path, - options, - fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), - errHandler, // no need to use broadcast here - fsWatchBroadcast.bind(null, fullPath, KEY_RAW) - ); - if (!watcher) return; - watcher.on(EV_ERROR, async (error) => { - const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR); - cont.watcherUnusable = true; // documented since Node 10.4.1 - // Workaround for https://github.com/joyent/node/issues/4337 - if (isWindows && error.code === 'EPERM') { - try { - const fd = await open(path, 'r'); - await close(fd); - broadcastErr(error); - } catch (err) {} - } else { - broadcastErr(error); - } - }); - cont = { - listeners: listener, - errHandlers: errHandler, - rawEmitters: rawEmitter, - watcher - }; - FsWatchInstances.set(fullPath, cont); - } - // const index = cont.listeners.indexOf(listener); - - // removes this instance's listeners and closes the underlying fs_watch - // instance if there are no more listeners left - return () => { - delFromSet(cont, KEY_LISTENERS, listener); - delFromSet(cont, KEY_ERR, errHandler); - delFromSet(cont, KEY_RAW, rawEmitter); - if (isEmptySet(cont.listeners)) { - // Check to protect against issue gh-730. - // if (cont.watcherUnusable) { - cont.watcher.close(); - // } - FsWatchInstances.delete(fullPath); - HANDLER_KEYS.forEach(clearItem(cont)); - cont.watcher = undefined; - Object.freeze(cont); - } - }; -}; - -// fs_watchFile helpers - -// object to hold per-process fs_watchFile instances -// (may be shared across chokidar FSWatcher instances) -const FsWatchFileInstances = new Map(); - -/** - * Instantiates the fs_watchFile interface or binds listeners - * to an existing one covering the same file system entry - * @param {String} path to be watched - * @param {String} fullPath absolute path - * @param {Object} options options to be passed to fs_watchFile - * @param {Object} handlers container for event listener functions - * @returns {Function} closer - */ -const setFsWatchFileListener = (path, fullPath, options, handlers) => { - const {listener, rawEmitter} = handlers; - let cont = FsWatchFileInstances.get(fullPath); - - /* eslint-disable no-unused-vars, prefer-destructuring */ - let listeners = new Set(); - let rawEmitters = new Set(); - - const copts = cont && cont.options; - if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) { - // "Upgrade" the watcher to persistence or a quicker interval. - // This creates some unlikely edge case issues if the user mixes - // settings in a very weird way, but solving for those cases - // doesn't seem worthwhile for the added complexity. - listeners = cont.listeners; - rawEmitters = cont.rawEmitters; - fs.unwatchFile(fullPath); - cont = undefined; - } - - /* eslint-enable no-unused-vars, prefer-destructuring */ - - if (cont) { - addAndConvert(cont, KEY_LISTENERS, listener); - addAndConvert(cont, KEY_RAW, rawEmitter); - } else { - // TODO - // listeners.add(listener); - // rawEmitters.add(rawEmitter); - cont = { - listeners: listener, - rawEmitters: rawEmitter, - options, - watcher: fs.watchFile(fullPath, options, (curr, prev) => { - foreach(cont.rawEmitters, (rawEmitter) => { - rawEmitter(EV_CHANGE, fullPath, {curr, prev}); - }); - const currmtime = curr.mtimeMs; - if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) { - foreach(cont.listeners, (listener) => listener(path, curr)); - } - }) - }; - FsWatchFileInstances.set(fullPath, cont); - } - // const index = cont.listeners.indexOf(listener); - - // Removes this instance's listeners and closes the underlying fs_watchFile - // instance if there are no more listeners left. - return () => { - delFromSet(cont, KEY_LISTENERS, listener); - delFromSet(cont, KEY_RAW, rawEmitter); - if (isEmptySet(cont.listeners)) { - FsWatchFileInstances.delete(fullPath); - fs.unwatchFile(fullPath); - cont.options = cont.watcher = undefined; - Object.freeze(cont); - } - }; -}; - -/** - * @mixin - */ -class NodeFsHandler { - -/** - * @param {import("../index").FSWatcher} fsW - */ -constructor(fsW) { - this.fsw = fsW; - this._boundHandleError = (error) => fsW._handleError(error); -} - -/** - * Watch file for changes with fs_watchFile or fs_watch. - * @param {String} path to file or dir - * @param {Function} listener on fs change - * @returns {Function} closer for the watcher instance - */ -_watchWithNodeFs(path, listener) { - const opts = this.fsw.options; - const directory = sysPath.dirname(path); - const basename = sysPath.basename(path); - const parent = this.fsw._getWatchedDir(directory); - parent.add(basename); - const absolutePath = sysPath.resolve(path); - const options = {persistent: opts.persistent}; - if (!listener) listener = EMPTY_FN; - - let closer; - if (opts.usePolling) { - options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? - opts.binaryInterval : opts.interval; - closer = setFsWatchFileListener(path, absolutePath, options, { - listener, - rawEmitter: this.fsw._emitRaw - }); - } else { - closer = setFsWatchListener(path, absolutePath, options, { - listener, - errHandler: this._boundHandleError, - rawEmitter: this.fsw._emitRaw - }); - } - return closer; -} - -/** - * Watch a file and emit add event if warranted. - * @param {Path} file Path - * @param {fs.Stats} stats result of fs_stat - * @param {Boolean} initialAdd was the file added at watch instantiation? - * @returns {Function} closer for the watcher instance - */ -_handleFile(file, stats, initialAdd) { - if (this.fsw.closed) { - return; - } - const dirname = sysPath.dirname(file); - const basename = sysPath.basename(file); - const parent = this.fsw._getWatchedDir(dirname); - // stats is always present - let prevStats = stats; - - // if the file is already being watched, do nothing - if (parent.has(basename)) return; - - const listener = async (path, newStats) => { - if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; - if (!newStats || newStats.mtimeMs === 0) { - try { - const newStats = await stat(file); - if (this.fsw.closed) return; - // Check that change event was not fired because of changed only accessTime. - const at = newStats.atimeMs; - const mt = newStats.mtimeMs; - if (!at || at <= mt || mt !== prevStats.mtimeMs) { - this.fsw._emit(EV_CHANGE, file, newStats); - } - if (isLinux && prevStats.ino !== newStats.ino) { - this.fsw._closeFile(path) - prevStats = newStats; - this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener)); - } else { - prevStats = newStats; - } - } catch (error) { - // Fix issues where mtime is null but file is still present - this.fsw._remove(dirname, basename); - } - // add is about to be emitted if file not already tracked in parent - } else if (parent.has(basename)) { - // Check that change event was not fired because of changed only accessTime. - const at = newStats.atimeMs; - const mt = newStats.mtimeMs; - if (!at || at <= mt || mt !== prevStats.mtimeMs) { - this.fsw._emit(EV_CHANGE, file, newStats); - } - prevStats = newStats; - } - } - // kick off the watcher - const closer = this._watchWithNodeFs(file, listener); - - // emit an add event if we're supposed to - if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) { - if (!this.fsw._throttle(EV_ADD, file, 0)) return; - this.fsw._emit(EV_ADD, file, stats); - } - - return closer; -} - -/** - * Handle symlinks encountered while reading a dir. - * @param {Object} entry returned by readdirp - * @param {String} directory path of dir being read - * @param {String} path of this item - * @param {String} item basename of this item - * @returns {Promise} true if no more processing is needed for this entry. - */ -async _handleSymlink(entry, directory, path, item) { - if (this.fsw.closed) { - return; - } - const full = entry.fullPath; - const dir = this.fsw._getWatchedDir(directory); - - if (!this.fsw.options.followSymlinks) { - // watch symlink directly (don't follow) and detect changes - this.fsw._incrReadyCount(); - - let linkPath; - try { - linkPath = await fsrealpath(path); - } catch (e) { - this.fsw._emitReady(); - return true; - } - - if (this.fsw.closed) return; - if (dir.has(item)) { - if (this.fsw._symlinkPaths.get(full) !== linkPath) { - this.fsw._symlinkPaths.set(full, linkPath); - this.fsw._emit(EV_CHANGE, path, entry.stats); - } - } else { - dir.add(item); - this.fsw._symlinkPaths.set(full, linkPath); - this.fsw._emit(EV_ADD, path, entry.stats); - } - this.fsw._emitReady(); - return true; - } - - // don't follow the same symlink more than once - if (this.fsw._symlinkPaths.has(full)) { - return true; - } - - this.fsw._symlinkPaths.set(full, true); -} - -_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { - // Normalize the directory name on Windows - directory = sysPath.join(directory, EMPTY_STR); - - if (!wh.hasGlob) { - throttler = this.fsw._throttle('readdir', directory, 1000); - if (!throttler) return; - } - - const previous = this.fsw._getWatchedDir(wh.path); - const current = new Set(); - - let stream = this.fsw._readdirp(directory, { - fileFilter: entry => wh.filterPath(entry), - directoryFilter: entry => wh.filterDir(entry), - depth: 0 - }).on(STR_DATA, async (entry) => { - if (this.fsw.closed) { - stream = undefined; - return; - } - const item = entry.path; - let path = sysPath.join(directory, item); - current.add(item); - - if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) { - return; - } - - if (this.fsw.closed) { - stream = undefined; - return; - } - // Files that present in current directory snapshot - // but absent in previous are added to watch list and - // emit `add` event. - if (item === target || !target && !previous.has(item)) { - this.fsw._incrReadyCount(); - - // ensure relativeness of path is preserved in case of watcher reuse - path = sysPath.join(dir, sysPath.relative(dir, path)); - - this._addToNodeFs(path, initialAdd, wh, depth + 1); - } - }).on(EV_ERROR, this._boundHandleError); - - return new Promise(resolve => - stream.once(STR_END, () => { - if (this.fsw.closed) { - stream = undefined; - return; - } - const wasThrottled = throttler ? throttler.clear() : false; - - resolve(); - - // Files that absent in current directory snapshot - // but present in previous emit `remove` event - // and are removed from @watched[directory]. - previous.getChildren().filter((item) => { - return item !== directory && - !current.has(item) && - // in case of intersecting globs; - // a path may have been filtered out of this readdir, but - // shouldn't be removed because it matches a different glob - (!wh.hasGlob || wh.filterPath({ - fullPath: sysPath.resolve(directory, item) - })); - }).forEach((item) => { - this.fsw._remove(directory, item); - }); - - stream = undefined; - - // one more time for any missed in case changes came in extremely quickly - if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler); - }) - ); -} - -/** - * Read directory to add / remove files from `@watched` list and re-read it on change. - * @param {String} dir fs path - * @param {fs.Stats} stats - * @param {Boolean} initialAdd - * @param {Number} depth relative to user-supplied path - * @param {String} target child path targeted for watch - * @param {Object} wh Common watch helpers for this path - * @param {String} realpath - * @returns {Promise} closer for the watcher instance. - */ -async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) { - const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir)); - const tracked = parentDir.has(sysPath.basename(dir)); - if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) { - if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats); - } - - // ensure dir is tracked (harmless if redundant) - parentDir.add(sysPath.basename(dir)); - this.fsw._getWatchedDir(dir); - let throttler; - let closer; - - const oDepth = this.fsw.options.depth; - if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) { - if (!target) { - await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler); - if (this.fsw.closed) return; - } - - closer = this._watchWithNodeFs(dir, (dirPath, stats) => { - // if current directory is removed, do nothing - if (stats && stats.mtimeMs === 0) return; - - this._handleRead(dirPath, false, wh, target, dir, depth, throttler); - }); - } - return closer; -} - -/** - * Handle added file, directory, or glob pattern. - * Delegates call to _handleFile / _handleDir after checks. - * @param {String} path to file or ir - * @param {Boolean} initialAdd was the file added at watch instantiation? - * @param {Object} priorWh depth relative to user-supplied path - * @param {Number} depth Child path actually targeted for watch - * @param {String=} target Child path actually targeted for watch - * @returns {Promise} - */ -async _addToNodeFs(path, initialAdd, priorWh, depth, target) { - const ready = this.fsw._emitReady; - if (this.fsw._isIgnored(path) || this.fsw.closed) { - ready(); - return false; - } - - const wh = this.fsw._getWatchHelpers(path, depth); - if (!wh.hasGlob && priorWh) { - wh.hasGlob = priorWh.hasGlob; - wh.globFilter = priorWh.globFilter; - wh.filterPath = entry => priorWh.filterPath(entry); - wh.filterDir = entry => priorWh.filterDir(entry); - } - - // evaluate what is at the path we're being asked to watch - try { - const stats = await statMethods[wh.statMethod](wh.watchPath); - if (this.fsw.closed) return; - if (this.fsw._isIgnored(wh.watchPath, stats)) { - ready(); - return false; - } - - const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START); - let closer; - if (stats.isDirectory()) { - const absPath = sysPath.resolve(path); - const targetPath = follow ? await fsrealpath(path) : path; - if (this.fsw.closed) return; - closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); - if (this.fsw.closed) return; - // preserve this symlink's target path - if (absPath !== targetPath && targetPath !== undefined) { - this.fsw._symlinkPaths.set(absPath, targetPath); - } - } else if (stats.isSymbolicLink()) { - const targetPath = follow ? await fsrealpath(path) : path; - if (this.fsw.closed) return; - const parent = sysPath.dirname(wh.watchPath); - this.fsw._getWatchedDir(parent).add(wh.watchPath); - this.fsw._emit(EV_ADD, wh.watchPath, stats); - closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath); - if (this.fsw.closed) return; - - // preserve this symlink's target path - if (targetPath !== undefined) { - this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath); - } - } else { - closer = this._handleFile(wh.watchPath, stats, initialAdd); - } - ready(); - - this.fsw._addPathCloser(path, closer); - return false; - - } catch (error) { - if (this.fsw._handleError(error)) { - ready(); - return path; - } - } -} - -} - -module.exports = NodeFsHandler; diff --git a/node_modules/chokidar/node_modules/glob-parent/CHANGELOG.md b/node_modules/chokidar/node_modules/glob-parent/CHANGELOG.md deleted file mode 100644 index fb9de96..0000000 --- a/node_modules/chokidar/node_modules/glob-parent/CHANGELOG.md +++ /dev/null @@ -1,110 +0,0 @@ -### [5.1.2](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2) (2021-03-06) - - -### Bug Fixes - -* eliminate ReDoS ([#36](https://github.com/gulpjs/glob-parent/issues/36)) ([f923116](https://github.com/gulpjs/glob-parent/commit/f9231168b0041fea3f8f954b3cceb56269fc6366)) - -### [5.1.1](https://github.com/gulpjs/glob-parent/compare/v5.1.0...v5.1.1) (2021-01-27) - - -### Bug Fixes - -* unescape exclamation mark ([#26](https://github.com/gulpjs/glob-parent/issues/26)) ([a98874f](https://github.com/gulpjs/glob-parent/commit/a98874f1a59e407f4fb1beb0db4efa8392da60bb)) - -## [5.1.0](https://github.com/gulpjs/glob-parent/compare/v5.0.0...v5.1.0) (2021-01-27) - - -### Features - -* add `flipBackslashes` option to disable auto conversion of slashes (closes [#24](https://github.com/gulpjs/glob-parent/issues/24)) ([#25](https://github.com/gulpjs/glob-parent/issues/25)) ([eecf91d](https://github.com/gulpjs/glob-parent/commit/eecf91d5e3834ed78aee39c4eaaae654d76b87b3)) - -## [5.0.0](https://github.com/gulpjs/glob-parent/compare/v4.0.0...v5.0.0) (2021-01-27) - - -### ⚠ BREAKING CHANGES - -* Drop support for node <6 & bump dependencies - -### Miscellaneous Chores - -* Drop support for node <6 & bump dependencies ([896c0c0](https://github.com/gulpjs/glob-parent/commit/896c0c00b4e7362f60b96e7fc295ae929245255a)) - -## [4.0.0](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v4.0.0) (2021-01-27) - - -### ⚠ BREAKING CHANGES - -* question marks are valid path characters on Windows so avoid flagging as a glob when alone -* Update is-glob dependency - -### Features - -* hoist regexps and strings for performance gains ([4a80667](https://github.com/gulpjs/glob-parent/commit/4a80667c69355c76a572a5892b0f133c8e1f457e)) -* question marks are valid path characters on Windows so avoid flagging as a glob when alone ([2a551dd](https://github.com/gulpjs/glob-parent/commit/2a551dd0dc3235e78bf3c94843d4107072d17841)) -* Update is-glob dependency ([e41fcd8](https://github.com/gulpjs/glob-parent/commit/e41fcd895d1f7bc617dba45c9d935a7949b9c281)) - -## [3.1.0](https://github.com/gulpjs/glob-parent/compare/v3.0.1...v3.1.0) (2021-01-27) - - -### Features - -* allow basic win32 backslash use ([272afa5](https://github.com/gulpjs/glob-parent/commit/272afa5fd070fc0f796386a5993d4ee4a846988b)) -* handle extglobs (parentheses) containing separators ([7db1bdb](https://github.com/gulpjs/glob-parent/commit/7db1bdb0756e55fd14619e8ce31aa31b17b117fd)) -* new approach to braces/brackets handling ([8269bd8](https://github.com/gulpjs/glob-parent/commit/8269bd89290d99fac9395a354fb56fdcdb80f0be)) -* pre-process braces/brackets sections ([9ef8a87](https://github.com/gulpjs/glob-parent/commit/9ef8a87f66b1a43d0591e7a8e4fc5a18415ee388)) -* preserve escaped brace/bracket at end of string ([8cfb0ba](https://github.com/gulpjs/glob-parent/commit/8cfb0ba84202d51571340dcbaf61b79d16a26c76)) - - -### Bug Fixes - -* trailing escaped square brackets ([99ec9fe](https://github.com/gulpjs/glob-parent/commit/99ec9fecc60ee488ded20a94dd4f18b4f55c4ccf)) - -### [3.0.1](https://github.com/gulpjs/glob-parent/compare/v3.0.0...v3.0.1) (2021-01-27) - - -### Features - -* use path-dirname ponyfill ([cdbea5f](https://github.com/gulpjs/glob-parent/commit/cdbea5f32a58a54e001a75ddd7c0fccd4776aacc)) - - -### Bug Fixes - -* unescape glob-escaped dirnames on output ([598c533](https://github.com/gulpjs/glob-parent/commit/598c533bdf49c1428bc063aa9b8db40c5a86b030)) - -## [3.0.0](https://github.com/gulpjs/glob-parent/compare/v2.0.0...v3.0.0) (2021-01-27) - - -### ⚠ BREAKING CHANGES - -* update is-glob dependency - -### Features - -* update is-glob dependency ([5c5f8ef](https://github.com/gulpjs/glob-parent/commit/5c5f8efcee362a8e7638cf8220666acd8784f6bd)) - -## [2.0.0](https://github.com/gulpjs/glob-parent/compare/v1.3.0...v2.0.0) (2021-01-27) - - -### Features - -* move up to dirname regardless of glob characters ([f97fb83](https://github.com/gulpjs/glob-parent/commit/f97fb83be2e0a9fc8d3b760e789d2ecadd6aa0c2)) - -## [1.3.0](https://github.com/gulpjs/glob-parent/compare/v1.2.0...v1.3.0) (2021-01-27) - -## [1.2.0](https://github.com/gulpjs/glob-parent/compare/v1.1.0...v1.2.0) (2021-01-27) - - -### Reverts - -* feat: make regex test strings smaller ([dc80fa9](https://github.com/gulpjs/glob-parent/commit/dc80fa9658dca20549cfeba44bbd37d5246fcce0)) - -## [1.1.0](https://github.com/gulpjs/glob-parent/compare/v1.0.0...v1.1.0) (2021-01-27) - - -### Features - -* make regex test strings smaller ([cd83220](https://github.com/gulpjs/glob-parent/commit/cd832208638f45169f986d80fcf66e401f35d233)) - -## 1.0.0 (2021-01-27) - diff --git a/node_modules/chokidar/node_modules/glob-parent/LICENSE b/node_modules/chokidar/node_modules/glob-parent/LICENSE deleted file mode 100644 index 63222d7..0000000 --- a/node_modules/chokidar/node_modules/glob-parent/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2015, 2019 Elan Shanker - -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/chokidar/node_modules/glob-parent/README.md b/node_modules/chokidar/node_modules/glob-parent/README.md deleted file mode 100644 index 36a2793..0000000 --- a/node_modules/chokidar/node_modules/glob-parent/README.md +++ /dev/null @@ -1,137 +0,0 @@ -

- - - -

- -# glob-parent - -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] - -Extract the non-magic parent path from a glob string. - -## Usage - -```js -var globParent = require('glob-parent'); - -globParent('path/to/*.js'); // 'path/to' -globParent('/root/path/to/*.js'); // '/root/path/to' -globParent('/*.js'); // '/' -globParent('*.js'); // '.' -globParent('**/*.js'); // '.' -globParent('path/{to,from}'); // 'path' -globParent('path/!(to|from)'); // 'path' -globParent('path/?(to|from)'); // 'path' -globParent('path/+(to|from)'); // 'path' -globParent('path/*(to|from)'); // 'path' -globParent('path/@(to|from)'); // 'path' -globParent('path/**/*'); // 'path' - -// if provided a non-glob path, returns the nearest dir -globParent('path/foo/bar.js'); // 'path/foo' -globParent('path/foo/'); // 'path/foo' -globParent('path/foo'); // 'path' (see issue #3 for details) -``` - -## API - -### `globParent(maybeGlobString, [options])` - -Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. - -#### options - -```js -{ - // Disables the automatic conversion of slashes for Windows - flipBackslashes: true -} -``` - -## Escaping - -The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: - -- `?` (question mark) unless used as a path segment alone -- `*` (asterisk) -- `|` (pipe) -- `(` (opening parenthesis) -- `)` (closing parenthesis) -- `{` (opening curly brace) -- `}` (closing curly brace) -- `[` (opening bracket) -- `]` (closing bracket) - -**Example** - -```js -globParent('foo/[bar]/') // 'foo' -globParent('foo/\\[bar]/') // 'foo/[bar]' -``` - -## Limitations - -### Braces & Brackets -This library attempts a quick and imperfect method of determining which path -parts have glob magic without fully parsing/lexing the pattern. There are some -advanced use cases that can trip it up, such as nested braces where the outer -pair is escaped and the inner one contains a path separator. If you find -yourself in the unlikely circumstance of being affected by this or need to -ensure higher-fidelity glob handling in your library, it is recommended that you -pre-process your input with [expand-braces] and/or [expand-brackets]. - -### Windows -Backslashes are not valid path separators for globs. If a path with backslashes -is provided anyway, for simple cases, glob-parent will replace the path -separator for you and return the non-glob parent path (now with -forward-slashes, which are still valid as Windows path separators). - -This cannot be used in conjunction with escape characters. - -```js -// BAD -globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)' - -// GOOD -globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)' -``` - -If you are using escape characters for a pattern without path parts (i.e. -relative to `cwd`), prefix with `./` to avoid confusing glob-parent. - -```js -// BAD -globParent('foo \\[bar]') // 'foo ' -globParent('foo \\[bar]*') // 'foo ' - -// GOOD -globParent('./foo \\[bar]') // 'foo [bar]' -globParent('./foo \\[bar]*') // '.' -``` - -## License - -ISC - -[expand-braces]: https://github.com/jonschlinkert/expand-braces -[expand-brackets]: https://github.com/jonschlinkert/expand-brackets - -[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg -[npm-url]: https://www.npmjs.com/package/glob-parent -[npm-image]: https://img.shields.io/npm/v/glob-parent.svg - -[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=2&branchName=master -[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/glob-parent?branchName=master - -[travis-url]: https://travis-ci.org/gulpjs/glob-parent -[travis-image]: https://img.shields.io/travis/gulpjs/glob-parent.svg?label=travis-ci - -[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-parent -[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-parent.svg?label=appveyor - -[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent -[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg - -[gitter-url]: https://gitter.im/gulpjs/gulp -[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/chokidar/node_modules/glob-parent/index.js b/node_modules/chokidar/node_modules/glob-parent/index.js deleted file mode 100644 index 09e257e..0000000 --- a/node_modules/chokidar/node_modules/glob-parent/index.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -var isGlob = require('is-glob'); -var pathPosixDirname = require('path').posix.dirname; -var isWin32 = require('os').platform() === 'win32'; - -var slash = '/'; -var backslash = /\\/g; -var enclosure = /[\{\[].*[\}\]]$/; -var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; -var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; - -/** - * @param {string} str - * @param {Object} opts - * @param {boolean} [opts.flipBackslashes=true] - * @returns {string} - */ -module.exports = function globParent(str, opts) { - var options = Object.assign({ flipBackslashes: true }, opts); - - // flip windows path separators - if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { - str = str.replace(backslash, slash); - } - - // special case for strings ending in enclosure containing path separator - if (enclosure.test(str)) { - str += slash; - } - - // preserves full path in case of trailing path separator - str += 'a'; - - // remove path parts that are globby - do { - str = pathPosixDirname(str); - } while (isGlob(str) || globby.test(str)); - - // remove escape chars and return result - return str.replace(escaped, '$1'); -}; diff --git a/node_modules/chokidar/node_modules/glob-parent/package.json b/node_modules/chokidar/node_modules/glob-parent/package.json deleted file mode 100644 index 125c971..0000000 --- a/node_modules/chokidar/node_modules/glob-parent/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "glob-parent", - "version": "5.1.2", - "description": "Extract the non-magic parent path from a glob string.", - "author": "Gulp Team (https://gulpjs.com/)", - "contributors": [ - "Elan Shanker (https://github.com/es128)", - "Blaine Bublitz " - ], - "repository": "gulpjs/glob-parent", - "license": "ISC", - "engines": { - "node": ">= 6" - }, - "main": "index.js", - "files": [ - "LICENSE", - "index.js" - ], - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "nyc mocha --async-only", - "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", - "coveralls": "nyc report --reporter=text-lcov | coveralls" - }, - "dependencies": { - "is-glob": "^4.0.1" - }, - "devDependencies": { - "coveralls": "^3.0.11", - "eslint": "^2.13.1", - "eslint-config-gulp": "^3.0.1", - "expect": "^1.20.2", - "mocha": "^6.0.2", - "nyc": "^13.3.0" - }, - "keywords": [ - "glob", - "parent", - "strip", - "path", - "dirname", - "directory", - "base", - "wildcard" - ] -} diff --git a/node_modules/chokidar/package.json b/node_modules/chokidar/package.json deleted file mode 100644 index e8f8b3d..0000000 --- a/node_modules/chokidar/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "chokidar", - "description": "Minimal and efficient cross-platform file watching library", - "version": "3.6.0", - "homepage": "https://github.com/paulmillr/chokidar", - "author": "Paul Miller (https://paulmillr.com)", - "contributors": [ - "Paul Miller (https://paulmillr.com)", - "Elan Shanker" - ], - "engines": { - "node": ">= 8.10.0" - }, - "main": "index.js", - "types": "./types/index.d.ts", - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - }, - "devDependencies": { - "@types/node": "^14", - "chai": "^4.3", - "dtslint": "^3.3.0", - "eslint": "^7.0.0", - "mocha": "^7.0.0", - "rimraf": "^3.0.0", - "sinon": "^9.0.1", - "sinon-chai": "^3.3.0", - "typescript": "^4.4.3", - "upath": "^1.2.0" - }, - "files": [ - "index.js", - "lib/*.js", - "types/index.d.ts" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/paulmillr/chokidar.git" - }, - "bugs": { - "url": "https://github.com/paulmillr/chokidar/issues" - }, - "license": "MIT", - "scripts": { - "dtslint": "dtslint types", - "lint": "eslint --report-unused-disable-directives --ignore-path .gitignore .", - "build": "npm ls", - "mocha": "mocha --exit --timeout 90000", - "test": "npm run lint && npm run mocha" - }, - "keywords": [ - "fs", - "watch", - "watchFile", - "watcher", - "watching", - "file", - "fsevents" - ], - "funding": "https://paulmillr.com/funding/" -} diff --git a/node_modules/chokidar/types/index.d.ts b/node_modules/chokidar/types/index.d.ts deleted file mode 100644 index 4558066..0000000 --- a/node_modules/chokidar/types/index.d.ts +++ /dev/null @@ -1,192 +0,0 @@ -// TypeScript Version: 3.0 - -/// - -import * as fs from "fs"; -import { EventEmitter } from "events"; -import { Matcher } from 'anymatch'; - -export class FSWatcher extends EventEmitter implements fs.FSWatcher { - options: WatchOptions; - - /** - * Constructs a new FSWatcher instance with optional WatchOptions parameter. - */ - constructor(options?: WatchOptions); - - /** - * Add files, directories, or glob patterns for tracking. Takes an array of strings or just one - * string. - */ - add(paths: string | ReadonlyArray): this; - - /** - * Stop watching files, directories, or glob patterns. Takes an array of strings or just one - * string. - */ - unwatch(paths: string | ReadonlyArray): this; - - /** - * Returns an object representing all the paths on the file system being watched by this - * `FSWatcher` instance. The object's keys are all the directories (using absolute paths unless - * the `cwd` option was used), and the values are arrays of the names of the items contained in - * each directory. - */ - getWatched(): { - [directory: string]: string[]; - }; - - /** - * Removes all listeners from watched files. - */ - close(): Promise; - - on(event: 'add'|'addDir'|'change', listener: (path: string, stats?: fs.Stats) => void): this; - - on(event: 'all', listener: (eventName: 'add'|'addDir'|'change'|'unlink'|'unlinkDir', path: string, stats?: fs.Stats) => void): this; - - /** - * Error occurred - */ - on(event: 'error', listener: (error: Error) => void): this; - - /** - * Exposes the native Node `fs.FSWatcher events` - */ - on(event: 'raw', listener: (eventName: string, path: string, details: any) => void): this; - - /** - * Fires when the initial scan is complete - */ - on(event: 'ready', listener: () => void): this; - - on(event: 'unlink'|'unlinkDir', listener: (path: string) => void): this; - - on(event: string, listener: (...args: any[]) => void): this; - - ref(): this; - - unref(): this; -} - -export interface WatchOptions { - /** - * Indicates whether the process should continue to run as long as files are being watched. If - * set to `false` when using `fsevents` to watch, no more events will be emitted after `ready`, - * even if the process continues to run. - */ - persistent?: boolean; - - /** - * ([anymatch](https://github.com/micromatch/anymatch)-compatible definition) Defines files/paths to - * be ignored. The whole relative or absolute path is tested, not just filename. If a function - * with two arguments is provided, it gets called twice per path - once with a single argument - * (the path), second time with two arguments (the path and the - * [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object of that path). - */ - ignored?: Matcher; - - /** - * If set to `false` then `add`/`addDir` events are also emitted for matching paths while - * instantiating the watching as chokidar discovers these file paths (before the `ready` event). - */ - ignoreInitial?: boolean; - - /** - * When `false`, only the symlinks themselves will be watched for changes instead of following - * the link references and bubbling events through the link's path. - */ - followSymlinks?: boolean; - - /** - * The base directory from which watch `paths` are to be derived. Paths emitted with events will - * be relative to this. - */ - cwd?: string; - - /** - * If set to true then the strings passed to .watch() and .add() are treated as literal path - * names, even if they look like globs. Default: false. - */ - disableGlobbing?: boolean; - - /** - * Whether to use fs.watchFile (backed by polling), or fs.watch. If polling leads to high CPU - * utilization, consider setting this to `false`. It is typically necessary to **set this to - * `true` to successfully watch files over a network**, and it may be necessary to successfully - * watch files in other non-standard situations. Setting to `true` explicitly on OS X overrides - * the `useFsEvents` default. - */ - usePolling?: boolean; - - /** - * Whether to use the `fsevents` watching interface if available. When set to `true` explicitly - * and `fsevents` is available this supercedes the `usePolling` setting. When set to `false` on - * OS X, `usePolling: true` becomes the default. - */ - useFsEvents?: boolean; - - /** - * If relying upon the [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats) object that - * may get passed with `add`, `addDir`, and `change` events, set this to `true` to ensure it is - * provided even in cases where it wasn't already available from the underlying watch events. - */ - alwaysStat?: boolean; - - /** - * If set, limits how many levels of subdirectories will be traversed. - */ - depth?: number; - - /** - * Interval of file system polling. - */ - interval?: number; - - /** - * Interval of file system polling for binary files. ([see list of binary extensions](https://gi - * thub.com/sindresorhus/binary-extensions/blob/master/binary-extensions.json)) - */ - binaryInterval?: number; - - /** - * Indicates whether to watch files that don't have read permissions if possible. If watching - * fails due to `EPERM` or `EACCES` with this set to `true`, the errors will be suppressed - * silently. - */ - ignorePermissionErrors?: boolean; - - /** - * `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts - * that occur when using editors that use "atomic writes" instead of writing directly to the - * source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change` - * event rather than `unlink` then `add`. If the default of 100 ms does not work well for you, - * you can override it by setting `atomic` to a custom value, in milliseconds. - */ - atomic?: boolean | number; - - /** - * can be set to an object in order to adjust timing params: - */ - awaitWriteFinish?: AwaitWriteFinishOptions | boolean; -} - -export interface AwaitWriteFinishOptions { - /** - * Amount of time in milliseconds for a file size to remain constant before emitting its event. - */ - stabilityThreshold?: number; - - /** - * File size polling interval. - */ - pollInterval?: number; -} - -/** - * produces an instance of `FSWatcher`. - */ -export function watch( - paths: string | ReadonlyArray, - options?: WatchOptions -): FSWatcher; diff --git a/node_modules/commander/CHANGELOG.md b/node_modules/commander/CHANGELOG.md deleted file mode 100644 index f00cb2b..0000000 --- a/node_modules/commander/CHANGELOG.md +++ /dev/null @@ -1,436 +0,0 @@ -# Changelog - -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). (Format adopted after v3.0.0.) - - - -## [4.1.1] (2020-02-02) - -### Fixed - -* TypeScript definition for `.action()` should include Promise for async ([#1157]) - -## [4.1.0] (2020-01-06) - -### Added - -* two routines to change how option values are handled, and eliminate name clashes with command properties ([#933] [#1102]) - * see storeOptionsAsProperties and passCommandToAction in README -* `.parseAsync` to use instead of `.parse` if supply async action handlers ([#806] [#1118]) - -### Fixed - -* Remove trailing blanks from wrapped help text ([#1096]) - -### Changed - -* update dependencies -* extend security coverage for Commander 2.x to 2020-02-03 -* improvements to README -* improvements to TypeScript definition documentation -* move old versions out of main CHANGELOG -* removed explicit use of `ts-node` in tests - -## [4.0.1] (2019-11-12) - -### Fixed - -* display help when requested, even if there are missing required options ([#1091]) - -## [4.0.0] (2019-11-02) - -### Added - -* automatically wrap and indent help descriptions for options and commands ([#1051]) -* `.exitOverride()` allows override of calls to `process.exit` for additional error handling and to keep program running ([#1040]) -* support for declaring required options with `.requiredOptions()` ([#1071]) -* GitHub Actions support ([#1027]) -* translation links in README - -### Changed - -* dev: switch tests from Sinon+Should to Jest with major rewrite of tests ([#1035]) -* call default subcommand even when there are unknown options ([#1047]) -* *Breaking* Commander is only officially supported on Node 8 and above, and requires Node 6 ([#1053]) - -### Fixed - -* *Breaking* keep command object out of program.args when action handler called ([#1048]) - * also, action handler now passed array of unknown arguments -* complain about unknown options when program argument supplied and action handler ([#1049]) - * this changes parameters to `command:*` event to include unknown arguments -* removed deprecated `customFds` option from call to `child_process.spawn` ([#1052]) -* rework TypeScript declarations to bring all types into imported namespace ([#1081]) - -### Migration Tips - -#### Testing for no arguments - -If you were previously using code like: - -```js -if (!program.args.length) ... -``` - -a partial replacement is: - -```js -if (program.rawArgs.length < 3) ... -``` - -## [4.0.0-1] Prerelease (2019-10-08) - -(Released in 4.0.0) - -## [4.0.0-0] Prerelease (2019-10-01) - -(Released in 4.0.0) - -## [2.20.1] (2019-09-29) - -### Fixed - -* Improve tracking of executable subcommands. - -### Changed - -* update development dependencies - -## [3.0.2] (2019-09-27) - -### Fixed - -* Improve tracking of executable subcommands. - -### Changed - -* update development dependencies - -## [3.0.1] (2019-08-30) - -### Added - -* .name and .usage to README ([#1010]) -* Table of Contents to README ([#1010]) -* TypeScript definition for `executableFile` in CommandOptions ([#1028]) - -### Changed - -* consistently use `const` rather than `var` in README ([#1026]) - -### Fixed - -* help for sub commands with custom executableFile ([#1018]) - -## [3.0.0] / 2019-08-08 - -* Add option to specify executable file name ([#999]) - * e.g. `.command('clone', 'clone description', { executableFile: 'myClone' })` -* Change docs for `.command` to contrast action handler vs git-style executable. ([#938] [#990]) -* **Breaking** Change TypeScript to use overloaded function for `.command`. ([#938] [#990]) -* Change to use straight quotes around strings in error messages (like 'this' instead of `this') ([#915]) -* Add TypeScript "reference types" for node ([#974]) -* Add support for hyphen as an option argument in subcommands ([#697]) -* Add support for a short option flag and its value to be concatenated for action handler subcommands ([#599]) - * e.g. `-p 80` can also be supplied as `-p80` -* Add executable arguments to spawn in win32, for git-style executables ([#611]) - * e.g. `node --harmony myCommand.js clone` -* Add parent command as prefix of subcommand in help ([#980]) -* Add optional custom description to `.version` ([#963]) - * e.g. `program.version('0.0.1', '-v, --vers', 'output the current version')` -* Add `.helpOption(flags, description)` routine to customise help flags and description ([#963]) - * e.g. `.helpOption('-e, --HELP', 'read more information')` -* Fix behavior of --no-* options ([#795]) - * can now define both `--foo` and `--no-foo` - * **Breaking** custom event listeners: `--no-foo` on cli now emits `option:no-foo` (previously `option:foo`) - * **Breaking** default value: defining `--no-foo` after defining `--foo` leaves the default value unchanged (previously set it to false) - * allow boolean default value, such as from environment ([#987]) -* Increment inspector port for spawned subcommands ([#991]) - * e.g. `node --inspect myCommand.js clone` - -### Migration Tips - -The custom event for a negated option like `--no-foo` is `option:no-foo` (previously `option:foo`). - -```js -program - .option('--no-foo') - .on('option:no-foo', () => { - console.log('removing foo'); - }); -``` - -When using TypeScript, adding a command does not allow an explicit `undefined` for an unwanted executable description (e.g -for a command with an action handler). - -```js -program - .command('action1', undefined, { noHelp: true }) // No longer valid - .command('action2', { noHelp: true }) // Correct -``` - -## 3.0.0-0 Prerelease / 2019-07-28 - -(Released as 3.0.0) - -## 2.20.0 / 2019-04-02 - -* fix: resolve symbolic links completely when hunting for subcommands (#935) -* Update index.d.ts (#930) -* Update Readme.md (#924) -* Remove --save option as it isn't required anymore (#918) -* Add link to the license file (#900) -* Added example of receiving args from options (#858) -* Added missing semicolon (#882) -* Add extension to .eslintrc (#876) - -## 2.19.0 / 2018-10-02 - -* Removed newline after Options and Commands headers (#864) -* Bugfix - Error output (#862) -* Fix to change default value to string (#856) - -## 2.18.0 / 2018-09-07 - -* Standardize help output (#853) -* chmod 644 travis.yml (#851) -* add support for execute typescript subcommand via ts-node (#849) - -## 2.17.1 / 2018-08-07 - -* Fix bug in command emit (#844) - -## 2.17.0 / 2018-08-03 - -* fixed newline output after help information (#833) -* Fix to emit the action even without command (#778) -* npm update (#823) - -## 2.16.0 / 2018-06-29 - -* Remove Makefile and `test/run` (#821) -* Make 'npm test' run on Windows (#820) -* Add badge to display install size (#807) -* chore: cache node_modules (#814) -* chore: remove Node.js 4 (EOL), add Node.js 10 (#813) -* fixed typo in readme (#812) -* Fix types (#804) -* Update eslint to resolve vulnerabilities in lodash (#799) -* updated readme with custom event listeners. (#791) -* fix tests (#794) - -## 2.15.0 / 2018-03-07 - -* Update downloads badge to point to graph of downloads over time instead of duplicating link to npm -* Arguments description - -## 2.14.1 / 2018-02-07 - -* Fix typing of help function - -## 2.14.0 / 2018-02-05 - -* only register the option:version event once -* Fixes issue #727: Passing empty string for option on command is set to undefined -* enable eqeqeq rule -* resolves #754 add linter configuration to project -* resolves #560 respect custom name for version option -* document how to override the version flag -* document using options per command - -## 2.13.0 / 2018-01-09 - -* Do not print default for --no- -* remove trailing spaces in command help -* Update CI's Node.js to LTS and latest version -* typedefs: Command and Option types added to commander namespace - -## 2.12.2 / 2017-11-28 - -* fix: typings are not shipped - -## 2.12.1 / 2017-11-23 - -* Move @types/node to dev dependency - -## 2.12.0 / 2017-11-22 - -* add attributeName() method to Option objects -* Documentation updated for options with --no prefix -* typings: `outputHelp` takes a string as the first parameter -* typings: use overloads -* feat(typings): update to match js api -* Print default value in option help -* Fix translation error -* Fail when using same command and alias (#491) -* feat(typings): add help callback -* fix bug when description is add after command with options (#662) -* Format js code -* Rename History.md to CHANGELOG.md (#668) -* feat(typings): add typings to support TypeScript (#646) -* use current node - -## 2.11.0 / 2017-07-03 - -* Fix help section order and padding (#652) -* feature: support for signals to subcommands (#632) -* Fixed #37, --help should not display first (#447) -* Fix translation errors. (#570) -* Add package-lock.json -* Remove engines -* Upgrade package version -* Prefix events to prevent conflicts between commands and options (#494) -* Removing dependency on graceful-readlink -* Support setting name in #name function and make it chainable -* Add .vscode directory to .gitignore (Visual Studio Code metadata) -* Updated link to ruby commander in readme files - -## 2.10.0 / 2017-06-19 - -* Update .travis.yml. drop support for older node.js versions. -* Fix require arguments in README.md -* On SemVer you do not start from 0.0.1 -* Add missing semi colon in readme -* Add save param to npm install -* node v6 travis test -* Update Readme_zh-CN.md -* Allow literal '--' to be passed-through as an argument -* Test subcommand alias help -* link build badge to master branch -* Support the alias of Git style sub-command -* added keyword commander for better search result on npm -* Fix Sub-Subcommands -* test node.js stable -* Fixes TypeError when a command has an option called `--description` -* Update README.md to make it beginner friendly and elaborate on the difference between angled and square brackets. -* Add chinese Readme file - -## 2.9.0 / 2015-10-13 - -* Add option `isDefault` to set default subcommand #415 @Qix- -* Add callback to allow filtering or post-processing of help text #434 @djulien -* Fix `undefined` text in help information close #414 #416 @zhiyelee - -## 2.8.1 / 2015-04-22 - -* Back out `support multiline description` Close #396 #397 - -## 2.8.0 / 2015-04-07 - -* Add `process.execArg` support, execution args like `--harmony` will be passed to sub-commands #387 @DigitalIO @zhiyelee -* Fix bug in Git-style sub-commands #372 @zhiyelee -* Allow commands to be hidden from help #383 @tonylukasavage -* When git-style sub-commands are in use, yet none are called, display help #382 @claylo -* Add ability to specify arguments syntax for top-level command #258 @rrthomas -* Support multiline descriptions #208 @zxqfox - -## 2.7.1 / 2015-03-11 - -* Revert #347 (fix collisions when option and first arg have same name) which causes a bug in #367. - -## 2.7.0 / 2015-03-09 - -* Fix git-style bug when installed globally. Close #335 #349 @zhiyelee -* Fix collisions when option and first arg have same name. Close #346 #347 @tonylukasavage -* Add support for camelCase on `opts()`. Close #353 @nkzawa -* Add node.js 0.12 and io.js to travis.yml -* Allow RegEx options. #337 @palanik -* Fixes exit code when sub-command failing. Close #260 #332 @pirelenito -* git-style `bin` files in $PATH make sense. Close #196 #327 @zhiyelee - -## 2.6.0 / 2014-12-30 - -* added `Command#allowUnknownOption` method. Close #138 #318 @doozr @zhiyelee -* Add application description to the help msg. Close #112 @dalssoft - -## 2.5.1 / 2014-12-15 - -* fixed two bugs incurred by variadic arguments. Close #291 @Quentin01 #302 @zhiyelee - -## 2.5.0 / 2014-10-24 - -* add support for variadic arguments. Closes #277 @whitlockjc - -## 2.4.0 / 2014-10-17 - -* fixed a bug on executing the coercion function of subcommands option. Closes #270 -* added `Command.prototype.name` to retrieve command name. Closes #264 #266 @tonylukasavage -* added `Command.prototype.opts` to retrieve all the options as a simple object of key-value pairs. Closes #262 @tonylukasavage -* fixed a bug on subcommand name. Closes #248 @jonathandelgado -* fixed function normalize doesn’t honor option terminator. Closes #216 @abbr - -## 2.3.0 / 2014-07-16 - -* add command alias'. Closes PR #210 -* fix: Typos. Closes #99 -* fix: Unused fs module. Closes #217 - -## 2.2.0 / 2014-03-29 - -* add passing of previous option value -* fix: support subcommands on windows. Closes #142 -* Now the defaultValue passed as the second argument of the coercion function. - -## 2.1.0 / 2013-11-21 - -* add: allow cflag style option params, unit test, fixes #174 - -## 2.0.0 / 2013-07-18 - -* remove input methods (.prompt, .confirm, etc) - -## Older versions - -* [1.x](./changelogs/CHANGELOG-1.md) -* [0.x](./changelogs/CHANGELOG-0.md) - -[#599]: https://github.com/tj/commander.js/issues/599 -[#611]: https://github.com/tj/commander.js/issues/611 -[#697]: https://github.com/tj/commander.js/issues/697 -[#795]: https://github.com/tj/commander.js/issues/795 -[#806]: https://github.com/tj/commander.js/issues/806 -[#915]: https://github.com/tj/commander.js/issues/915 -[#938]: https://github.com/tj/commander.js/issues/938 -[#963]: https://github.com/tj/commander.js/issues/963 -[#974]: https://github.com/tj/commander.js/issues/974 -[#980]: https://github.com/tj/commander.js/issues/980 -[#987]: https://github.com/tj/commander.js/issues/987 -[#990]: https://github.com/tj/commander.js/issues/990 -[#991]: https://github.com/tj/commander.js/issues/991 -[#993]: https://github.com/tj/commander.js/issues/993 -[#999]: https://github.com/tj/commander.js/issues/999 -[#1010]: https://github.com/tj/commander.js/pull/1010 -[#1018]: https://github.com/tj/commander.js/pull/1018 -[#1026]: https://github.com/tj/commander.js/pull/1026 -[#1027]: https://github.com/tj/commander.js/pull/1027 -[#1028]: https://github.com/tj/commander.js/pull/1028 -[#1035]: https://github.com/tj/commander.js/pull/1035 -[#1040]: https://github.com/tj/commander.js/pull/1040 -[#1047]: https://github.com/tj/commander.js/pull/1047 -[#1048]: https://github.com/tj/commander.js/pull/1048 -[#1049]: https://github.com/tj/commander.js/pull/1049 -[#1051]: https://github.com/tj/commander.js/pull/1051 -[#1052]: https://github.com/tj/commander.js/pull/1052 -[#1053]: https://github.com/tj/commander.js/pull/1053 -[#1071]: https://github.com/tj/commander.js/pull/1071 -[#1081]: https://github.com/tj/commander.js/pull/1081 -[#1091]: https://github.com/tj/commander.js/pull/1091 -[#1096]: https://github.com/tj/commander.js/pull/1096 -[#1102]: https://github.com/tj/commander.js/pull/1102 -[#1118]: https://github.com/tj/commander.js/pull/1118 -[#1157]: https://github.com/tj/commander.js/pull/1157 - -[Unreleased]: https://github.com/tj/commander.js/compare/master...develop -[4.1.1]: https://github.com/tj/commander.js/compare/v4.0.0..v4.1.1 -[4.1.0]: https://github.com/tj/commander.js/compare/v4.0.1..v4.1.0 -[4.0.1]: https://github.com/tj/commander.js/compare/v4.0.0..v4.0.1 -[4.0.0]: https://github.com/tj/commander.js/compare/v3.0.2..v4.0.0 -[4.0.0-1]: https://github.com/tj/commander.js/compare/v4.0.0-0..v4.0.0-1 -[4.0.0-0]: https://github.com/tj/commander.js/compare/v3.0.2...v4.0.0-0 -[3.0.2]: https://github.com/tj/commander.js/compare/v3.0.1...v3.0.2 -[3.0.1]: https://github.com/tj/commander.js/compare/v3.0.0...v3.0.1 -[3.0.0]: https://github.com/tj/commander.js/compare/v2.20.1...v3.0.0 -[2.20.1]: https://github.com/tj/commander.js/compare/v2.20.0...v2.20.1 diff --git a/node_modules/commander/LICENSE b/node_modules/commander/LICENSE deleted file mode 100644 index 10f997a..0000000 --- a/node_modules/commander/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2011 TJ Holowaychuk - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/commander/Readme.md b/node_modules/commander/Readme.md deleted file mode 100644 index aa4f42b..0000000 --- a/node_modules/commander/Readme.md +++ /dev/null @@ -1,713 +0,0 @@ -# Commander.js - -[![Build Status](https://api.travis-ci.org/tj/commander.js.svg?branch=master)](http://travis-ci.org/tj/commander.js) -[![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, inspired by Ruby's [commander](https://github.com/commander-rb/commander). - -Read this in other languages: English | [简体中文](./Readme_zh-CN.md) - -- [Commander.js](#commanderjs) - - [Installation](#installation) - - [Declaring program variable](#declaring-program-variable) - - [Options](#options) - - [Common option types, boolean and value](#common-option-types-boolean-and-value) - - [Default option value](#default-option-value) - - [Other option types, negatable boolean and flag|value](#other-option-types-negatable-boolean-and-flagvalue) - - [Custom option processing](#custom-option-processing) - - [Required option](#required-option) - - [Version option](#version-option) - - [Commands](#commands) - - [Specify the argument syntax](#specify-the-argument-syntax) - - [Action handler (sub)commands](#action-handler-subcommands) - - [Git-style executable (sub)commands](#git-style-executable-subcommands) - - [Automated --help](#automated---help) - - [Custom help](#custom-help) - - [.usage and .name](#usage-and-name) - - [.outputHelp(cb)](#outputhelpcb) - - [.helpOption(flags, description)](#helpoptionflags-description) - - [.help(cb)](#helpcb) - - [Custom event listeners](#custom-event-listeners) - - [Bits and pieces](#bits-and-pieces) - - [Avoiding option name clashes](#avoiding-option-name-clashes) - - [TypeScript](#typescript) - - [Node options such as --harmony](#node-options-such-as---harmony) - - [Node debugging](#node-debugging) - - [Override exit handling](#override-exit-handling) - - [Examples](#examples) - - [License](#license) - - [Support](#support) - - [Commander for enterprise](#commander-for-enterprise) - -## Installation - -```bash -npm install commander -``` - -## Declaring _program_ variable - -Commander exports a global object which is convenient for quick programs. -This is used in the examples in this README for brevity. - -```js -const program = require('commander'); -program.version('0.0.1'); -``` - -For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use. - - ```js - const commander = require('commander'); - const program = new commander.Command(); - program.version('0.0.1'); - ``` - -## 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. - -The options can be accessed as properties on the Command object. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc. Multiple short flags may be combined as a single arg, for example `-abc` is equivalent to `-a -b -c`. - -See also optional new behaviour to [avoid name clashes](#avoiding-option-name-clashes). - -### Common option types, boolean and value - -The two most used option types are a boolean flag, and an option which takes a value (declared using angle brackets). Both are `undefined` unless specified on command line. - -```js -const program = require('commander'); - -program - .option('-d, --debug', 'output extra debugging') - .option('-s, --small', 'small pizza size') - .option('-p, --pizza-type ', 'flavour of pizza'); - -program.parse(process.argv); - -if (program.debug) console.log(program.opts()); -console.log('pizza details:'); -if (program.small) console.log('- small pizza size'); -if (program.pizzaType) console.log(`- ${program.pizzaType}`); -``` - -```bash -$ pizza-options -d -{ debug: true, small: undefined, pizzaType: undefined } -pizza details: -$ pizza-options -p -error: option '-p, --pizza-type ' argument missing -$ pizza-options -ds -p vegetarian -{ debug: true, small: true, pizzaType: 'vegetarian' } -pizza details: -- small pizza size -- vegetarian -$ pizza-options --pizza-type=cheese -pizza details: -- cheese -``` - -`program.parse(arguments)` processes the arguments, leaving any args not consumed by the options as the `program.args` array. - -### Default option value - -You can specify a default value for an option which takes a value. - -```js -const program = require('commander'); - -program - .option('-c, --cheese ', 'add the specified type of cheese', 'blue'); - -program.parse(process.argv); - -console.log(`cheese: ${program.cheese}`); -``` - -```bash -$ pizza-options -cheese: blue -$ pizza-options --cheese stilton -cheese: stilton -``` - -### Other option types, negatable boolean and flag|value - -You can specify a boolean option long name with a leading `no-` to set the option value to false when used. -Defined alone this also makes the option true by default. - -If you define `--foo` first, adding `--no-foo` does not change the default value from what it would -otherwise be. You can specify a default boolean value for a boolean flag and it can be overridden on command line. - -```js -const program = require('commander'); - -program - .option('--no-sauce', 'Remove sauce') - .option('--cheese ', 'cheese flavour', 'mozzarella') - .option('--no-cheese', 'plain with no cheese') - .parse(process.argv); - -const sauceStr = program.sauce ? 'sauce' : 'no sauce'; -const cheeseStr = (program.cheese === false) ? 'no cheese' : `${program.cheese} cheese`; -console.log(`You ordered a pizza with ${sauceStr} and ${cheeseStr}`); -``` - -```bash -$ pizza-options -You ordered a pizza with sauce and mozzarella cheese -$ pizza-options --sauce -error: unknown option '--sauce' -$ pizza-options --cheese=blue -You ordered a pizza with sauce and blue cheese -$ pizza-options --no-sauce --no-cheese -You ordered a pizza with no sauce and no cheese -``` - -You can specify an option which functions as a flag but may also take a value (declared using square brackets). - -```js -const program = require('commander'); - -program - .option('-c, --cheese [type]', 'Add cheese with optional type'); - -program.parse(process.argv); - -if (program.cheese === undefined) console.log('no cheese'); -else if (program.cheese === true) console.log('add cheese'); -else console.log(`add cheese type ${program.cheese}`); -``` - -```bash -$ pizza-options -no cheese -$ pizza-options --cheese -add cheese -$ pizza-options --cheese mozzarella -add cheese type mozzarella -``` - -### Custom option processing - -You may specify a function to do custom processing of option values. The callback function receives two parameters, the user specified value and the -previous value for the option. It returns the new value for the option. - -This allows you to coerce the option value 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. - -```js -const program = require('commander'); - -function myParseInt(value, dummyPrevious) { - // parseInt takes a string and an optional radix - return parseInt(value); -} - -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(process.argv); - -if (program.float !== undefined) console.log(`float: ${program.float}`); -if (program.integer !== undefined) console.log(`integer: ${program.integer}`); -if (program.verbose > 0) console.log(`verbosity: ${program.verbose}`); -if (program.collect.length > 0) console.log(program.collect); -if (program.list !== undefined) console.log(program.list); -``` - -```bash -$ custom -f 1e2 -float: 100 -$ custom --integer 2 -integer: 2 -$ custom -v -v -v -verbose: 3 -$ custom -c a -c b -c c -[ 'a', 'b', 'c' ] -$ custom --list x,y,z -[ 'x', 'y', 'z' ] -``` - -### Required option - -You may specify a required (mandatory) option using `.requiredOption`. The option must be specified on the command line, or by having a default value. The method is otherwise the same as `.option` in format, taking flags and description, and optional default value or custom processing. - -```js -const program = require('commander'); - -program - .requiredOption('-c, --cheese ', 'pizza must have cheese'); - -program.parse(process.argv); -``` - -``` -$ pizza -error: required option '-c, --cheese ' not specified -``` - -### Version option - -The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits. - -```js -program.version('0.0.1'); -``` - -```bash -$ ./examples/pizza -V -0.0.1 -``` - -You may change the flags and description by passing additional parameters to the `version` method, using -the same syntax for flags as the `option` method. The version flags can be named anything, but a long name is required. - -```js -program.version('0.0.1', '-v, --vers', 'output the current version'); -``` - -## Commands - -You can specify (sub)commands for your top-level command using `.command`. There are two ways these can be implemented: using an action handler attached to the command, or as a separate executable file (described in more detail later). In the first parameter to `.command` you specify the command name and any command arguments. The arguments may be `` or `[optional]`, and the last argument may also be `variadic...`. - -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 separate executable file (description is second parameter to `.command`) -// Returns top-level command for adding more commands. -program - .command('start ', 'start named service') - .command('stop [service]', 'stop named service, or all if no name supplied'); -``` - -### Specify the argument syntax - -You use `.arguments` to specify the arguments for the top-level command, and for subcommands they are included in the `.command` call. Angled brackets (e.g. ``) indicate required input. Square brackets (e.g. `[optional]`) indicate optional input. - -```js -const program = require('commander'); - -program - .version('0.1.0') - .arguments(' [env]') - .action(function (cmd, env) { - cmdValue = cmd; - envValue = env; - }); - -program.parse(process.argv); - -if (typeof cmdValue === 'undefined') { - console.error('no command given!'); - process.exit(1); -} -console.log('command:', cmdValue); -console.log('environment:', envValue || "no environment given"); -``` - - 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. For example: - -```js -const program = require('commander'); - -program - .version('0.1.0') - .command('rmdir [otherDirs...]') - .action(function (dir, otherDirs) { - console.log('rmdir %s', dir); - if (otherDirs) { - otherDirs.forEach(function (oDir) { - console.log('rmdir %s', oDir); - }); - } - }); - -program.parse(process.argv); -``` - -The variadic argument is passed to the action handler as an array. (And this also applies to `program.args`.) - -### Action handler (sub)commands - -You can add options to a command that uses an action handler. -The action handler gets passed a parameter for each argument you declared, and one additional argument which is the -command object itself. This command argument has the values for the command-specific options added as properties. - -```js -const program = require('commander'); - -program - .command('rm ') - .option('-r, --recursive', 'Remove recursively') - .action(function (dir, cmdObj) { - console.log('remove ' + dir + (cmdObj.recursive ? ' recursively' : '')) - }) - -program.parse(process.argv) -``` - -You may supply an `async` action handler, in which case you call `.parseAsync` rather than `.parse`. - -```js -async function run() { /* code goes here */ } - -async function main() { - program - .command('run') - .action(run); - await program.parseAsync(process.argv); -} -``` - -A command's options on the command line are validated when the command is used. Any unknown options will be reported as an error. However, if an action-based command does not define an action, then the options are not validated. - -Configuration options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the command from the generated help output. - -### Git-style executable (sub)commands - -When `.command()` is invoked with a description argument, this tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. -Commander will search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-subcommand`, like `pm-install`, `pm-search`. -You can specify a custom name with the `executableFile` configuration option. - -You handle the options for an executable (sub)command in the executable, and don't declare them at the top-level. - -```js -// file: ./examples/pm -const program = require('commander'); - -program - .version('0.1.0') - .command('install [name]', 'install one or more packages') - .command('search [query]', 'search with optional query') - .command('update', 'update installed packages', {executableFile: 'myUpdateSubCommand'}) - .command('list', 'list packages installed', {isDefault: true}) - .parse(process.argv); -``` - -Configuration options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the command from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified. -Specifying a name with `executableFile` will override the default constructed name. - -If the program is designed to be installed globally, make sure the executables have proper modes, like `755`. - -## Automated --help - - The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: - -```bash -$ ./examples/pizza --help -Usage: pizza [options] - -An application for pizzas ordering - -Options: - -V, --version output the version number - -p, --peppers Add peppers - -P, --pineapple Add pineapple - -b, --bbq Add bbq sauce - -c, --cheese Add the specified type of cheese (default: "marble") - -C, --no-cheese You do not want any cheese - -h, --help output usage information -``` - -### Custom help - - You can display arbitrary `-h, --help` information - by listening for "--help". Commander will automatically - exit once you are done so that the remainder of your program - does not execute causing undesired behaviors, for example - in the following executable "stuff" will not output when - `--help` is used. - -```js -#!/usr/bin/env node - -const program = require('commander'); - -program - .version('0.1.0') - .option('-f, --foo', 'enable some foo') - .option('-b, --bar', 'enable some bar') - .option('-B, --baz', 'enable some baz'); - -// must be before .parse() since -// node's emit() is immediate - -program.on('--help', function(){ - console.log('') - console.log('Examples:'); - console.log(' $ custom-help --help'); - console.log(' $ custom-help -h'); -}); - -program.parse(process.argv); - -console.log('stuff'); -``` - -Yields the following help output when `node script-name.js -h` or `node script-name.js --help` are run: - -```Text -Usage: custom-help [options] - -Options: - -h, --help output usage information - -V, --version output the version number - -f, --foo enable some foo - -b, --bar enable some bar - -B, --baz enable some baz - -Examples: - $ custom-help --help - $ custom-help -h -``` - -### .usage and .name - -These allow you to customise the usage description in the first line of the help. The name is otherwise -deduced from the (full) program arguments. Given: - -```js -program - .name("my-command") - .usage("[global options] command") -``` - -The help will start with: - -```Text -Usage: my-command [global options] command -``` - -### .outputHelp(cb) - -Output help information without exiting. -Optional callback cb allows post-processing of help text before it is displayed. - -If you want to display help by default (e.g. if no command was provided), you can use something like: - -```js -const program = require('commander'); -const colors = require('colors'); - -program - .version('0.1.0') - .command('getstream [url]', 'get stream URL') - .parse(process.argv); - -if (!process.argv.slice(2).length) { - program.outputHelp(make_red); -} - -function make_red(txt) { - return colors.red(txt); //display the help text in red on the console -} -``` - -### .helpOption(flags, description) - - Override the default help flags and description. - -```js -program - .helpOption('-e, --HELP', 'read more information'); -``` - -### .help(cb) - - Output help information and exit immediately. - Optional callback cb allows post-processing of help text before it is displayed. - -## Custom event listeners - - You can execute custom actions by listening to command and option events. - -```js -program.on('option:verbose', function () { - process.env.VERBOSE = this.verbose; -}); - -// error on unknown commands -program.on('command:*', function () { - console.error('Invalid command: %s\nSee --help for a list of available commands.', program.args.join(' ')); - process.exit(1); -}); -``` - -## Bits and pieces - -### Avoiding option name clashes - -The original and default behaviour is that the option values are stored -as properties on the program, and the action handler is passed a -command object with the options values stored as properties. -This is very convenient to code, but the downside is possible clashes with -existing properties of Command. - -There are two new routines to change the behaviour, and the default behaviour may change in the future: - -- `storeOptionsAsProperties`: whether to store option values as properties on command object, or store separately (specify false) and access using `.opts()` -- `passCommandToAction`: whether to pass command to action handler, -or just the options (specify false) - -```js -// file: ./examples/storeOptionsAsProperties.action.js -program - .storeOptionsAsProperties(false) - .passCommandToAction(false); - -program - .name('my-program-name') - .option('-n,--name '); - -program - .command('show') - .option('-a,--action ') - .action((options) => { - console.log(options.action); - }); - -program.parse(process.argv); - -const programOptions = program.opts(); -console.log(programOptions.name); -``` - -### TypeScript - -The Commander package includes its TypeScript Definition file, but also requires the node types which you need to install yourself. e.g. - -```bash -npm install commander -npm install --save-dev @types/node -``` - -If you use `ts-node` and git-style sub-commands written as `.ts` files, you need to call your program through node to get the sub-commands called correctly. e.g. - -```bash -node -r ts-node/register pm.ts -``` - -### Node options such as `--harmony` - -You can enable `--harmony` option in two ways: - -- Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. (Note Windows does not support this pattern.) -- Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process. - -### Node debugging - -If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) git-style executable (sub)commands using `node --inspect` et al, -the inspector port is incremented by 1 for the spawned subcommand. - -### Override exit handling - -By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override -this behaviour and optionally supply a callback. The default override throws a `CommanderError`. - -The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`. The default override behaviour is to throw the error, except for async handling of executable subcommand completion which carries on. The normal display of error messages or version or help -is not affected by the override which is called after the display. - -``` js -program.exitOverride(); - -try { - program.parse(process.argv); -} catch (err) { - // custom processing... -} -``` - -## Examples - -```js -const program = require('commander'); - -program - .version('0.1.0') - .option('-C, --chdir ', 'change the working directory') - .option('-c, --config ', 'set config path. defaults to ./deploy.conf') - .option('-T, --no-tests', 'ignore test hook'); - -program - .command('setup [env]') - .description('run setup commands for all envs') - .option("-s, --setup_mode [mode]", "Which setup mode to use") - .action(function(env, options){ - const mode = options.setup_mode || "normal"; - env = env || 'all'; - console.log('setup for %s env(s) with %s mode', env, mode); - }); - -program - .command('exec ') - .alias('ex') - .description('execute the given remote cmd') - .option("-e, --exec_mode ", "Which exec mode to use") - .action(function(cmd, options){ - console.log('exec "%s" using %s mode', cmd, options.exec_mode); - }).on('--help', function() { - console.log(''); - console.log('Examples:'); - console.log(''); - console.log(' $ deploy exec sequential'); - console.log(' $ deploy exec async'); - }); - -program - .command('*') - .action(function(env){ - console.log('deploying "%s"', env); - }); - -program.parse(process.argv); -``` - -More Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory. - -## License - -[MIT](https://github.com/tj/commander.js/blob/master/LICENSE) - -## Support - -Commander 4.x is supported on Node 8 and above, and is likely to work with Node 6 but not tested. -(For versions of Node below Node 6, use Commander 3.x or 2.x.) - -The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub. - -### Commander for enterprise - -Available as part of the Tidelift Subscription - -The maintainers of Commander and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-commander?utm_source=npm-commander&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/commander/index.js b/node_modules/commander/index.js deleted file mode 100644 index 37d20cc..0000000 --- a/node_modules/commander/index.js +++ /dev/null @@ -1,1649 +0,0 @@ -/** - * Module dependencies. - */ - -var EventEmitter = require('events').EventEmitter; -var spawn = require('child_process').spawn; -var path = require('path'); -var dirname = path.dirname; -var basename = path.basename; -var fs = require('fs'); - -/** - * Inherit `Command` from `EventEmitter.prototype`. - */ - -require('util').inherits(Command, EventEmitter); - -/** - * Expose the root command. - */ - -exports = module.exports = new Command(); - -/** - * Expose `Command`. - */ - -exports.Command = Command; - -/** - * Expose `Option`. - */ - -exports.Option = Option; - -/** - * Initialize a new `Option` with the given `flags` and `description`. - * - * @param {String} flags - * @param {String} description - * @api public - */ - -function Option(flags, description) { - this.flags = flags; - this.required = flags.indexOf('<') >= 0; // A value must be supplied when the option is specified. - this.optional = flags.indexOf('[') >= 0; // A value is optional when the option is specified. - this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line. - this.negate = flags.indexOf('-no-') !== -1; - flags = flags.split(/[ ,|]+/); - if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift(); - this.long = flags.shift(); - this.description = description || ''; -} - -/** - * Return option name. - * - * @return {String} - * @api private - */ - -Option.prototype.name = function() { - return this.long.replace(/^--/, ''); -}; - -/** - * Return option name, in a camelcase format that can be used - * as a object attribute key. - * - * @return {String} - * @api private - */ - -Option.prototype.attributeName = function() { - return camelcase(this.name().replace(/^no-/, '')); -}; - -/** - * Check if `arg` matches the short or long flag. - * - * @param {String} arg - * @return {Boolean} - * @api private - */ - -Option.prototype.is = function(arg) { - return this.short === arg || this.long === arg; -}; - -/** - * CommanderError class - * @class - */ -class CommanderError extends Error { - /** - * Constructs the CommanderError class - * @param {Number} exitCode suggested exit code which could be used with process.exit - * @param {String} code an id string representing the error - * @param {String} message human-readable description of the error - * @constructor - */ - constructor(exitCode, code, message) { - super(message); - // properly capture stack trace in Node.js - Error.captureStackTrace(this, this.constructor); - this.name = this.constructor.name; - this.code = code; - this.exitCode = exitCode; - } -} - -exports.CommanderError = CommanderError; - -/** - * Initialize a new `Command`. - * - * @param {String} [name] - * @api public - */ - -function Command(name) { - this.commands = []; - this.options = []; - this._execs = new Set(); - this._allowUnknownOption = false; - this._args = []; - this._name = name || ''; - this._optionValues = {}; - this._storeOptionsAsProperties = true; // backwards compatible by default - this._passCommandToAction = true; // backwards compatible by default - this._actionResults = []; - - this._helpFlags = '-h, --help'; - this._helpDescription = 'output usage information'; - this._helpShortFlag = '-h'; - this._helpLongFlag = '--help'; -} - -/** - * Define a command. - * - * There are two styles of command: pay attention to where to put the description. - * - * Examples: - * - * // Command implemented using action handler (description is supplied separately to `.command`) - * program - * .command('clone [destination]') - * .description('clone a repository into a newly created directory') - * .action((source, destination) => { - * console.log('clone command called'); - * }); - * - * // Command implemented using separate executable file (description is second parameter to `.command`) - * program - * .command('start ', 'start named service') - * .command('stop [service]', 'stop named service, or all if no name supplied'); - * - * @param {string} nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...` - * @param {Object|string} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable) - * @param {Object} [execOpts] - configuration options (for executable) - * @return {Command} returns new command for action handler, or top-level command for executable command - * @api public - */ - -Command.prototype.command = function(nameAndArgs, actionOptsOrExecDesc, execOpts) { - var desc = actionOptsOrExecDesc; - var opts = execOpts; - if (typeof desc === 'object' && desc !== null) { - opts = desc; - desc = null; - } - opts = opts || {}; - var args = nameAndArgs.split(/ +/); - var cmd = new Command(args.shift()); - - if (desc) { - cmd.description(desc); - this.executables = true; - this._execs.add(cmd._name); - if (opts.isDefault) this.defaultExecutable = cmd._name; - } - cmd._noHelp = !!opts.noHelp; - cmd._helpFlags = this._helpFlags; - cmd._helpDescription = this._helpDescription; - cmd._helpShortFlag = this._helpShortFlag; - cmd._helpLongFlag = this._helpLongFlag; - cmd._exitCallback = this._exitCallback; - cmd._storeOptionsAsProperties = this._storeOptionsAsProperties; - cmd._passCommandToAction = this._passCommandToAction; - - cmd._executableFile = opts.executableFile; // Custom name for executable file - this.commands.push(cmd); - cmd.parseExpectedArgs(args); - cmd.parent = this; - - if (desc) return this; - return cmd; -}; - -/** - * Define argument syntax for the top-level command. - * - * @api public - */ - -Command.prototype.arguments = function(desc) { - return this.parseExpectedArgs(desc.split(/ +/)); -}; - -/** - * Add an implicit `help [cmd]` subcommand - * which invokes `--help` for the given command. - * - * @api private - */ - -Command.prototype.addImplicitHelpCommand = function() { - this.command('help [cmd]', 'display help for [cmd]'); -}; - -/** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @param {Array} args - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parseExpectedArgs = function(args) { - if (!args.length) return; - var self = this; - args.forEach(function(arg) { - var argDetails = { - required: false, - name: '', - variadic: false - }; - - switch (arg[0]) { - case '<': - argDetails.required = true; - argDetails.name = arg.slice(1, -1); - break; - case '[': - argDetails.name = arg.slice(1, -1); - break; - } - - if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') { - argDetails.variadic = true; - argDetails.name = argDetails.name.slice(0, -3); - } - if (argDetails.name) { - self._args.push(argDetails); - } - }); - return this; -}; - -/** - * Register callback to use as replacement for calling process.exit. - * - * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing - * @return {Command} for chaining - * @api public - */ - -Command.prototype.exitOverride = function(fn) { - if (fn) { - this._exitCallback = fn; - } else { - this._exitCallback = function(err) { - if (err.code !== 'commander.executeSubCommandAsync') { - throw err; - } else { - // Async callback from spawn events, not useful to throw. - } - }; - } - return this; -}; - -/** - * Call process.exit, and _exitCallback if defined. - * - * @param {Number} exitCode exit code for using with process.exit - * @param {String} code an id string representing the error - * @param {String} message human-readable description of the error - * @return never - * @api private - */ - -Command.prototype._exit = function(exitCode, code, message) { - if (this._exitCallback) { - this._exitCallback(new CommanderError(exitCode, code, message)); - // Expecting this line is not reached. - } - process.exit(exitCode); -}; - -/** - * Register callback `fn` for the command. - * - * Examples: - * - * program - * .command('help') - * .description('display verbose help') - * .action(function() { - * // output help here - * }); - * - * @param {Function} fn - * @return {Command} for chaining - * @api public - */ - -Command.prototype.action = function(fn) { - var self = this; - var listener = function(args, unknown) { - // Parse any so-far unknown options - args = args || []; - unknown = unknown || []; - - var parsed = self.parseOptions(unknown); - - // Output help if necessary - outputHelpIfRequested(self, parsed.unknown); - self._checkForMissingMandatoryOptions(); - - // If there are still any unknown options, then we simply - // die, unless someone asked for help, in which case we give it - // to them, and then we die. - if (parsed.unknown.length > 0) { - self.unknownOption(parsed.unknown[0]); - } - - // Leftover arguments need to be pushed back. Fixes issue #56 - if (parsed.args.length) args = parsed.args.concat(args); - - self._args.forEach(function(arg, i) { - if (arg.required && args[i] == null) { - self.missingArgument(arg.name); - } else if (arg.variadic) { - if (i !== self._args.length - 1) { - self.variadicArgNotLast(arg.name); - } - - args[i] = args.splice(i); - } - }); - - // The .action callback takes an extra parameter which is the command itself. - var expectedArgsCount = self._args.length; - var actionArgs = args.slice(0, expectedArgsCount); - if (self._passCommandToAction) { - actionArgs[expectedArgsCount] = self; - } else { - actionArgs[expectedArgsCount] = self.opts(); - } - // Add the extra arguments so available too. - if (args.length > expectedArgsCount) { - actionArgs.push(args.slice(expectedArgsCount)); - } - - const actionResult = fn.apply(self, actionArgs); - // Remember result in case it is async. Assume parseAsync getting called on root. - let rootCommand = self; - while (rootCommand.parent) { - rootCommand = rootCommand.parent; - } - rootCommand._actionResults.push(actionResult); - }; - var parent = this.parent || this; - var name = parent === this ? '*' : this._name; - parent.on('command:' + name, listener); - if (this._alias) parent.on('command:' + this._alias, listener); - return this; -}; - -/** - * Internal implementation shared by .option() and .requiredOption() - * - * @param {Object} config - * @param {String} flags - * @param {String} description - * @param {Function|*} [fn] - custom option processing function or default vaue - * @param {*} [defaultValue] - * @return {Command} for chaining - * @api private - */ - -Command.prototype._optionEx = function(config, flags, description, fn, defaultValue) { - var self = this, - option = new Option(flags, description), - oname = option.name(), - name = option.attributeName(); - option.mandatory = !!config.mandatory; - - // default as 3rd arg - if (typeof fn !== 'function') { - if (fn instanceof RegExp) { - // This is a bit simplistic (especially no error messages), and probably better handled by caller using custom option processing. - // No longer documented in README, but still present for backwards compatibility. - var regex = fn; - fn = function(val, def) { - var m = regex.exec(val); - return m ? m[0] : def; - }; - } else { - defaultValue = fn; - fn = null; - } - } - - // preassign default value for --no-*, [optional], , or plain flag if boolean value - if (option.negate || option.optional || option.required || typeof defaultValue === 'boolean') { - // when --no-foo we make sure default is true, unless a --foo option is already defined - if (option.negate) { - const positiveLongFlag = option.long.replace(/^--no-/, '--'); - defaultValue = self.optionFor(positiveLongFlag) ? self._getOptionValue(name) : true; - } - // preassign only if we have a default - if (defaultValue !== undefined) { - self._setOptionValue(name, defaultValue); - option.defaultValue = defaultValue; - } - } - - // register the option - this.options.push(option); - - // when it's passed assign the value - // and conditionally invoke the callback - this.on('option:' + oname, function(val) { - // coercion - if (val !== null && fn) { - val = fn(val, self._getOptionValue(name) === undefined ? defaultValue : self._getOptionValue(name)); - } - - // unassigned or boolean value - if (typeof self._getOptionValue(name) === 'boolean' || typeof self._getOptionValue(name) === 'undefined') { - // if no value, negate false, and we have a default, then use it! - if (val == null) { - self._setOptionValue(name, option.negate - ? false - : defaultValue || true); - } else { - self._setOptionValue(name, val); - } - } else if (val !== null) { - // reassign - self._setOptionValue(name, option.negate ? false : val); - } - }); - - return this; -}; - -/** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * Examples: - * - * // simple boolean defaulting to undefined - * program.option('-p, --pepper', 'add pepper'); - * - * program.pepper - * // => undefined - * - * --pepper - * program.pepper - * // => true - * - * // simple boolean defaulting to true (unless non-negated option is also defined) - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => false - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @param {String} flags - * @param {String} description - * @param {Function|*} [fn] - custom option processing function or default vaue - * @param {*} [defaultValue] - * @return {Command} for chaining - * @api public - */ - -Command.prototype.option = function(flags, description, fn, defaultValue) { - return this._optionEx({}, flags, description, fn, defaultValue); -}; - -/* - * Add a required option which must have a value after parsing. This usually means - * the option must be specified on the command line. (Otherwise the same as .option().) - * - * The `flags` string should contain both the short and long flags, separated by comma, a pipe or space. - * - * @param {String} flags - * @param {String} description - * @param {Function|*} [fn] - custom option processing function or default vaue - * @param {*} [defaultValue] - * @return {Command} for chaining - * @api public - */ - -Command.prototype.requiredOption = function(flags, description, fn, defaultValue) { - return this._optionEx({ mandatory: true }, flags, description, fn, defaultValue); -}; - -/** - * Allow unknown options on the command line. - * - * @param {Boolean} arg if `true` or omitted, no error will be thrown - * for unknown options. - * @api public - */ -Command.prototype.allowUnknownOption = function(arg) { - this._allowUnknownOption = arguments.length === 0 || arg; - return this; -}; - -/** - * Whether to store option values as properties on command object, - * or store separately (specify false). In both cases the option values can be accessed using .opts(). - * - * @param {boolean} value - * @return {Command} Command for chaining - * @api public - */ - -Command.prototype.storeOptionsAsProperties = function(value) { - this._storeOptionsAsProperties = (value === undefined) || value; - if (this.options.length) { - // This is for programmer, not end user. - console.error('Commander usage error: call storeOptionsAsProperties before adding options'); - } - return this; -}; - -/** - * Whether to pass command to action handler, - * or just the options (specify false). - * - * @param {boolean} value - * @return {Command} Command for chaining - * @api public - */ - -Command.prototype.passCommandToAction = function(value) { - this._passCommandToAction = (value === undefined) || value; - return this; -}; - -/** - * Store option value - * - * @param {String} key - * @param {Object} value - * @api private - */ - -Command.prototype._setOptionValue = function(key, value) { - if (this._storeOptionsAsProperties) { - this[key] = value; - } else { - this._optionValues[key] = value; - } -}; - -/** - * Retrieve option value - * - * @param {String} key - * @return {Object} value - * @api private - */ - -Command.prototype._getOptionValue = function(key) { - if (this._storeOptionsAsProperties) { - return this[key]; - } - return this._optionValues[key]; -}; - -/** - * Parse `argv`, setting options and invoking commands when defined. - * - * @param {Array} argv - * @return {Command} for chaining - * @api public - */ - -Command.prototype.parse = function(argv) { - // implicit help - if (this.executables) this.addImplicitHelpCommand(); - - // store raw args - this.rawArgs = argv; - - // guess name - this._name = this._name || basename(argv[1], '.js'); - - // github-style sub-commands with no sub-command - if (this.executables && argv.length < 3 && !this.defaultExecutable) { - // this user needs help - argv.push(this._helpLongFlag); - } - - // process argv - var normalized = this.normalize(argv.slice(2)); - var parsed = this.parseOptions(normalized); - var args = this.args = parsed.args; - - var result = this.parseArgs(this.args, parsed.unknown); - - if (args[0] === 'help' && args.length === 1) this.help(); - - // Note for future: we could return early if we found an action handler in parseArgs, as none of following code needed? - - // --help - if (args[0] === 'help') { - args[0] = args[1]; - args[1] = this._helpLongFlag; - } else { - // If calling through to executable subcommand we could check for help flags before failing, - // but a somewhat unlikely case since program options not passed to executable subcommands. - // Wait for reports to see if check needed and what usage pattern is. - this._checkForMissingMandatoryOptions(); - } - - // executable sub-commands - // (Debugging note for future: args[0] is not right if an action has been called) - var name = result.args[0]; - var subCommand = null; - - // Look for subcommand - if (name) { - subCommand = this.commands.find(function(command) { - return command._name === name; - }); - } - - // Look for alias - if (!subCommand && name) { - subCommand = this.commands.find(function(command) { - return command.alias() === name; - }); - if (subCommand) { - name = subCommand._name; - args[0] = name; - } - } - - // Look for default subcommand - if (!subCommand && this.defaultExecutable) { - name = this.defaultExecutable; - args.unshift(name); - subCommand = this.commands.find(function(command) { - return command._name === name; - }); - } - - if (this._execs.has(name)) { - return this.executeSubCommand(argv, args, parsed.unknown, subCommand ? subCommand._executableFile : undefined); - } - - return result; -}; - -/** - * Parse `argv`, setting options and invoking commands when defined. - * - * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise. - * - * @param {Array} argv - * @return {Promise} - * @api public - */ -Command.prototype.parseAsync = function(argv) { - this.parse(argv); - return Promise.all(this._actionResults); -}; - -/** - * Execute a sub-command executable. - * - * @param {Array} argv - * @param {Array} args - * @param {Array} unknown - * @param {String} executableFile - * @api private - */ - -Command.prototype.executeSubCommand = function(argv, args, unknown, executableFile) { - args = args.concat(unknown); - - if (!args.length) this.help(); - - var isExplicitJS = false; // Whether to use node to launch "executable" - - // executable - var pm = argv[1]; - // name of the subcommand, like `pm-install` - var bin = basename(pm, path.extname(pm)) + '-' + args[0]; - if (executableFile != null) { - bin = executableFile; - // Check for same extensions as we scan for below so get consistent launch behaviour. - var executableExt = path.extname(executableFile); - isExplicitJS = executableExt === '.js' || executableExt === '.ts' || executableExt === '.mjs'; - } - - // In case of globally installed, get the base dir where executable - // subcommand file should be located at - var baseDir; - - var resolvedLink = fs.realpathSync(pm); - - baseDir = dirname(resolvedLink); - - // prefer local `./` to bin in the $PATH - var localBin = path.join(baseDir, bin); - - // whether bin file is a js script with explicit `.js` or `.ts` extension - if (exists(localBin + '.js')) { - bin = localBin + '.js'; - isExplicitJS = true; - } else if (exists(localBin + '.ts')) { - bin = localBin + '.ts'; - isExplicitJS = true; - } else if (exists(localBin + '.mjs')) { - bin = localBin + '.mjs'; - isExplicitJS = true; - } else if (exists(localBin)) { - bin = localBin; - } - - args = args.slice(1); - - var proc; - if (process.platform !== 'win32') { - if (isExplicitJS) { - args.unshift(bin); - // add executable arguments to spawn - args = incrementNodeInspectorPort(process.execArgv).concat(args); - - proc = spawn(process.argv[0], args, { stdio: 'inherit' }); - } else { - proc = spawn(bin, args, { stdio: 'inherit' }); - } - } else { - args.unshift(bin); - // add executable arguments to spawn - args = incrementNodeInspectorPort(process.execArgv).concat(args); - proc = spawn(process.execPath, args, { stdio: 'inherit' }); - } - - var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP']; - signals.forEach(function(signal) { - process.on(signal, function() { - if (proc.killed === false && proc.exitCode === null) { - proc.kill(signal); - } - }); - }); - - // By default terminate process when spawned process terminates. - // Suppressing the exit if exitCallback defined is a bit messy and of limited use, but does allow process to stay running! - const exitCallback = this._exitCallback; - if (!exitCallback) { - proc.on('close', process.exit.bind(process)); - } else { - proc.on('close', () => { - exitCallback(new CommanderError(process.exitCode || 0, 'commander.executeSubCommandAsync', '(close)')); - }); - } - proc.on('error', function(err) { - if (err.code === 'ENOENT') { - console.error('error: %s(1) does not exist, try --help', bin); - } else if (err.code === 'EACCES') { - console.error('error: %s(1) not executable. try chmod or run with root', bin); - } - if (!exitCallback) { - process.exit(1); - } else { - const wrappedError = new CommanderError(1, 'commander.executeSubCommandAsync', '(error)'); - wrappedError.nestedError = err; - exitCallback(wrappedError); - } - }); - - // Store the reference to the child process - this.runningCommand = proc; -}; - -/** - * Normalize `args`, splitting joined short flags. For example - * the arg "-abc" is equivalent to "-a -b -c". - * This also normalizes equal sign and splits "--abc=def" into "--abc def". - * - * @param {Array} args - * @return {Array} - * @api private - */ - -Command.prototype.normalize = function(args) { - var ret = [], - arg, - lastOpt, - index, - short, - opt; - - for (var i = 0, len = args.length; i < len; ++i) { - arg = args[i]; - if (i > 0) { - lastOpt = this.optionFor(args[i - 1]); - } - - if (arg === '--') { - // Honor option terminator - ret = ret.concat(args.slice(i)); - break; - } else if (lastOpt && lastOpt.required) { - ret.push(arg); - } else if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') { - short = arg.slice(0, 2); - opt = this.optionFor(short); - if (opt && (opt.required || opt.optional)) { - ret.push(short); - ret.push(arg.slice(2)); - } else { - arg.slice(1).split('').forEach(function(c) { - ret.push('-' + c); - }); - } - } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) { - ret.push(arg.slice(0, index), arg.slice(index + 1)); - } else { - ret.push(arg); - } - } - - return ret; -}; - -/** - * Parse command `args`. - * - * When listener(s) are available those - * callbacks are invoked, otherwise the "*" - * event is emitted and those actions are invoked. - * - * @param {Array} args - * @return {Command} for chaining - * @api private - */ - -Command.prototype.parseArgs = function(args, unknown) { - var name; - - if (args.length) { - name = args[0]; - if (this.listeners('command:' + name).length) { - this.emit('command:' + args.shift(), args, unknown); - } else { - this.emit('command:*', args, unknown); - } - } else { - outputHelpIfRequested(this, unknown); - - // If there were no args and we have unknown options, - // then they are extraneous and we need to error. - if (unknown.length > 0 && !this.defaultExecutable) { - this.unknownOption(unknown[0]); - } - if (this.commands.length === 0 && - this._args.filter(function(a) { return a.required; }).length === 0) { - this.emit('command:*'); - } - } - - return this; -}; - -/** - * Return an option matching `arg` if any. - * - * @param {String} arg - * @return {Option} - * @api private - */ - -Command.prototype.optionFor = function(arg) { - for (var i = 0, len = this.options.length; i < len; ++i) { - if (this.options[i].is(arg)) { - return this.options[i]; - } - } -}; - -/** - * Display an error message if a mandatory option does not have a value. - * - * @api private - */ - -Command.prototype._checkForMissingMandatoryOptions = function() { - // Walk up hierarchy so can call from action handler after checking for displaying help. - for (var cmd = this; cmd; cmd = cmd.parent) { - cmd.options.forEach((anOption) => { - if (anOption.mandatory && (cmd._getOptionValue(anOption.attributeName()) === undefined)) { - cmd.missingMandatoryOptionValue(anOption); - } - }); - } -}; - -/** - * Parse options from `argv` returning `argv` - * void of these options. - * - * @param {Array} argv - * @return {{args: Array, unknown: Array}} - * @api public - */ - -Command.prototype.parseOptions = function(argv) { - var args = [], - len = argv.length, - literal, - option, - arg; - - var unknownOptions = []; - - // parse options - for (var i = 0; i < len; ++i) { - arg = argv[i]; - - // literal args after -- - if (literal) { - args.push(arg); - continue; - } - - if (arg === '--') { - literal = true; - continue; - } - - // find matching Option - option = this.optionFor(arg); - - // option is defined - if (option) { - // requires arg - if (option.required) { - arg = argv[++i]; - if (arg == null) return this.optionMissingArgument(option); - this.emit('option:' + option.name(), arg); - // optional arg - } else if (option.optional) { - arg = argv[i + 1]; - if (arg == null || (arg[0] === '-' && arg !== '-')) { - arg = null; - } else { - ++i; - } - this.emit('option:' + option.name(), arg); - // flag - } else { - this.emit('option:' + option.name()); - } - continue; - } - - // looks like an option - if (arg.length > 1 && arg[0] === '-') { - unknownOptions.push(arg); - - // If the next argument looks like it might be - // an argument for this option, we pass it on. - // If it isn't, then it'll simply be ignored - if ((i + 1) < argv.length && (argv[i + 1][0] !== '-' || argv[i + 1] === '-')) { - unknownOptions.push(argv[++i]); - } - continue; - } - - // arg - args.push(arg); - } - - return { args: args, unknown: unknownOptions }; -}; - -/** - * Return an object containing options as key-value pairs - * - * @return {Object} - * @api public - */ -Command.prototype.opts = function() { - if (this._storeOptionsAsProperties) { - // Preserve original behaviour so backwards compatible when still using properties - var result = {}, - len = this.options.length; - - for (var i = 0; i < len; i++) { - var key = this.options[i].attributeName(); - result[key] = key === this._versionOptionName ? this._version : this[key]; - } - return result; - } - - return this._optionValues; -}; - -/** - * Argument `name` is missing. - * - * @param {String} name - * @api private - */ - -Command.prototype.missingArgument = function(name) { - const message = `error: missing required argument '${name}'`; - console.error(message); - this._exit(1, 'commander.missingArgument', message); -}; - -/** - * `Option` is missing an argument, but received `flag` or nothing. - * - * @param {Option} option - * @param {String} [flag] - * @api private - */ - -Command.prototype.optionMissingArgument = function(option, flag) { - let message; - if (flag) { - message = `error: option '${option.flags}' argument missing, got '${flag}'`; - } else { - message = `error: option '${option.flags}' argument missing`; - } - console.error(message); - this._exit(1, 'commander.optionMissingArgument', message); -}; - -/** - * `Option` does not have a value, and is a mandatory option. - * - * @param {Option} option - * @api private - */ - -Command.prototype.missingMandatoryOptionValue = function(option) { - const message = `error: required option '${option.flags}' not specified`; - console.error(message); - this._exit(1, 'commander.missingMandatoryOptionValue', message); -}; - -/** - * Unknown option `flag`. - * - * @param {String} flag - * @api private - */ - -Command.prototype.unknownOption = function(flag) { - if (this._allowUnknownOption) return; - const message = `error: unknown option '${flag}'`; - console.error(message); - this._exit(1, 'commander.unknownOption', message); -}; - -/** - * Variadic argument with `name` is not the last argument as required. - * - * @param {String} name - * @api private - */ - -Command.prototype.variadicArgNotLast = function(name) { - const message = `error: variadic arguments must be last '${name}'`; - console.error(message); - this._exit(1, 'commander.variadicArgNotLast', message); -}; - -/** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * You can optionally supply the flags and description to override the defaults. - * - * @param {String} str - * @param {String} [flags] - * @param {String} [description] - * @return {Command} for chaining - * @api public - */ - -Command.prototype.version = function(str, flags, description) { - if (arguments.length === 0) return this._version; - this._version = str; - flags = flags || '-V, --version'; - description = description || 'output the version number'; - var versionOption = new Option(flags, description); - this._versionOptionName = versionOption.long.substr(2) || 'version'; - this.options.push(versionOption); - var self = this; - this.on('option:' + this._versionOptionName, function() { - process.stdout.write(str + '\n'); - self._exit(0, 'commander.version', str); - }); - return this; -}; - -/** - * Set the description to `str`. - * - * @param {String} str - * @param {Object} [argsDescription] - * @return {String|Command} - * @api public - */ - -Command.prototype.description = function(str, argsDescription) { - if (arguments.length === 0) return this._description; - this._description = str; - this._argsDescription = argsDescription; - return this; -}; - -/** - * Set an alias for the command - * - * @param {String} alias - * @return {String|Command} - * @api public - */ - -Command.prototype.alias = function(alias) { - var command = this; - if (this.commands.length !== 0) { - command = this.commands[this.commands.length - 1]; - } - - if (arguments.length === 0) return command._alias; - - if (alias === command._name) throw new Error('Command alias can\'t be the same as its name'); - - command._alias = alias; - return this; -}; - -/** - * Set / get the command usage `str`. - * - * @param {String} [str] - * @return {String|Command} - * @api public - */ - -Command.prototype.usage = function(str) { - var args = this._args.map(function(arg) { - return humanReadableArgName(arg); - }); - - var usage = '[options]' + - (this.commands.length ? ' [command]' : '') + - (this._args.length ? ' ' + args.join(' ') : ''); - - if (arguments.length === 0) return this._usage || usage; - this._usage = str; - - return this; -}; - -/** - * Get or set the name of the command - * - * @param {String} [str] - * @return {String|Command} - * @api public - */ - -Command.prototype.name = function(str) { - if (arguments.length === 0) return this._name; - this._name = str; - return this; -}; - -/** - * Return prepared commands. - * - * @return {Array} - * @api private - */ - -Command.prototype.prepareCommands = function() { - return this.commands.filter(function(cmd) { - return !cmd._noHelp; - }).map(function(cmd) { - var args = cmd._args.map(function(arg) { - return humanReadableArgName(arg); - }).join(' '); - - return [ - cmd._name + - (cmd._alias ? '|' + cmd._alias : '') + - (cmd.options.length ? ' [options]' : '') + - (args ? ' ' + args : ''), - cmd._description - ]; - }); -}; - -/** - * Return the largest command length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestCommandLength = function() { - var commands = this.prepareCommands(); - return commands.reduce(function(max, command) { - return Math.max(max, command[0].length); - }, 0); -}; - -/** - * Return the largest option length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestOptionLength = function() { - var options = [].slice.call(this.options); - options.push({ - flags: this._helpFlags - }); - - return options.reduce(function(max, option) { - return Math.max(max, option.flags.length); - }, 0); -}; - -/** - * Return the largest arg length. - * - * @return {Number} - * @api private - */ - -Command.prototype.largestArgLength = function() { - return this._args.reduce(function(max, arg) { - return Math.max(max, arg.name.length); - }, 0); -}; - -/** - * Return the pad width. - * - * @return {Number} - * @api private - */ - -Command.prototype.padWidth = function() { - var width = this.largestOptionLength(); - if (this._argsDescription && this._args.length) { - if (this.largestArgLength() > width) { - width = this.largestArgLength(); - } - } - - if (this.commands && this.commands.length) { - if (this.largestCommandLength() > width) { - width = this.largestCommandLength(); - } - } - - return width; -}; - -/** - * Return help for options. - * - * @return {String} - * @api private - */ - -Command.prototype.optionHelp = function() { - var width = this.padWidth(); - - var columns = process.stdout.columns || 80; - var descriptionWidth = columns - width - 4; - - // Append the help information - return this.options.map(function(option) { - const fullDesc = option.description + - ((!option.negate && option.defaultValue !== undefined) ? ' (default: ' + JSON.stringify(option.defaultValue) + ')' : ''); - return pad(option.flags, width) + ' ' + optionalWrap(fullDesc, descriptionWidth, width + 2); - }).concat([pad(this._helpFlags, width) + ' ' + optionalWrap(this._helpDescription, descriptionWidth, width + 2)]) - .join('\n'); -}; - -/** - * Return command help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.commandHelp = function() { - if (!this.commands.length) return ''; - - var commands = this.prepareCommands(); - var width = this.padWidth(); - - var columns = process.stdout.columns || 80; - var descriptionWidth = columns - width - 4; - - return [ - 'Commands:', - commands.map(function(cmd) { - var desc = cmd[1] ? ' ' + cmd[1] : ''; - return (desc ? pad(cmd[0], width) : cmd[0]) + optionalWrap(desc, descriptionWidth, width + 2); - }).join('\n').replace(/^/gm, ' '), - '' - ].join('\n'); -}; - -/** - * Return program help documentation. - * - * @return {String} - * @api private - */ - -Command.prototype.helpInformation = function() { - var desc = []; - if (this._description) { - desc = [ - this._description, - '' - ]; - - var argsDescription = this._argsDescription; - if (argsDescription && this._args.length) { - var width = this.padWidth(); - var columns = process.stdout.columns || 80; - var descriptionWidth = columns - width - 5; - desc.push('Arguments:'); - desc.push(''); - this._args.forEach(function(arg) { - desc.push(' ' + pad(arg.name, width) + ' ' + wrap(argsDescription[arg.name], descriptionWidth, width + 4)); - }); - desc.push(''); - } - } - - var cmdName = this._name; - if (this._alias) { - cmdName = cmdName + '|' + this._alias; - } - var parentCmdNames = ''; - for (var parentCmd = this.parent; parentCmd; parentCmd = parentCmd.parent) { - parentCmdNames = parentCmd.name() + ' ' + parentCmdNames; - } - var usage = [ - 'Usage: ' + parentCmdNames + cmdName + ' ' + this.usage(), - '' - ]; - - var cmds = []; - var commandHelp = this.commandHelp(); - if (commandHelp) cmds = [commandHelp]; - - var options = [ - 'Options:', - '' + this.optionHelp().replace(/^/gm, ' '), - '' - ]; - - return usage - .concat(desc) - .concat(options) - .concat(cmds) - .join('\n'); -}; - -/** - * Output help information for this command. - * - * When listener(s) are available for the helpLongFlag - * those callbacks are invoked. - * - * @api public - */ - -Command.prototype.outputHelp = function(cb) { - if (!cb) { - cb = function(passthru) { - return passthru; - }; - } - const cbOutput = cb(this.helpInformation()); - if (typeof cbOutput !== 'string' && !Buffer.isBuffer(cbOutput)) { - throw new Error('outputHelp callback must return a string or a Buffer'); - } - process.stdout.write(cbOutput); - this.emit(this._helpLongFlag); -}; - -/** - * You can pass in flags and a description to override the help - * flags and help description for your command. - * - * @param {String} [flags] - * @param {String} [description] - * @return {Command} - * @api public - */ - -Command.prototype.helpOption = function(flags, description) { - this._helpFlags = flags || this._helpFlags; - this._helpDescription = description || this._helpDescription; - - var splitFlags = this._helpFlags.split(/[ ,|]+/); - - if (splitFlags.length > 1) this._helpShortFlag = splitFlags.shift(); - - this._helpLongFlag = splitFlags.shift(); - - return this; -}; - -/** - * Output help information and exit. - * - * @param {Function} [cb] - * @api public - */ - -Command.prototype.help = function(cb) { - this.outputHelp(cb); - // exitCode: preserving original behaviour which was calling process.exit() - // message: do not have all displayed text available so only passing placeholder. - this._exit(process.exitCode || 0, 'commander.help', '(outputHelp)'); -}; - -/** - * Camel-case the given `flag` - * - * @param {String} flag - * @return {String} - * @api private - */ - -function camelcase(flag) { - return flag.split('-').reduce(function(str, word) { - return str + word[0].toUpperCase() + word.slice(1); - }); -} - -/** - * Pad `str` to `width`. - * - * @param {String} str - * @param {Number} width - * @return {String} - * @api private - */ - -function pad(str, width) { - var len = Math.max(0, width - str.length); - return str + Array(len + 1).join(' '); -} - -/** - * Wraps the given string with line breaks at the specified width while breaking - * words and indenting every but the first line on the left. - * - * @param {String} str - * @param {Number} width - * @param {Number} indent - * @return {String} - * @api private - */ -function wrap(str, width, indent) { - var regex = new RegExp('.{1,' + (width - 1) + '}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)', 'g'); - var lines = str.match(regex) || []; - return lines.map(function(line, i) { - if (line.slice(-1) === '\n') { - line = line.slice(0, line.length - 1); - } - return ((i > 0 && indent) ? Array(indent + 1).join(' ') : '') + line.trimRight(); - }).join('\n'); -} - -/** - * Optionally wrap the given str to a max width of width characters per line - * while indenting with indent spaces. Do not wrap if insufficient width or - * string is manually formatted. - * - * @param {String} str - * @param {Number} width - * @param {Number} indent - * @return {String} - * @api private - */ -function optionalWrap(str, width, indent) { - // Detect manually wrapped and indented strings by searching for line breaks - // followed by multiple spaces/tabs. - if (str.match(/[\n]\s+/)) return str; - // Do not wrap to narrow columns (or can end up with a word per line). - const minWidth = 40; - if (width < minWidth) return str; - - return wrap(str, width, indent); -} - -/** - * Output help information if help flags specified - * - * @param {Command} cmd - command to output help for - * @param {Array} options - array of options to search for -h or --help - * @api private - */ - -function outputHelpIfRequested(cmd, options) { - options = options || []; - - for (var i = 0; i < options.length; i++) { - if (options[i] === cmd._helpLongFlag || options[i] === cmd._helpShortFlag) { - cmd.outputHelp(); - // (Do not have all displayed text available so only passing placeholder.) - cmd._exit(0, 'commander.helpDisplayed', '(outputHelp)'); - } - } -} - -/** - * Takes an argument and returns its human readable equivalent for help usage. - * - * @param {Object} arg - * @return {String} - * @api private - */ - -function humanReadableArgName(arg) { - var nameOutput = arg.name + (arg.variadic === true ? '...' : ''); - - return arg.required - ? '<' + nameOutput + '>' - : '[' + nameOutput + ']'; -} - -// for versions before node v0.8 when there weren't `fs.existsSync` -function exists(file) { - try { - if (fs.statSync(file).isFile()) { - return true; - } - } catch (e) { - return false; - } -} - -/** - * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command). - * - * @param {string[]} args - array of arguments from node.execArgv - * @returns {string[]} - * @api private - */ - -function incrementNodeInspectorPort(args) { - // Testing for these options: - // --inspect[=[host:]port] - // --inspect-brk[=[host:]port] - // --inspect-port=[host:]port - return args.map((arg) => { - var result = arg; - if (arg.indexOf('--inspect') === 0) { - var debugOption; - var debugHost = '127.0.0.1'; - var debugPort = '9229'; - var match; - if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) { - // e.g. --inspect - debugOption = match[1]; - } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) { - debugOption = match[1]; - if (/^\d+$/.test(match[3])) { - // e.g. --inspect=1234 - debugPort = match[3]; - } else { - // e.g. --inspect=localhost - debugHost = match[3]; - } - } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) { - // e.g. --inspect=localhost:1234 - debugOption = match[1]; - debugHost = match[3]; - debugPort = match[4]; - } - - if (debugOption && debugPort !== '0') { - result = `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`; - } - } - return result; - }); -} diff --git a/node_modules/commander/package.json b/node_modules/commander/package.json deleted file mode 100644 index e4781e5..0000000 --- a/node_modules/commander/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "commander", - "version": "4.1.1", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "commander", - "command", - "option", - "parser" - ], - "author": "TJ Holowaychuk ", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/tj/commander.js.git" - }, - "scripts": { - "lint": "eslint index.js \"tests/**/*.js\"", - "test": "jest && npm run test-typings", - "test-typings": "tsc -p tsconfig.json" - }, - "main": "index", - "files": [ - "index.js", - "typings/index.d.ts" - ], - "dependencies": {}, - "devDependencies": { - "@types/jest": "^24.0.23", - "@types/node": "^12.12.11", - "eslint": "^6.7.0", - "eslint-plugin-jest": "^22.21.0", - "jest": "^24.8.0", - "standard": "^14.3.1", - "typescript": "^3.7.2" - }, - "typings": "typings/index.d.ts", - "engines": { - "node": ">= 6" - } -} diff --git a/node_modules/commander/typings/index.d.ts b/node_modules/commander/typings/index.d.ts deleted file mode 100644 index 082a3a3..0000000 --- a/node_modules/commander/typings/index.d.ts +++ /dev/null @@ -1,311 +0,0 @@ -// Type definitions for commander -// Original definitions by: Alan Agius , Marcelo Dezem , vvakame , Jules Randolph - -/// - -declare namespace commander { - - interface CommanderError extends Error { - code: string; - exitCode: number; - message: string; - nestedError?: string; - } - type CommanderErrorConstructor = { new (exitCode: number, code: string, message: string): CommanderError }; - - interface Option { - flags: string; - required: boolean; // A value must be supplied when the option is specified. - optional: boolean; // A value is optional when the option is specified. - mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line. - bool: boolean; - short?: string; - long: string; - description: string; - } - type OptionConstructor = { new (flags: string, description?: string): Option }; - - interface Command extends NodeJS.EventEmitter { - [key: string]: any; // options as properties - - args: string[]; - - /** - * Set the program version to `str`. - * - * This method auto-registers the "-V, --version" flag - * which will print the version number when passed. - * - * You can optionally supply the flags and description to override the defaults. - */ - version(str: string, flags?: string, description?: string): Command; - - /** - * Define a command, implemented using an action handler. - * - * @remarks - * The command description is supplied using `.description`, not as a parameter to `.command`. - * - * @example - * ```ts - * program - * .command('clone [destination]') - * .description('clone a repository into a newly created directory') - * .action((source, destination) => { - * console.log('clone command called'); - * }); - * ``` - * - * @param nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...` - * @param opts - configuration options - * @returns new command - */ - command(nameAndArgs: string, opts?: CommandOptions): Command; - /** - * Define a command, implemented in a separate executable file. - * - * @remarks - * The command description is supplied as the second parameter to `.command`. - * - * @example - * ```ts - * program - * .command('start ', 'start named service') - * .command('stop [service]', 'stop named serice, or all if no name supplied'); - * ``` - * - * @param nameAndArgs - command name and arguments, args are `` or `[optional]` and last may also be `variadic...` - * @param description - description of executable command - * @param opts - configuration options - * @returns top level command for chaining more command definitions - */ - command(nameAndArgs: string, description: string, opts?: commander.CommandOptions): Command; - - /** - * Define argument syntax for the top-level command. - * - * @returns Command for chaining - */ - arguments(desc: string): Command; - - /** - * Parse expected `args`. - * - * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`. - * - * @returns Command for chaining - */ - parseExpectedArgs(args: string[]): Command; - - /** - * Register callback to use as replacement for calling process.exit. - */ - exitOverride(callback?: (err: CommanderError) => never|void): Command; - - /** - * Register callback `fn` for the command. - * - * @example - * program - * .command('help') - * .description('display verbose help') - * .action(function() { - * // output help here - * }); - * - * @returns Command for chaining - */ - action(fn: (...args: any[]) => void | Promise): Command; - - /** - * Define option with `flags`, `description` and optional - * coercion `fn`. - * - * The `flags` string should contain both the short and long flags, - * separated by comma, a pipe or space. The following are all valid - * all will output this way when `--help` is used. - * - * "-p, --pepper" - * "-p|--pepper" - * "-p --pepper" - * - * @example - * // simple boolean defaulting to false - * program.option('-p, --pepper', 'add pepper'); - * - * --pepper - * program.pepper - * // => Boolean - * - * // simple boolean defaulting to true - * program.option('-C, --no-cheese', 'remove cheese'); - * - * program.cheese - * // => true - * - * --no-cheese - * program.cheese - * // => false - * - * // required argument - * program.option('-C, --chdir ', 'change the working directory'); - * - * --chdir /tmp - * program.chdir - * // => "/tmp" - * - * // optional argument - * program.option('-c, --cheese [type]', 'add cheese [marble]'); - * - * @returns Command for chaining - */ - option(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command; - option(flags: string, description?: string, defaultValue?: any): Command; - - /** - * Define a required option, which must have a value after parsing. This usually means - * the option must be specified on the command line. (Otherwise the same as .option().) - * - * The `flags` string should contain both the short and long flags, separated by comma, a pipe or space. - */ - requiredOption(flags: string, description?: string, fn?: ((arg1: any, arg2: any) => void) | RegExp, defaultValue?: any): Command; - requiredOption(flags: string, description?: string, defaultValue?: any): Command; - - - /** - * Whether to store option values as properties on command object, - * or store separately (specify false). In both cases the option values can be accessed using .opts(). - * - * @return Command for chaining - */ - storeOptionsAsProperties(value?: boolean): Command; - - /** - * Whether to pass command to action handler, - * or just the options (specify false). - * - * @return Command for chaining - */ - passCommandToAction(value?: boolean): Command; - - /** - * Allow unknown options on the command line. - * - * @param [arg] if `true` or omitted, no error will be thrown for unknown options. - * @returns Command for chaining - */ - allowUnknownOption(arg?: boolean): Command; - - /** - * Parse `argv`, setting options and invoking commands when defined. - * - * @returns Command for chaining - */ - parse(argv: string[]): Command; - - /** - * Parse `argv`, setting options and invoking commands when defined. - * - * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise. - * - * @returns Promise - */ - parseAsync(argv: string[]): Promise; - - /** - * Parse options from `argv` returning `argv` void of these options. - */ - parseOptions(argv: string[]): commander.ParseOptionsResult; - - /** - * Return an object containing options as key-value pairs - */ - opts(): { [key: string]: any }; - - /** - * Set the description. - * - * @returns Command for chaining - */ - description(str: string, argsDescription?: {[argName: string]: string}): Command; - /** - * Get the description. - */ - description(): string; - - /** - * Set an alias for the command. - * - * @returns Command for chaining - */ - alias(alias: string): Command; - /** - * Get alias for the command. - */ - alias(): string; - - /** - * Set the command usage. - * - * @returns Command for chaining - */ - usage(str: string): Command; - /** - * Get the command usage. - */ - usage(): string; - - /** - * Set the name of the command. - * - * @returns Command for chaining - */ - name(str: string): Command; - /** - * Get the name of the command. - */ - name(): string; - - /** - * Output help information for this command. - * - * When listener(s) are available for the helpLongFlag - * those callbacks are invoked. - */ - outputHelp(cb?: (str: string) => string): void; - - /** - * You can pass in flags and a description to override the help - * flags and help description for your command. - */ - helpOption(flags?: string, description?: string): Command; - - /** - * Output help information and exit. - */ - help(cb?: (str: string) => string): never; - } - type CommandConstructor = { new (name?: string): Command }; - - - interface CommandOptions { - noHelp?: boolean; - isDefault?: boolean; - executableFile?: string; - } - - interface ParseOptionsResult { - args: string[]; - unknown: string[]; - } - - interface CommanderStatic extends Command { - Command: CommandConstructor; - Option: OptionConstructor; - CommanderError:CommanderErrorConstructor; - } - -} - -declare const commander: commander.CommanderStatic; -export = commander; diff --git a/node_modules/cssesc/LICENSE-MIT.txt b/node_modules/cssesc/LICENSE-MIT.txt deleted file mode 100644 index a41e0a7..0000000 --- a/node_modules/cssesc/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/cssesc/README.md b/node_modules/cssesc/README.md deleted file mode 100644 index 58fb8fe..0000000 --- a/node_modules/cssesc/README.md +++ /dev/null @@ -1,201 +0,0 @@ -# cssesc [![Build status](https://travis-ci.org/mathiasbynens/cssesc.svg?branch=master)](https://travis-ci.org/mathiasbynens/cssesc) [![Code coverage status](https://img.shields.io/codecov/c/github/mathiasbynens/cssesc.svg)](https://codecov.io/gh/mathiasbynens/cssesc) - -A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output. - -This is a JavaScript library for [escaping text for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes) while generating the shortest possible valid ASCII-only output. [Here’s an online demo.](https://mothereff.in/css-escapes) - -[A polyfill for the CSSOM `CSS.escape()` method is available in a separate repository.](https://mths.be/cssescape) (In comparison, _cssesc_ is much more powerful.) - -Feel free to fork if you see possible improvements! - -## Installation - -Via [npm](https://www.npmjs.com/): - -```bash -npm install cssesc -``` - -In a browser: - -```html - -``` - -In [Node.js](https://nodejs.org/): - -```js -const cssesc = require('cssesc'); -``` - -In Ruby using [the `ruby-cssesc` wrapper gem](https://github.com/borodean/ruby-cssesc): - -```bash -gem install ruby-cssesc -``` - -```ruby -require 'ruby-cssesc' -CSSEsc.escape('I ♥ Ruby', is_identifier: true) -``` - -In Sass using [`sassy-escape`](https://github.com/borodean/sassy-escape): - -```bash -gem install sassy-escape -``` - -```scss -body { - content: escape('I ♥ Sass', $is-identifier: true); -} -``` - -## API - -### `cssesc(value, options)` - -This function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes). - -```js -cssesc('Ich ♥ Bücher'); -// → 'Ich \\2665 B\\FC cher' - -cssesc('foo 𝌆 bar'); -// → 'foo \\1D306 bar' -``` - -By default, `cssesc` returns a string that can be used as part of a CSS string. If the target is a CSS identifier rather than a CSS string, use the `isIdentifier: true` setting (see below). - -The optional `options` argument accepts an object with the following options: - -#### `isIdentifier` - -The default value for the `isIdentifier` option is `false`. This means that the input text will be escaped for use in a CSS string literal. If you want to use the result as a CSS identifier instead (in a selector, for example), set this option to `true`. - -```js -cssesc('123a2b'); -// → '123a2b' - -cssesc('123a2b', { - 'isIdentifier': true -}); -// → '\\31 23a2b' -``` - -#### `quotes` - -The default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input text will be escaped as `\'`, so that the output can be used in a CSS string literal wrapped in single quotes. - -```js -cssesc('Lorem ipsum "dolor" sit \'amet\' etc.'); -// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' -// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc." - -cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { - 'quotes': 'single' -}); -// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' -// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc." -``` - -If you want to use the output as part of a CSS string literal wrapped in double quotes, set the `quotes` option to `'double'`. - -```js -cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { - 'quotes': 'double' -}); -// → 'Lorem ipsum \\"dolor\\" sit \'amet\' etc.' -// → "Lorem ipsum \\\"dolor\\\" sit 'amet' etc." -``` - -#### `wrap` - -The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid CSS string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting. - -```js -cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { - 'quotes': 'single', - 'wrap': true -}); -// → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\'' -// → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'" - -cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', { - 'quotes': 'double', - 'wrap': true -}); -// → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."' -// → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\"" -``` - -#### `escapeEverything` - -The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols. - -```js -cssesc('lolwat"foo\'bar', { - 'escapeEverything': true -}); -// → '\\6C\\6F\\6C\\77\\61\\74\\"\\66\\6F\\6F\\\'\\62\\61\\72' -// → "\\6C\\6F\\6C\\77\\61\\74\\\"\\66\\6F\\6F\\'\\62\\61\\72" -``` - -#### Overriding the default options globally - -The global default settings can be overridden by modifying the `css.options` object. This saves you from passing in an `options` object for every call to `encode` if you want to use the non-default setting. - -```js -// Read the global default setting for `escapeEverything`: -cssesc.options.escapeEverything; -// → `false` by default - -// Override the global default setting for `escapeEverything`: -cssesc.options.escapeEverything = true; - -// Using the global default setting for `escapeEverything`, which is now `true`: -cssesc('foo © bar ≠ baz 𝌆 qux'); -// → '\\66\\6F\\6F\\ \\A9\\ \\62\\61\\72\\ \\2260\\ \\62\\61\\7A\\ \\1D306\\ \\71\\75\\78' -``` - -### `cssesc.version` - -A string representing the semantic version number. - -### Using the `cssesc` binary - -To use the `cssesc` binary in your shell, simply install cssesc globally using npm: - -```bash -npm install -g cssesc -``` - -After that you will be able to escape text for use in CSS strings or identifiers from the command line: - -```bash -$ cssesc 'föo ♥ bår 𝌆 baz' -f\F6o \2665 b\E5r \1D306 baz -``` - -If the output needs to be a CSS identifier rather than part of a string literal, use the `-i`/`--identifier` option: - -```bash -$ cssesc --identifier 'föo ♥ bår 𝌆 baz' -f\F6o\ \2665\ b\E5r\ \1D306\ baz -``` - -See `cssesc --help` for the full list of options. - -## Support - -This library supports the Node.js and browser versions mentioned in [`.babelrc`](https://github.com/mathiasbynens/cssesc/blob/master/.babelrc). For a version that supports a wider variety of legacy browsers and environments out-of-the-box, [see v0.1.0](https://github.com/mathiasbynens/cssesc/releases/tag/v0.1.0). - -## Author - -| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | -|---| -| [Mathias Bynens](https://mathiasbynens.be/) | - -## License - -This library is available under the [MIT](https://mths.be/mit) license. diff --git a/node_modules/cssesc/bin/cssesc b/node_modules/cssesc/bin/cssesc deleted file mode 100755 index 188c034..0000000 --- a/node_modules/cssesc/bin/cssesc +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env node -const fs = require('fs'); -const cssesc = require('../cssesc.js'); -const strings = process.argv.splice(2); -const stdin = process.stdin; -const options = {}; -const log = console.log; - -const main = function() { - const option = strings[0]; - - if (/^(?:-h|--help|undefined)$/.test(option)) { - log( - 'cssesc v%s - https://mths.be/cssesc', - cssesc.version - ); - log([ - '\nUsage:\n', - '\tcssesc [string]', - '\tcssesc [-i | --identifier] [string]', - '\tcssesc [-s | --single-quotes] [string]', - '\tcssesc [-d | --double-quotes] [string]', - '\tcssesc [-w | --wrap] [string]', - '\tcssesc [-e | --escape-everything] [string]', - '\tcssesc [-v | --version]', - '\tcssesc [-h | --help]', - '\nExamples:\n', - '\tcssesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', - '\tcssesc --identifier \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', - '\tcssesc --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', - '\tcssesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'', - '\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | cssesc' - ].join('\n')); - return process.exit(1); - } - - if (/^(?:-v|--version)$/.test(option)) { - log('v%s', cssesc.version); - return process.exit(1); - } - - strings.forEach(function(string) { - // Process options - if (/^(?:-i|--identifier)$/.test(string)) { - options.isIdentifier = true; - return; - } - if (/^(?:-s|--single-quotes)$/.test(string)) { - options.quotes = 'single'; - return; - } - if (/^(?:-d|--double-quotes)$/.test(string)) { - options.quotes = 'double'; - return; - } - if (/^(?:-w|--wrap)$/.test(string)) { - options.wrap = true; - return; - } - if (/^(?:-e|--escape-everything)$/.test(string)) { - options.escapeEverything = true; - return; - } - - // Process string(s) - let result; - try { - result = cssesc(string, options); - log(result); - } catch (exception) { - log(exception.message + '\n'); - log('Error: failed to escape.'); - log('If you think this is a bug in cssesc, please report it:'); - log('https://github.com/mathiasbynens/cssesc/issues/new'); - log( - '\nStack trace using cssesc@%s:\n', - cssesc.version - ); - log(exception.stack); - return process.exit(1); - } - }); - // Return with exit status 0 outside of the `forEach` loop, in case - // multiple strings were passed in. - return process.exit(0); - -}; - -if (stdin.isTTY) { - // handle shell arguments - main(); -} else { - let timeout; - // Either the script is called from within a non-TTY context, or `stdin` - // content is being piped in. - if (!process.stdout.isTTY) { - // The script was called from a non-TTY context. This is a rather uncommon - // use case we don’t actively support. However, we don’t want the script - // to wait forever in such cases, so… - timeout = setTimeout(function() { - // …if no piped data arrived after a whole minute, handle shell - // arguments instead. - main(); - }, 60000); - } - let data = ''; - stdin.on('data', function(chunk) { - clearTimeout(timeout); - data += chunk; - }); - stdin.on('end', function() { - strings.push(data.trim()); - main(); - }); - stdin.resume(); -} diff --git a/node_modules/cssesc/cssesc.js b/node_modules/cssesc/cssesc.js deleted file mode 100644 index 1c0928e..0000000 --- a/node_modules/cssesc/cssesc.js +++ /dev/null @@ -1,110 +0,0 @@ -/*! https://mths.be/cssesc v3.0.0 by @mathias */ -'use strict'; - -var object = {}; -var hasOwnProperty = object.hasOwnProperty; -var merge = function merge(options, defaults) { - if (!options) { - return defaults; - } - var result = {}; - for (var key in defaults) { - // `if (defaults.hasOwnProperty(key) { … }` is not needed here, since - // only recognized option names are used. - result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key]; - } - return result; -}; - -var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/; -var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/; -var regexAlwaysEscape = /['"\\]/; -var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g; - -// https://mathiasbynens.be/notes/css-escapes#css -var cssesc = function cssesc(string, options) { - options = merge(options, cssesc.options); - if (options.quotes != 'single' && options.quotes != 'double') { - options.quotes = 'single'; - } - var quote = options.quotes == 'double' ? '"' : '\''; - var isIdentifier = options.isIdentifier; - - var firstChar = string.charAt(0); - var output = ''; - var counter = 0; - var length = string.length; - while (counter < length) { - var character = string.charAt(counter++); - var codePoint = character.charCodeAt(); - var value = void 0; - // If it’s not a printable ASCII character… - if (codePoint < 0x20 || codePoint > 0x7E) { - if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) { - // It’s a high surrogate, and there is a next character. - var extra = string.charCodeAt(counter++); - if ((extra & 0xFC00) == 0xDC00) { - // next character is low surrogate - codePoint = ((codePoint & 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. - counter--; - } - } - value = '\\' + codePoint.toString(16).toUpperCase() + ' '; - } else { - if (options.escapeEverything) { - if (regexAnySingleEscape.test(character)) { - value = '\\' + character; - } else { - value = '\\' + codePoint.toString(16).toUpperCase() + ' '; - } - } else if (/[\t\n\f\r\x0B]/.test(character)) { - value = '\\' + codePoint.toString(16).toUpperCase() + ' '; - } else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) { - value = '\\' + character; - } else { - value = character; - } - } - output += value; - } - - if (isIdentifier) { - if (/^-[-\d]/.test(output)) { - output = '\\-' + output.slice(1); - } else if (/\d/.test(firstChar)) { - output = '\\3' + firstChar + ' ' + output.slice(1); - } - } - - // Remove spaces after `\HEX` escapes that are not followed by a hex digit, - // since they’re redundant. Note that this is only possible if the escape - // sequence isn’t preceded by an odd number of backslashes. - output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) { - if ($1 && $1.length % 2) { - // It’s not safe to remove the space, so don’t. - return $0; - } - // Strip the space. - return ($1 || '') + $2; - }); - - if (!isIdentifier && options.wrap) { - return quote + output + quote; - } - return output; -}; - -// Expose default options (so they can be overridden globally). -cssesc.options = { - 'escapeEverything': false, - 'isIdentifier': false, - 'quotes': 'single', - 'wrap': false -}; - -cssesc.version = '3.0.0'; - -module.exports = cssesc; diff --git a/node_modules/cssesc/man/cssesc.1 b/node_modules/cssesc/man/cssesc.1 deleted file mode 100644 index eee4996..0000000 --- a/node_modules/cssesc/man/cssesc.1 +++ /dev/null @@ -1,70 +0,0 @@ -.Dd August 9, 2013 -.Dt cssesc 1 -.Sh NAME -.Nm cssesc -.Nd escape text for use in CSS string literals or identifiers -.Sh SYNOPSIS -.Nm -.Op Fl i | -identifier Ar string -.br -.Op Fl s | -single-quotes Ar string -.br -.Op Fl d | -double-quotes Ar string -.br -.Op Fl w | -wrap Ar string -.br -.Op Fl e | -escape-everything Ar string -.br -.Op Fl v | -version -.br -.Op Fl h | -help -.Sh DESCRIPTION -.Nm -escapes strings for use in CSS string literals or identifiers while generating the shortest possible valid ASCII-only output. -.Sh OPTIONS -.Bl -ohang -offset -.It Sy "-s, --single-quotes" -Escape any occurences of ' in the input string as \\', so that the output can be used in a CSS string literal wrapped in single quotes. -.It Sy "-d, --double-quotes" -Escape any occurences of " in the input string as \\", so that the output can be used in a CSS string literal wrapped in double quotes. -.It Sy "-w, --wrap" -Make sure the output is a valid CSS string literal wrapped in quotes. The type of quotes can be specified using the -.Ar -s | --single-quotes -or -.Ar -d | --double-quotes -settings. -.It Sy "-e, --escape-everything" -Escape all the symbols in the output, even printable ASCII symbols. -.It Sy "-v, --version" -Print cssesc's version. -.It Sy "-h, --help" -Show the help screen. -.El -.Sh EXIT STATUS -The -.Nm cssesc -utility exits with one of the following values: -.Pp -.Bl -tag -width flag -compact -.It Li 0 -.Nm -successfully escaped the given text and printed the result. -.It Li 1 -.Nm -wasn't instructed to escape anything (for example, the -.Ar --help -flag was set); or, an error occurred. -.El -.Sh EXAMPLES -.Bl -ohang -offset -.It Sy "cssesc 'foo bar baz'" -Print an escaped version of the given text. -.It Sy echo\ 'foo bar baz'\ |\ cssesc -Print an escaped version of the text that gets piped in. -.El -.Sh BUGS -cssesc's bug tracker is located at . -.Sh AUTHOR -Mathias Bynens -.Sh WWW - diff --git a/node_modules/cssesc/package.json b/node_modules/cssesc/package.json deleted file mode 100644 index 076c84d..0000000 --- a/node_modules/cssesc/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "cssesc", - "version": "3.0.0", - "description": "A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.", - "homepage": "https://mths.be/cssesc", - "engines": { - "node": ">=4" - }, - "main": "cssesc.js", - "bin": "bin/cssesc", - "man": "man/cssesc.1", - "keywords": [ - "css", - "escape", - "identifier", - "string", - "tool" - ], - "license": "MIT", - "author": { - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - }, - "repository": { - "type": "git", - "url": "https://github.com/mathiasbynens/cssesc.git" - }, - "bugs": "https://github.com/mathiasbynens/cssesc/issues", - "files": [ - "LICENSE-MIT.txt", - "cssesc.js", - "bin/", - "man/" - ], - "scripts": { - "build": "grunt template && babel cssesc.js -o cssesc.js", - "test": "mocha tests", - "cover": "istanbul cover --report html node_modules/.bin/_mocha tests -- -u exports -R spec" - }, - "devDependencies": { - "babel-cli": "^6.26.0", - "babel-preset-env": "^1.6.1", - "codecov": "^1.0.1", - "grunt": "^1.0.1", - "grunt-template": "^1.0.0", - "istanbul": "^0.4.4", - "mocha": "^2.5.3", - "regenerate": "^1.2.1", - "requirejs": "^2.1.16" - } -} diff --git a/node_modules/didyoumean/LICENSE b/node_modules/didyoumean/LICENSE deleted file mode 100644 index 32c23db..0000000 --- a/node_modules/didyoumean/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -## License - -didYouMean.js copyright (c) 2013 Dave Porter. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License -[here](http://www.apache.org/licenses/LICENSE-2.0). - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/node_modules/didyoumean/README.md b/node_modules/didyoumean/README.md deleted file mode 100644 index cd16698..0000000 --- a/node_modules/didyoumean/README.md +++ /dev/null @@ -1,134 +0,0 @@ -didYouMean.js - A simple JavaScript matching engine -=================================================== - -[Available on GitHub](https://github.com/dcporter/didyoumean.js). - -A super-simple, highly optimized JS library for matching human-quality input to a list of potential -matches. You can use it to suggest a misspelled command-line utility option to a user, or to offer -links to nearby valid URLs on your 404 page. (The examples below are taken from a personal project, -my [HTML5 business card](http://dcporter.aws.af.cm/me), which uses didYouMean.js to suggest correct -URLs from misspelled ones, such as [dcporter.aws.af.cm/me/instagarm](http://dcporter.aws.af.cm/me/instagarm).) -Uses the [Levenshtein distance algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance). - -didYouMean.js works in the browser as well as in node.js. To install it for use in node: - -``` -npm install didyoumean -``` - - -Examples --------- - -Matching against a list of strings: -``` -var input = 'insargrm' -var list = ['facebook', 'twitter', 'instagram', 'linkedin']; -console.log(didYouMean(input, list)); -> 'instagram' -// The method matches 'insargrm' to 'instagram'. - -input = 'google plus'; -console.log(didYouMean(input, list)); -> null -// The method was unable to find 'google plus' in the list of options. -``` - -Matching against a list of objects: -``` -var input = 'insargrm'; -var list = [ { id: 'facebook' }, { id: 'twitter' }, { id: 'instagram' }, { id: 'linkedin' } ]; -var key = 'id'; -console.log(didYouMean(input, list, key)); -> 'instagram' -// The method returns the matching value. - -didYouMean.returnWinningObject = true; -console.log(didYouMean(input, list, key)); -> { id: 'instagram' } -// The method returns the matching object. -``` - - -didYouMean(str, list, [key]) ----------------------------- - -- str: The string input to match. -- list: An array of strings or objects to match against. -- key (OPTIONAL): If your list array contains objects, you must specify the key which contains the string - to match against. - -Returns: the closest matching string, or null if no strings exceed the threshold. - - -Options -------- - -Options are set on the didYouMean function object. You may change them at any time. - -### threshold - - By default, the method will only return strings whose edit distance is less than 40% (0.4x) of their length. - For example, if a ten-letter string is five edits away from its nearest match, the method will return null. - - You can control this by setting the "threshold" value on the didYouMean function. For example, to set the - edit distance threshold to 50% of the input string's length: - - ``` - didYouMean.threshold = 0.5; - ``` - - To return the nearest match no matter the threshold, set this value to null. - -### thresholdAbsolute - - This option behaves the same as threshold, but instead takes an integer number of edit steps. For example, - if thresholdAbsolute is set to 20 (the default), then the method will only return strings whose edit distance - is less than 20. Both options apply. - -### caseSensitive - - By default, the method will perform case-insensitive comparisons. If you wish to force case sensitivity, set - the "caseSensitive" value to true: - - ``` - didYouMean.caseSensitive = true; - ``` - -### nullResultValue - - By default, the method will return null if there is no sufficiently close match. You can change this value here. - -### returnWinningObject - - By default, the method will return the winning string value (if any). If your list contains objects rather - than strings, you may set returnWinningObject to true. - - ``` - didYouMean.returnWinningObject = true; - ``` - - This option has no effect on lists of strings. - -### returnFirstMatch - - By default, the method will search all values and return the closest match. If you're simply looking for a "good- - enough" match, you can set your thresholds appropriately and set returnFirstMatch to true to substantially speed - things up. - - -License -------- - -didYouMean copyright (c) 2013-2014 Dave Porter. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License -[here](http://www.apache.org/licenses/LICENSE-2.0). - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/node_modules/didyoumean/didYouMean-1.2.1.js b/node_modules/didyoumean/didYouMean-1.2.1.js deleted file mode 100644 index febb30e..0000000 --- a/node_modules/didyoumean/didYouMean-1.2.1.js +++ /dev/null @@ -1,274 +0,0 @@ -/* - -didYouMean.js - A simple JavaScript matching engine -=================================================== - -[Available on GitHub](https://github.com/dcporter/didyoumean.js). - -A super-simple, highly optimized JS library for matching human-quality input to a list of potential -matches. You can use it to suggest a misspelled command-line utility option to a user, or to offer -links to nearby valid URLs on your 404 page. (The examples below are taken from a personal project, -my [HTML5 business card](http://dcporter.aws.af.cm/me), which uses didYouMean.js to suggest correct -URLs from misspelled ones, such as [dcporter.aws.af.cm/me/instagarm](http://dcporter.aws.af.cm/me/instagarm).) -Uses the [Levenshtein distance algorithm](https://en.wikipedia.org/wiki/Levenshtein_distance). - -didYouMean.js works in the browser as well as in node.js. To install it for use in node: - -``` -npm install didyoumean -``` - - -Examples --------- - -Matching against a list of strings: -``` -var input = 'insargrm' -var list = ['facebook', 'twitter', 'instagram', 'linkedin']; -console.log(didYouMean(input, list)); -> 'instagram' -// The method matches 'insargrm' to 'instagram'. - -input = 'google plus'; -console.log(didYouMean(input, list)); -> null -// The method was unable to find 'google plus' in the list of options. -``` - -Matching against a list of objects: -``` -var input = 'insargrm'; -var list = [ { id: 'facebook' }, { id: 'twitter' }, { id: 'instagram' }, { id: 'linkedin' } ]; -var key = 'id'; -console.log(didYouMean(input, list, key)); -> 'instagram' -// The method returns the matching value. - -didYouMean.returnWinningObject = true; -console.log(didYouMean(input, list, key)); -> { id: 'instagram' } -// The method returns the matching object. -``` - - -didYouMean(str, list, [key]) ----------------------------- - -- str: The string input to match. -- list: An array of strings or objects to match against. -- key (OPTIONAL): If your list array contains objects, you must specify the key which contains the string - to match against. - -Returns: the closest matching string, or null if no strings exceed the threshold. - - -Options -------- - -Options are set on the didYouMean function object. You may change them at any time. - -### threshold - - By default, the method will only return strings whose edit distance is less than 40% (0.4x) of their length. - For example, if a ten-letter string is five edits away from its nearest match, the method will return null. - - You can control this by setting the "threshold" value on the didYouMean function. For example, to set the - edit distance threshold to 50% of the input string's length: - - ``` - didYouMean.threshold = 0.5; - ``` - - To return the nearest match no matter the threshold, set this value to null. - -### thresholdAbsolute - - This option behaves the same as threshold, but instead takes an integer number of edit steps. For example, - if thresholdAbsolute is set to 20 (the default), then the method will only return strings whose edit distance - is less than 20. Both options apply. - -### caseSensitive - - By default, the method will perform case-insensitive comparisons. If you wish to force case sensitivity, set - the "caseSensitive" value to true: - - ``` - didYouMean.caseSensitive = true; - ``` - -### nullResultValue - - By default, the method will return null if there is no sufficiently close match. You can change this value here. - -### returnWinningObject - - By default, the method will return the winning string value (if any). If your list contains objects rather - than strings, you may set returnWinningObject to true. - - ``` - didYouMean.returnWinningObject = true; - ``` - - This option has no effect on lists of strings. - -### returnFirstMatch - - By default, the method will search all values and return the closest match. If you're simply looking for a "good- - enough" match, you can set your thresholds appropriately and set returnFirstMatch to true to substantially speed - things up. - - -License -------- - -didYouMean copyright (c) 2013-2014 Dave Porter. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License -[here](http://www.apache.org/licenses/LICENSE-2.0). - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. - -*/ -(function() { - "use strict"; - - // The didYouMean method. - function didYouMean(str, list, key) { - if (!str) return null; - - // If we're running a case-insensitive search, smallify str. - if (!didYouMean.caseSensitive) { str = str.toLowerCase(); } - - // Calculate the initial value (the threshold) if present. - var thresholdRelative = didYouMean.threshold === null ? null : didYouMean.threshold * str.length, - thresholdAbsolute = didYouMean.thresholdAbsolute, - winningVal; - if (thresholdRelative !== null && thresholdAbsolute !== null) winningVal = Math.min(thresholdRelative, thresholdAbsolute); - else if (thresholdRelative !== null) winningVal = thresholdRelative; - else if (thresholdAbsolute !== null) winningVal = thresholdAbsolute; - else winningVal = null; - - // Get the edit distance to each option. If the closest one is less than 40% (by default) of str's length, - // then return it. - var winner, candidate, testCandidate, val, - i, len = list.length; - for (i = 0; i < len; i++) { - // Get item. - candidate = list[i]; - // If there's a key, get the candidate value out of the object. - if (key) { candidate = candidate[key]; } - // Gatekeep. - if (!candidate) { continue; } - // If we're running a case-insensitive search, smallify the candidate. - if (!didYouMean.caseSensitive) { testCandidate = candidate.toLowerCase(); } - else { testCandidate = candidate; } - // Get and compare edit distance. - val = getEditDistance(str, testCandidate, winningVal); - // If this value is smaller than our current winning value, OR if we have no winning val yet (i.e. the - // threshold option is set to null, meaning the caller wants a match back no matter how bad it is), then - // this is our new winner. - if (winningVal === null || val < winningVal) { - winningVal = val; - // Set the winner to either the value or its object, depending on the returnWinningObject option. - if (key && didYouMean.returnWinningObject) winner = list[i]; - else winner = candidate; - // If we're returning the first match, return it now. - if (didYouMean.returnFirstMatch) return winner; - } - } - - // If we have a winner, return it. - return winner || didYouMean.nullResultValue; - } - - // Set default options. - didYouMean.threshold = 0.4; - didYouMean.thresholdAbsolute = 20; - didYouMean.caseSensitive = false; - didYouMean.nullResultValue = null; - didYouMean.returnWinningObject = null; - didYouMean.returnFirstMatch = false; - - // Expose. - // In node... - if (typeof module !== 'undefined' && module.exports) { - module.exports = didYouMean; - } - // Otherwise... - else { - window.didYouMean = didYouMean; - } - - var MAX_INT = Math.pow(2,32) - 1; // We could probably go higher than this, but for practical reasons let's not. - function getEditDistance(a, b, max) { - // Handle null or undefined max. - max = max || max === 0 ? max : MAX_INT; - - var lena = a.length; - var lenb = b.length; - - // Fast path - no A or B. - if (lena === 0) return Math.min(max + 1, lenb); - if (lenb === 0) return Math.min(max + 1, lena); - - // Fast path - length diff larger than max. - if (Math.abs(lena - lenb) > max) return max + 1; - - // Slow path. - var matrix = [], - i, j, colMin, minJ, maxJ; - - // Set up the first row ([0, 1, 2, 3, etc]). - for (i = 0; i <= lenb; i++) { matrix[i] = [i]; } - - // Set up the first column (same). - for (j = 0; j <= lena; j++) { matrix[0][j] = j; } - - // Loop over the rest of the columns. - for (i = 1; i <= lenb; i++) { - colMin = MAX_INT; - minJ = 1; - if (i > max) minJ = i - max; - maxJ = lenb + 1; - if (maxJ > max + i) maxJ = max + i; - // Loop over the rest of the rows. - for (j = 1; j <= lena; j++) { - // If j is out of bounds, just put a large value in the slot. - if (j < minJ || j > maxJ) { - matrix[i][j] = max + 1; - } - - // Otherwise do the normal Levenshtein thing. - else { - // If the characters are the same, there's no change in edit distance. - if (b.charAt(i - 1) === a.charAt(j - 1)) { - matrix[i][j] = matrix[i - 1][j - 1]; - } - // Otherwise, see if we're substituting, inserting or deleting. - else { - matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // Substitute - Math.min(matrix[i][j - 1] + 1, // Insert - matrix[i - 1][j] + 1)); // Delete - } - } - - // Either way, update colMin. - if (matrix[i][j] < colMin) colMin = matrix[i][j]; - } - - // If this column's minimum is greater than the allowed maximum, there's no point - // in going on with life. - if (colMin > max) return max + 1; - } - // If we made it this far without running into the max, then return the final matrix value. - return matrix[lenb][lena]; - } - -})(); diff --git a/node_modules/didyoumean/didYouMean-1.2.1.min.js b/node_modules/didyoumean/didYouMean-1.2.1.min.js deleted file mode 100644 index c41abd8..0000000 --- a/node_modules/didyoumean/didYouMean-1.2.1.min.js +++ /dev/null @@ -1,17 +0,0 @@ -/* - didYouMean.js copyright (c) 2013-2014 Dave Porter. - - [Available on GitHub](https://github.com/dcporter/didyoumean.js). - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License - [here](http://www.apache.org/licenses/LICENSE-2.0). - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/ -(function(){"use strict";function e(t,r,i){if(!t)return null;if(!e.caseSensitive){t=t.toLowerCase()}var s=e.threshold===null?null:e.threshold*t.length,o=e.thresholdAbsolute,u;if(s!==null&&o!==null)u=Math.min(s,o);else if(s!==null)u=s;else if(o!==null)u=o;else u=null;var a,f,l,c,h,p=r.length;for(h=0;hr)return r+1;var o=[],u,a,f,l,c;for(u=0;u<=s;u++){o[u]=[u]}for(a=0;a<=i;a++){o[0][a]=a}for(u=1;u<=s;u++){f=t;l=1;if(u>r)l=u-r;c=s+1;if(c>r+u)c=r+u;for(a=1;a<=i;a++){if(ac){o[u][a]=r+1}else{if(n.charAt(u-1)===e.charAt(a-1)){o[u][a]=o[u-1][a-1]}else{o[u][a]=Math.min(o[u-1][a-1]+1,Math.min(o[u][a-1]+1,o[u-1][a]+1))}}if(o[u][a]r)return r+1}return o[s][i]}e.threshold=.4;e.thresholdAbsolute=20;e.caseSensitive=false;e.nullResultValue=null;e.returnWinningObject=null;e.returnFirstMatch=false;if(typeof module!=="undefined"&&module.exports){module.exports=e}else{window.didYouMean=e}var t=Math.pow(2,32)-1})(); \ No newline at end of file diff --git a/node_modules/didyoumean/package.json b/node_modules/didyoumean/package.json deleted file mode 100755 index 1301d03..0000000 --- a/node_modules/didyoumean/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "didyoumean", - "version": "1.2.2", - "description": "Match human-quality input to potential matches by edit distance.", - "homepage": "https://github.com/dcporter/didyoumean.js", - "author": { - "name": "Dave Porter", - "email": "dcporter@gmail.com", - "url": "http://dcporter.net/" - }, - "keywords": [ - "didyoumean", - "mean", - "edit", - "distance", - "levenshtein" - ], - "main": "./didYouMean-1.2.1.js", - "repository": { - "type": "git", - "url": "https://github.com/dcporter/didyoumean.js.git" - }, - "bugs": { - "url": "https://github.com/dcporter/didyoumean.js/issues" - }, - "license": "Apache-2.0" -} diff --git a/node_modules/dlv/README.md b/node_modules/dlv/README.md deleted file mode 100644 index 6a8429d..0000000 --- a/node_modules/dlv/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# `dlv(obj, keypath)` [![NPM](https://img.shields.io/npm/v/dlv.svg)](https://npmjs.com/package/dlv) [![Build](https://travis-ci.org/developit/dlv.svg?branch=master)](https://travis-ci.org/developit/dlv) - -> Safely get a dot-notated path within a nested object, with ability to return a default if the full key path does not exist or the value is undefined - - -### Why? - -Smallest possible implementation: only **130 bytes.** - -You could write this yourself, but then you'd have to write [tests]. - -Supports ES Modules, CommonJS and globals. - - -### Installation - -`npm install --save dlv` - - -### Usage - -`delve(object, keypath, [default])` - -```js -import delve from 'dlv'; - -let obj = { - a: { - b: { - c: 1, - d: undefined, - e: null - } - } -}; - -//use string dot notation for keys -delve(obj, 'a.b.c') === 1; - -//or use an array key -delve(obj, ['a', 'b', 'c']) === 1; - -delve(obj, 'a.b') === obj.a.b; - -//returns undefined if the full key path does not exist and no default is specified -delve(obj, 'a.b.f') === undefined; - -//optional third parameter for default if the full key in path is missing -delve(obj, 'a.b.f', 'foo') === 'foo'; - -//or if the key exists but the value is undefined -delve(obj, 'a.b.d', 'foo') === 'foo'; - -//Non-truthy defined values are still returned if they exist at the full keypath -delve(obj, 'a.b.e', 'foo') === null; - -//undefined obj or key returns undefined, unless a default is supplied -delve(undefined, 'a.b.c') === undefined; -delve(undefined, 'a.b.c', 'foo') === 'foo'; -delve(obj, undefined, 'foo') === 'foo'; -``` - - -### Setter Counterparts - -- [dset](https://github.com/lukeed/dset) by [@lukeed](https://github.com/lukeed) is the spiritual "set" counterpart of `dlv` and very fast. -- [bury](https://github.com/kalmbach/bury) by [@kalmbach](https://github.com/kalmbach) does the opposite of `dlv` and is implemented in a very similar manner. - - -### License - -[MIT](https://oss.ninja/mit/developit/) - - -[preact]: https://github.com/developit/preact -[tests]: https://github.com/developit/dlv/blob/master/test.js diff --git a/node_modules/dlv/dist/dlv.es.js b/node_modules/dlv/dist/dlv.es.js deleted file mode 100644 index 06b981b..0000000 --- a/node_modules/dlv/dist/dlv.es.js +++ /dev/null @@ -1,2 +0,0 @@ -export default function(t,e,l,n,r){for(e=e.split?e.split("."):e,n=0;n (http://jasonformat.com)", - "repository": "developit/dlv", - "license": "MIT", - "devDependencies": { - "microbundle": "^0.11.0" - } -} diff --git a/node_modules/fast-glob/LICENSE b/node_modules/fast-glob/LICENSE deleted file mode 100644 index 65a9994..0000000 --- a/node_modules/fast-glob/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Denis Malinochkin - -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-glob/README.md b/node_modules/fast-glob/README.md deleted file mode 100644 index 1d7843a..0000000 --- a/node_modules/fast-glob/README.md +++ /dev/null @@ -1,830 +0,0 @@ -# fast-glob - -> It's a very fast and efficient [glob][glob_definition] library for [Node.js][node_js]. - -This package provides methods for traversing the file system and returning pathnames that matched a defined set of a specified pattern according to the rules used by the Unix Bash shell with some simplifications, meanwhile results are returned in **arbitrary order**. Quick, simple, effective. - -## Table of Contents - -
-Details - -* [Highlights](#highlights) -* [Old and modern mode](#old-and-modern-mode) -* [Pattern syntax](#pattern-syntax) - * [Basic syntax](#basic-syntax) - * [Advanced syntax](#advanced-syntax) -* [Installation](#installation) -* [API](#api) - * [Asynchronous](#asynchronous) - * [Synchronous](#synchronous) - * [Stream](#stream) - * [patterns](#patterns) - * [[options]](#options) - * [Helpers](#helpers) - * [generateTasks](#generatetaskspatterns-options) - * [isDynamicPattern](#isdynamicpatternpattern-options) - * [escapePath](#escapepathpath) - * [convertPathToPattern](#convertpathtopatternpath) -* [Options](#options-3) - * [Common](#common) - * [concurrency](#concurrency) - * [cwd](#cwd) - * [deep](#deep) - * [followSymbolicLinks](#followsymboliclinks) - * [fs](#fs) - * [ignore](#ignore) - * [suppressErrors](#suppresserrors) - * [throwErrorOnBrokenSymbolicLink](#throwerroronbrokensymboliclink) - * [Output control](#output-control) - * [absolute](#absolute) - * [markDirectories](#markdirectories) - * [objectMode](#objectmode) - * [onlyDirectories](#onlydirectories) - * [onlyFiles](#onlyfiles) - * [stats](#stats) - * [unique](#unique) - * [Matching control](#matching-control) - * [braceExpansion](#braceexpansion) - * [caseSensitiveMatch](#casesensitivematch) - * [dot](#dot) - * [extglob](#extglob) - * [globstar](#globstar) - * [baseNameMatch](#basenamematch) -* [FAQ](#faq) - * [What is a static or dynamic pattern?](#what-is-a-static-or-dynamic-pattern) - * [How to write patterns on Windows?](#how-to-write-patterns-on-windows) - * [Why are parentheses match wrong?](#why-are-parentheses-match-wrong) - * [How to exclude directory from reading?](#how-to-exclude-directory-from-reading) - * [How to use UNC path?](#how-to-use-unc-path) - * [Compatible with `node-glob`?](#compatible-with-node-glob) -* [Benchmarks](#benchmarks) - * [Server](#server) - * [Nettop](#nettop) -* [Changelog](#changelog) -* [License](#license) - -
- -## Highlights - -* Fast. Probably the fastest. -* Supports multiple and negative patterns. -* Synchronous, Promise and Stream API. -* Object mode. Can return more than just strings. -* Error-tolerant. - -## Old and modern mode - -This package works in two modes, depending on the environment in which it is used. - -* **Old mode**. Node.js below 10.10 or when the [`stats`](#stats) option is *enabled*. -* **Modern mode**. Node.js 10.10+ and the [`stats`](#stats) option is *disabled*. - -The modern mode is faster. Learn more about the [internal mechanism][nodelib_fs_scandir_old_and_modern_modern]. - -## Pattern syntax - -> :warning: Always use forward-slashes in glob expressions (patterns and [`ignore`](#ignore) option). Use backslashes for escaping characters. - -There is more than one form of syntax: basic and advanced. Below is a brief overview of the supported features. Also pay attention to our [FAQ](#faq). - -> :book: This package uses [`micromatch`][micromatch] as a library for pattern matching. - -### Basic syntax - -* An asterisk (`*`) — matches everything except slashes (path separators), hidden files (names starting with `.`). -* A double star or globstar (`**`) — matches zero or more directories. -* Question mark (`?`) – matches any single character except slashes (path separators). -* Sequence (`[seq]`) — matches any character in sequence. - -> :book: A few additional words about the [basic matching behavior][picomatch_matching_behavior]. - -Some examples: - -* `src/**/*.js` — matches all files in the `src` directory (any level of nesting) that have the `.js` extension. -* `src/*.??` — matches all files in the `src` directory (only first level of nesting) that have a two-character extension. -* `file-[01].js` — matches files: `file-0.js`, `file-1.js`. - -### Advanced syntax - -* [Escapes characters][micromatch_backslashes] (`\\`) — matching special characters (`$^*+?()[]`) as literals. -* [POSIX character classes][picomatch_posix_brackets] (`[[:digit:]]`). -* [Extended globs][micromatch_extglobs] (`?(pattern-list)`). -* [Bash style brace expansions][micromatch_braces] (`{}`). -* [Regexp character classes][micromatch_regex_character_classes] (`[1-5]`). -* [Regex groups][regular_expressions_brackets] (`(a|b)`). - -> :book: A few additional words about the [advanced matching behavior][micromatch_extended_globbing]. - -Some examples: - -* `src/**/*.{css,scss}` — matches all files in the `src` directory (any level of nesting) that have the `.css` or `.scss` extension. -* `file-[[:digit:]].js` — matches files: `file-0.js`, `file-1.js`, …, `file-9.js`. -* `file-{1..3}.js` — matches files: `file-1.js`, `file-2.js`, `file-3.js`. -* `file-(1|2)` — matches files: `file-1.js`, `file-2.js`. - -## Installation - -```console -npm install fast-glob -``` - -## API - -### Asynchronous - -```js -fg(patterns, [options]) -fg.async(patterns, [options]) -fg.glob(patterns, [options]) -``` - -Returns a `Promise` with an array of matching entries. - -```js -const fg = require('fast-glob'); - -const entries = await fg(['.editorconfig', '**/index.js'], { dot: true }); - -// ['.editorconfig', 'services/index.js'] -``` - -### Synchronous - -```js -fg.sync(patterns, [options]) -fg.globSync(patterns, [options]) -``` - -Returns an array of matching entries. - -```js -const fg = require('fast-glob'); - -const entries = fg.sync(['.editorconfig', '**/index.js'], { dot: true }); - -// ['.editorconfig', 'services/index.js'] -``` - -### Stream - -```js -fg.stream(patterns, [options]) -fg.globStream(patterns, [options]) -``` - -Returns a [`ReadableStream`][node_js_stream_readable_streams] when the `data` event will be emitted with matching entry. - -```js -const fg = require('fast-glob'); - -const stream = fg.stream(['.editorconfig', '**/index.js'], { dot: true }); - -for await (const entry of stream) { - // .editorconfig - // services/index.js -} -``` - -#### patterns - -* Required: `true` -* Type: `string | string[]` - -Any correct pattern(s). - -> :1234: [Pattern syntax](#pattern-syntax) -> -> :warning: This package does not respect the order of patterns. First, all the negative patterns are applied, and only then the positive patterns. If you want to get a certain order of records, use sorting or split calls. - -#### [options] - -* Required: `false` -* Type: [`Options`](#options-3) - -See [Options](#options-3) section. - -### Helpers - -#### `generateTasks(patterns, [options])` - -Returns the internal representation of patterns ([`Task`](./src/managers/tasks.ts) is a combining patterns by base directory). - -```js -fg.generateTasks('*'); - -[{ - base: '.', // Parent directory for all patterns inside this task - dynamic: true, // Dynamic or static patterns are in this task - patterns: ['*'], - positive: ['*'], - negative: [] -}] -``` - -##### patterns - -* Required: `true` -* Type: `string | string[]` - -Any correct pattern(s). - -##### [options] - -* Required: `false` -* Type: [`Options`](#options-3) - -See [Options](#options-3) section. - -#### `isDynamicPattern(pattern, [options])` - -Returns `true` if the passed pattern is a dynamic pattern. - -> :1234: [What is a static or dynamic pattern?](#what-is-a-static-or-dynamic-pattern) - -```js -fg.isDynamicPattern('*'); // true -fg.isDynamicPattern('abc'); // false -``` - -##### pattern - -* Required: `true` -* Type: `string` - -Any correct pattern. - -##### [options] - -* Required: `false` -* Type: [`Options`](#options-3) - -See [Options](#options-3) section. - -#### `escapePath(path)` - -Returns the path with escaped special characters depending on the platform. - -* Posix: - * `*?|(){}[]`; - * `!` at the beginning of line; - * `@+!` before the opening parenthesis; - * `\\` before non-special characters; -* Windows: - * `(){}[]` - * `!` at the beginning of line; - * `@+!` before the opening parenthesis; - * Characters like `*?|` cannot be used in the path ([windows_naming_conventions][windows_naming_conventions]), so they will not be escaped; - -```js -fg.escapePath('!abc'); -// \\!abc -fg.escapePath('[OpenSource] mrmlnc – fast-glob (Deluxe Edition) 2014') + '/*.flac' -// \\[OpenSource\\] mrmlnc – fast-glob \\(Deluxe Edition\\) 2014/*.flac - -fg.posix.escapePath('C:\\Program Files (x86)\\**\\*'); -// C:\\\\Program Files \\(x86\\)\\*\\*\\* -fg.win32.escapePath('C:\\Program Files (x86)\\**\\*'); -// Windows: C:\\Program Files \\(x86\\)\\**\\* -``` - -#### `convertPathToPattern(path)` - -Converts a path to a pattern depending on the platform, including special character escaping. - -* Posix. Works similarly to the `fg.posix.escapePath` method. -* Windows. Works similarly to the `fg.win32.escapePath` method, additionally converting backslashes to forward slashes in cases where they are not escape characters (`!()+@{}[]`). - -```js -fg.convertPathToPattern('[OpenSource] mrmlnc – fast-glob (Deluxe Edition) 2014') + '/*.flac'; -// \\[OpenSource\\] mrmlnc – fast-glob \\(Deluxe Edition\\) 2014/*.flac - -fg.convertPathToPattern('C:/Program Files (x86)/**/*'); -// Posix: C:/Program Files \\(x86\\)/\\*\\*/\\* -// Windows: C:/Program Files \\(x86\\)/**/* - -fg.convertPathToPattern('C:\\Program Files (x86)\\**\\*'); -// Posix: C:\\\\Program Files \\(x86\\)\\*\\*\\* -// Windows: C:/Program Files \\(x86\\)/**/* - -fg.posix.convertPathToPattern('\\\\?\\c:\\Program Files (x86)') + '/**/*'; -// Posix: \\\\\\?\\\\c:\\\\Program Files \\(x86\\)/**/* (broken pattern) -fg.win32.convertPathToPattern('\\\\?\\c:\\Program Files (x86)') + '/**/*'; -// Windows: //?/c:/Program Files \\(x86\\)/**/* -``` - -## Options - -### Common options - -#### concurrency - -* Type: `number` -* Default: `os.cpus().length` - -Specifies the maximum number of concurrent requests from a reader to read directories. - -> :book: The higher the number, the higher the performance and load on the file system. If you want to read in quiet mode, set the value to a comfortable number or `1`. - -
- -More details - -In Node, there are [two types of threads][nodejs_thread_pool]: Event Loop (code) and a Thread Pool (fs, dns, …). The thread pool size controlled by the `UV_THREADPOOL_SIZE` environment variable. Its default size is 4 ([documentation][libuv_thread_pool]). The pool is one for all tasks within a single Node process. - -Any code can make 4 real concurrent accesses to the file system. The rest of the FS requests will wait in the queue. - -> :book: Each new instance of FG in the same Node process will use the same Thread pool. - -But this package also has the `concurrency` option. This option allows you to control the number of concurrent accesses to the FS at the package level. By default, this package has a value equal to the number of cores available for the current Node process. This allows you to set a value smaller than the pool size (`concurrency: 1`) or, conversely, to prepare tasks for the pool queue more quickly (`concurrency: Number.POSITIVE_INFINITY`). - -So, in fact, this package can **only make 4 concurrent requests to the FS**. You can increase this value by using an environment variable (`UV_THREADPOOL_SIZE`), but in practice this does not give a multiple advantage. - -
- -#### cwd - -* Type: `string` -* Default: `process.cwd()` - -The current working directory in which to search. - -#### deep - -* Type: `number` -* Default: `Infinity` - -Specifies the maximum depth of a read directory relative to the start directory. - -For example, you have the following tree: - -```js -dir/ -└── one/ // 1 - └── two/ // 2 - └── file.js // 3 -``` - -```js -// With base directory -fg.sync('dir/**', { onlyFiles: false, deep: 1 }); // ['dir/one'] -fg.sync('dir/**', { onlyFiles: false, deep: 2 }); // ['dir/one', 'dir/one/two'] - -// With cwd option -fg.sync('**', { onlyFiles: false, cwd: 'dir', deep: 1 }); // ['one'] -fg.sync('**', { onlyFiles: false, cwd: 'dir', deep: 2 }); // ['one', 'one/two'] -``` - -> :book: If you specify a pattern with some base directory, this directory will not participate in the calculation of the depth of the found directories. Think of it as a [`cwd`](#cwd) option. - -#### followSymbolicLinks - -* Type: `boolean` -* Default: `true` - -Indicates whether to traverse descendants of symbolic link directories when expanding `**` patterns. - -> :book: Note that this option does not affect the base directory of the pattern. For example, if `./a` is a symlink to directory `./b` and you specified `['./a**', './b/**']` patterns, then directory `./a` will still be read. - -> :book: If the [`stats`](#stats) option is specified, the information about the symbolic link (`fs.lstat`) will be replaced with information about the entry (`fs.stat`) behind it. - -#### fs - -* Type: `FileSystemAdapter` -* Default: `fs.*` - -Custom implementation of methods for working with the file system. Supports objects with enumerable properties only. - -```ts -export interface FileSystemAdapter { - lstat?: typeof fs.lstat; - stat?: typeof fs.stat; - lstatSync?: typeof fs.lstatSync; - statSync?: typeof fs.statSync; - readdir?: typeof fs.readdir; - readdirSync?: typeof fs.readdirSync; -} -``` - -#### ignore - -* Type: `string[]` -* Default: `[]` - -An array of glob patterns to exclude matches. This is an alternative way to use negative patterns. - -```js -dir/ -├── package-lock.json -└── package.json -``` - -```js -fg.sync(['*.json', '!package-lock.json']); // ['package.json'] -fg.sync('*.json', { ignore: ['package-lock.json'] }); // ['package.json'] -``` - -#### suppressErrors - -* Type: `boolean` -* Default: `false` - -By default this package suppress only `ENOENT` errors. Set to `true` to suppress any error. - -> :book: Can be useful when the directory has entries with a special level of access. - -#### throwErrorOnBrokenSymbolicLink - -* Type: `boolean` -* Default: `false` - -Throw an error when symbolic link is broken if `true` or safely return `lstat` call if `false`. - -> :book: This option has no effect on errors when reading the symbolic link directory. - -### Output control - -#### absolute - -* Type: `boolean` -* Default: `false` - -Return the absolute path for entries. - -```js -fg.sync('*.js', { absolute: false }); // ['index.js'] -fg.sync('*.js', { absolute: true }); // ['/home/user/index.js'] -``` - -> :book: This option is required if you want to use negative patterns with absolute path, for example, `!${__dirname}/*.js`. - -#### markDirectories - -* Type: `boolean` -* Default: `false` - -Mark the directory path with the final slash. - -```js -fg.sync('*', { onlyFiles: false, markDirectories: false }); // ['index.js', 'controllers'] -fg.sync('*', { onlyFiles: false, markDirectories: true }); // ['index.js', 'controllers/'] -``` - -#### objectMode - -* Type: `boolean` -* Default: `false` - -Returns objects (instead of strings) describing entries. - -```js -fg.sync('*', { objectMode: false }); // ['src/index.js'] -fg.sync('*', { objectMode: true }); // [{ name: 'index.js', path: 'src/index.js', dirent: }] -``` - -The object has the following fields: - -* name (`string`) — the last part of the path (basename) -* path (`string`) — full path relative to the pattern base directory -* dirent ([`fs.Dirent`][node_js_fs_class_fs_dirent]) — instance of `fs.Dirent` - -> :book: An object is an internal representation of entry, so getting it does not affect performance. - -#### onlyDirectories - -* Type: `boolean` -* Default: `false` - -Return only directories. - -```js -fg.sync('*', { onlyDirectories: false }); // ['index.js', 'src'] -fg.sync('*', { onlyDirectories: true }); // ['src'] -``` - -> :book: If `true`, the [`onlyFiles`](#onlyfiles) option is automatically `false`. - -#### onlyFiles - -* Type: `boolean` -* Default: `true` - -Return only files. - -```js -fg.sync('*', { onlyFiles: false }); // ['index.js', 'src'] -fg.sync('*', { onlyFiles: true }); // ['index.js'] -``` - -#### stats - -* Type: `boolean` -* Default: `false` - -Enables an [object mode](#objectmode) with an additional field: - -* stats ([`fs.Stats`][node_js_fs_class_fs_stats]) — instance of `fs.Stats` - -```js -fg.sync('*', { stats: false }); // ['src/index.js'] -fg.sync('*', { stats: true }); // [{ name: 'index.js', path: 'src/index.js', dirent: , stats: }] -``` - -> :book: Returns `fs.stat` instead of `fs.lstat` for symbolic links when the [`followSymbolicLinks`](#followsymboliclinks) option is specified. -> -> :warning: Unlike [object mode](#objectmode) this mode requires additional calls to the file system. On average, this mode is slower at least twice. See [old and modern mode](#old-and-modern-mode) for more details. - -#### unique - -* Type: `boolean` -* Default: `true` - -Ensures that the returned entries are unique. - -```js -fg.sync(['*.json', 'package.json'], { unique: false }); // ['package.json', 'package.json'] -fg.sync(['*.json', 'package.json'], { unique: true }); // ['package.json'] -``` - -If `true` and similar entries are found, the result is the first found. - -### Matching control - -#### braceExpansion - -* Type: `boolean` -* Default: `true` - -Enables Bash-like brace expansion. - -> :1234: [Syntax description][bash_hackers_syntax_expansion_brace] or more [detailed description][micromatch_braces]. - -```js -dir/ -├── abd -├── acd -└── a{b,c}d -``` - -```js -fg.sync('a{b,c}d', { braceExpansion: false }); // ['a{b,c}d'] -fg.sync('a{b,c}d', { braceExpansion: true }); // ['abd', 'acd'] -``` - -#### caseSensitiveMatch - -* Type: `boolean` -* Default: `true` - -Enables a [case-sensitive][wikipedia_case_sensitivity] mode for matching files. - -```js -dir/ -├── file.txt -└── File.txt -``` - -```js -fg.sync('file.txt', { caseSensitiveMatch: false }); // ['file.txt', 'File.txt'] -fg.sync('file.txt', { caseSensitiveMatch: true }); // ['file.txt'] -``` - -#### dot - -* Type: `boolean` -* Default: `false` - -Allow patterns to match entries that begin with a period (`.`). - -> :book: Note that an explicit dot in a portion of the pattern will always match dot files. - -```js -dir/ -├── .editorconfig -└── package.json -``` - -```js -fg.sync('*', { dot: false }); // ['package.json'] -fg.sync('*', { dot: true }); // ['.editorconfig', 'package.json'] -``` - -#### extglob - -* Type: `boolean` -* Default: `true` - -Enables Bash-like `extglob` functionality. - -> :1234: [Syntax description][micromatch_extglobs]. - -```js -dir/ -├── README.md -└── package.json -``` - -```js -fg.sync('*.+(json|md)', { extglob: false }); // [] -fg.sync('*.+(json|md)', { extglob: true }); // ['README.md', 'package.json'] -``` - -#### globstar - -* Type: `boolean` -* Default: `true` - -Enables recursively repeats a pattern containing `**`. If `false`, `**` behaves exactly like `*`. - -```js -dir/ -└── a - └── b -``` - -```js -fg.sync('**', { onlyFiles: false, globstar: false }); // ['a'] -fg.sync('**', { onlyFiles: false, globstar: true }); // ['a', 'a/b'] -``` - -#### baseNameMatch - -* Type: `boolean` -* Default: `false` - -If set to `true`, then patterns without slashes will be matched against the basename of the path if it contains slashes. - -```js -dir/ -└── one/ - └── file.md -``` - -```js -fg.sync('*.md', { baseNameMatch: false }); // [] -fg.sync('*.md', { baseNameMatch: true }); // ['one/file.md'] -``` - -## FAQ - -## What is a static or dynamic pattern? - -All patterns can be divided into two types: - -* **static**. A pattern is considered static if it can be used to get an entry on the file system without using matching mechanisms. For example, the `file.js` pattern is a static pattern because we can just verify that it exists on the file system. -* **dynamic**. A pattern is considered dynamic if it cannot be used directly to find occurrences without using a matching mechanisms. For example, the `*` pattern is a dynamic pattern because we cannot use this pattern directly. - -A pattern is considered dynamic if it contains the following characters (`…` — any characters or their absence) or options: - -* The [`caseSensitiveMatch`](#casesensitivematch) option is disabled -* `\\` (the escape character) -* `*`, `?`, `!` (at the beginning of line) -* `[…]` -* `(…|…)` -* `@(…)`, `!(…)`, `*(…)`, `?(…)`, `+(…)` (respects the [`extglob`](#extglob) option) -* `{…,…}`, `{…..…}` (respects the [`braceExpansion`](#braceexpansion) option) - -## How to write patterns on Windows? - -Always use forward-slashes in glob expressions (patterns and [`ignore`](#ignore) option). Use backslashes for escaping characters. With the [`cwd`](#cwd) option use a convenient format. - -**Bad** - -```ts -[ - 'directory\\*', - path.join(process.cwd(), '**') -] -``` - -**Good** - -```ts -[ - 'directory/*', - fg.convertPathToPattern(process.cwd()) + '/**' -] -``` - -> :book: Use the [`.convertPathToPattern`](#convertpathtopatternpath) package to convert Windows-style path to a Unix-style path. - -Read more about [matching with backslashes][micromatch_backslashes]. - -## Why are parentheses match wrong? - -```js -dir/ -└── (special-*file).txt -``` - -```js -fg.sync(['(special-*file).txt']) // [] -``` - -Refers to Bash. You need to escape special characters: - -```js -fg.sync(['\\(special-*file\\).txt']) // ['(special-*file).txt'] -``` - -Read more about [matching special characters as literals][picomatch_matching_special_characters_as_literals]. Or use the [`.escapePath`](#escapepathpath). - -## How to exclude directory from reading? - -You can use a negative pattern like this: `!**/node_modules` or `!**/node_modules/**`. Also you can use [`ignore`](#ignore) option. Just look at the example below. - -```js -first/ -├── file.md -└── second/ - └── file.txt -``` - -If you don't want to read the `second` directory, you must write the following pattern: `!**/second` or `!**/second/**`. - -```js -fg.sync(['**/*.md', '!**/second']); // ['first/file.md'] -fg.sync(['**/*.md'], { ignore: ['**/second/**'] }); // ['first/file.md'] -``` - -> :warning: When you write `!**/second/**/*` it means that the directory will be **read**, but all the entries will not be included in the results. - -You have to understand that if you write the pattern to exclude directories, then the directory will not be read under any circumstances. - -## How to use UNC path? - -You cannot use [Uniform Naming Convention (UNC)][unc_path] paths as patterns (due to syntax) directly, but you can use them as [`cwd`](#cwd) directory or use the `fg.convertPathToPattern` method. - -```ts -// cwd -fg.sync('*', { cwd: '\\\\?\\C:\\Python27' /* or //?/C:/Python27 */ }); -fg.sync('Python27/*', { cwd: '\\\\?\\C:\\' /* or //?/C:/ */ }); - -// .convertPathToPattern -fg.sync(fg.convertPathToPattern('\\\\?\\c:\\Python27') + '/*'); -``` - -## Compatible with `node-glob`? - -| node-glob | fast-glob | -| :----------: | :-------: | -| `cwd` | [`cwd`](#cwd) | -| `root` | – | -| `dot` | [`dot`](#dot) | -| `nomount` | – | -| `mark` | [`markDirectories`](#markdirectories) | -| `nosort` | – | -| `nounique` | [`unique`](#unique) | -| `nobrace` | [`braceExpansion`](#braceexpansion) | -| `noglobstar` | [`globstar`](#globstar) | -| `noext` | [`extglob`](#extglob) | -| `nocase` | [`caseSensitiveMatch`](#casesensitivematch) | -| `matchBase` | [`baseNameMatch`](#basenamematch) | -| `nodir` | [`onlyFiles`](#onlyfiles) | -| `ignore` | [`ignore`](#ignore) | -| `follow` | [`followSymbolicLinks`](#followsymboliclinks) | -| `realpath` | – | -| `absolute` | [`absolute`](#absolute) | - -## Benchmarks - -You can see results [here](https://github.com/mrmlnc/fast-glob/actions/workflows/benchmark.yml?query=branch%3Amaster) for every commit into the `main` branch. - -* **Product benchmark** – comparison with the main competitors. -* **Regress benchmark** – regression between the current version and the version from the npm registry. - -## Changelog - -See the [Releases section of our GitHub project][github_releases] for changelog for each release version. - -## License - -This software is released under the terms of the MIT license. - -[bash_hackers_syntax_expansion_brace]: https://wiki.bash-hackers.org/syntax/expansion/brace -[github_releases]: https://github.com/mrmlnc/fast-glob/releases -[glob_definition]: https://en.wikipedia.org/wiki/Glob_(programming) -[glob_linux_man]: http://man7.org/linux/man-pages/man3/glob.3.html -[micromatch_backslashes]: https://github.com/micromatch/micromatch#backslashes -[micromatch_braces]: https://github.com/micromatch/braces -[micromatch_extended_globbing]: https://github.com/micromatch/micromatch#extended-globbing -[micromatch_extglobs]: https://github.com/micromatch/micromatch#extglobs -[micromatch_regex_character_classes]: https://github.com/micromatch/micromatch#regex-character-classes -[micromatch]: https://github.com/micromatch/micromatch -[node_js_fs_class_fs_dirent]: https://nodejs.org/api/fs.html#fs_class_fs_dirent -[node_js_fs_class_fs_stats]: https://nodejs.org/api/fs.html#fs_class_fs_stats -[node_js_stream_readable_streams]: https://nodejs.org/api/stream.html#stream_readable_streams -[node_js]: https://nodejs.org/en -[nodelib_fs_scandir_old_and_modern_modern]: https://github.com/nodelib/nodelib/blob/master/packages/fs/fs.scandir/README.md#old-and-modern-mode -[npm_normalize_path]: https://www.npmjs.com/package/normalize-path -[npm_unixify]: https://www.npmjs.com/package/unixify -[picomatch_matching_behavior]: https://github.com/micromatch/picomatch#matching-behavior-vs-bash -[picomatch_matching_special_characters_as_literals]: https://github.com/micromatch/picomatch#matching-special-characters-as-literals -[picomatch_posix_brackets]: https://github.com/micromatch/picomatch#posix-brackets -[regular_expressions_brackets]: https://www.regular-expressions.info/brackets.html -[unc_path]: https://learn.microsoft.com/openspecs/windows_protocols/ms-dtyp/62e862f4-2a51-452e-8eeb-dc4ff5ee33cc -[wikipedia_case_sensitivity]: https://en.wikipedia.org/wiki/Case_sensitivity -[nodejs_thread_pool]: https://nodejs.org/en/docs/guides/dont-block-the-event-loop -[libuv_thread_pool]: http://docs.libuv.org/en/v1.x/threadpool.html -[windows_naming_conventions]: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions diff --git a/node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md b/node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md deleted file mode 100644 index fb9de96..0000000 --- a/node_modules/fast-glob/node_modules/glob-parent/CHANGELOG.md +++ /dev/null @@ -1,110 +0,0 @@ -### [5.1.2](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2) (2021-03-06) - - -### Bug Fixes - -* eliminate ReDoS ([#36](https://github.com/gulpjs/glob-parent/issues/36)) ([f923116](https://github.com/gulpjs/glob-parent/commit/f9231168b0041fea3f8f954b3cceb56269fc6366)) - -### [5.1.1](https://github.com/gulpjs/glob-parent/compare/v5.1.0...v5.1.1) (2021-01-27) - - -### Bug Fixes - -* unescape exclamation mark ([#26](https://github.com/gulpjs/glob-parent/issues/26)) ([a98874f](https://github.com/gulpjs/glob-parent/commit/a98874f1a59e407f4fb1beb0db4efa8392da60bb)) - -## [5.1.0](https://github.com/gulpjs/glob-parent/compare/v5.0.0...v5.1.0) (2021-01-27) - - -### Features - -* add `flipBackslashes` option to disable auto conversion of slashes (closes [#24](https://github.com/gulpjs/glob-parent/issues/24)) ([#25](https://github.com/gulpjs/glob-parent/issues/25)) ([eecf91d](https://github.com/gulpjs/glob-parent/commit/eecf91d5e3834ed78aee39c4eaaae654d76b87b3)) - -## [5.0.0](https://github.com/gulpjs/glob-parent/compare/v4.0.0...v5.0.0) (2021-01-27) - - -### ⚠ BREAKING CHANGES - -* Drop support for node <6 & bump dependencies - -### Miscellaneous Chores - -* Drop support for node <6 & bump dependencies ([896c0c0](https://github.com/gulpjs/glob-parent/commit/896c0c00b4e7362f60b96e7fc295ae929245255a)) - -## [4.0.0](https://github.com/gulpjs/glob-parent/compare/v3.1.0...v4.0.0) (2021-01-27) - - -### ⚠ BREAKING CHANGES - -* question marks are valid path characters on Windows so avoid flagging as a glob when alone -* Update is-glob dependency - -### Features - -* hoist regexps and strings for performance gains ([4a80667](https://github.com/gulpjs/glob-parent/commit/4a80667c69355c76a572a5892b0f133c8e1f457e)) -* question marks are valid path characters on Windows so avoid flagging as a glob when alone ([2a551dd](https://github.com/gulpjs/glob-parent/commit/2a551dd0dc3235e78bf3c94843d4107072d17841)) -* Update is-glob dependency ([e41fcd8](https://github.com/gulpjs/glob-parent/commit/e41fcd895d1f7bc617dba45c9d935a7949b9c281)) - -## [3.1.0](https://github.com/gulpjs/glob-parent/compare/v3.0.1...v3.1.0) (2021-01-27) - - -### Features - -* allow basic win32 backslash use ([272afa5](https://github.com/gulpjs/glob-parent/commit/272afa5fd070fc0f796386a5993d4ee4a846988b)) -* handle extglobs (parentheses) containing separators ([7db1bdb](https://github.com/gulpjs/glob-parent/commit/7db1bdb0756e55fd14619e8ce31aa31b17b117fd)) -* new approach to braces/brackets handling ([8269bd8](https://github.com/gulpjs/glob-parent/commit/8269bd89290d99fac9395a354fb56fdcdb80f0be)) -* pre-process braces/brackets sections ([9ef8a87](https://github.com/gulpjs/glob-parent/commit/9ef8a87f66b1a43d0591e7a8e4fc5a18415ee388)) -* preserve escaped brace/bracket at end of string ([8cfb0ba](https://github.com/gulpjs/glob-parent/commit/8cfb0ba84202d51571340dcbaf61b79d16a26c76)) - - -### Bug Fixes - -* trailing escaped square brackets ([99ec9fe](https://github.com/gulpjs/glob-parent/commit/99ec9fecc60ee488ded20a94dd4f18b4f55c4ccf)) - -### [3.0.1](https://github.com/gulpjs/glob-parent/compare/v3.0.0...v3.0.1) (2021-01-27) - - -### Features - -* use path-dirname ponyfill ([cdbea5f](https://github.com/gulpjs/glob-parent/commit/cdbea5f32a58a54e001a75ddd7c0fccd4776aacc)) - - -### Bug Fixes - -* unescape glob-escaped dirnames on output ([598c533](https://github.com/gulpjs/glob-parent/commit/598c533bdf49c1428bc063aa9b8db40c5a86b030)) - -## [3.0.0](https://github.com/gulpjs/glob-parent/compare/v2.0.0...v3.0.0) (2021-01-27) - - -### ⚠ BREAKING CHANGES - -* update is-glob dependency - -### Features - -* update is-glob dependency ([5c5f8ef](https://github.com/gulpjs/glob-parent/commit/5c5f8efcee362a8e7638cf8220666acd8784f6bd)) - -## [2.0.0](https://github.com/gulpjs/glob-parent/compare/v1.3.0...v2.0.0) (2021-01-27) - - -### Features - -* move up to dirname regardless of glob characters ([f97fb83](https://github.com/gulpjs/glob-parent/commit/f97fb83be2e0a9fc8d3b760e789d2ecadd6aa0c2)) - -## [1.3.0](https://github.com/gulpjs/glob-parent/compare/v1.2.0...v1.3.0) (2021-01-27) - -## [1.2.0](https://github.com/gulpjs/glob-parent/compare/v1.1.0...v1.2.0) (2021-01-27) - - -### Reverts - -* feat: make regex test strings smaller ([dc80fa9](https://github.com/gulpjs/glob-parent/commit/dc80fa9658dca20549cfeba44bbd37d5246fcce0)) - -## [1.1.0](https://github.com/gulpjs/glob-parent/compare/v1.0.0...v1.1.0) (2021-01-27) - - -### Features - -* make regex test strings smaller ([cd83220](https://github.com/gulpjs/glob-parent/commit/cd832208638f45169f986d80fcf66e401f35d233)) - -## 1.0.0 (2021-01-27) - diff --git a/node_modules/fast-glob/node_modules/glob-parent/LICENSE b/node_modules/fast-glob/node_modules/glob-parent/LICENSE deleted file mode 100644 index 63222d7..0000000 --- a/node_modules/fast-glob/node_modules/glob-parent/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2015, 2019 Elan Shanker - -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/fast-glob/node_modules/glob-parent/README.md b/node_modules/fast-glob/node_modules/glob-parent/README.md deleted file mode 100644 index 36a2793..0000000 --- a/node_modules/fast-glob/node_modules/glob-parent/README.md +++ /dev/null @@ -1,137 +0,0 @@ -

- - - -

- -# glob-parent - -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Azure Pipelines Build Status][azure-pipelines-image]][azure-pipelines-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] - -Extract the non-magic parent path from a glob string. - -## Usage - -```js -var globParent = require('glob-parent'); - -globParent('path/to/*.js'); // 'path/to' -globParent('/root/path/to/*.js'); // '/root/path/to' -globParent('/*.js'); // '/' -globParent('*.js'); // '.' -globParent('**/*.js'); // '.' -globParent('path/{to,from}'); // 'path' -globParent('path/!(to|from)'); // 'path' -globParent('path/?(to|from)'); // 'path' -globParent('path/+(to|from)'); // 'path' -globParent('path/*(to|from)'); // 'path' -globParent('path/@(to|from)'); // 'path' -globParent('path/**/*'); // 'path' - -// if provided a non-glob path, returns the nearest dir -globParent('path/foo/bar.js'); // 'path/foo' -globParent('path/foo/'); // 'path/foo' -globParent('path/foo'); // 'path' (see issue #3 for details) -``` - -## API - -### `globParent(maybeGlobString, [options])` - -Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. - -#### options - -```js -{ - // Disables the automatic conversion of slashes for Windows - flipBackslashes: true -} -``` - -## Escaping - -The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: - -- `?` (question mark) unless used as a path segment alone -- `*` (asterisk) -- `|` (pipe) -- `(` (opening parenthesis) -- `)` (closing parenthesis) -- `{` (opening curly brace) -- `}` (closing curly brace) -- `[` (opening bracket) -- `]` (closing bracket) - -**Example** - -```js -globParent('foo/[bar]/') // 'foo' -globParent('foo/\\[bar]/') // 'foo/[bar]' -``` - -## Limitations - -### Braces & Brackets -This library attempts a quick and imperfect method of determining which path -parts have glob magic without fully parsing/lexing the pattern. There are some -advanced use cases that can trip it up, such as nested braces where the outer -pair is escaped and the inner one contains a path separator. If you find -yourself in the unlikely circumstance of being affected by this or need to -ensure higher-fidelity glob handling in your library, it is recommended that you -pre-process your input with [expand-braces] and/or [expand-brackets]. - -### Windows -Backslashes are not valid path separators for globs. If a path with backslashes -is provided anyway, for simple cases, glob-parent will replace the path -separator for you and return the non-glob parent path (now with -forward-slashes, which are still valid as Windows path separators). - -This cannot be used in conjunction with escape characters. - -```js -// BAD -globParent('C:\\Program Files \\(x86\\)\\*.ext') // 'C:/Program Files /(x86/)' - -// GOOD -globParent('C:/Program Files\\(x86\\)/*.ext') // 'C:/Program Files (x86)' -``` - -If you are using escape characters for a pattern without path parts (i.e. -relative to `cwd`), prefix with `./` to avoid confusing glob-parent. - -```js -// BAD -globParent('foo \\[bar]') // 'foo ' -globParent('foo \\[bar]*') // 'foo ' - -// GOOD -globParent('./foo \\[bar]') // 'foo [bar]' -globParent('./foo \\[bar]*') // '.' -``` - -## License - -ISC - -[expand-braces]: https://github.com/jonschlinkert/expand-braces -[expand-brackets]: https://github.com/jonschlinkert/expand-brackets - -[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg -[npm-url]: https://www.npmjs.com/package/glob-parent -[npm-image]: https://img.shields.io/npm/v/glob-parent.svg - -[azure-pipelines-url]: https://dev.azure.com/gulpjs/gulp/_build/latest?definitionId=2&branchName=master -[azure-pipelines-image]: https://dev.azure.com/gulpjs/gulp/_apis/build/status/glob-parent?branchName=master - -[travis-url]: https://travis-ci.org/gulpjs/glob-parent -[travis-image]: https://img.shields.io/travis/gulpjs/glob-parent.svg?label=travis-ci - -[appveyor-url]: https://ci.appveyor.com/project/gulpjs/glob-parent -[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/glob-parent.svg?label=appveyor - -[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent -[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg - -[gitter-url]: https://gitter.im/gulpjs/gulp -[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg diff --git a/node_modules/fast-glob/node_modules/glob-parent/index.js b/node_modules/fast-glob/node_modules/glob-parent/index.js deleted file mode 100644 index 09e257e..0000000 --- a/node_modules/fast-glob/node_modules/glob-parent/index.js +++ /dev/null @@ -1,42 +0,0 @@ -'use strict'; - -var isGlob = require('is-glob'); -var pathPosixDirname = require('path').posix.dirname; -var isWin32 = require('os').platform() === 'win32'; - -var slash = '/'; -var backslash = /\\/g; -var enclosure = /[\{\[].*[\}\]]$/; -var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; -var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; - -/** - * @param {string} str - * @param {Object} opts - * @param {boolean} [opts.flipBackslashes=true] - * @returns {string} - */ -module.exports = function globParent(str, opts) { - var options = Object.assign({ flipBackslashes: true }, opts); - - // flip windows path separators - if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { - str = str.replace(backslash, slash); - } - - // special case for strings ending in enclosure containing path separator - if (enclosure.test(str)) { - str += slash; - } - - // preserves full path in case of trailing path separator - str += 'a'; - - // remove path parts that are globby - do { - str = pathPosixDirname(str); - } while (isGlob(str) || globby.test(str)); - - // remove escape chars and return result - return str.replace(escaped, '$1'); -}; diff --git a/node_modules/fast-glob/node_modules/glob-parent/package.json b/node_modules/fast-glob/node_modules/glob-parent/package.json deleted file mode 100644 index 125c971..0000000 --- a/node_modules/fast-glob/node_modules/glob-parent/package.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "name": "glob-parent", - "version": "5.1.2", - "description": "Extract the non-magic parent path from a glob string.", - "author": "Gulp Team (https://gulpjs.com/)", - "contributors": [ - "Elan Shanker (https://github.com/es128)", - "Blaine Bublitz " - ], - "repository": "gulpjs/glob-parent", - "license": "ISC", - "engines": { - "node": ">= 6" - }, - "main": "index.js", - "files": [ - "LICENSE", - "index.js" - ], - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "nyc mocha --async-only", - "azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit", - "coveralls": "nyc report --reporter=text-lcov | coveralls" - }, - "dependencies": { - "is-glob": "^4.0.1" - }, - "devDependencies": { - "coveralls": "^3.0.11", - "eslint": "^2.13.1", - "eslint-config-gulp": "^3.0.1", - "expect": "^1.20.2", - "mocha": "^6.0.2", - "nyc": "^13.3.0" - }, - "keywords": [ - "glob", - "parent", - "strip", - "path", - "dirname", - "directory", - "base", - "wildcard" - ] -} diff --git a/node_modules/fast-glob/out/index.d.ts b/node_modules/fast-glob/out/index.d.ts deleted file mode 100644 index 46823bb..0000000 --- a/node_modules/fast-glob/out/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/// -import * as taskManager from './managers/tasks'; -import { Options as OptionsInternal } from './settings'; -import { Entry as EntryInternal, FileSystemAdapter as FileSystemAdapterInternal, Pattern as PatternInternal } from './types'; -type EntryObjectModePredicate = { - [TKey in keyof Pick]-?: true; -}; -type EntryStatsPredicate = { - [TKey in keyof Pick]-?: true; -}; -type EntryObjectPredicate = EntryObjectModePredicate | EntryStatsPredicate; -declare function FastGlob(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): Promise; -declare function FastGlob(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Promise; -declare namespace FastGlob { - type Options = OptionsInternal; - type Entry = EntryInternal; - type Task = taskManager.Task; - type Pattern = PatternInternal; - type FileSystemAdapter = FileSystemAdapterInternal; - const glob: typeof FastGlob; - const globSync: typeof sync; - const globStream: typeof stream; - const async: typeof FastGlob; - function sync(source: PatternInternal | PatternInternal[], options: OptionsInternal & EntryObjectPredicate): EntryInternal[]; - function sync(source: PatternInternal | PatternInternal[], options?: OptionsInternal): string[]; - function stream(source: PatternInternal | PatternInternal[], options?: OptionsInternal): NodeJS.ReadableStream; - function generateTasks(source: PatternInternal | PatternInternal[], options?: OptionsInternal): Task[]; - function isDynamicPattern(source: PatternInternal, options?: OptionsInternal): boolean; - function escapePath(source: string): PatternInternal; - function convertPathToPattern(source: string): PatternInternal; - namespace posix { - function escapePath(source: string): PatternInternal; - function convertPathToPattern(source: string): PatternInternal; - } - namespace win32 { - function escapePath(source: string): PatternInternal; - function convertPathToPattern(source: string): PatternInternal; - } -} -export = FastGlob; diff --git a/node_modules/fast-glob/out/index.js b/node_modules/fast-glob/out/index.js deleted file mode 100644 index 90365d4..0000000 --- a/node_modules/fast-glob/out/index.js +++ /dev/null @@ -1,102 +0,0 @@ -"use strict"; -const taskManager = require("./managers/tasks"); -const async_1 = require("./providers/async"); -const stream_1 = require("./providers/stream"); -const sync_1 = require("./providers/sync"); -const settings_1 = require("./settings"); -const utils = require("./utils"); -async function FastGlob(source, options) { - assertPatternsInput(source); - const works = getWorks(source, async_1.default, options); - const result = await Promise.all(works); - return utils.array.flatten(result); -} -// https://github.com/typescript-eslint/typescript-eslint/issues/60 -// eslint-disable-next-line no-redeclare -(function (FastGlob) { - FastGlob.glob = FastGlob; - FastGlob.globSync = sync; - FastGlob.globStream = stream; - FastGlob.async = FastGlob; - function sync(source, options) { - assertPatternsInput(source); - const works = getWorks(source, sync_1.default, options); - return utils.array.flatten(works); - } - FastGlob.sync = sync; - function stream(source, options) { - assertPatternsInput(source); - const works = getWorks(source, stream_1.default, options); - /** - * The stream returned by the provider cannot work with an asynchronous iterator. - * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams. - * This affects performance (+25%). I don't see best solution right now. - */ - return utils.stream.merge(works); - } - FastGlob.stream = stream; - function generateTasks(source, options) { - assertPatternsInput(source); - const patterns = [].concat(source); - const settings = new settings_1.default(options); - return taskManager.generate(patterns, settings); - } - FastGlob.generateTasks = generateTasks; - function isDynamicPattern(source, options) { - assertPatternsInput(source); - const settings = new settings_1.default(options); - return utils.pattern.isDynamicPattern(source, settings); - } - FastGlob.isDynamicPattern = isDynamicPattern; - function escapePath(source) { - assertPatternsInput(source); - return utils.path.escape(source); - } - FastGlob.escapePath = escapePath; - function convertPathToPattern(source) { - assertPatternsInput(source); - return utils.path.convertPathToPattern(source); - } - FastGlob.convertPathToPattern = convertPathToPattern; - let posix; - (function (posix) { - function escapePath(source) { - assertPatternsInput(source); - return utils.path.escapePosixPath(source); - } - posix.escapePath = escapePath; - function convertPathToPattern(source) { - assertPatternsInput(source); - return utils.path.convertPosixPathToPattern(source); - } - posix.convertPathToPattern = convertPathToPattern; - })(posix = FastGlob.posix || (FastGlob.posix = {})); - let win32; - (function (win32) { - function escapePath(source) { - assertPatternsInput(source); - return utils.path.escapeWindowsPath(source); - } - win32.escapePath = escapePath; - function convertPathToPattern(source) { - assertPatternsInput(source); - return utils.path.convertWindowsPathToPattern(source); - } - win32.convertPathToPattern = convertPathToPattern; - })(win32 = FastGlob.win32 || (FastGlob.win32 = {})); -})(FastGlob || (FastGlob = {})); -function getWorks(source, _Provider, options) { - const patterns = [].concat(source); - const settings = new settings_1.default(options); - const tasks = taskManager.generate(patterns, settings); - const provider = new _Provider(settings); - return tasks.map(provider.read, provider); -} -function assertPatternsInput(input) { - const source = [].concat(input); - const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item)); - if (!isValidSource) { - throw new TypeError('Patterns must be a string (non empty) or an array of strings'); - } -} -module.exports = FastGlob; diff --git a/node_modules/fast-glob/out/managers/tasks.d.ts b/node_modules/fast-glob/out/managers/tasks.d.ts deleted file mode 100644 index 59d2c42..0000000 --- a/node_modules/fast-glob/out/managers/tasks.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import Settings from '../settings'; -import { Pattern, PatternsGroup } from '../types'; -export type Task = { - base: string; - dynamic: boolean; - patterns: Pattern[]; - positive: Pattern[]; - negative: Pattern[]; -}; -export declare function generate(input: Pattern[], settings: Settings): Task[]; -/** - * Returns tasks grouped by basic pattern directories. - * - * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. - * This is necessary because directory traversal starts at the base directory and goes deeper. - */ -export declare function convertPatternsToTasks(positive: Pattern[], negative: Pattern[], dynamic: boolean): Task[]; -export declare function getPositivePatterns(patterns: Pattern[]): Pattern[]; -export declare function getNegativePatternsAsPositive(patterns: Pattern[], ignore: Pattern[]): Pattern[]; -export declare function groupPatternsByBaseDirectory(patterns: Pattern[]): PatternsGroup; -export declare function convertPatternGroupsToTasks(positive: PatternsGroup, negative: Pattern[], dynamic: boolean): Task[]; -export declare function convertPatternGroupToTask(base: string, positive: Pattern[], negative: Pattern[], dynamic: boolean): Task; diff --git a/node_modules/fast-glob/out/managers/tasks.js b/node_modules/fast-glob/out/managers/tasks.js deleted file mode 100644 index 335a765..0000000 --- a/node_modules/fast-glob/out/managers/tasks.js +++ /dev/null @@ -1,110 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0; -const utils = require("../utils"); -function generate(input, settings) { - const patterns = processPatterns(input, settings); - const ignore = processPatterns(settings.ignore, settings); - const positivePatterns = getPositivePatterns(patterns); - const negativePatterns = getNegativePatternsAsPositive(patterns, ignore); - const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings)); - const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings)); - const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); - const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); - return staticTasks.concat(dynamicTasks); -} -exports.generate = generate; -function processPatterns(input, settings) { - let patterns = input; - /** - * The original pattern like `{,*,**,a/*}` can lead to problems checking the depth when matching entry - * and some problems with the micromatch package (see fast-glob issues: #365, #394). - * - * To solve this problem, we expand all patterns containing brace expansion. This can lead to a slight slowdown - * in matching in the case of a large set of patterns after expansion. - */ - if (settings.braceExpansion) { - patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns); - } - /** - * If the `baseNameMatch` option is enabled, we must add globstar to patterns, so that they can be used - * at any nesting level. - * - * We do this here, because otherwise we have to complicate the filtering logic. For example, we need to change - * the pattern in the filter before creating a regular expression. There is no need to change the patterns - * in the application. Only on the input. - */ - if (settings.baseNameMatch) { - patterns = patterns.map((pattern) => pattern.includes('/') ? pattern : `**/${pattern}`); - } - /** - * This method also removes duplicate slashes that may have been in the pattern or formed as a result of expansion. - */ - return patterns.map((pattern) => utils.pattern.removeDuplicateSlashes(pattern)); -} -/** - * Returns tasks grouped by basic pattern directories. - * - * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately. - * This is necessary because directory traversal starts at the base directory and goes deeper. - */ -function convertPatternsToTasks(positive, negative, dynamic) { - const tasks = []; - const patternsOutsideCurrentDirectory = utils.pattern.getPatternsOutsideCurrentDirectory(positive); - const patternsInsideCurrentDirectory = utils.pattern.getPatternsInsideCurrentDirectory(positive); - const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory); - const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory); - tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic)); - /* - * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory - * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest. - */ - if ('.' in insideCurrentDirectoryGroup) { - tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic)); - } - else { - tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic)); - } - return tasks; -} -exports.convertPatternsToTasks = convertPatternsToTasks; -function getPositivePatterns(patterns) { - return utils.pattern.getPositivePatterns(patterns); -} -exports.getPositivePatterns = getPositivePatterns; -function getNegativePatternsAsPositive(patterns, ignore) { - const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore); - const positive = negative.map(utils.pattern.convertToPositivePattern); - return positive; -} -exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; -function groupPatternsByBaseDirectory(patterns) { - const group = {}; - return patterns.reduce((collection, pattern) => { - const base = utils.pattern.getBaseDirectory(pattern); - if (base in collection) { - collection[base].push(pattern); - } - else { - collection[base] = [pattern]; - } - return collection; - }, group); -} -exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; -function convertPatternGroupsToTasks(positive, negative, dynamic) { - return Object.keys(positive).map((base) => { - return convertPatternGroupToTask(base, positive[base], negative, dynamic); - }); -} -exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; -function convertPatternGroupToTask(base, positive, negative, dynamic) { - return { - dynamic, - positive, - negative, - base, - patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern)) - }; -} -exports.convertPatternGroupToTask = convertPatternGroupToTask; diff --git a/node_modules/fast-glob/out/providers/async.d.ts b/node_modules/fast-glob/out/providers/async.d.ts deleted file mode 100644 index 2742616..0000000 --- a/node_modules/fast-glob/out/providers/async.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Task } from '../managers/tasks'; -import { Entry, EntryItem, ReaderOptions } from '../types'; -import ReaderAsync from '../readers/async'; -import Provider from './provider'; -export default class ProviderAsync extends Provider> { - protected _reader: ReaderAsync; - read(task: Task): Promise; - api(root: string, task: Task, options: ReaderOptions): Promise; -} diff --git a/node_modules/fast-glob/out/providers/async.js b/node_modules/fast-glob/out/providers/async.js deleted file mode 100644 index 0c5286e..0000000 --- a/node_modules/fast-glob/out/providers/async.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const async_1 = require("../readers/async"); -const provider_1 = require("./provider"); -class ProviderAsync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new async_1.default(this._settings); - } - async read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = await this.api(root, task, options); - return entries.map((entry) => options.transform(entry)); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports.default = ProviderAsync; diff --git a/node_modules/fast-glob/out/providers/filters/deep.d.ts b/node_modules/fast-glob/out/providers/filters/deep.d.ts deleted file mode 100644 index 377fab8..0000000 --- a/node_modules/fast-glob/out/providers/filters/deep.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { MicromatchOptions, EntryFilterFunction, Pattern } from '../../types'; -import Settings from '../../settings'; -export default class DeepFilter { - private readonly _settings; - private readonly _micromatchOptions; - constructor(_settings: Settings, _micromatchOptions: MicromatchOptions); - getFilter(basePath: string, positive: Pattern[], negative: Pattern[]): EntryFilterFunction; - private _getMatcher; - private _getNegativePatternsRe; - private _filter; - private _isSkippedByDeep; - private _getEntryLevel; - private _isSkippedSymbolicLink; - private _isSkippedByPositivePatterns; - private _isSkippedByNegativePatterns; -} diff --git a/node_modules/fast-glob/out/providers/filters/deep.js b/node_modules/fast-glob/out/providers/filters/deep.js deleted file mode 100644 index 644bf41..0000000 --- a/node_modules/fast-glob/out/providers/filters/deep.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = require("../../utils"); -const partial_1 = require("../matchers/partial"); -class DeepFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - } - getFilter(basePath, positive, negative) { - const matcher = this._getMatcher(positive); - const negativeRe = this._getNegativePatternsRe(negative); - return (entry) => this._filter(basePath, entry, matcher, negativeRe); - } - _getMatcher(patterns) { - return new partial_1.default(patterns, this._settings, this._micromatchOptions); - } - _getNegativePatternsRe(patterns) { - const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern); - return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions); - } - _filter(basePath, entry, matcher, negativeRe) { - if (this._isSkippedByDeep(basePath, entry.path)) { - return false; - } - if (this._isSkippedSymbolicLink(entry)) { - return false; - } - const filepath = utils.path.removeLeadingDotSegment(entry.path); - if (this._isSkippedByPositivePatterns(filepath, matcher)) { - return false; - } - return this._isSkippedByNegativePatterns(filepath, negativeRe); - } - _isSkippedByDeep(basePath, entryPath) { - /** - * Avoid unnecessary depth calculations when it doesn't matter. - */ - if (this._settings.deep === Infinity) { - return false; - } - return this._getEntryLevel(basePath, entryPath) >= this._settings.deep; - } - _getEntryLevel(basePath, entryPath) { - const entryPathDepth = entryPath.split('/').length; - if (basePath === '') { - return entryPathDepth; - } - const basePathDepth = basePath.split('/').length; - return entryPathDepth - basePathDepth; - } - _isSkippedSymbolicLink(entry) { - return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink(); - } - _isSkippedByPositivePatterns(entryPath, matcher) { - return !this._settings.baseNameMatch && !matcher.match(entryPath); - } - _isSkippedByNegativePatterns(entryPath, patternsRe) { - return !utils.pattern.matchAny(entryPath, patternsRe); - } -} -exports.default = DeepFilter; diff --git a/node_modules/fast-glob/out/providers/filters/entry.d.ts b/node_modules/fast-glob/out/providers/filters/entry.d.ts deleted file mode 100644 index 23db353..0000000 --- a/node_modules/fast-glob/out/providers/filters/entry.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import Settings from '../../settings'; -import { EntryFilterFunction, MicromatchOptions, Pattern } from '../../types'; -export default class EntryFilter { - private readonly _settings; - private readonly _micromatchOptions; - readonly index: Map; - constructor(_settings: Settings, _micromatchOptions: MicromatchOptions); - getFilter(positive: Pattern[], negative: Pattern[]): EntryFilterFunction; - private _filter; - private _isDuplicateEntry; - private _createIndexRecord; - private _onlyFileFilter; - private _onlyDirectoryFilter; - private _isMatchToPatternsSet; - private _isMatchToAbsoluteNegative; - private _isMatchToPatterns; -} diff --git a/node_modules/fast-glob/out/providers/filters/entry.js b/node_modules/fast-glob/out/providers/filters/entry.js deleted file mode 100644 index 0c9210c..0000000 --- a/node_modules/fast-glob/out/providers/filters/entry.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = require("../../utils"); -class EntryFilter { - constructor(_settings, _micromatchOptions) { - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this.index = new Map(); - } - getFilter(positive, negative) { - const [absoluteNegative, relativeNegative] = utils.pattern.partitionAbsoluteAndRelative(negative); - const patterns = { - positive: { - all: utils.pattern.convertPatternsToRe(positive, this._micromatchOptions) - }, - negative: { - absolute: utils.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })), - relative: utils.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })) - } - }; - return (entry) => this._filter(entry, patterns); - } - _filter(entry, patterns) { - const filepath = utils.path.removeLeadingDotSegment(entry.path); - if (this._settings.unique && this._isDuplicateEntry(filepath)) { - return false; - } - if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) { - return false; - } - const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory()); - if (this._settings.unique && isMatched) { - this._createIndexRecord(filepath); - } - return isMatched; - } - _isDuplicateEntry(filepath) { - return this.index.has(filepath); - } - _createIndexRecord(filepath) { - this.index.set(filepath, undefined); - } - _onlyFileFilter(entry) { - return this._settings.onlyFiles && !entry.dirent.isFile(); - } - _onlyDirectoryFilter(entry) { - return this._settings.onlyDirectories && !entry.dirent.isDirectory(); - } - _isMatchToPatternsSet(filepath, patterns, isDirectory) { - const isMatched = this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory); - if (!isMatched) { - return false; - } - const isMatchedByRelativeNegative = this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory); - if (isMatchedByRelativeNegative) { - return false; - } - const isMatchedByAbsoluteNegative = this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory); - if (isMatchedByAbsoluteNegative) { - return false; - } - return true; - } - _isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory) { - if (patternsRe.length === 0) { - return false; - } - const fullpath = utils.path.makeAbsolute(this._settings.cwd, filepath); - return this._isMatchToPatterns(fullpath, patternsRe, isDirectory); - } - _isMatchToPatterns(filepath, patternsRe, isDirectory) { - if (patternsRe.length === 0) { - return false; - } - // Trying to match files and directories by patterns. - const isMatched = utils.pattern.matchAny(filepath, patternsRe); - // A pattern with a trailling slash can be used for directory matching. - // To apply such pattern, we need to add a tralling slash to the path. - if (!isMatched && isDirectory) { - return utils.pattern.matchAny(filepath + '/', patternsRe); - } - return isMatched; - } -} -exports.default = EntryFilter; diff --git a/node_modules/fast-glob/out/providers/filters/error.d.ts b/node_modules/fast-glob/out/providers/filters/error.d.ts deleted file mode 100644 index 170eb25..0000000 --- a/node_modules/fast-glob/out/providers/filters/error.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import Settings from '../../settings'; -import { ErrorFilterFunction } from '../../types'; -export default class ErrorFilter { - private readonly _settings; - constructor(_settings: Settings); - getFilter(): ErrorFilterFunction; - private _isNonFatalError; -} diff --git a/node_modules/fast-glob/out/providers/filters/error.js b/node_modules/fast-glob/out/providers/filters/error.js deleted file mode 100644 index 1c6f241..0000000 --- a/node_modules/fast-glob/out/providers/filters/error.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = require("../../utils"); -class ErrorFilter { - constructor(_settings) { - this._settings = _settings; - } - getFilter() { - return (error) => this._isNonFatalError(error); - } - _isNonFatalError(error) { - return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors; - } -} -exports.default = ErrorFilter; diff --git a/node_modules/fast-glob/out/providers/matchers/matcher.d.ts b/node_modules/fast-glob/out/providers/matchers/matcher.d.ts deleted file mode 100644 index d04c232..0000000 --- a/node_modules/fast-glob/out/providers/matchers/matcher.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { Pattern, MicromatchOptions, PatternRe } from '../../types'; -import Settings from '../../settings'; -export type PatternSegment = StaticPatternSegment | DynamicPatternSegment; -type StaticPatternSegment = { - dynamic: false; - pattern: Pattern; -}; -type DynamicPatternSegment = { - dynamic: true; - pattern: Pattern; - patternRe: PatternRe; -}; -export type PatternSection = PatternSegment[]; -export type PatternInfo = { - /** - * Indicates that the pattern has a globstar (more than a single section). - */ - complete: boolean; - pattern: Pattern; - segments: PatternSegment[]; - sections: PatternSection[]; -}; -export default abstract class Matcher { - private readonly _patterns; - private readonly _settings; - private readonly _micromatchOptions; - protected readonly _storage: PatternInfo[]; - constructor(_patterns: Pattern[], _settings: Settings, _micromatchOptions: MicromatchOptions); - private _fillStorage; - private _getPatternSegments; - private _splitSegmentsIntoSections; -} -export {}; diff --git a/node_modules/fast-glob/out/providers/matchers/matcher.js b/node_modules/fast-glob/out/providers/matchers/matcher.js deleted file mode 100644 index eae67c9..0000000 --- a/node_modules/fast-glob/out/providers/matchers/matcher.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = require("../../utils"); -class Matcher { - constructor(_patterns, _settings, _micromatchOptions) { - this._patterns = _patterns; - this._settings = _settings; - this._micromatchOptions = _micromatchOptions; - this._storage = []; - this._fillStorage(); - } - _fillStorage() { - for (const pattern of this._patterns) { - const segments = this._getPatternSegments(pattern); - const sections = this._splitSegmentsIntoSections(segments); - this._storage.push({ - complete: sections.length <= 1, - pattern, - segments, - sections - }); - } - } - _getPatternSegments(pattern) { - const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions); - return parts.map((part) => { - const dynamic = utils.pattern.isDynamicPattern(part, this._settings); - if (!dynamic) { - return { - dynamic: false, - pattern: part - }; - } - return { - dynamic: true, - pattern: part, - patternRe: utils.pattern.makeRe(part, this._micromatchOptions) - }; - }); - } - _splitSegmentsIntoSections(segments) { - return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern)); - } -} -exports.default = Matcher; diff --git a/node_modules/fast-glob/out/providers/matchers/partial.d.ts b/node_modules/fast-glob/out/providers/matchers/partial.d.ts deleted file mode 100644 index 91520f6..0000000 --- a/node_modules/fast-glob/out/providers/matchers/partial.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import Matcher from './matcher'; -export default class PartialMatcher extends Matcher { - match(filepath: string): boolean; -} diff --git a/node_modules/fast-glob/out/providers/matchers/partial.js b/node_modules/fast-glob/out/providers/matchers/partial.js deleted file mode 100644 index 1dfffeb..0000000 --- a/node_modules/fast-glob/out/providers/matchers/partial.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const matcher_1 = require("./matcher"); -class PartialMatcher extends matcher_1.default { - match(filepath) { - const parts = filepath.split('/'); - const levels = parts.length; - const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels); - for (const pattern of patterns) { - const section = pattern.sections[0]; - /** - * In this case, the pattern has a globstar and we must read all directories unconditionally, - * but only if the level has reached the end of the first group. - * - * fixtures/{a,b}/** - * ^ true/false ^ always true - */ - if (!pattern.complete && levels > section.length) { - return true; - } - const match = parts.every((part, index) => { - const segment = pattern.segments[index]; - if (segment.dynamic && segment.patternRe.test(part)) { - return true; - } - if (!segment.dynamic && segment.pattern === part) { - return true; - } - return false; - }); - if (match) { - return true; - } - } - return false; - } -} -exports.default = PartialMatcher; diff --git a/node_modules/fast-glob/out/providers/provider.d.ts b/node_modules/fast-glob/out/providers/provider.d.ts deleted file mode 100644 index 1053460..0000000 --- a/node_modules/fast-glob/out/providers/provider.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { Task } from '../managers/tasks'; -import Settings from '../settings'; -import { MicromatchOptions, ReaderOptions } from '../types'; -import DeepFilter from './filters/deep'; -import EntryFilter from './filters/entry'; -import ErrorFilter from './filters/error'; -import EntryTransformer from './transformers/entry'; -export default abstract class Provider { - protected readonly _settings: Settings; - readonly errorFilter: ErrorFilter; - readonly entryFilter: EntryFilter; - readonly deepFilter: DeepFilter; - readonly entryTransformer: EntryTransformer; - constructor(_settings: Settings); - abstract read(_task: Task): T; - protected _getRootDirectory(task: Task): string; - protected _getReaderOptions(task: Task): ReaderOptions; - protected _getMicromatchOptions(): MicromatchOptions; -} diff --git a/node_modules/fast-glob/out/providers/provider.js b/node_modules/fast-glob/out/providers/provider.js deleted file mode 100644 index da88ee0..0000000 --- a/node_modules/fast-glob/out/providers/provider.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = require("path"); -const deep_1 = require("./filters/deep"); -const entry_1 = require("./filters/entry"); -const error_1 = require("./filters/error"); -const entry_2 = require("./transformers/entry"); -class Provider { - constructor(_settings) { - this._settings = _settings; - this.errorFilter = new error_1.default(this._settings); - this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions()); - this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions()); - this.entryTransformer = new entry_2.default(this._settings); - } - _getRootDirectory(task) { - return path.resolve(this._settings.cwd, task.base); - } - _getReaderOptions(task) { - const basePath = task.base === '.' ? '' : task.base; - return { - basePath, - pathSegmentSeparator: '/', - concurrency: this._settings.concurrency, - deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative), - entryFilter: this.entryFilter.getFilter(task.positive, task.negative), - errorFilter: this.errorFilter.getFilter(), - followSymbolicLinks: this._settings.followSymbolicLinks, - fs: this._settings.fs, - stats: this._settings.stats, - throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink, - transform: this.entryTransformer.getTransformer() - }; - } - _getMicromatchOptions() { - return { - dot: this._settings.dot, - matchBase: this._settings.baseNameMatch, - nobrace: !this._settings.braceExpansion, - nocase: !this._settings.caseSensitiveMatch, - noext: !this._settings.extglob, - noglobstar: !this._settings.globstar, - posix: true, - strictSlashes: false - }; - } -} -exports.default = Provider; diff --git a/node_modules/fast-glob/out/providers/stream.d.ts b/node_modules/fast-glob/out/providers/stream.d.ts deleted file mode 100644 index 3d02a1f..0000000 --- a/node_modules/fast-glob/out/providers/stream.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/// -import { Readable } from 'stream'; -import { Task } from '../managers/tasks'; -import ReaderStream from '../readers/stream'; -import { ReaderOptions } from '../types'; -import Provider from './provider'; -export default class ProviderStream extends Provider { - protected _reader: ReaderStream; - read(task: Task): Readable; - api(root: string, task: Task, options: ReaderOptions): Readable; -} diff --git a/node_modules/fast-glob/out/providers/stream.js b/node_modules/fast-glob/out/providers/stream.js deleted file mode 100644 index 85da62e..0000000 --- a/node_modules/fast-glob/out/providers/stream.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = require("stream"); -const stream_2 = require("../readers/stream"); -const provider_1 = require("./provider"); -class ProviderStream extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new stream_2.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const source = this.api(root, task, options); - const destination = new stream_1.Readable({ objectMode: true, read: () => { } }); - source - .once('error', (error) => destination.emit('error', error)) - .on('data', (entry) => destination.emit('data', options.transform(entry))) - .once('end', () => destination.emit('end')); - destination - .once('close', () => source.destroy()); - return destination; - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports.default = ProviderStream; diff --git a/node_modules/fast-glob/out/providers/sync.d.ts b/node_modules/fast-glob/out/providers/sync.d.ts deleted file mode 100644 index 9c0fe1e..0000000 --- a/node_modules/fast-glob/out/providers/sync.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Task } from '../managers/tasks'; -import ReaderSync from '../readers/sync'; -import { Entry, EntryItem, ReaderOptions } from '../types'; -import Provider from './provider'; -export default class ProviderSync extends Provider { - protected _reader: ReaderSync; - read(task: Task): EntryItem[]; - api(root: string, task: Task, options: ReaderOptions): Entry[]; -} diff --git a/node_modules/fast-glob/out/providers/sync.js b/node_modules/fast-glob/out/providers/sync.js deleted file mode 100644 index d70aa1b..0000000 --- a/node_modules/fast-glob/out/providers/sync.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const sync_1 = require("../readers/sync"); -const provider_1 = require("./provider"); -class ProviderSync extends provider_1.default { - constructor() { - super(...arguments); - this._reader = new sync_1.default(this._settings); - } - read(task) { - const root = this._getRootDirectory(task); - const options = this._getReaderOptions(task); - const entries = this.api(root, task, options); - return entries.map(options.transform); - } - api(root, task, options) { - if (task.dynamic) { - return this._reader.dynamic(root, options); - } - return this._reader.static(task.patterns, options); - } -} -exports.default = ProviderSync; diff --git a/node_modules/fast-glob/out/providers/transformers/entry.d.ts b/node_modules/fast-glob/out/providers/transformers/entry.d.ts deleted file mode 100644 index e9b85fa..0000000 --- a/node_modules/fast-glob/out/providers/transformers/entry.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import Settings from '../../settings'; -import { EntryTransformerFunction } from '../../types'; -export default class EntryTransformer { - private readonly _settings; - constructor(_settings: Settings); - getTransformer(): EntryTransformerFunction; - private _transform; -} diff --git a/node_modules/fast-glob/out/providers/transformers/entry.js b/node_modules/fast-glob/out/providers/transformers/entry.js deleted file mode 100644 index d11903c..0000000 --- a/node_modules/fast-glob/out/providers/transformers/entry.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const utils = require("../../utils"); -class EntryTransformer { - constructor(_settings) { - this._settings = _settings; - } - getTransformer() { - return (entry) => this._transform(entry); - } - _transform(entry) { - let filepath = entry.path; - if (this._settings.absolute) { - filepath = utils.path.makeAbsolute(this._settings.cwd, filepath); - filepath = utils.path.unixify(filepath); - } - if (this._settings.markDirectories && entry.dirent.isDirectory()) { - filepath += '/'; - } - if (!this._settings.objectMode) { - return filepath; - } - return Object.assign(Object.assign({}, entry), { path: filepath }); - } -} -exports.default = EntryTransformer; diff --git a/node_modules/fast-glob/out/readers/async.d.ts b/node_modules/fast-glob/out/readers/async.d.ts deleted file mode 100644 index fbca428..0000000 --- a/node_modules/fast-glob/out/readers/async.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as fsWalk from '@nodelib/fs.walk'; -import { Entry, ReaderOptions, Pattern } from '../types'; -import Reader from './reader'; -import ReaderStream from './stream'; -export default class ReaderAsync extends Reader> { - protected _walkAsync: typeof fsWalk.walk; - protected _readerStream: ReaderStream; - dynamic(root: string, options: ReaderOptions): Promise; - static(patterns: Pattern[], options: ReaderOptions): Promise; -} diff --git a/node_modules/fast-glob/out/readers/async.js b/node_modules/fast-glob/out/readers/async.js deleted file mode 100644 index d024145..0000000 --- a/node_modules/fast-glob/out/readers/async.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const fsWalk = require("@nodelib/fs.walk"); -const reader_1 = require("./reader"); -const stream_1 = require("./stream"); -class ReaderAsync extends reader_1.default { - constructor() { - super(...arguments); - this._walkAsync = fsWalk.walk; - this._readerStream = new stream_1.default(this._settings); - } - dynamic(root, options) { - return new Promise((resolve, reject) => { - this._walkAsync(root, options, (error, entries) => { - if (error === null) { - resolve(entries); - } - else { - reject(error); - } - }); - }); - } - async static(patterns, options) { - const entries = []; - const stream = this._readerStream.static(patterns, options); - // After #235, replace it with an asynchronous iterator. - return new Promise((resolve, reject) => { - stream.once('error', reject); - stream.on('data', (entry) => entries.push(entry)); - stream.once('end', () => resolve(entries)); - }); - } -} -exports.default = ReaderAsync; diff --git a/node_modules/fast-glob/out/readers/reader.d.ts b/node_modules/fast-glob/out/readers/reader.d.ts deleted file mode 100644 index 2af16b6..0000000 --- a/node_modules/fast-glob/out/readers/reader.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// -import * as fs from 'fs'; -import * as fsStat from '@nodelib/fs.stat'; -import Settings from '../settings'; -import { Entry, ErrnoException, Pattern, ReaderOptions } from '../types'; -export default abstract class Reader { - protected readonly _settings: Settings; - protected readonly _fsStatSettings: fsStat.Settings; - constructor(_settings: Settings); - abstract dynamic(root: string, options: ReaderOptions): T; - abstract static(patterns: Pattern[], options: ReaderOptions): T; - protected _getFullEntryPath(filepath: string): string; - protected _makeEntry(stats: fs.Stats, pattern: Pattern): Entry; - protected _isFatalError(error: ErrnoException): boolean; -} diff --git a/node_modules/fast-glob/out/readers/reader.js b/node_modules/fast-glob/out/readers/reader.js deleted file mode 100644 index 7b40255..0000000 --- a/node_modules/fast-glob/out/readers/reader.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const path = require("path"); -const fsStat = require("@nodelib/fs.stat"); -const utils = require("../utils"); -class Reader { - constructor(_settings) { - this._settings = _settings; - this._fsStatSettings = new fsStat.Settings({ - followSymbolicLink: this._settings.followSymbolicLinks, - fs: this._settings.fs, - throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks - }); - } - _getFullEntryPath(filepath) { - return path.resolve(this._settings.cwd, filepath); - } - _makeEntry(stats, pattern) { - const entry = { - name: pattern, - path: pattern, - dirent: utils.fs.createDirentFromStats(pattern, stats) - }; - if (this._settings.stats) { - entry.stats = stats; - } - return entry; - } - _isFatalError(error) { - return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors; - } -} -exports.default = Reader; diff --git a/node_modules/fast-glob/out/readers/stream.d.ts b/node_modules/fast-glob/out/readers/stream.d.ts deleted file mode 100644 index 1c74cac..0000000 --- a/node_modules/fast-glob/out/readers/stream.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/// -import { Readable } from 'stream'; -import * as fsStat from '@nodelib/fs.stat'; -import * as fsWalk from '@nodelib/fs.walk'; -import { Pattern, ReaderOptions } from '../types'; -import Reader from './reader'; -export default class ReaderStream extends Reader { - protected _walkStream: typeof fsWalk.walkStream; - protected _stat: typeof fsStat.stat; - dynamic(root: string, options: ReaderOptions): Readable; - static(patterns: Pattern[], options: ReaderOptions): Readable; - private _getEntry; - private _getStat; -} diff --git a/node_modules/fast-glob/out/readers/stream.js b/node_modules/fast-glob/out/readers/stream.js deleted file mode 100644 index 317c6d5..0000000 --- a/node_modules/fast-glob/out/readers/stream.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const stream_1 = require("stream"); -const fsStat = require("@nodelib/fs.stat"); -const fsWalk = require("@nodelib/fs.walk"); -const reader_1 = require("./reader"); -class ReaderStream extends reader_1.default { - constructor() { - super(...arguments); - this._walkStream = fsWalk.walkStream; - this._stat = fsStat.stat; - } - dynamic(root, options) { - return this._walkStream(root, options); - } - static(patterns, options) { - const filepaths = patterns.map(this._getFullEntryPath, this); - const stream = new stream_1.PassThrough({ objectMode: true }); - stream._write = (index, _enc, done) => { - return this._getEntry(filepaths[index], patterns[index], options) - .then((entry) => { - if (entry !== null && options.entryFilter(entry)) { - stream.push(entry); - } - if (index === filepaths.length - 1) { - stream.end(); - } - done(); - }) - .catch(done); - }; - for (let i = 0; i < filepaths.length; i++) { - stream.write(i); - } - return stream; - } - _getEntry(filepath, pattern, options) { - return this._getStat(filepath) - .then((stats) => this._makeEntry(stats, pattern)) - .catch((error) => { - if (options.errorFilter(error)) { - return null; - } - throw error; - }); - } - _getStat(filepath) { - return new Promise((resolve, reject) => { - this._stat(filepath, this._fsStatSettings, (error, stats) => { - return error === null ? resolve(stats) : reject(error); - }); - }); - } -} -exports.default = ReaderStream; diff --git a/node_modules/fast-glob/out/readers/sync.d.ts b/node_modules/fast-glob/out/readers/sync.d.ts deleted file mode 100644 index c96ffee..0000000 --- a/node_modules/fast-glob/out/readers/sync.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import * as fsStat from '@nodelib/fs.stat'; -import * as fsWalk from '@nodelib/fs.walk'; -import { Entry, Pattern, ReaderOptions } from '../types'; -import Reader from './reader'; -export default class ReaderSync extends Reader { - protected _walkSync: typeof fsWalk.walkSync; - protected _statSync: typeof fsStat.statSync; - dynamic(root: string, options: ReaderOptions): Entry[]; - static(patterns: Pattern[], options: ReaderOptions): Entry[]; - private _getEntry; - private _getStat; -} diff --git a/node_modules/fast-glob/out/readers/sync.js b/node_modules/fast-glob/out/readers/sync.js deleted file mode 100644 index 4704d65..0000000 --- a/node_modules/fast-glob/out/readers/sync.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const fsStat = require("@nodelib/fs.stat"); -const fsWalk = require("@nodelib/fs.walk"); -const reader_1 = require("./reader"); -class ReaderSync extends reader_1.default { - constructor() { - super(...arguments); - this._walkSync = fsWalk.walkSync; - this._statSync = fsStat.statSync; - } - dynamic(root, options) { - return this._walkSync(root, options); - } - static(patterns, options) { - const entries = []; - for (const pattern of patterns) { - const filepath = this._getFullEntryPath(pattern); - const entry = this._getEntry(filepath, pattern, options); - if (entry === null || !options.entryFilter(entry)) { - continue; - } - entries.push(entry); - } - return entries; - } - _getEntry(filepath, pattern, options) { - try { - const stats = this._getStat(filepath); - return this._makeEntry(stats, pattern); - } - catch (error) { - if (options.errorFilter(error)) { - return null; - } - throw error; - } - } - _getStat(filepath) { - return this._statSync(filepath, this._fsStatSettings); - } -} -exports.default = ReaderSync; diff --git a/node_modules/fast-glob/out/settings.d.ts b/node_modules/fast-glob/out/settings.d.ts deleted file mode 100644 index 76a74f8..0000000 --- a/node_modules/fast-glob/out/settings.d.ts +++ /dev/null @@ -1,164 +0,0 @@ -import { FileSystemAdapter, Pattern } from './types'; -export declare const DEFAULT_FILE_SYSTEM_ADAPTER: FileSystemAdapter; -export type Options = { - /** - * Return the absolute path for entries. - * - * @default false - */ - absolute?: boolean; - /** - * If set to `true`, then patterns without slashes will be matched against - * the basename of the path if it contains slashes. - * - * @default false - */ - baseNameMatch?: boolean; - /** - * Enables Bash-like brace expansion. - * - * @default true - */ - braceExpansion?: boolean; - /** - * Enables a case-sensitive mode for matching files. - * - * @default true - */ - caseSensitiveMatch?: boolean; - /** - * Specifies the maximum number of concurrent requests from a reader to read - * directories. - * - * @default os.cpus().length - */ - concurrency?: number; - /** - * The current working directory in which to search. - * - * @default process.cwd() - */ - cwd?: string; - /** - * Specifies the maximum depth of a read directory relative to the start - * directory. - * - * @default Infinity - */ - deep?: number; - /** - * Allow patterns to match entries that begin with a period (`.`). - * - * @default false - */ - dot?: boolean; - /** - * Enables Bash-like `extglob` functionality. - * - * @default true - */ - extglob?: boolean; - /** - * Indicates whether to traverse descendants of symbolic link directories. - * - * @default true - */ - followSymbolicLinks?: boolean; - /** - * Custom implementation of methods for working with the file system. - * - * @default fs.* - */ - fs?: Partial; - /** - * Enables recursively repeats a pattern containing `**`. - * If `false`, `**` behaves exactly like `*`. - * - * @default true - */ - globstar?: boolean; - /** - * An array of glob patterns to exclude matches. - * This is an alternative way to use negative patterns. - * - * @default [] - */ - ignore?: Pattern[]; - /** - * Mark the directory path with the final slash. - * - * @default false - */ - markDirectories?: boolean; - /** - * Returns objects (instead of strings) describing entries. - * - * @default false - */ - objectMode?: boolean; - /** - * Return only directories. - * - * @default false - */ - onlyDirectories?: boolean; - /** - * Return only files. - * - * @default true - */ - onlyFiles?: boolean; - /** - * Enables an object mode (`objectMode`) with an additional `stats` field. - * - * @default false - */ - stats?: boolean; - /** - * By default this package suppress only `ENOENT` errors. - * Set to `true` to suppress any error. - * - * @default false - */ - suppressErrors?: boolean; - /** - * Throw an error when symbolic link is broken if `true` or safely - * return `lstat` call if `false`. - * - * @default false - */ - throwErrorOnBrokenSymbolicLink?: boolean; - /** - * Ensures that the returned entries are unique. - * - * @default true - */ - unique?: boolean; -}; -export default class Settings { - private readonly _options; - readonly absolute: boolean; - readonly baseNameMatch: boolean; - readonly braceExpansion: boolean; - readonly caseSensitiveMatch: boolean; - readonly concurrency: number; - readonly cwd: string; - readonly deep: number; - readonly dot: boolean; - readonly extglob: boolean; - readonly followSymbolicLinks: boolean; - readonly fs: FileSystemAdapter; - readonly globstar: boolean; - readonly ignore: Pattern[]; - readonly markDirectories: boolean; - readonly objectMode: boolean; - readonly onlyDirectories: boolean; - readonly onlyFiles: boolean; - readonly stats: boolean; - readonly suppressErrors: boolean; - readonly throwErrorOnBrokenSymbolicLink: boolean; - readonly unique: boolean; - constructor(_options?: Options); - private _getValue; - private _getFileSystemMethods; -} diff --git a/node_modules/fast-glob/out/settings.js b/node_modules/fast-glob/out/settings.js deleted file mode 100644 index 23f916c..0000000 --- a/node_modules/fast-glob/out/settings.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0; -const fs = require("fs"); -const os = require("os"); -/** - * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero. - * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107 - */ -const CPU_COUNT = Math.max(os.cpus().length, 1); -exports.DEFAULT_FILE_SYSTEM_ADAPTER = { - lstat: fs.lstat, - lstatSync: fs.lstatSync, - stat: fs.stat, - statSync: fs.statSync, - readdir: fs.readdir, - readdirSync: fs.readdirSync -}; -class Settings { - constructor(_options = {}) { - this._options = _options; - this.absolute = this._getValue(this._options.absolute, false); - this.baseNameMatch = this._getValue(this._options.baseNameMatch, false); - this.braceExpansion = this._getValue(this._options.braceExpansion, true); - this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true); - this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT); - this.cwd = this._getValue(this._options.cwd, process.cwd()); - this.deep = this._getValue(this._options.deep, Infinity); - this.dot = this._getValue(this._options.dot, false); - this.extglob = this._getValue(this._options.extglob, true); - this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true); - this.fs = this._getFileSystemMethods(this._options.fs); - this.globstar = this._getValue(this._options.globstar, true); - this.ignore = this._getValue(this._options.ignore, []); - this.markDirectories = this._getValue(this._options.markDirectories, false); - this.objectMode = this._getValue(this._options.objectMode, false); - this.onlyDirectories = this._getValue(this._options.onlyDirectories, false); - this.onlyFiles = this._getValue(this._options.onlyFiles, true); - this.stats = this._getValue(this._options.stats, false); - this.suppressErrors = this._getValue(this._options.suppressErrors, false); - this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false); - this.unique = this._getValue(this._options.unique, true); - if (this.onlyDirectories) { - this.onlyFiles = false; - } - if (this.stats) { - this.objectMode = true; - } - // Remove the cast to the array in the next major (#404). - this.ignore = [].concat(this.ignore); - } - _getValue(option, value) { - return option === undefined ? value : option; - } - _getFileSystemMethods(methods = {}) { - return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods); - } -} -exports.default = Settings; diff --git a/node_modules/fast-glob/out/types/index.d.ts b/node_modules/fast-glob/out/types/index.d.ts deleted file mode 100644 index 6506caf..0000000 --- a/node_modules/fast-glob/out/types/index.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -/// -import * as fsWalk from '@nodelib/fs.walk'; -export type ErrnoException = NodeJS.ErrnoException; -export type Entry = fsWalk.Entry; -export type EntryItem = string | Entry; -export type Pattern = string; -export type PatternRe = RegExp; -export type PatternsGroup = Record; -export type ReaderOptions = fsWalk.Options & { - transform(entry: Entry): EntryItem; - deepFilter: DeepFilterFunction; - entryFilter: EntryFilterFunction; - errorFilter: ErrorFilterFunction; - fs: FileSystemAdapter; - stats: boolean; -}; -export type ErrorFilterFunction = fsWalk.ErrorFilterFunction; -export type EntryFilterFunction = fsWalk.EntryFilterFunction; -export type DeepFilterFunction = fsWalk.DeepFilterFunction; -export type EntryTransformerFunction = (entry: Entry) => EntryItem; -export type MicromatchOptions = { - dot?: boolean; - matchBase?: boolean; - nobrace?: boolean; - nocase?: boolean; - noext?: boolean; - noglobstar?: boolean; - posix?: boolean; - strictSlashes?: boolean; -}; -export type FileSystemAdapter = fsWalk.FileSystemAdapter; diff --git a/node_modules/fast-glob/out/types/index.js b/node_modules/fast-glob/out/types/index.js deleted file mode 100644 index c8ad2e5..0000000 --- a/node_modules/fast-glob/out/types/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/node_modules/fast-glob/out/utils/array.d.ts b/node_modules/fast-glob/out/utils/array.d.ts deleted file mode 100644 index 98e7325..0000000 --- a/node_modules/fast-glob/out/utils/array.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function flatten(items: T[][]): T[]; -export declare function splitWhen(items: T[], predicate: (item: T) => boolean): T[][]; diff --git a/node_modules/fast-glob/out/utils/array.js b/node_modules/fast-glob/out/utils/array.js deleted file mode 100644 index 50c406e..0000000 --- a/node_modules/fast-glob/out/utils/array.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.splitWhen = exports.flatten = void 0; -function flatten(items) { - return items.reduce((collection, item) => [].concat(collection, item), []); -} -exports.flatten = flatten; -function splitWhen(items, predicate) { - const result = [[]]; - let groupIndex = 0; - for (const item of items) { - if (predicate(item)) { - groupIndex++; - result[groupIndex] = []; - } - else { - result[groupIndex].push(item); - } - } - return result; -} -exports.splitWhen = splitWhen; diff --git a/node_modules/fast-glob/out/utils/errno.d.ts b/node_modules/fast-glob/out/utils/errno.d.ts deleted file mode 100644 index 1c08d3b..0000000 --- a/node_modules/fast-glob/out/utils/errno.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { ErrnoException } from '../types'; -export declare function isEnoentCodeError(error: ErrnoException): boolean; diff --git a/node_modules/fast-glob/out/utils/errno.js b/node_modules/fast-glob/out/utils/errno.js deleted file mode 100644 index f0bd801..0000000 --- a/node_modules/fast-glob/out/utils/errno.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isEnoentCodeError = void 0; -function isEnoentCodeError(error) { - return error.code === 'ENOENT'; -} -exports.isEnoentCodeError = isEnoentCodeError; diff --git a/node_modules/fast-glob/out/utils/fs.d.ts b/node_modules/fast-glob/out/utils/fs.d.ts deleted file mode 100644 index 64c61ce..0000000 --- a/node_modules/fast-glob/out/utils/fs.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -import * as fs from 'fs'; -import { Dirent } from '@nodelib/fs.walk'; -export declare function createDirentFromStats(name: string, stats: fs.Stats): Dirent; diff --git a/node_modules/fast-glob/out/utils/fs.js b/node_modules/fast-glob/out/utils/fs.js deleted file mode 100644 index ace7c74..0000000 --- a/node_modules/fast-glob/out/utils/fs.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.createDirentFromStats = void 0; -class DirentFromStats { - constructor(name, stats) { - this.name = name; - this.isBlockDevice = stats.isBlockDevice.bind(stats); - this.isCharacterDevice = stats.isCharacterDevice.bind(stats); - this.isDirectory = stats.isDirectory.bind(stats); - this.isFIFO = stats.isFIFO.bind(stats); - this.isFile = stats.isFile.bind(stats); - this.isSocket = stats.isSocket.bind(stats); - this.isSymbolicLink = stats.isSymbolicLink.bind(stats); - } -} -function createDirentFromStats(name, stats) { - return new DirentFromStats(name, stats); -} -exports.createDirentFromStats = createDirentFromStats; diff --git a/node_modules/fast-glob/out/utils/index.d.ts b/node_modules/fast-glob/out/utils/index.d.ts deleted file mode 100644 index f634cad..0000000 --- a/node_modules/fast-glob/out/utils/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import * as array from './array'; -import * as errno from './errno'; -import * as fs from './fs'; -import * as path from './path'; -import * as pattern from './pattern'; -import * as stream from './stream'; -import * as string from './string'; -export { array, errno, fs, path, pattern, stream, string }; diff --git a/node_modules/fast-glob/out/utils/index.js b/node_modules/fast-glob/out/utils/index.js deleted file mode 100644 index 0f92c16..0000000 --- a/node_modules/fast-glob/out/utils/index.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0; -const array = require("./array"); -exports.array = array; -const errno = require("./errno"); -exports.errno = errno; -const fs = require("./fs"); -exports.fs = fs; -const path = require("./path"); -exports.path = path; -const pattern = require("./pattern"); -exports.pattern = pattern; -const stream = require("./stream"); -exports.stream = stream; -const string = require("./string"); -exports.string = string; diff --git a/node_modules/fast-glob/out/utils/path.d.ts b/node_modules/fast-glob/out/utils/path.d.ts deleted file mode 100644 index 0b13f4b..0000000 --- a/node_modules/fast-glob/out/utils/path.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Pattern } from '../types'; -/** - * Designed to work only with simple paths: `dir\\file`. - */ -export declare function unixify(filepath: string): string; -export declare function makeAbsolute(cwd: string, filepath: string): string; -export declare function removeLeadingDotSegment(entry: string): string; -export declare const escape: typeof escapeWindowsPath; -export declare function escapeWindowsPath(pattern: Pattern): Pattern; -export declare function escapePosixPath(pattern: Pattern): Pattern; -export declare const convertPathToPattern: typeof convertWindowsPathToPattern; -export declare function convertWindowsPathToPattern(filepath: string): Pattern; -export declare function convertPosixPathToPattern(filepath: string): Pattern; diff --git a/node_modules/fast-glob/out/utils/path.js b/node_modules/fast-glob/out/utils/path.js deleted file mode 100644 index 7b53b39..0000000 --- a/node_modules/fast-glob/out/utils/path.js +++ /dev/null @@ -1,68 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0; -const os = require("os"); -const path = require("path"); -const IS_WINDOWS_PLATFORM = os.platform() === 'win32'; -const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\ -/** - * All non-escaped special characters. - * Posix: ()*?[]{|}, !+@ before (, ! at the beginning, \\ before non-special characters. - * Windows: (){}[], !+@ before (, ! at the beginning. - */ -const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g; -const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g; -/** - * The device path (\\.\ or \\?\). - * https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths - */ -const DOS_DEVICE_PATH_RE = /^\\\\([.?])/; -/** - * All backslashes except those escaping special characters. - * Windows: !()+@{} - * https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions - */ -const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g; -/** - * Designed to work only with simple paths: `dir\\file`. - */ -function unixify(filepath) { - return filepath.replace(/\\/g, '/'); -} -exports.unixify = unixify; -function makeAbsolute(cwd, filepath) { - return path.resolve(cwd, filepath); -} -exports.makeAbsolute = makeAbsolute; -function removeLeadingDotSegment(entry) { - // We do not use `startsWith` because this is 10x slower than current implementation for some cases. - // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with - if (entry.charAt(0) === '.') { - const secondCharactery = entry.charAt(1); - if (secondCharactery === '/' || secondCharactery === '\\') { - return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT); - } - } - return entry; -} -exports.removeLeadingDotSegment = removeLeadingDotSegment; -exports.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath; -function escapeWindowsPath(pattern) { - return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); -} -exports.escapeWindowsPath = escapeWindowsPath; -function escapePosixPath(pattern) { - return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2'); -} -exports.escapePosixPath = escapePosixPath; -exports.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern; -function convertWindowsPathToPattern(filepath) { - return escapeWindowsPath(filepath) - .replace(DOS_DEVICE_PATH_RE, '//$1') - .replace(WINDOWS_BACKSLASHES_RE, '/'); -} -exports.convertWindowsPathToPattern = convertWindowsPathToPattern; -function convertPosixPathToPattern(filepath) { - return escapePosixPath(filepath); -} -exports.convertPosixPathToPattern = convertPosixPathToPattern; diff --git a/node_modules/fast-glob/out/utils/pattern.d.ts b/node_modules/fast-glob/out/utils/pattern.d.ts deleted file mode 100644 index e3598a9..0000000 --- a/node_modules/fast-glob/out/utils/pattern.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { MicromatchOptions, Pattern, PatternRe } from '../types'; -type PatternTypeOptions = { - braceExpansion?: boolean; - caseSensitiveMatch?: boolean; - extglob?: boolean; -}; -export declare function isStaticPattern(pattern: Pattern, options?: PatternTypeOptions): boolean; -export declare function isDynamicPattern(pattern: Pattern, options?: PatternTypeOptions): boolean; -export declare function convertToPositivePattern(pattern: Pattern): Pattern; -export declare function convertToNegativePattern(pattern: Pattern): Pattern; -export declare function isNegativePattern(pattern: Pattern): boolean; -export declare function isPositivePattern(pattern: Pattern): boolean; -export declare function getNegativePatterns(patterns: Pattern[]): Pattern[]; -export declare function getPositivePatterns(patterns: Pattern[]): Pattern[]; -/** - * Returns patterns that can be applied inside the current directory. - * - * @example - * // ['./*', '*', 'a/*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ -export declare function getPatternsInsideCurrentDirectory(patterns: Pattern[]): Pattern[]; -/** - * Returns patterns to be expanded relative to (outside) the current directory. - * - * @example - * // ['../*', './../*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ -export declare function getPatternsOutsideCurrentDirectory(patterns: Pattern[]): Pattern[]; -export declare function isPatternRelatedToParentDirectory(pattern: Pattern): boolean; -export declare function getBaseDirectory(pattern: Pattern): string; -export declare function hasGlobStar(pattern: Pattern): boolean; -export declare function endsWithSlashGlobStar(pattern: Pattern): boolean; -export declare function isAffectDepthOfReadingPattern(pattern: Pattern): boolean; -export declare function expandPatternsWithBraceExpansion(patterns: Pattern[]): Pattern[]; -export declare function expandBraceExpansion(pattern: Pattern): Pattern[]; -export declare function getPatternParts(pattern: Pattern, options: MicromatchOptions): Pattern[]; -export declare function makeRe(pattern: Pattern, options: MicromatchOptions): PatternRe; -export declare function convertPatternsToRe(patterns: Pattern[], options: MicromatchOptions): PatternRe[]; -export declare function matchAny(entry: string, patternsRe: PatternRe[]): boolean; -/** - * This package only works with forward slashes as a path separator. - * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes. - */ -export declare function removeDuplicateSlashes(pattern: string): string; -export declare function partitionAbsoluteAndRelative(patterns: Pattern[]): Pattern[][]; -export declare function isAbsolute(pattern: string): boolean; -export {}; diff --git a/node_modules/fast-glob/out/utils/pattern.js b/node_modules/fast-glob/out/utils/pattern.js deleted file mode 100644 index b2924e7..0000000 --- a/node_modules/fast-glob/out/utils/pattern.js +++ /dev/null @@ -1,206 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0; -const path = require("path"); -const globParent = require("glob-parent"); -const micromatch = require("micromatch"); -const GLOBSTAR = '**'; -const ESCAPE_SYMBOL = '\\'; -const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/; -const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/; -const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/; -const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/; -const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./; -/** - * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string. - * The latter is due to the presence of the device path at the beginning of the UNC path. - */ -const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g; -function isStaticPattern(pattern, options = {}) { - return !isDynamicPattern(pattern, options); -} -exports.isStaticPattern = isStaticPattern; -function isDynamicPattern(pattern, options = {}) { - /** - * A special case with an empty string is necessary for matching patterns that start with a forward slash. - * An empty string cannot be a dynamic pattern. - * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'. - */ - if (pattern === '') { - return false; - } - /** - * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check - * filepath directly (without read directory). - */ - if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) { - return true; - } - if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) { - return true; - } - if (options.braceExpansion !== false && hasBraceExpansion(pattern)) { - return true; - } - return false; -} -exports.isDynamicPattern = isDynamicPattern; -function hasBraceExpansion(pattern) { - const openingBraceIndex = pattern.indexOf('{'); - if (openingBraceIndex === -1) { - return false; - } - const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1); - if (closingBraceIndex === -1) { - return false; - } - const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex); - return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent); -} -function convertToPositivePattern(pattern) { - return isNegativePattern(pattern) ? pattern.slice(1) : pattern; -} -exports.convertToPositivePattern = convertToPositivePattern; -function convertToNegativePattern(pattern) { - return '!' + pattern; -} -exports.convertToNegativePattern = convertToNegativePattern; -function isNegativePattern(pattern) { - return pattern.startsWith('!') && pattern[1] !== '('; -} -exports.isNegativePattern = isNegativePattern; -function isPositivePattern(pattern) { - return !isNegativePattern(pattern); -} -exports.isPositivePattern = isPositivePattern; -function getNegativePatterns(patterns) { - return patterns.filter(isNegativePattern); -} -exports.getNegativePatterns = getNegativePatterns; -function getPositivePatterns(patterns) { - return patterns.filter(isPositivePattern); -} -exports.getPositivePatterns = getPositivePatterns; -/** - * Returns patterns that can be applied inside the current directory. - * - * @example - * // ['./*', '*', 'a/*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ -function getPatternsInsideCurrentDirectory(patterns) { - return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern)); -} -exports.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory; -/** - * Returns patterns to be expanded relative to (outside) the current directory. - * - * @example - * // ['../*', './../*'] - * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*']) - */ -function getPatternsOutsideCurrentDirectory(patterns) { - return patterns.filter(isPatternRelatedToParentDirectory); -} -exports.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory; -function isPatternRelatedToParentDirectory(pattern) { - return pattern.startsWith('..') || pattern.startsWith('./..'); -} -exports.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory; -function getBaseDirectory(pattern) { - return globParent(pattern, { flipBackslashes: false }); -} -exports.getBaseDirectory = getBaseDirectory; -function hasGlobStar(pattern) { - return pattern.includes(GLOBSTAR); -} -exports.hasGlobStar = hasGlobStar; -function endsWithSlashGlobStar(pattern) { - return pattern.endsWith('/' + GLOBSTAR); -} -exports.endsWithSlashGlobStar = endsWithSlashGlobStar; -function isAffectDepthOfReadingPattern(pattern) { - const basename = path.basename(pattern); - return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); -} -exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; -function expandPatternsWithBraceExpansion(patterns) { - return patterns.reduce((collection, pattern) => { - return collection.concat(expandBraceExpansion(pattern)); - }, []); -} -exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion; -function expandBraceExpansion(pattern) { - const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true }); - /** - * Sort the patterns by length so that the same depth patterns are processed side by side. - * `a/{b,}/{c,}/*` – `['a///*', 'a/b//*', 'a//c/*', 'a/b/c/*']` - */ - patterns.sort((a, b) => a.length - b.length); - /** - * Micromatch can return an empty string in the case of patterns like `{a,}`. - */ - return patterns.filter((pattern) => pattern !== ''); -} -exports.expandBraceExpansion = expandBraceExpansion; -function getPatternParts(pattern, options) { - let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true })); - /** - * The scan method returns an empty array in some cases. - * See micromatch/picomatch#58 for more details. - */ - if (parts.length === 0) { - parts = [pattern]; - } - /** - * The scan method does not return an empty part for the pattern with a forward slash. - * This is another part of micromatch/picomatch#58. - */ - if (parts[0].startsWith('/')) { - parts[0] = parts[0].slice(1); - parts.unshift(''); - } - return parts; -} -exports.getPatternParts = getPatternParts; -function makeRe(pattern, options) { - return micromatch.makeRe(pattern, options); -} -exports.makeRe = makeRe; -function convertPatternsToRe(patterns, options) { - return patterns.map((pattern) => makeRe(pattern, options)); -} -exports.convertPatternsToRe = convertPatternsToRe; -function matchAny(entry, patternsRe) { - return patternsRe.some((patternRe) => patternRe.test(entry)); -} -exports.matchAny = matchAny; -/** - * This package only works with forward slashes as a path separator. - * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes. - */ -function removeDuplicateSlashes(pattern) { - return pattern.replace(DOUBLE_SLASH_RE, '/'); -} -exports.removeDuplicateSlashes = removeDuplicateSlashes; -function partitionAbsoluteAndRelative(patterns) { - const absolute = []; - const relative = []; - for (const pattern of patterns) { - if (isAbsolute(pattern)) { - absolute.push(pattern); - } - else { - relative.push(pattern); - } - } - return [absolute, relative]; -} -exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative; -function isAbsolute(pattern) { - return path.isAbsolute(pattern); -} -exports.isAbsolute = isAbsolute; diff --git a/node_modules/fast-glob/out/utils/stream.d.ts b/node_modules/fast-glob/out/utils/stream.d.ts deleted file mode 100644 index 4daf913..0000000 --- a/node_modules/fast-glob/out/utils/stream.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -/// -import { Readable } from 'stream'; -export declare function merge(streams: Readable[]): NodeJS.ReadableStream; diff --git a/node_modules/fast-glob/out/utils/stream.js b/node_modules/fast-glob/out/utils/stream.js deleted file mode 100644 index b32028c..0000000 --- a/node_modules/fast-glob/out/utils/stream.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.merge = void 0; -const merge2 = require("merge2"); -function merge(streams) { - const mergedStream = merge2(streams); - streams.forEach((stream) => { - stream.once('error', (error) => mergedStream.emit('error', error)); - }); - mergedStream.once('close', () => propagateCloseEventToSources(streams)); - mergedStream.once('end', () => propagateCloseEventToSources(streams)); - return mergedStream; -} -exports.merge = merge; -function propagateCloseEventToSources(streams) { - streams.forEach((stream) => stream.emit('close')); -} diff --git a/node_modules/fast-glob/out/utils/string.d.ts b/node_modules/fast-glob/out/utils/string.d.ts deleted file mode 100644 index c884735..0000000 --- a/node_modules/fast-glob/out/utils/string.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function isString(input: unknown): input is string; -export declare function isEmpty(input: string): boolean; diff --git a/node_modules/fast-glob/out/utils/string.js b/node_modules/fast-glob/out/utils/string.js deleted file mode 100644 index 76e7ea5..0000000 --- a/node_modules/fast-glob/out/utils/string.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.isEmpty = exports.isString = void 0; -function isString(input) { - return typeof input === 'string'; -} -exports.isString = isString; -function isEmpty(input) { - return input === ''; -} -exports.isEmpty = isEmpty; diff --git a/node_modules/fast-glob/package.json b/node_modules/fast-glob/package.json deleted file mode 100644 index e910de9..0000000 --- a/node_modules/fast-glob/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "fast-glob", - "version": "3.3.3", - "description": "It's a very fast and efficient glob library for Node.js", - "license": "MIT", - "repository": "mrmlnc/fast-glob", - "author": { - "name": "Denis Malinochkin", - "url": "https://mrmlnc.com" - }, - "engines": { - "node": ">=8.6.0" - }, - "main": "out/index.js", - "typings": "out/index.d.ts", - "files": [ - "out", - "!out/{benchmark,tests}", - "!out/**/*.map", - "!out/**/*.spec.*" - ], - "keywords": [ - "glob", - "patterns", - "fast", - "implementation" - ], - "devDependencies": { - "@nodelib/fs.macchiato": "^1.0.1", - "@types/glob-parent": "^5.1.0", - "@types/merge2": "^1.1.4", - "@types/micromatch": "^4.0.0", - "@types/mocha": "^5.2.7", - "@types/node": "^14.18.53", - "@types/picomatch": "^2.3.0", - "@types/sinon": "^7.5.0", - "bencho": "^0.1.1", - "eslint": "^6.5.1", - "eslint-config-mrmlnc": "^1.1.0", - "execa": "^7.1.1", - "fast-glob": "^3.0.4", - "fdir": "6.0.1", - "glob": "^10.0.0", - "hereby": "^1.8.1", - "mocha": "^6.2.1", - "rimraf": "^5.0.0", - "sinon": "^7.5.0", - "snap-shot-it": "^7.9.10", - "typescript": "^4.9.5" - }, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.8" - }, - "scripts": { - "clean": "rimraf out", - "lint": "eslint \"src/**/*.ts\" --cache", - "compile": "tsc", - "test": "mocha \"out/**/*.spec.js\" -s 0", - "test:e2e": "mocha \"out/**/*.e2e.js\" -s 0", - "test:e2e:sync": "mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(sync\\)\"", - "test:e2e:async": "mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(async\\)\"", - "test:e2e:stream": "mocha \"out/**/*.e2e.js\" -s 0 --grep \"\\(stream\\)\"", - "build": "npm run clean && npm run compile && npm run lint && npm test", - "watch": "npm run clean && npm run compile -- -- --sourceMap --watch", - "bench:async": "npm run bench:product:async && npm run bench:regression:async", - "bench:stream": "npm run bench:product:stream && npm run bench:regression:stream", - "bench:sync": "npm run bench:product:sync && npm run bench:regression:sync", - "bench:product": "npm run bench:product:async && npm run bench:product:sync && npm run bench:product:stream", - "bench:product:async": "hereby bench:product:async", - "bench:product:sync": "hereby bench:product:sync", - "bench:product:stream": "hereby bench:product:stream", - "bench:regression": "npm run bench:regression:async && npm run bench:regression:sync && npm run bench:regression:stream", - "bench:regression:async": "hereby bench:regression:async", - "bench:regression:sync": "hereby bench:regression:sync", - "bench:regression:stream": "hereby bench:regression:stream" - } -} diff --git a/node_modules/fastq/LICENSE b/node_modules/fastq/LICENSE deleted file mode 100644 index 27c7bb4..0000000 --- a/node_modules/fastq/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2015-2020, Matteo Collina - -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/fastq/README.md b/node_modules/fastq/README.md deleted file mode 100644 index b44cce3..0000000 --- a/node_modules/fastq/README.md +++ /dev/null @@ -1,310 +0,0 @@ -# fastq - -![ci][ci-url] -[![npm version][npm-badge]][npm-url] - -Fast, in memory work queue. - -Benchmarks (1 million tasks): - -* setImmediate: 812ms -* fastq: 854ms -* async.queue: 1298ms -* neoAsync.queue: 1249ms - -Obtained on node 12.16.1, on a dedicated server. - -If you need zero-overhead series function call, check out -[fastseries](http://npm.im/fastseries). For zero-overhead parallel -function call, check out [fastparallel](http://npm.im/fastparallel). - - * Installation - * Usage - * API - * Licence & copyright - -## Install - -`npm i fastq --save` - -## Usage (callback API) - -```js -'use strict' - -const queue = require('fastq')(worker, 1) - -queue.push(42, function (err, result) { - if (err) { throw err } - console.log('the result is', result) -}) - -function worker (arg, cb) { - cb(null, arg * 2) -} -``` - -## Usage (promise API) - -```js -const queue = require('fastq').promise(worker, 1) - -async function worker (arg) { - return arg * 2 -} - -async function run () { - const result = await queue.push(42) - console.log('the result is', result) -} - -run() -``` - -### Setting "this" - -```js -'use strict' - -const that = { hello: 'world' } -const queue = require('fastq')(that, worker, 1) - -queue.push(42, function (err, result) { - if (err) { throw err } - console.log(this) - console.log('the result is', result) -}) - -function worker (arg, cb) { - console.log(this) - cb(null, arg * 2) -} -``` - -### Using with TypeScript (callback API) - -```ts -'use strict' - -import * as fastq from "fastq"; -import type { queue, done } from "fastq"; - -type Task = { - id: number -} - -const q: queue = fastq(worker, 1) - -q.push({ id: 42}) - -function worker (arg: Task, cb: done) { - console.log(arg.id) - cb(null) -} -``` - -### Using with TypeScript (promise API) - -```ts -'use strict' - -import * as fastq from "fastq"; -import type { queueAsPromised } from "fastq"; - -type Task = { - id: number -} - -const q: queueAsPromised = fastq.promise(asyncWorker, 1) - -q.push({ id: 42}).catch((err) => console.error(err)) - -async function asyncWorker (arg: Task): Promise { - // No need for a try-catch block, fastq handles errors automatically - console.log(arg.id) -} -``` - -## API - -* fastqueue() -* queue#push() -* queue#unshift() -* queue#pause() -* queue#resume() -* queue#idle() -* queue#length() -* queue#getQueue() -* queue#kill() -* queue#killAndDrain() -* queue#error() -* queue#concurrency -* queue#drain -* queue#empty -* queue#saturated -* fastqueue.promise() - -------------------------------------------------------- - -### fastqueue([that], worker, concurrency) - -Creates a new queue. - -Arguments: - -* `that`, optional context of the `worker` function. -* `worker`, worker function, it would be called with `that` as `this`, - if that is specified. -* `concurrency`, number of concurrent tasks that could be executed in - parallel. - -------------------------------------------------------- - -### queue.push(task, done) - -Add a task at the end of the queue. `done(err, result)` will be called -when the task was processed. - -------------------------------------------------------- - -### queue.unshift(task, done) - -Add a task at the beginning of the queue. `done(err, result)` will be called -when the task was processed. - -------------------------------------------------------- - -### queue.pause() - -Pause the processing of tasks. Currently worked tasks are not -stopped. - -------------------------------------------------------- - -### queue.resume() - -Resume the processing of tasks. - -------------------------------------------------------- - -### queue.idle() - -Returns `false` if there are tasks being processed or waiting to be processed. -`true` otherwise. - -------------------------------------------------------- - -### queue.length() - -Returns the number of tasks waiting to be processed (in the queue). - -------------------------------------------------------- - -### queue.getQueue() - -Returns all the tasks be processed (in the queue). Returns empty array when there are no tasks - -------------------------------------------------------- - -### queue.kill() - -Removes all tasks waiting to be processed, and reset `drain` to an empty -function. - -------------------------------------------------------- - -### queue.killAndDrain() - -Same than `kill` but the `drain` function will be called before reset to empty. - -------------------------------------------------------- - -### queue.error(handler) - -Set a global error handler. `handler(err, task)` will be called -each time a task is completed, `err` will be not null if the task has thrown an error. - -------------------------------------------------------- - -### queue.concurrency - -Property that returns the number of concurrent tasks that could be executed in -parallel. It can be altered at runtime. - -------------------------------------------------------- - -### queue.paused - -Property (Read-Only) that returns `true` when the queue is in a paused state. - -------------------------------------------------------- - -### queue.drain - -Function that will be called when the last -item from the queue has been processed by a worker. -It can be altered at runtime. - -------------------------------------------------------- - -### queue.empty - -Function that will be called when the last -item from the queue has been assigned to a worker. -It can be altered at runtime. - -------------------------------------------------------- - -### queue.saturated - -Function that will be called when the queue hits the concurrency -limit. -It can be altered at runtime. - -------------------------------------------------------- - -### fastqueue.promise([that], worker(arg), concurrency) - -Creates a new queue with `Promise` apis. It also offers all the methods -and properties of the object returned by [`fastqueue`](#fastqueue) with the modified -[`push`](#pushPromise) and [`unshift`](#unshiftPromise) methods. - -Node v10+ is required to use the promisified version. - -Arguments: -* `that`, optional context of the `worker` function. -* `worker`, worker function, it would be called with `that` as `this`, - if that is specified. It MUST return a `Promise`. -* `concurrency`, number of concurrent tasks that could be executed in - parallel. - - -#### queue.push(task) => Promise - -Add a task at the end of the queue. The returned `Promise` will be fulfilled (rejected) -when the task is completed successfully (unsuccessfully). - -This promise could be ignored as it will not lead to a `'unhandledRejection'`. - - -#### queue.unshift(task) => Promise - -Add a task at the beginning of the queue. The returned `Promise` will be fulfilled (rejected) -when the task is completed successfully (unsuccessfully). - -This promise could be ignored as it will not lead to a `'unhandledRejection'`. - - -#### queue.drained() => Promise - -Wait for the queue to be drained. The returned `Promise` will be resolved when all tasks in the queue have been processed by a worker. - -This promise could be ignored as it will not lead to a `'unhandledRejection'`. - -## License - -ISC - -[ci-url]: https://github.com/mcollina/fastq/workflows/ci/badge.svg -[npm-badge]: https://badge.fury.io/js/fastq.svg -[npm-url]: https://badge.fury.io/js/fastq diff --git a/node_modules/fastq/SECURITY.md b/node_modules/fastq/SECURITY.md deleted file mode 100644 index dd9f1d5..0000000 --- a/node_modules/fastq/SECURITY.md +++ /dev/null @@ -1,15 +0,0 @@ -# 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 | -| ------- | ------------------ | -| 1.x | :white_check_mark: | -| < 1.0 | :x: | - -## Reporting a Vulnerability - -Please report all vulnerabilities at [https://github.com/mcollina/fastq/security](https://github.com/mcollina/fastq/security). diff --git a/node_modules/fastq/bench.js b/node_modules/fastq/bench.js deleted file mode 100644 index 4eaa829..0000000 --- a/node_modules/fastq/bench.js +++ /dev/null @@ -1,66 +0,0 @@ -'use strict' - -const max = 1000000 -const fastqueue = require('./')(worker, 1) -const { promisify } = require('util') -const immediate = promisify(setImmediate) -const qPromise = require('./').promise(immediate, 1) -const async = require('async') -const neo = require('neo-async') -const asyncqueue = async.queue(worker, 1) -const neoqueue = neo.queue(worker, 1) - -function bench (func, done) { - const key = max + '*' + func.name - let count = -1 - - console.time(key) - end() - - function end () { - if (++count < max) { - func(end) - } else { - console.timeEnd(key) - if (done) { - done() - } - } - } -} - -function benchFastQ (done) { - fastqueue.push(42, done) -} - -function benchAsyncQueue (done) { - asyncqueue.push(42, done) -} - -function benchNeoQueue (done) { - neoqueue.push(42, done) -} - -function worker (arg, cb) { - setImmediate(cb) -} - -function benchSetImmediate (cb) { - worker(42, cb) -} - -function benchFastQPromise (done) { - qPromise.push(42).then(function () { done() }, done) -} - -function runBench (done) { - async.eachSeries([ - benchSetImmediate, - benchFastQ, - benchNeoQueue, - benchAsyncQueue, - benchFastQPromise - ], bench, done) -} - -runBench(runBench) diff --git a/node_modules/fastq/eslint.config.js b/node_modules/fastq/eslint.config.js deleted file mode 100644 index 57482db..0000000 --- a/node_modules/fastq/eslint.config.js +++ /dev/null @@ -1,11 +0,0 @@ -const neostandard = require('neostandard') - -module.exports = [ - ...neostandard(), - { - name: 'node-0.10-compatibility', - rules: { - 'object-shorthand': 'off' // Disable ES6 object shorthand for Node.js 0.10 compatibility - } - } -] diff --git a/node_modules/fastq/example.js b/node_modules/fastq/example.js deleted file mode 100644 index 665fdc8..0000000 --- a/node_modules/fastq/example.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -/* eslint-disable no-var */ - -var queue = require('./')(worker, 1) - -queue.push(42, function (err, result) { - if (err) { throw err } - console.log('the result is', result) -}) - -function worker (arg, cb) { - cb(null, 42 * 2) -} diff --git a/node_modules/fastq/example.mjs b/node_modules/fastq/example.mjs deleted file mode 100644 index f31364a..0000000 --- a/node_modules/fastq/example.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { promise as queueAsPromised } from './queue.js' - -const queue = queueAsPromised(worker, 1) - -console.log('the result is', await queue.push(42)) - -async function worker (arg) { - return 42 * 2 -} diff --git a/node_modules/fastq/index.d.ts b/node_modules/fastq/index.d.ts deleted file mode 100644 index 262dd04..0000000 --- a/node_modules/fastq/index.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -declare function fastq(context: C, worker: fastq.worker, concurrency: number): fastq.queue -declare function fastq(worker: fastq.worker, concurrency: number): fastq.queue - -declare namespace fastq { - type worker = (this: C, task: T, cb: fastq.done) => void - type asyncWorker = (this: C, task: T) => Promise - type done = (err: Error | null, result?: R) => void - type errorHandler = (err: Error, task: T) => void - - interface queue { - /** Add a task at the end of the queue. `done(err, result)` will be called when the task was processed. */ - push(task: T, done?: done): void - /** Add a task at the beginning of the queue. `done(err, result)` will be called when the task was processed. */ - unshift(task: T, done?: done): void - /** Pause the processing of tasks. Currently worked tasks are not stopped. */ - pause(): any - /** Resume the processing of tasks. */ - resume(): any - running(): number - /** Returns `false` if there are tasks being processed or waiting to be processed. `true` otherwise. */ - idle(): boolean - /** Returns the number of tasks waiting to be processed (in the queue). */ - length(): number - /** Returns all the tasks be processed (in the queue). Returns empty array when there are no tasks */ - getQueue(): T[] - /** Removes all tasks waiting to be processed, and reset `drain` to an empty function. */ - kill(): any - /** Same than `kill` but the `drain` function will be called before reset to empty. */ - killAndDrain(): any - /** Removes all tasks waiting to be processed, calls each task's callback with an abort error (rejects promises for promise-based queues), and resets `drain` to an empty function. */ - abort(): any - /** Set a global error handler. `handler(err, task)` will be called each time a task is completed, `err` will be not null if the task has thrown an error. */ - error(handler: errorHandler): void - /** Property that returns the number of concurrent tasks that could be executed in parallel. It can be altered at runtime. */ - concurrency: number - /** Property (Read-Only) that returns `true` when the queue is in a paused state. */ - readonly paused: boolean - /** Function that will be called when the last item from the queue has been processed by a worker. It can be altered at runtime. */ - drain(): any - /** Function that will be called when the last item from the queue has been assigned to a worker. It can be altered at runtime. */ - empty: () => void - /** Function that will be called when the queue hits the concurrency limit. It can be altered at runtime. */ - saturated: () => void - } - - interface queueAsPromised extends queue { - /** Add a task at the end of the queue. The returned `Promise` will be fulfilled (rejected) when the task is completed successfully (unsuccessfully). */ - push(task: T): Promise - /** Add a task at the beginning of the queue. The returned `Promise` will be fulfilled (rejected) when the task is completed successfully (unsuccessfully). */ - unshift(task: T): Promise - /** Wait for the queue to be drained. The returned `Promise` will be resolved when all tasks in the queue have been processed by a worker. */ - drained(): Promise - } - - function promise(context: C, worker: fastq.asyncWorker, concurrency: number): fastq.queueAsPromised - function promise(worker: fastq.asyncWorker, concurrency: number): fastq.queueAsPromised -} - -export = fastq diff --git a/node_modules/fastq/package.json b/node_modules/fastq/package.json deleted file mode 100644 index 9e1d9dd..0000000 --- a/node_modules/fastq/package.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "fastq", - "version": "1.20.1", - "description": "Fast, in memory work queue", - "main": "queue.js", - "type": "commonjs", - "scripts": { - "lint": "eslint .", - "unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test/test.js test/promise.js", - "coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js test/promise.js", - "test:report": "npm run lint && npm run unit:report", - "test": "npm run lint && npm run unit", - "typescript": "tsc --project ./test/tsconfig.json", - "legacy": "tape test/test.js" - }, - "pre-commit": [ - "test", - "typescript" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/mcollina/fastq.git" - }, - "keywords": [ - "fast", - "queue", - "async", - "worker" - ], - "author": "Matteo Collina ", - "license": "ISC", - "bugs": { - "url": "https://github.com/mcollina/fastq/issues" - }, - "homepage": "https://github.com/mcollina/fastq#readme", - "devDependencies": { - "async": "^3.1.0", - "eslint": "^9.36.0", - "neo-async": "^2.6.1", - "neostandard": "^0.12.2", - "nyc": "^17.0.0", - "pre-commit": "^1.2.2", - "tape": "^5.0.0", - "typescript": "^5.0.4" - }, - "dependencies": { - "reusify": "^1.0.4" - } -} diff --git a/node_modules/fastq/queue.js b/node_modules/fastq/queue.js deleted file mode 100644 index d0fbf20..0000000 --- a/node_modules/fastq/queue.js +++ /dev/null @@ -1,346 +0,0 @@ -'use strict' - -/* eslint-disable no-var */ - -var reusify = require('reusify') - -function fastqueue (context, worker, _concurrency) { - if (typeof context === 'function') { - _concurrency = worker - worker = context - context = null - } - - if (!(_concurrency >= 1)) { - throw new Error('fastqueue concurrency must be equal to or greater than 1') - } - - var cache = reusify(Task) - var queueHead = null - var queueTail = null - var _running = 0 - var errorHandler = null - - var self = { - push: push, - drain: noop, - saturated: noop, - pause: pause, - paused: false, - - get concurrency () { - return _concurrency - }, - set concurrency (value) { - if (!(value >= 1)) { - throw new Error('fastqueue concurrency must be equal to or greater than 1') - } - _concurrency = value - - if (self.paused) return - for (; queueHead && _running < _concurrency;) { - _running++ - release() - } - }, - - running: running, - resume: resume, - idle: idle, - length: length, - getQueue: getQueue, - unshift: unshift, - empty: noop, - kill: kill, - killAndDrain: killAndDrain, - error: error, - abort: abort - } - - return self - - function running () { - return _running - } - - function pause () { - self.paused = true - } - - function length () { - var current = queueHead - var counter = 0 - - while (current) { - current = current.next - counter++ - } - - return counter - } - - function getQueue () { - var current = queueHead - var tasks = [] - - while (current) { - tasks.push(current.value) - current = current.next - } - - return tasks - } - - function resume () { - if (!self.paused) return - self.paused = false - if (queueHead === null) { - _running++ - release() - return - } - for (; queueHead && _running < _concurrency;) { - _running++ - release() - } - } - - function idle () { - return _running === 0 && self.length() === 0 - } - - function push (value, done) { - var current = cache.get() - - current.context = context - current.release = release - current.value = value - current.callback = done || noop - current.errorHandler = errorHandler - - if (_running >= _concurrency || self.paused) { - if (queueTail) { - queueTail.next = current - queueTail = current - } else { - queueHead = current - queueTail = current - self.saturated() - } - } else { - _running++ - worker.call(context, current.value, current.worked) - } - } - - function unshift (value, done) { - var current = cache.get() - - current.context = context - current.release = release - current.value = value - current.callback = done || noop - current.errorHandler = errorHandler - - if (_running >= _concurrency || self.paused) { - if (queueHead) { - current.next = queueHead - queueHead = current - } else { - queueHead = current - queueTail = current - self.saturated() - } - } else { - _running++ - worker.call(context, current.value, current.worked) - } - } - - function release (holder) { - if (holder) { - cache.release(holder) - } - var next = queueHead - if (next && _running <= _concurrency) { - if (!self.paused) { - if (queueTail === queueHead) { - queueTail = null - } - queueHead = next.next - next.next = null - worker.call(context, next.value, next.worked) - if (queueTail === null) { - self.empty() - } - } else { - _running-- - } - } else if (--_running === 0) { - self.drain() - } - } - - function kill () { - queueHead = null - queueTail = null - self.drain = noop - } - - function killAndDrain () { - queueHead = null - queueTail = null - self.drain() - self.drain = noop - } - - function abort () { - var current = queueHead - queueHead = null - queueTail = null - - while (current) { - var next = current.next - var callback = current.callback - var errorHandler = current.errorHandler - var val = current.value - var context = current.context - - // Reset the task state - current.value = null - current.callback = noop - current.errorHandler = null - - // Call error handler if present - if (errorHandler) { - errorHandler(new Error('abort'), val) - } - - // Call callback with error - callback.call(context, new Error('abort')) - - // Release the task back to the pool - current.release(current) - - current = next - } - - self.drain = noop - } - - function error (handler) { - errorHandler = handler - } -} - -function noop () {} - -function Task () { - this.value = null - this.callback = noop - this.next = null - this.release = noop - this.context = null - this.errorHandler = null - - var self = this - - this.worked = function worked (err, result) { - var callback = self.callback - var errorHandler = self.errorHandler - var val = self.value - self.value = null - self.callback = noop - if (self.errorHandler) { - errorHandler(err, val) - } - callback.call(self.context, err, result) - self.release(self) - } -} - -function queueAsPromised (context, worker, _concurrency) { - if (typeof context === 'function') { - _concurrency = worker - worker = context - context = null - } - - function asyncWrapper (arg, cb) { - worker.call(this, arg) - .then(function (res) { - cb(null, res) - }, cb) - } - - var queue = fastqueue(context, asyncWrapper, _concurrency) - - var pushCb = queue.push - var unshiftCb = queue.unshift - - queue.push = push - queue.unshift = unshift - queue.drained = drained - - return queue - - function push (value) { - var p = new Promise(function (resolve, reject) { - pushCb(value, function (err, result) { - if (err) { - reject(err) - return - } - resolve(result) - }) - }) - - // Let's fork the promise chain to - // make the error bubble up to the user but - // not lead to a unhandledRejection - p.catch(noop) - - return p - } - - function unshift (value) { - var p = new Promise(function (resolve, reject) { - unshiftCb(value, function (err, result) { - if (err) { - reject(err) - return - } - resolve(result) - }) - }) - - // Let's fork the promise chain to - // make the error bubble up to the user but - // not lead to a unhandledRejection - p.catch(noop) - - return p - } - - function drained () { - var p = new Promise(function (resolve) { - process.nextTick(function () { - if (queue.idle()) { - resolve() - } else { - var previousDrain = queue.drain - queue.drain = function () { - if (typeof previousDrain === 'function') previousDrain() - resolve() - queue.drain = previousDrain - } - } - }) - }) - - return p - } -} - -module.exports = fastqueue -module.exports.promise = queueAsPromised diff --git a/node_modules/fastq/test/example.ts b/node_modules/fastq/test/example.ts deleted file mode 100644 index a47d441..0000000 --- a/node_modules/fastq/test/example.ts +++ /dev/null @@ -1,83 +0,0 @@ -import * as fastq from '../' -import { promise as queueAsPromised } from '../' - -// Basic example - -const queue = fastq(worker, 1) - -queue.push('world', (err, result) => { - if (err) throw err - console.log('the result is', result) -}) - -queue.push('push without cb') - -queue.concurrency - -queue.drain() - -queue.empty = () => undefined - -console.log('the queue tasks are', queue.getQueue()) - -queue.idle() - -queue.kill() - -queue.killAndDrain() - -queue.length - -queue.pause() - -queue.resume() - -queue.running() - -queue.saturated = () => undefined - -queue.unshift('world', (err, result) => { - if (err) throw err - console.log('the result is', result) -}) - -queue.unshift('unshift without cb') - -function worker(task: any, cb: fastq.done) { - cb(null, 'hello ' + task) -} - -// Generics example - -interface GenericsContext { - base: number; -} - -const genericsQueue = fastq({ base: 6 }, genericsWorker, 1) - -genericsQueue.push(7, (err, done) => { - if (err) throw err - console.log('the result is', done) -}) - -genericsQueue.unshift(7, (err, done) => { - if (err) throw err - console.log('the result is', done) -}) - -function genericsWorker(this: GenericsContext, task: number, cb: fastq.done) { - cb(null, 'the meaning of life is ' + (this.base * task)) -} - -const queue2 = queueAsPromised(asyncWorker, 1) - -async function asyncWorker(task: any) { - return 'hello ' + task -} - -async function run () { - await queue.push(42) - await queue.unshift(42) -} - -run() diff --git a/node_modules/fastq/test/promise.js b/node_modules/fastq/test/promise.js deleted file mode 100644 index b425fda..0000000 --- a/node_modules/fastq/test/promise.js +++ /dev/null @@ -1,325 +0,0 @@ -'use strict' - -const test = require('tape') -const buildQueue = require('../').promise -const { promisify } = require('util') -const sleep = promisify(setTimeout) -const immediate = promisify(setImmediate) - -test('concurrency', function (t) { - t.plan(2) - t.throws(buildQueue.bind(null, worker, 0)) - t.doesNotThrow(buildQueue.bind(null, worker, 1)) - - async function worker (arg) { - return true - } -}) - -test('worker execution', async function (t) { - const queue = buildQueue(worker, 1) - - const result = await queue.push(42) - - t.equal(result, true, 'result matches') - - async function worker (arg) { - t.equal(arg, 42) - return true - } -}) - -test('limit', async function (t) { - const queue = buildQueue(worker, 1) - - const [res1, res2] = await Promise.all([queue.push(10), queue.push(0)]) - t.equal(res1, 10, 'the result matches') - t.equal(res2, 0, 'the result matches') - - async function worker (arg) { - await sleep(arg) - return arg - } -}) - -test('multiple executions', async function (t) { - const queue = buildQueue(worker, 1) - const toExec = [1, 2, 3, 4, 5] - const expected = ['a', 'b', 'c', 'd', 'e'] - let count = 0 - - await Promise.all(toExec.map(async function (task, i) { - const result = await queue.push(task) - t.equal(result, expected[i], 'the result matches') - })) - - async function worker (arg) { - t.equal(arg, toExec[count], 'arg matches') - return expected[count++] - } -}) - -test('drained', async function (t) { - const queue = buildQueue(worker, 2) - - const toExec = new Array(10).fill(10) - let count = 0 - - async function worker (arg) { - await sleep(arg) - count++ - } - - toExec.forEach(function (i) { - queue.push(i) - }) - - await queue.drained() - - t.equal(count, toExec.length) - - toExec.forEach(function (i) { - queue.push(i) - }) - - await queue.drained() - - t.equal(count, toExec.length * 2) -}) - -test('drained with exception should not throw', async function (t) { - const queue = buildQueue(worker, 2) - - const toExec = new Array(10).fill(10) - - async function worker () { - throw new Error('foo') - } - - toExec.forEach(function (i) { - queue.push(i) - }) - - await queue.drained() -}) - -test('drained with drain function', async function (t) { - let drainCalled = false - const queue = buildQueue(worker, 2) - - queue.drain = function () { - drainCalled = true - } - - const toExec = new Array(10).fill(10) - let count = 0 - - async function worker (arg) { - await sleep(arg) - count++ - } - - toExec.forEach(function () { - queue.push() - }) - - await queue.drained() - - t.equal(count, toExec.length) - t.equal(drainCalled, true) -}) - -test('drained while idle should resolve', async function (t) { - const queue = buildQueue(worker, 2) - - async function worker (arg) { - await sleep(arg) - } - - await queue.drained() -}) - -test('drained while idle should not call the drain function', async function (t) { - let drainCalled = false - const queue = buildQueue(worker, 2) - - queue.drain = function () { - drainCalled = true - } - - async function worker (arg) { - await sleep(arg) - } - - await queue.drained() - - t.equal(drainCalled, false) -}) - -test('set this', async function (t) { - t.plan(1) - const that = {} - const queue = buildQueue(that, worker, 1) - - await queue.push(42) - - async function worker (arg) { - t.equal(this, that, 'this matches') - } -}) - -test('unshift', async function (t) { - const queue = buildQueue(worker, 1) - const expected = [1, 2, 3, 4] - - await Promise.all([ - queue.push(1), - queue.push(4), - queue.unshift(3), - queue.unshift(2) - ]) - - t.is(expected.length, 0) - - async function worker (arg) { - t.equal(expected.shift(), arg, 'tasks come in order') - } -}) - -test('push with worker throwing error', async function (t) { - t.plan(5) - const q = buildQueue(async function (task, cb) { - throw new Error('test error') - }, 1) - q.error(function (err, task) { - t.ok(err instanceof Error, 'global error handler should catch the error') - t.match(err.message, /test error/, 'error message should be "test error"') - t.equal(task, 42, 'The task executed should be passed') - }) - try { - await q.push(42) - } catch (err) { - t.ok(err instanceof Error, 'push callback should catch the error') - t.match(err.message, /test error/, 'error message should be "test error"') - } -}) - -test('unshift with worker throwing error', async function (t) { - t.plan(2) - const q = buildQueue(async function (task, cb) { - throw new Error('test error') - }, 1) - try { - await q.unshift(42) - } catch (err) { - t.ok(err instanceof Error, 'push callback should catch the error') - t.match(err.message, /test error/, 'error message should be "test error"') - } -}) - -test('no unhandledRejection (push)', async function (t) { - function handleRejection () { - t.fail('unhandledRejection') - } - process.once('unhandledRejection', handleRejection) - const q = buildQueue(async function (task, cb) { - throw new Error('test error') - }, 1) - - q.push(42) - - await immediate() - process.removeListener('unhandledRejection', handleRejection) -}) - -test('no unhandledRejection (unshift)', async function (t) { - function handleRejection () { - t.fail('unhandledRejection') - } - process.once('unhandledRejection', handleRejection) - const q = buildQueue(async function (task, cb) { - throw new Error('test error') - }, 1) - - q.unshift(42) - - await immediate() - process.removeListener('unhandledRejection', handleRejection) -}) - -test('drained should resolve after async tasks complete', async function (t) { - const logs = [] - - async function processTask () { - await new Promise(resolve => setTimeout(resolve, 0)) - logs.push('processed') - } - - const queue = buildQueue(processTask, 1) - queue.drain = () => logs.push('called drain') - - queue.drained().then(() => logs.push('drained promise resolved')) - - await Promise.all([ - queue.push(), - queue.push(), - queue.push() - ]) - - t.deepEqual(logs, [ - 'processed', - 'processed', - 'processed', - 'called drain', - 'drained promise resolved' - ], 'events happened in correct order') -}) - -test('drained should handle undefined drain function', async function (t) { - const queue = buildQueue(worker, 1) - - async function worker (arg) { - await sleep(10) - return arg - } - - queue.drain = undefined - queue.push(1) - await queue.drained() - - t.pass('drained resolved successfully with undefined drain') -}) - -test('abort rejects all pending promises', async function (t) { - const queue = buildQueue(worker, 1) - const promises = [] - let rejectedCount = 0 - - // Pause queue to prevent tasks from starting - queue.pause() - - for (let i = 0; i < 10; i++) { - promises.push(queue.push(i)) - } - - queue.abort() - - // All promises should be rejected - for (const promise of promises) { - try { - await promise - t.fail('promise should have been rejected') - } catch (err) { - t.equal(err.message, 'abort', 'error message is abort') - rejectedCount++ - } - } - - t.equal(rejectedCount, 10, 'all promises were rejected') - t.equal(queue.length(), 0, 'queue is empty') - - async function worker (arg) { - await sleep(500) - return arg - } -}) diff --git a/node_modules/fastq/test/test.js b/node_modules/fastq/test/test.js deleted file mode 100644 index 37e211e..0000000 --- a/node_modules/fastq/test/test.js +++ /dev/null @@ -1,733 +0,0 @@ -'use strict' - -/* eslint-disable no-var */ - -var test = require('tape') -var buildQueue = require('../') - -test('concurrency', function (t) { - t.plan(6) - t.throws(buildQueue.bind(null, worker, 0)) - t.throws(buildQueue.bind(null, worker, NaN)) - t.doesNotThrow(buildQueue.bind(null, worker, 1)) - - var queue = buildQueue(worker, 1) - t.throws(function () { - queue.concurrency = 0 - }) - t.throws(function () { - queue.concurrency = NaN - }) - t.doesNotThrow(function () { - queue.concurrency = 2 - }) - - function worker (arg, cb) { - cb(null, true) - } -}) - -test('worker execution', function (t) { - t.plan(3) - - var queue = buildQueue(worker, 1) - - queue.push(42, function (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - }) - - function worker (arg, cb) { - t.equal(arg, 42) - cb(null, true) - } -}) - -test('limit', function (t) { - t.plan(4) - - var expected = [10, 0] - var queue = buildQueue(worker, 1) - - queue.push(10, result) - queue.push(0, result) - - function result (err, arg) { - t.error(err, 'no error') - t.equal(arg, expected.shift(), 'the result matches') - } - - function worker (arg, cb) { - setTimeout(cb, arg, null, arg) - } -}) - -test('multiple executions', function (t) { - t.plan(15) - - var queue = buildQueue(worker, 1) - var toExec = [1, 2, 3, 4, 5] - var count = 0 - - toExec.forEach(function (task) { - queue.push(task, done) - }) - - function done (err, result) { - t.error(err, 'no error') - t.equal(result, toExec[count - 1], 'the result matches') - } - - function worker (arg, cb) { - t.equal(arg, toExec[count], 'arg matches') - count++ - setImmediate(cb, null, arg) - } -}) - -test('multiple executions, one after another', function (t) { - t.plan(15) - - var queue = buildQueue(worker, 1) - var toExec = [1, 2, 3, 4, 5] - var count = 0 - - queue.push(toExec[0], done) - - function done (err, result) { - t.error(err, 'no error') - t.equal(result, toExec[count - 1], 'the result matches') - if (count < toExec.length) { - queue.push(toExec[count], done) - } - } - - function worker (arg, cb) { - t.equal(arg, toExec[count], 'arg matches') - count++ - setImmediate(cb, null, arg) - } -}) - -test('set this', function (t) { - t.plan(3) - - var that = {} - var queue = buildQueue(that, worker, 1) - - queue.push(42, function (err, result) { - t.error(err, 'no error') - t.equal(this, that, 'this matches') - }) - - function worker (arg, cb) { - t.equal(this, that, 'this matches') - cb(null, true) - } -}) - -test('drain', function (t) { - t.plan(4) - - var queue = buildQueue(worker, 1) - var worked = false - - queue.push(42, function (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - }) - - queue.drain = function () { - t.equal(true, worked, 'drained') - } - - function worker (arg, cb) { - t.equal(arg, 42) - worked = true - setImmediate(cb, null, true) - } -}) - -test('pause && resume', function (t) { - t.plan(13) - - var queue = buildQueue(worker, 1) - var worked = false - var expected = [42, 24] - - t.notOk(queue.paused, 'it should not be paused') - - queue.pause() - - queue.push(42, function (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - }) - - queue.push(24, function (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - }) - - t.notOk(worked, 'it should be paused') - t.ok(queue.paused, 'it should be paused') - - queue.resume() - queue.pause() - queue.resume() - queue.resume() // second resume is a no-op - - function worker (arg, cb) { - t.notOk(queue.paused, 'it should not be paused') - t.ok(queue.running() <= queue.concurrency, 'should respect the concurrency') - t.equal(arg, expected.shift()) - worked = true - process.nextTick(function () { cb(null, true) }) - } -}) - -test('pause in flight && resume', function (t) { - t.plan(16) - - var queue = buildQueue(worker, 1) - var expected = [42, 24, 12] - - t.notOk(queue.paused, 'it should not be paused') - - queue.push(42, function (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - t.ok(queue.paused, 'it should be paused') - process.nextTick(function () { - queue.resume() - queue.pause() - queue.resume() - }) - }) - - queue.push(24, function (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - t.notOk(queue.paused, 'it should not be paused') - }) - - queue.push(12, function (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - t.notOk(queue.paused, 'it should not be paused') - }) - - queue.pause() - - function worker (arg, cb) { - t.ok(queue.running() <= queue.concurrency, 'should respect the concurrency') - t.equal(arg, expected.shift()) - process.nextTick(function () { cb(null, true) }) - } -}) - -test('altering concurrency', function (t) { - t.plan(24) - - var queue = buildQueue(worker, 1) - - queue.push(24, workDone) - queue.push(24, workDone) - queue.push(24, workDone) - - queue.pause() - - queue.concurrency = 3 // concurrency changes are ignored while paused - queue.concurrency = 2 - - queue.resume() - - t.equal(queue.running(), 2, '2 jobs running') - - queue.concurrency = 3 - - t.equal(queue.running(), 3, '3 jobs running') - - queue.concurrency = 1 - - t.equal(queue.running(), 3, '3 jobs running') // running jobs can't be killed - - queue.push(24, workDone) - queue.push(24, workDone) - queue.push(24, workDone) - queue.push(24, workDone) - - function workDone (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - } - - function worker (arg, cb) { - t.ok(queue.running() <= queue.concurrency, 'should respect the concurrency') - setImmediate(function () { - cb(null, true) - }) - } -}) - -test('idle()', function (t) { - t.plan(12) - - var queue = buildQueue(worker, 1) - - t.ok(queue.idle(), 'queue is idle') - - queue.push(42, function (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - t.notOk(queue.idle(), 'queue is not idle') - }) - - queue.push(42, function (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - // it will go idle after executing this function - setImmediate(function () { - t.ok(queue.idle(), 'queue is now idle') - }) - }) - - t.notOk(queue.idle(), 'queue is not idle') - - function worker (arg, cb) { - t.notOk(queue.idle(), 'queue is not idle') - t.equal(arg, 42) - setImmediate(cb, null, true) - } -}) - -test('saturated', function (t) { - t.plan(9) - - var queue = buildQueue(worker, 1) - var preworked = 0 - var worked = 0 - - queue.saturated = function () { - t.pass('saturated') - t.equal(preworked, 1, 'started 1 task') - t.equal(worked, 0, 'worked zero task') - } - - queue.push(42, done) - queue.push(42, done) - - function done (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - } - - function worker (arg, cb) { - t.equal(arg, 42) - preworked++ - setImmediate(function () { - worked++ - cb(null, true) - }) - } -}) - -test('length', function (t) { - t.plan(7) - - var queue = buildQueue(worker, 1) - - t.equal(queue.length(), 0, 'nothing waiting') - queue.push(42, done) - t.equal(queue.length(), 0, 'nothing waiting') - queue.push(42, done) - t.equal(queue.length(), 1, 'one task waiting') - queue.push(42, done) - t.equal(queue.length(), 2, 'two tasks waiting') - - function done (err, result) { - t.error(err, 'no error') - } - - function worker (arg, cb) { - setImmediate(function () { - cb(null, true) - }) - } -}) - -test('getQueue', function (t) { - t.plan(10) - - var queue = buildQueue(worker, 1) - - t.equal(queue.getQueue().length, 0, 'nothing waiting') - queue.push(42, done) - t.equal(queue.getQueue().length, 0, 'nothing waiting') - queue.push(42, done) - t.equal(queue.getQueue().length, 1, 'one task waiting') - t.equal(queue.getQueue()[0], 42, 'should be equal') - queue.push(43, done) - t.equal(queue.getQueue().length, 2, 'two tasks waiting') - t.equal(queue.getQueue()[0], 42, 'should be equal') - t.equal(queue.getQueue()[1], 43, 'should be equal') - - function done (err, result) { - t.error(err, 'no error') - } - - function worker (arg, cb) { - setImmediate(function () { - cb(null, true) - }) - } -}) - -test('unshift', function (t) { - t.plan(8) - - var queue = buildQueue(worker, 1) - var expected = [1, 2, 3, 4] - - queue.push(1, done) - queue.push(4, done) - queue.unshift(3, done) - queue.unshift(2, done) - - function done (err, result) { - t.error(err, 'no error') - } - - function worker (arg, cb) { - t.equal(expected.shift(), arg, 'tasks come in order') - setImmediate(function () { - cb(null, true) - }) - } -}) - -test('unshift && empty', function (t) { - t.plan(2) - - var queue = buildQueue(worker, 1) - var completed = false - - queue.pause() - - queue.empty = function () { - t.notOk(completed, 'the task has not completed yet') - } - - queue.unshift(1, done) - - queue.resume() - - function done (err, result) { - completed = true - t.error(err, 'no error') - } - - function worker (arg, cb) { - setImmediate(function () { - cb(null, true) - }) - } -}) - -test('push && empty', function (t) { - t.plan(2) - - var queue = buildQueue(worker, 1) - var completed = false - - queue.pause() - - queue.empty = function () { - t.notOk(completed, 'the task has not completed yet') - } - - queue.push(1, done) - - queue.resume() - - function done (err, result) { - completed = true - t.error(err, 'no error') - } - - function worker (arg, cb) { - setImmediate(function () { - cb(null, true) - }) - } -}) - -test('kill', function (t) { - t.plan(5) - - var queue = buildQueue(worker, 1) - var expected = [1] - - var predrain = queue.drain - - queue.drain = function drain () { - t.fail('drain should never be called') - } - - queue.push(1, done) - queue.push(4, done) - queue.unshift(3, done) - queue.unshift(2, done) - queue.kill() - - function done (err, result) { - t.error(err, 'no error') - setImmediate(function () { - t.equal(queue.length(), 0, 'no queued tasks') - t.equal(queue.running(), 0, 'no running tasks') - t.equal(queue.drain, predrain, 'drain is back to default') - }) - } - - function worker (arg, cb) { - t.equal(expected.shift(), arg, 'tasks come in order') - setImmediate(function () { - cb(null, true) - }) - } -}) - -test('killAndDrain', function (t) { - t.plan(6) - - var queue = buildQueue(worker, 1) - var expected = [1] - - var predrain = queue.drain - - queue.drain = function drain () { - t.pass('drain has been called') - } - - queue.push(1, done) - queue.push(4, done) - queue.unshift(3, done) - queue.unshift(2, done) - queue.killAndDrain() - - function done (err, result) { - t.error(err, 'no error') - setImmediate(function () { - t.equal(queue.length(), 0, 'no queued tasks') - t.equal(queue.running(), 0, 'no running tasks') - t.equal(queue.drain, predrain, 'drain is back to default') - }) - } - - function worker (arg, cb) { - t.equal(expected.shift(), arg, 'tasks come in order') - setImmediate(function () { - cb(null, true) - }) - } -}) - -test('pause && idle', function (t) { - t.plan(11) - - var queue = buildQueue(worker, 1) - var worked = false - - t.notOk(queue.paused, 'it should not be paused') - t.ok(queue.idle(), 'should be idle') - - queue.pause() - - queue.push(42, function (err, result) { - t.error(err, 'no error') - t.equal(result, true, 'result matches') - }) - - t.notOk(worked, 'it should be paused') - t.ok(queue.paused, 'it should be paused') - t.notOk(queue.idle(), 'should not be idle') - - queue.resume() - - t.notOk(queue.paused, 'it should not be paused') - t.notOk(queue.idle(), 'it should not be idle') - - function worker (arg, cb) { - t.equal(arg, 42) - worked = true - process.nextTick(cb.bind(null, null, true)) - process.nextTick(function () { - t.ok(queue.idle(), 'is should be idle') - }) - } -}) - -test('push without cb', function (t) { - t.plan(1) - - var queue = buildQueue(worker, 1) - - queue.push(42) - - function worker (arg, cb) { - t.equal(arg, 42) - cb() - } -}) - -test('unshift without cb', function (t) { - t.plan(1) - - var queue = buildQueue(worker, 1) - - queue.unshift(42) - - function worker (arg, cb) { - t.equal(arg, 42) - cb() - } -}) - -test('push with worker throwing error', function (t) { - t.plan(5) - var q = buildQueue(function (task, cb) { - cb(new Error('test error'), null) - }, 1) - q.error(function (err, task) { - t.ok(err instanceof Error, 'global error handler should catch the error') - t.match(err.message, /test error/, 'error message should be "test error"') - t.equal(task, 42, 'The task executed should be passed') - }) - q.push(42, function (err) { - t.ok(err instanceof Error, 'push callback should catch the error') - t.match(err.message, /test error/, 'error message should be "test error"') - }) -}) - -test('unshift with worker throwing error', function (t) { - t.plan(5) - var q = buildQueue(function (task, cb) { - cb(new Error('test error'), null) - }, 1) - q.error(function (err, task) { - t.ok(err instanceof Error, 'global error handler should catch the error') - t.match(err.message, /test error/, 'error message should be "test error"') - t.equal(task, 42, 'The task executed should be passed') - }) - q.unshift(42, function (err) { - t.ok(err instanceof Error, 'unshift callback should catch the error') - t.match(err.message, /test error/, 'error message should be "test error"') - }) -}) - -test('pause/resume should trigger drain event', function (t) { - t.plan(1) - - var queue = buildQueue(worker, 1) - queue.pause() - queue.drain = function () { - t.pass('drain should be called') - } - - function worker (arg, cb) { - cb(null, true) - } - - queue.resume() -}) - -test('paused flag', function (t) { - t.plan(2) - - var queue = buildQueue(function (arg, cb) { - cb(null) - }, 1) - t.equal(queue.paused, false) - queue.pause() - t.equal(queue.paused, true) -}) - -test('abort', function (t) { - t.plan(11) - - var queue = buildQueue(worker, 1) - var abortedTasks = 0 - - var predrain = queue.drain - - queue.drain = function drain () { - t.fail('drain should never be called') - } - - // Pause queue to prevent tasks from starting - queue.pause() - queue.push(1, doneAborted) - queue.push(4, doneAborted) - queue.unshift(3, doneAborted) - queue.unshift(2, doneAborted) - - // Abort all queued tasks - queue.abort() - - // Verify state after abort - t.equal(queue.length(), 0, 'no queued tasks after abort') - t.equal(queue.drain, predrain, 'drain is back to default') - - setImmediate(function () { - t.equal(abortedTasks, 4, 'all queued tasks were aborted') - }) - - function doneAborted (err) { - t.ok(err, 'error is present') - t.equal(err.message, 'abort', 'error message is abort') - abortedTasks++ - } - - function worker (arg, cb) { - t.fail('worker should not be called') - setImmediate(function () { - cb(null, true) - }) - } -}) - -test('abort with error handler', function (t) { - t.plan(7) - - var queue = buildQueue(worker, 1) - var errorHandlerCalled = 0 - - queue.error(function (err, task) { - t.equal(err.message, 'abort', 'error handler receives abort error') - t.ok(task !== null, 'error handler receives task value') - errorHandlerCalled++ - }) - - // Pause queue to prevent tasks from starting - queue.pause() - queue.push(1, doneAborted) - queue.push(2, doneAborted) - - // Abort all queued tasks - queue.abort() - - setImmediate(function () { - t.equal(errorHandlerCalled, 2, 'error handler called for all aborted tasks') - }) - - function doneAborted (err) { - t.ok(err, 'callback receives error') - } - - function worker (arg, cb) { - t.fail('worker should not be called') - setImmediate(function () { - cb(null, true) - }) - } -}) diff --git a/node_modules/fastq/test/tsconfig.json b/node_modules/fastq/test/tsconfig.json deleted file mode 100644 index 66e16e9..0000000 --- a/node_modules/fastq/test/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", - "module": "commonjs", - "noEmit": true, - "strict": true - }, - "files": [ - "./example.ts" - ] -} diff --git a/node_modules/fill-range/LICENSE b/node_modules/fill-range/LICENSE deleted file mode 100644 index 9af4a67..0000000 --- a/node_modules/fill-range/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-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/fill-range/README.md b/node_modules/fill-range/README.md deleted file mode 100644 index 8d756fe..0000000 --- a/node_modules/fill-range/README.md +++ /dev/null @@ -1,237 +0,0 @@ -# fill-range [![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/fill-range.svg?style=flat)](https://www.npmjs.com/package/fill-range) [![NPM monthly downloads](https://img.shields.io/npm/dm/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![NPM total downloads](https://img.shields.io/npm/dt/fill-range.svg?style=flat)](https://npmjs.org/package/fill-range) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/fill-range.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/fill-range) - -> Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex` - -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 fill-range -``` - -## Usage - -Expands numbers and letters, optionally using a `step` as the last argument. _(Numbers may be defined as JavaScript numbers or strings)_. - -```js -const fill = require('fill-range'); -// fill(from, to[, step, options]); - -console.log(fill('1', '10')); //=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'] -console.log(fill('1', '10', { toRegex: true })); //=> [1-9]|10 -``` - -**Params** - -* `from`: **{String|Number}** the number or letter to start with -* `to`: **{String|Number}** the number or letter to end with -* `step`: **{String|Number|Object|Function}** Optionally pass a [step](#optionsstep) to use. -* `options`: **{Object|Function}**: See all available [options](#options) - -## Examples - -By default, an array of values is returned. - -**Alphabetical ranges** - -```js -console.log(fill('a', 'e')); //=> ['a', 'b', 'c', 'd', 'e'] -console.log(fill('A', 'E')); //=> [ 'A', 'B', 'C', 'D', 'E' ] -``` - -**Numerical ranges** - -Numbers can be defined as actual numbers or strings. - -```js -console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] -console.log(fill('1', '5')); //=> [ 1, 2, 3, 4, 5 ] -``` - -**Negative ranges** - -Numbers can be defined as actual numbers or strings. - -```js -console.log(fill('-5', '-1')); //=> [ '-5', '-4', '-3', '-2', '-1' ] -console.log(fill('-5', '5')); //=> [ '-5', '-4', '-3', '-2', '-1', '0', '1', '2', '3', '4', '5' ] -``` - -**Steps (increments)** - -```js -// numerical ranges with increments -console.log(fill('0', '25', 4)); //=> [ '0', '4', '8', '12', '16', '20', '24' ] -console.log(fill('0', '25', 5)); //=> [ '0', '5', '10', '15', '20', '25' ] -console.log(fill('0', '25', 6)); //=> [ '0', '6', '12', '18', '24' ] - -// alphabetical ranges with increments -console.log(fill('a', 'z', 4)); //=> [ 'a', 'e', 'i', 'm', 'q', 'u', 'y' ] -console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] -console.log(fill('a', 'z', 6)); //=> [ 'a', 'g', 'm', 's', 'y' ] -``` - -## Options - -### options.step - -**Type**: `number` (formatted as a string or number) - -**Default**: `undefined` - -**Description**: The increment to use for the range. Can be used with letters or numbers. - -**Example(s)** - -```js -// numbers -console.log(fill('1', '10', 2)); //=> [ '1', '3', '5', '7', '9' ] -console.log(fill('1', '10', 3)); //=> [ '1', '4', '7', '10' ] -console.log(fill('1', '10', 4)); //=> [ '1', '5', '9' ] - -// letters -console.log(fill('a', 'z', 5)); //=> [ 'a', 'f', 'k', 'p', 'u', 'z' ] -console.log(fill('a', 'z', 7)); //=> [ 'a', 'h', 'o', 'v' ] -console.log(fill('a', 'z', 9)); //=> [ 'a', 'j', 's' ] -``` - -### options.strictRanges - -**Type**: `boolean` - -**Default**: `false` - -**Description**: By default, `null` is returned when an invalid range is passed. Enable this option to throw a `RangeError` on invalid ranges. - -**Example(s)** - -The following are all invalid: - -```js -fill('1.1', '2'); // decimals not supported in ranges -fill('a', '2'); // incompatible range values -fill(1, 10, 'foo'); // invalid "step" argument -``` - -### options.stringify - -**Type**: `boolean` - -**Default**: `undefined` - -**Description**: Cast all returned values to strings. By default, integers are returned as numbers. - -**Example(s)** - -```js -console.log(fill(1, 5)); //=> [ 1, 2, 3, 4, 5 ] -console.log(fill(1, 5, { stringify: true })); //=> [ '1', '2', '3', '4', '5' ] -``` - -### options.toRegex - -**Type**: `boolean` - -**Default**: `undefined` - -**Description**: Create a regex-compatible source string, instead of expanding values to an array. - -**Example(s)** - -```js -// alphabetical range -console.log(fill('a', 'e', { toRegex: true })); //=> '[a-e]' -// alphabetical with step -console.log(fill('a', 'z', 3, { toRegex: true })); //=> 'a|d|g|j|m|p|s|v|y' -// numerical range -console.log(fill('1', '100', { toRegex: true })); //=> '[1-9]|[1-9][0-9]|100' -// numerical range with zero padding -console.log(fill('000001', '100000', { toRegex: true })); -//=> '0{5}[1-9]|0{4}[1-9][0-9]|0{3}[1-9][0-9]{2}|0{2}[1-9][0-9]{3}|0[1-9][0-9]{4}|100000' -``` - -### options.transform - -**Type**: `function` - -**Default**: `undefined` - -**Description**: Customize each value in the returned array (or [string](#optionstoRegex)). _(you can also pass this function as the last argument to `fill()`)_. - -**Example(s)** - -```js -// add zero padding -console.log(fill(1, 5, value => String(value).padStart(4, '0'))); -//=> ['0001', '0002', '0003', '0004', '0005'] -``` - -## 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 -``` - -
- -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 116 | [jonschlinkert](https://github.com/jonschlinkert) | -| 4 | [paulmillr](https://github.com/paulmillr) | -| 2 | [realityking](https://github.com/realityking) | -| 2 | [bluelovers](https://github.com/bluelovers) | -| 1 | [edorivai](https://github.com/edorivai) | -| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) | - -### Author - -**Jon Schlinkert** - -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) - -Please consider supporting me on Patreon, or [start your own Patreon page](https://patreon.com/invite/bxpbvm)! - - - - - -### 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 08, 2019._ \ No newline at end of file diff --git a/node_modules/fill-range/index.js b/node_modules/fill-range/index.js deleted file mode 100644 index ddb212e..0000000 --- a/node_modules/fill-range/index.js +++ /dev/null @@ -1,248 +0,0 @@ -/*! - * fill-range - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Licensed under the MIT License. - */ - -'use strict'; - -const util = require('util'); -const toRegexRange = require('to-regex-range'); - -const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); - -const transform = toNumber => { - return value => toNumber === true ? Number(value) : String(value); -}; - -const isValidValue = value => { - return typeof value === 'number' || (typeof value === 'string' && value !== ''); -}; - -const isNumber = num => Number.isInteger(+num); - -const zeros = input => { - let value = `${input}`; - let index = -1; - if (value[0] === '-') value = value.slice(1); - if (value === '0') return false; - while (value[++index] === '0'); - return index > 0; -}; - -const stringify = (start, end, options) => { - if (typeof start === 'string' || typeof end === 'string') { - return true; - } - return options.stringify === true; -}; - -const pad = (input, maxLength, toNumber) => { - if (maxLength > 0) { - let dash = input[0] === '-' ? '-' : ''; - if (dash) input = input.slice(1); - input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); - } - if (toNumber === false) { - return String(input); - } - return input; -}; - -const toMaxLen = (input, maxLength) => { - let negative = input[0] === '-' ? '-' : ''; - if (negative) { - input = input.slice(1); - maxLength--; - } - while (input.length < maxLength) input = '0' + input; - return negative ? ('-' + input) : input; -}; - -const toSequence = (parts, options, maxLen) => { - parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); - - let prefix = options.capture ? '' : '?:'; - let positives = ''; - let negatives = ''; - let result; - - if (parts.positives.length) { - positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|'); - } - - if (parts.negatives.length) { - negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`; - } - - if (positives && negatives) { - result = `${positives}|${negatives}`; - } else { - result = positives || negatives; - } - - if (options.wrap) { - return `(${prefix}${result})`; - } - - return result; -}; - -const toRange = (a, b, isNumbers, options) => { - if (isNumbers) { - return toRegexRange(a, b, { wrap: false, ...options }); - } - - let start = String.fromCharCode(a); - if (a === b) return start; - - let stop = String.fromCharCode(b); - return `[${start}-${stop}]`; -}; - -const toRegex = (start, end, options) => { - if (Array.isArray(start)) { - let wrap = options.wrap === true; - let prefix = options.capture ? '' : '?:'; - return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); - } - return toRegexRange(start, end, options); -}; - -const rangeError = (...args) => { - return new RangeError('Invalid range arguments: ' + util.inspect(...args)); -}; - -const invalidRange = (start, end, options) => { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; -}; - -const invalidStep = (step, options) => { - if (options.strictRanges === true) { - throw new TypeError(`Expected step "${step}" to be a number`); - } - return []; -}; - -const fillNumbers = (start, end, step = 1, options = {}) => { - let a = Number(start); - let b = Number(end); - - if (!Number.isInteger(a) || !Number.isInteger(b)) { - if (options.strictRanges === true) throw rangeError([start, end]); - return []; - } - - // fix negative zero - if (a === 0) a = 0; - if (b === 0) b = 0; - - let descending = a > b; - let startString = String(start); - let endString = String(end); - let stepString = String(step); - step = Math.max(Math.abs(step), 1); - - let padded = zeros(startString) || zeros(endString) || zeros(stepString); - let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; - let toNumber = padded === false && stringify(start, end, options) === false; - let format = options.transform || transform(toNumber); - - if (options.toRegex && step === 1) { - return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); - } - - let parts = { negatives: [], positives: [] }; - let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); - let range = []; - let index = 0; - - while (descending ? a >= b : a <= b) { - if (options.toRegex === true && step > 1) { - push(a); - } else { - range.push(pad(format(a, index), maxLen, toNumber)); - } - a = descending ? a - step : a + step; - index++; - } - - if (options.toRegex === true) { - return step > 1 - ? toSequence(parts, options, maxLen) - : toRegex(range, null, { wrap: false, ...options }); - } - - return range; -}; - -const fillLetters = (start, end, step = 1, options = {}) => { - if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { - return invalidRange(start, end, options); - } - - let format = options.transform || (val => String.fromCharCode(val)); - let a = `${start}`.charCodeAt(0); - let b = `${end}`.charCodeAt(0); - - let descending = a > b; - let min = Math.min(a, b); - let max = Math.max(a, b); - - if (options.toRegex && step === 1) { - return toRange(min, max, false, options); - } - - let range = []; - let index = 0; - - while (descending ? a >= b : a <= b) { - range.push(format(a, index)); - a = descending ? a - step : a + step; - index++; - } - - if (options.toRegex === true) { - return toRegex(range, null, { wrap: false, options }); - } - - return range; -}; - -const fill = (start, end, step, options = {}) => { - if (end == null && isValidValue(start)) { - return [start]; - } - - if (!isValidValue(start) || !isValidValue(end)) { - return invalidRange(start, end, options); - } - - if (typeof step === 'function') { - return fill(start, end, 1, { transform: step }); - } - - if (isObject(step)) { - return fill(start, end, 0, step); - } - - let opts = { ...options }; - if (opts.capture === true) opts.wrap = true; - step = step || opts.step || 1; - - if (!isNumber(step)) { - if (step != null && !isObject(step)) return invalidStep(step, opts); - return fill(start, end, 1, step); - } - - if (isNumber(start) && isNumber(end)) { - return fillNumbers(start, end, step, opts); - } - - return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); -}; - -module.exports = fill; diff --git a/node_modules/fill-range/package.json b/node_modules/fill-range/package.json deleted file mode 100644 index 582357f..0000000 --- a/node_modules/fill-range/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "fill-range", - "description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`", - "version": "7.1.1", - "homepage": "https://github.com/jonschlinkert/fill-range", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Edo Rivai (edo.rivai.nl)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Paul Miller (paulmillr.com)", - "Rouven Weßling (www.rouvenwessling.de)", - "(https://github.com/wtgtybhertgeghgtwtg)" - ], - "repository": "jonschlinkert/fill-range", - "bugs": { - "url": "https://github.com/jonschlinkert/fill-range/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=8" - }, - "scripts": { - "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .", - "mocha": "mocha --reporter dot", - "test": "npm run lint && npm run mocha", - "test:ci": "npm run test:cover", - "test:cover": "nyc npm run mocha" - }, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "devDependencies": { - "gulp-format-md": "^2.0.0", - "mocha": "^6.1.1", - "nyc": "^15.1.0" - }, - "keywords": [ - "alpha", - "alphabetical", - "array", - "bash", - "brace", - "expand", - "expansion", - "fill", - "glob", - "match", - "matches", - "matching", - "number", - "numerical", - "range", - "ranges", - "regex", - "sh" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - } -} 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-parent/LICENSE b/node_modules/glob-parent/LICENSE deleted file mode 100644 index d701b08..0000000 --- a/node_modules/glob-parent/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2015, 2019 Elan Shanker, 2021 Blaine Bublitz , Eric Schoffstall and other 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/glob-parent/README.md b/node_modules/glob-parent/README.md deleted file mode 100644 index 6ae18a1..0000000 --- a/node_modules/glob-parent/README.md +++ /dev/null @@ -1,134 +0,0 @@ -

- - - -

- -# glob-parent - -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url] - -Extract the non-magic parent path from a glob string. - -## Usage - -```js -var globParent = require('glob-parent'); - -globParent('path/to/*.js'); // 'path/to' -globParent('/root/path/to/*.js'); // '/root/path/to' -globParent('/*.js'); // '/' -globParent('*.js'); // '.' -globParent('**/*.js'); // '.' -globParent('path/{to,from}'); // 'path' -globParent('path/!(to|from)'); // 'path' -globParent('path/?(to|from)'); // 'path' -globParent('path/+(to|from)'); // 'path' -globParent('path/*(to|from)'); // 'path' -globParent('path/@(to|from)'); // 'path' -globParent('path/**/*'); // 'path' - -// if provided a non-glob path, returns the nearest dir -globParent('path/foo/bar.js'); // 'path/foo' -globParent('path/foo/'); // 'path/foo' -globParent('path/foo'); // 'path' (see issue #3 for details) -``` - -## API - -### `globParent(maybeGlobString, [options])` - -Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below. - -#### options - -```js -{ - // Disables the automatic conversion of slashes for Windows - flipBackslashes: true; -} -``` - -## Escaping - -The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters: - -- `?` (question mark) unless used as a path segment alone -- `*` (asterisk) -- `|` (pipe) -- `(` (opening parenthesis) -- `)` (closing parenthesis) -- `{` (opening curly brace) -- `}` (closing curly brace) -- `[` (opening bracket) -- `]` (closing bracket) - -**Example** - -```js -globParent('foo/[bar]/'); // 'foo' -globParent('foo/\\[bar]/'); // 'foo/[bar]' -``` - -## Limitations - -### Braces & Brackets - -This library attempts a quick and imperfect method of determining which path -parts have glob magic without fully parsing/lexing the pattern. There are some -advanced use cases that can trip it up, such as nested braces where the outer -pair is escaped and the inner one contains a path separator. If you find -yourself in the unlikely circumstance of being affected by this or need to -ensure higher-fidelity glob handling in your library, it is recommended that you -pre-process your input with [expand-braces] and/or [expand-brackets]. - -### Windows - -Backslashes are not valid path separators for globs. If a path with backslashes -is provided anyway, for simple cases, glob-parent will replace the path -separator for you and return the non-glob parent path (now with -forward-slashes, which are still valid as Windows path separators). - -This cannot be used in conjunction with escape characters. - -```js -// BAD -globParent('C:\\Program Files \\(x86\\)\\*.ext'); // 'C:/Program Files /(x86/)' - -// GOOD -globParent('C:/Program Files\\(x86\\)/*.ext'); // 'C:/Program Files (x86)' -``` - -If you are using escape characters for a pattern without path parts (i.e. -relative to `cwd`), prefix with `./` to avoid confusing glob-parent. - -```js -// BAD -globParent('foo \\[bar]'); // 'foo ' -globParent('foo \\[bar]*'); // 'foo ' - -// GOOD -globParent('./foo \\[bar]'); // 'foo [bar]' -globParent('./foo \\[bar]*'); // '.' -``` - -## License - -ISC - - -[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg?style=flat-square -[npm-url]: https://www.npmjs.com/package/glob-parent -[npm-image]: https://img.shields.io/npm/v/glob-parent.svg?style=flat-square - -[ci-url]: https://github.com/gulpjs/glob-parent/actions?query=workflow:dev -[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/glob-parent/dev?style=flat-square - -[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent -[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg?style=flat-square - - - -[expand-braces]: https://github.com/jonschlinkert/expand-braces -[expand-brackets]: https://github.com/jonschlinkert/expand-brackets - diff --git a/node_modules/glob-parent/index.js b/node_modules/glob-parent/index.js deleted file mode 100644 index 09dde64..0000000 --- a/node_modules/glob-parent/index.js +++ /dev/null @@ -1,75 +0,0 @@ -'use strict'; - -var isGlob = require('is-glob'); -var pathPosixDirname = require('path').posix.dirname; -var isWin32 = require('os').platform() === 'win32'; - -var slash = '/'; -var backslash = /\\/g; -var escaped = /\\([!*?|[\](){}])/g; - -/** - * @param {string} str - * @param {Object} opts - * @param {boolean} [opts.flipBackslashes=true] - */ -module.exports = function globParent(str, opts) { - var options = Object.assign({ flipBackslashes: true }, opts); - - // flip windows path separators - if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { - str = str.replace(backslash, slash); - } - - // special case for strings ending in enclosure containing path separator - if (isEnclosure(str)) { - str += slash; - } - - // preserves full path in case of trailing path separator - str += 'a'; - - // remove path parts that are globby - do { - str = pathPosixDirname(str); - } while (isGlobby(str)); - - // remove escape chars and return result - return str.replace(escaped, '$1'); -}; - -function isEnclosure(str) { - var lastChar = str.slice(-1); - - var enclosureStart; - switch (lastChar) { - case '}': - enclosureStart = '{'; - break; - case ']': - enclosureStart = '['; - break; - default: - return false; - } - - var foundIndex = str.indexOf(enclosureStart); - if (foundIndex < 0) { - return false; - } - - return str.slice(foundIndex + 1, -1).includes(slash); -} - -function isGlobby(str) { - if (/\([^()]+$/.test(str)) { - return true; - } - if (str[0] === '{' || str[0] === '[') { - return true; - } - if (/[^\\][{[]/.test(str)) { - return true; - } - return isGlob(str); -} diff --git a/node_modules/glob-parent/package.json b/node_modules/glob-parent/package.json deleted file mode 100644 index baeab42..0000000 --- a/node_modules/glob-parent/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "glob-parent", - "version": "6.0.2", - "description": "Extract the non-magic parent path from a glob string.", - "author": "Gulp Team (https://gulpjs.com/)", - "contributors": [ - "Elan Shanker (https://github.com/es128)", - "Blaine Bublitz " - ], - "repository": "gulpjs/glob-parent", - "license": "ISC", - "engines": { - "node": ">=10.13.0" - }, - "main": "index.js", - "files": [ - "LICENSE", - "index.js" - ], - "scripts": { - "lint": "eslint .", - "pretest": "npm run lint", - "test": "nyc mocha --async-only" - }, - "dependencies": { - "is-glob": "^4.0.3" - }, - "devDependencies": { - "eslint": "^7.0.0", - "eslint-config-gulp": "^5.0.0", - "expect": "^26.0.1", - "mocha": "^7.1.2", - "nyc": "^15.0.1" - }, - "nyc": { - "reporter": [ - "lcov", - "text-summary" - ] - }, - "prettier": { - "singleQuote": true - }, - "keywords": [ - "glob", - "parent", - "strip", - "path", - "dirname", - "directory", - "base", - "wildcard" - ] -} 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 2b0a980..0000000 --- a/node_modules/hasown/CHANGELOG.md +++ /dev/null @@ -1,40 +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.2](https://github.com/inspect-js/hasOwn/compare/v2.0.1...v2.0.2) - 2024-03-10 - -### Commits - -- [types] use shared config [`68e9d4d`](https://github.com/inspect-js/hasOwn/commit/68e9d4dab6facb4f05f02c6baea94a3f2a4e44b2) -- [actions] remove redundant finisher; use reusable workflow [`241a68e`](https://github.com/inspect-js/hasOwn/commit/241a68e13ea1fe52bec5ba7f74144befc31fae7b) -- [Tests] increase coverage [`4125c0d`](https://github.com/inspect-js/hasOwn/commit/4125c0d6121db56ae30e38346dfb0c000b04f0a7) -- [Tests] skip `npm ls` in old node due to TS [`01b9282`](https://github.com/inspect-js/hasOwn/commit/01b92822f9971dea031eafdd14767df41d61c202) -- [types] improve predicate type [`d340f85`](https://github.com/inspect-js/hasOwn/commit/d340f85ce02e286ef61096cbbb6697081d40a12b) -- [Dev Deps] update `tape` [`70089fc`](https://github.com/inspect-js/hasOwn/commit/70089fcf544e64acc024cbe60f5a9b00acad86de) -- [Tests] use `@arethetypeswrong/cli` [`50b272c`](https://github.com/inspect-js/hasOwn/commit/50b272c829f40d053a3dd91c9796e0ac0b2af084) - -## [v2.0.1](https://github.com/inspect-js/hasOwn/compare/v2.0.0...v2.0.1) - 2024-02-10 - -### Commits - -- [types] use a handwritten d.ts file; fix exported type [`012b989`](https://github.com/inspect-js/hasOwn/commit/012b9898ccf91dc441e2ebf594ff70270a5fda58) -- [Dev Deps] update `@types/function-bind`, `@types/mock-property`, `@types/tape`, `aud`, `mock-property`, `npmignore`, `tape`, `typescript` [`977a56f`](https://github.com/inspect-js/hasOwn/commit/977a56f51a1f8b20566f3c471612137894644025) -- [meta] add `sideEffects` flag [`3a60b7b`](https://github.com/inspect-js/hasOwn/commit/3a60b7bf42fccd8c605e5f145a6fcc83b13cb46f) - -## [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 aafdf3b..0000000 --- a/node_modules/hasown/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare function hasOwn(o: O, p: K): o is O & Record; - -export = hasOwn; diff --git a/node_modules/hasown/index.js b/node_modules/hasown/index.js deleted file mode 100644 index 34e6059..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 {import('.')} */ -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 8502e13..0000000 --- a/node_modules/hasown/package.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "name": "hasown", - "version": "2.0.2", - "description": "A robust, ES3 compatible, \"has own property\" predicate.", - "main": "index.js", - "exports": { - ".": "./index.js", - "./package.json": "./package.json" - }, - "types": "index.d.ts", - "sideEffects": false, - "scripts": { - "prepack": "npmignore --auto --commentLines=autogenerated", - "prepublish": "not-in-publish || npm run prepublishOnly", - "prepublishOnly": "safe-publish-latest", - "prelint": "evalmd README.md", - "lint": "eslint --ext=js,mjs .", - "postlint": "npm run tsc", - "pretest": "npm run lint", - "tsc": "tsc -p .", - "posttsc": "attw -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": { - "@arethetypeswrong/cli": "^0.15.1", - "@ljharb/eslint-config": "^21.1.0", - "@ljharb/tsconfig": "^0.2.0", - "@types/function-bind": "^1.1.10", - "@types/mock-property": "^1.0.2", - "@types/tape": "^5.6.4", - "aud": "^2.0.4", - "auto-changelog": "^2.4.0", - "eslint": "=8.8.0", - "evalmd": "^0.0.19", - "in-publish": "^2.0.1", - "mock-property": "^1.0.3", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "tape": "^5.7.5", - "typescript": "next" - }, - "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" - ] - } -} diff --git a/node_modules/hasown/tsconfig.json b/node_modules/hasown/tsconfig.json deleted file mode 100644 index 0930c56..0000000 --- a/node_modules/hasown/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "@ljharb/tsconfig", - "exclude": [ - "coverage", - ], -} diff --git a/node_modules/is-binary-path/index.d.ts b/node_modules/is-binary-path/index.d.ts deleted file mode 100644 index 19dcd43..0000000 --- a/node_modules/is-binary-path/index.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** -Check if a file path is a binary file. - -@example -``` -import isBinaryPath = require('is-binary-path'); - -isBinaryPath('source/unicorn.png'); -//=> true - -isBinaryPath('source/unicorn.txt'); -//=> false -``` -*/ -declare function isBinaryPath(filePath: string): boolean; - -export = isBinaryPath; diff --git a/node_modules/is-binary-path/index.js b/node_modules/is-binary-path/index.js deleted file mode 100644 index ef7548c..0000000 --- a/node_modules/is-binary-path/index.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; -const path = require('path'); -const binaryExtensions = require('binary-extensions'); - -const extensions = new Set(binaryExtensions); - -module.exports = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); diff --git a/node_modules/is-binary-path/license b/node_modules/is-binary-path/license deleted file mode 100644 index 401b1c7..0000000 --- a/node_modules/is-binary-path/license +++ /dev/null @@ -1,9 +0,0 @@ -MIT License - -Copyright (c) 2019 Sindre Sorhus (https://sindresorhus.com), Paul Miller (https://paulmillr.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/is-binary-path/package.json b/node_modules/is-binary-path/package.json deleted file mode 100644 index a8d005a..0000000 --- a/node_modules/is-binary-path/package.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "is-binary-path", - "version": "2.1.0", - "description": "Check if a file path is a binary file", - "license": "MIT", - "repository": "sindresorhus/is-binary-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": [ - "binary", - "extensions", - "extension", - "file", - "path", - "check", - "detect", - "is" - ], - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } -} diff --git a/node_modules/is-binary-path/readme.md b/node_modules/is-binary-path/readme.md deleted file mode 100644 index b4ab025..0000000 --- a/node_modules/is-binary-path/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# is-binary-path [![Build Status](https://travis-ci.org/sindresorhus/is-binary-path.svg?branch=master)](https://travis-ci.org/sindresorhus/is-binary-path) - -> Check if a file path is a binary file - - -## Install - -``` -$ npm install is-binary-path -``` - - -## Usage - -```js -const isBinaryPath = require('is-binary-path'); - -isBinaryPath('source/unicorn.png'); -//=> true - -isBinaryPath('source/unicorn.txt'); -//=> false -``` - - -## Related - -- [binary-extensions](https://github.com/sindresorhus/binary-extensions) - List of binary file extensions -- [is-text-path](https://github.com/sindresorhus/is-text-path) - Check if a filepath is a text file - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com), [Paul Miller](https://paulmillr.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 0177c82..0000000 --- a/node_modules/is-core-module/CHANGELOG.md +++ /dev/null @@ -1,218 +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.16.1](https://github.com/inspect-js/is-core-module/compare/v2.16.0...v2.16.1) - 2024-12-21 - -### Fixed - -- [Fix] `node:sqlite` is available in node ^22.13 [`#17`](https://github.com/inspect-js/is-core-module/issues/17) - -## [v2.16.0](https://github.com/inspect-js/is-core-module/compare/v2.15.1...v2.16.0) - 2024-12-13 - -### Commits - -- [New] add `node:sqlite` [`1ee94d2`](https://github.com/inspect-js/is-core-module/commit/1ee94d20857e22cdb24e9b4bb1a2097f2e03e26f) -- [Dev Deps] update `auto-changelog`, `tape` [`aa84aa3`](https://github.com/inspect-js/is-core-module/commit/aa84aa34face677f14e08ec1c737f0c4bba27260) - -## [v2.15.1](https://github.com/inspect-js/is-core-module/compare/v2.15.0...v2.15.1) - 2024-08-21 - -### Commits - -- [Tests] add `process.getBuiltinModule` tests [`28c7791`](https://github.com/inspect-js/is-core-module/commit/28c7791c196d58c64cfdf638b7e68ed1b62a4da0) -- [Fix] `test/mock_loader` is no longer exposed as of v22.7 [`68b08b0`](https://github.com/inspect-js/is-core-module/commit/68b08b0d7963447dbffa5142e8810dca550383af) -- [Tests] replace `aud` with `npm audit` [`32f8060`](https://github.com/inspect-js/is-core-module/commit/32f806026dac14f9016be4401a643851240c76b9) -- [Dev Deps] update `mock-property` [`f7d3c8f`](https://github.com/inspect-js/is-core-module/commit/f7d3c8f01e922be49621683eb41477c4f50522e1) -- [Dev Deps] add missing peer dep [`eaee885`](https://github.com/inspect-js/is-core-module/commit/eaee885b67238819e9c8ed5bd2098766e1d05331) - -## [v2.15.0](https://github.com/inspect-js/is-core-module/compare/v2.14.0...v2.15.0) - 2024-07-17 - -### Commits - -- [New] add `node:sea` [`2819fb3`](https://github.com/inspect-js/is-core-module/commit/2819fb3eae312fa64643bc5430ebd06ec0f3fb88) - -## [v2.14.0](https://github.com/inspect-js/is-core-module/compare/v2.13.1...v2.14.0) - 2024-06-20 - -### Commits - -- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `mock-property`, `npmignore`, `tape` [`0e43200`](https://github.com/inspect-js/is-core-module/commit/0e432006d97237cc082d41e6a593e87c81068364) -- [meta] add missing `engines.node` [`4ea3af8`](https://github.com/inspect-js/is-core-module/commit/4ea3af88891a1d4f96026f0ec0ef08c67cd1bd24) -- [New] add `test/mock_loader` [`e9fbd29`](https://github.com/inspect-js/is-core-module/commit/e9fbd2951383be070aeffb9ebbf3715237282610) -- [Deps] update `hasown` [`57f1940`](https://github.com/inspect-js/is-core-module/commit/57f1940947b3e368abdf529232d2f17d88909358) - -## [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 930ec68..0000000 --- a/node_modules/is-core-module/core.json +++ /dev/null @@ -1,162 +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"], - "node:sea": [">= 20.12 && < 21", ">= 21.7"], - "smalloc": ">= 0.11.5 && < 3", - "node:sqlite": [">= 22.13 && < 23", ">= 23.4"], - "_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"], - "test/mock_loader": ">= 22.3 && < 22.7", - "node:test/mock_loader": ">= 22.3 && < 22.7", - "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 2668256..0000000 --- a/node_modules/is-core-module/package.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "is-core-module", - "version": "2.16.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": "npx npm@'>=10.2' audit --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.2" - }, - "devDependencies": { - "@ljharb/eslint-config": "^21.1.1", - "auto-changelog": "^2.5.0", - "encoding": "^0.1.13", - "eslint": "=8.8.0", - "in-publish": "^2.0.1", - "mock-property": "^1.1.0", - "npmignore": "^0.3.1", - "nyc": "^10.3.2", - "safe-publish-latest": "^2.0.0", - "semver": "^6.3.1", - "tape": "^5.9.0" - }, - "auto-changelog": { - "output": "CHANGELOG.md", - "template": "keepachangelog", - "unreleased": false, - "commitLimit": false, - "backfillLimit": false, - "hideCredit": true - }, - "publishConfig": { - "ignore": [ - ".github" - ] - }, - "engines": { - "node": ">= 0.4" - } -} 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 7a81e1c..0000000 --- a/node_modules/is-core-module/test/index.js +++ /dev/null @@ -1,157 +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 Module = require('module'); - var libs = 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'); - } - if (semver.satisfies(process.version, '^20.12 || >= 21.7')) { - libs = libs.concat('node:sea'); - } - if (semver.satisfies(process.version, '>= 23.4')) { - libs = libs.concat('node:sqlite'); - } - - 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'); - - if (Module.isBuiltin) { - st.ok(Module.isBuiltin(mod), 'module.isBuiltin(' + mod + ') is true'); - } - - st.doesNotThrow( - function () { require(mod); }, // eslint-disable-line no-loop-func - 'requiring ' + mod + ' does not throw' - ); - - if (process.getBuiltinModule) { - st.equal( - process.getBuiltinModule(mod), - require(mod), - 'process.getBuiltinModule(' + mod + ') === require(' + mod + ')' - ); - } - - 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-extglob/LICENSE b/node_modules/is-extglob/LICENSE deleted file mode 100644 index 842218c..0000000 --- a/node_modules/is-extglob/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016, 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-extglob/README.md b/node_modules/is-extglob/README.md deleted file mode 100644 index 0416af5..0000000 --- a/node_modules/is-extglob/README.md +++ /dev/null @@ -1,107 +0,0 @@ -# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob) - -> Returns true if a string has an extglob. - -## Install - -Install with [npm](https://www.npmjs.com/): - -```sh -$ npm install --save is-extglob -``` - -## Usage - -```js -var isExtglob = require('is-extglob'); -``` - -**True** - -```js -isExtglob('?(abc)'); -isExtglob('@(abc)'); -isExtglob('!(abc)'); -isExtglob('*(abc)'); -isExtglob('+(abc)'); -``` - -**False** - -Escaped extglobs: - -```js -isExtglob('\\?(abc)'); -isExtglob('\\@(abc)'); -isExtglob('\\!(abc)'); -isExtglob('\\*(abc)'); -isExtglob('\\+(abc)'); -``` - -Everything else... - -```js -isExtglob('foo.js'); -isExtglob('!foo.js'); -isExtglob('*.js'); -isExtglob('**/abc.js'); -isExtglob('abc/*.js'); -isExtglob('abc/(aaa|bbb).js'); -isExtglob('abc/[a-z].js'); -isExtglob('abc/{a,b}.js'); -isExtglob('abc/?.js'); -isExtglob('abc.js'); -isExtglob('abc/def/ghi.js'); -``` - -## History - -**v2.0** - -Adds support for escaping. Escaped exglobs no longer return true. - -## About - -### Related projects - -* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.") -* [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/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/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") -* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.") - -### Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). - -### Building docs - -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ - -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): - -```sh -$ npm install -g verb verb-generate-readme && verb -``` - -### Running tests - -Install dev dependencies: - -```sh -$ npm install -d && npm test -``` - -### Author - -**Jon Schlinkert** - -* [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -### License - -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE). - -*** - -_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ \ No newline at end of file diff --git a/node_modules/is-extglob/index.js b/node_modules/is-extglob/index.js deleted file mode 100644 index c1d986f..0000000 --- a/node_modules/is-extglob/index.js +++ /dev/null @@ -1,20 +0,0 @@ -/*! - * is-extglob - * - * Copyright (c) 2014-2016, Jon Schlinkert. - * Licensed under the MIT License. - */ - -module.exports = function isExtglob(str) { - if (typeof str !== 'string' || str === '') { - return false; - } - - var match; - while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { - if (match[2]) return true; - str = str.slice(match.index + match[0].length); - } - - return false; -}; diff --git a/node_modules/is-extglob/package.json b/node_modules/is-extglob/package.json deleted file mode 100644 index 7a90836..0000000 --- a/node_modules/is-extglob/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "is-extglob", - "description": "Returns true if a string has an extglob.", - "version": "2.1.1", - "homepage": "https://github.com/jonschlinkert/is-extglob", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "repository": "jonschlinkert/is-extglob", - "bugs": { - "url": "https://github.com/jonschlinkert/is-extglob/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "gulp-format-md": "^0.1.10", - "mocha": "^3.0.2" - }, - "keywords": [ - "bash", - "braces", - "check", - "exec", - "expression", - "extglob", - "glob", - "globbing", - "globstar", - "is", - "match", - "matches", - "pattern", - "regex", - "regular", - "string", - "test" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "has-glob", - "is-glob", - "micromatch" - ] - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ], - "lint": { - "reflinks": true - } - } -} diff --git a/node_modules/is-glob/LICENSE b/node_modules/is-glob/LICENSE deleted file mode 100644 index 3f2eca1..0000000 --- a/node_modules/is-glob/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-glob/README.md b/node_modules/is-glob/README.md deleted file mode 100644 index 740724b..0000000 --- a/node_modules/is-glob/README.md +++ /dev/null @@ -1,206 +0,0 @@ -# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions) - -> 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 better user experience. - -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 is-glob -``` - -You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob). - -## Usage - -```js -var isGlob = require('is-glob'); -``` - -### Default behavior - -**True** - -Patterns that have glob characters or regex patterns will return `true`: - -```js -isGlob('!foo.js'); -isGlob('*.js'); -isGlob('**/abc.js'); -isGlob('abc/*.js'); -isGlob('abc/(aaa|bbb).js'); -isGlob('abc/[a-z].js'); -isGlob('abc/{a,b}.js'); -//=> true -``` - -Extglobs - -```js -isGlob('abc/@(a).js'); -isGlob('abc/!(a).js'); -isGlob('abc/+(a).js'); -isGlob('abc/*(a).js'); -isGlob('abc/?(a).js'); -//=> true -``` - -**False** - -Escaped globs or extglobs return `false`: - -```js -isGlob('abc/\\@(a).js'); -isGlob('abc/\\!(a).js'); -isGlob('abc/\\+(a).js'); -isGlob('abc/\\*(a).js'); -isGlob('abc/\\?(a).js'); -isGlob('\\!foo.js'); -isGlob('\\*.js'); -isGlob('\\*\\*/abc.js'); -isGlob('abc/\\*.js'); -isGlob('abc/\\(aaa|bbb).js'); -isGlob('abc/\\[a-z].js'); -isGlob('abc/\\{a,b}.js'); -//=> false -``` - -Patterns that do not have glob patterns return `false`: - -```js -isGlob('abc.js'); -isGlob('abc/def/ghi.js'); -isGlob('foo.js'); -isGlob('abc/@.js'); -isGlob('abc/+.js'); -isGlob('abc/?.js'); -isGlob(); -isGlob(null); -//=> false -``` - -Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)): - -```js -isGlob(['**/*.js']); -isGlob(['foo.js']); -//=> false -``` - -### Option strict - -When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that -some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not. - -**True** - -Patterns that have glob characters or regex patterns will return `true`: - -```js -isGlob('!foo.js', {strict: false}); -isGlob('*.js', {strict: false}); -isGlob('**/abc.js', {strict: false}); -isGlob('abc/*.js', {strict: false}); -isGlob('abc/(aaa|bbb).js', {strict: false}); -isGlob('abc/[a-z].js', {strict: false}); -isGlob('abc/{a,b}.js', {strict: false}); -//=> true -``` - -Extglobs - -```js -isGlob('abc/@(a).js', {strict: false}); -isGlob('abc/!(a).js', {strict: false}); -isGlob('abc/+(a).js', {strict: false}); -isGlob('abc/*(a).js', {strict: false}); -isGlob('abc/?(a).js', {strict: false}); -//=> true -``` - -**False** - -Escaped globs or extglobs return `false`: - -```js -isGlob('\\!foo.js', {strict: false}); -isGlob('\\*.js', {strict: false}); -isGlob('\\*\\*/abc.js', {strict: false}); -isGlob('abc/\\*.js', {strict: false}); -isGlob('abc/\\(aaa|bbb).js', {strict: false}); -isGlob('abc/\\[a-z].js', {strict: false}); -isGlob('abc/\\{a,b}.js', {strict: false}); -//=> false -``` - -## 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: - -* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit") -* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks") -* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.") -* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 47 | [jonschlinkert](https://github.com/jonschlinkert) | -| 5 | [doowb](https://github.com/doowb) | -| 1 | [phated](https://github.com/phated) | -| 1 | [danhper](https://github.com/danhper) | -| 1 | [paulmillr](https://github.com/paulmillr) | - -### 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 March 27, 2019._ \ No newline at end of file diff --git a/node_modules/is-glob/index.js b/node_modules/is-glob/index.js deleted file mode 100644 index 620f563..0000000 --- a/node_modules/is-glob/index.js +++ /dev/null @@ -1,150 +0,0 @@ -/*! - * is-glob - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ - -var isExtglob = require('is-extglob'); -var chars = { '{': '}', '(': ')', '[': ']'}; -var strictCheck = function(str) { - if (str[0] === '!') { - return true; - } - var index = 0; - var pipeIndex = -2; - var closeSquareIndex = -2; - var closeCurlyIndex = -2; - var closeParenIndex = -2; - var backSlashIndex = -2; - while (index < str.length) { - if (str[index] === '*') { - return true; - } - - if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { - return true; - } - - if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { - if (closeSquareIndex < index) { - closeSquareIndex = str.indexOf(']', index); - } - if (closeSquareIndex > index) { - if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { - return true; - } - backSlashIndex = str.indexOf('\\', index); - if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { - return true; - } - } - } - - if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { - closeCurlyIndex = str.indexOf('}', index); - if (closeCurlyIndex > index) { - backSlashIndex = str.indexOf('\\', index); - if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { - return true; - } - } - } - - if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { - closeParenIndex = str.indexOf(')', index); - if (closeParenIndex > index) { - backSlashIndex = str.indexOf('\\', index); - if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { - return true; - } - } - } - - if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { - if (pipeIndex < index) { - pipeIndex = str.indexOf('|', index); - } - if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { - closeParenIndex = str.indexOf(')', pipeIndex); - if (closeParenIndex > pipeIndex) { - backSlashIndex = str.indexOf('\\', pipeIndex); - if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { - return true; - } - } - } - } - - if (str[index] === '\\') { - var open = str[index + 1]; - index += 2; - var close = chars[open]; - - if (close) { - var n = str.indexOf(close, index); - if (n !== -1) { - index = n + 1; - } - } - - if (str[index] === '!') { - return true; - } - } else { - index++; - } - } - return false; -}; - -var relaxedCheck = function(str) { - if (str[0] === '!') { - return true; - } - var index = 0; - while (index < str.length) { - if (/[*?{}()[\]]/.test(str[index])) { - return true; - } - - if (str[index] === '\\') { - var open = str[index + 1]; - index += 2; - var close = chars[open]; - - if (close) { - var n = str.indexOf(close, index); - if (n !== -1) { - index = n + 1; - } - } - - if (str[index] === '!') { - return true; - } - } else { - index++; - } - } - return false; -}; - -module.exports = function isGlob(str, options) { - if (typeof str !== 'string' || str === '') { - return false; - } - - if (isExtglob(str)) { - return true; - } - - var check = strictCheck; - - // optionally relax check - if (options && options.strict === false) { - check = relaxedCheck; - } - - return check(str); -}; diff --git a/node_modules/is-glob/package.json b/node_modules/is-glob/package.json deleted file mode 100644 index 858af03..0000000 --- a/node_modules/is-glob/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "name": "is-glob", - "description": "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 better user experience.", - "version": "4.0.3", - "homepage": "https://github.com/micromatch/is-glob", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Brian Woodward (https://twitter.com/doowb)", - "Daniel Perez (https://tuvistavie.com)", - "Jon Schlinkert (http://twitter.com/jonschlinkert)" - ], - "repository": "micromatch/is-glob", - "bugs": { - "url": "https://github.com/micromatch/is-glob/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha && node benchmark.js" - }, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "devDependencies": { - "gulp-format-md": "^0.1.10", - "mocha": "^3.0.2" - }, - "keywords": [ - "bash", - "braces", - "check", - "exec", - "expression", - "extglob", - "glob", - "globbing", - "globstar", - "is", - "match", - "matches", - "pattern", - "regex", - "regular", - "string", - "test" - ], - "verb": { - "layout": "default", - "plugins": [ - "gulp-format-md" - ], - "related": { - "list": [ - "assemble", - "base", - "update", - "verb" - ] - }, - "reflinks": [ - "assemble", - "bach", - "base", - "composer", - "gulp", - "has-glob", - "is-valid-glob", - "micromatch", - "npm", - "scaffold", - "verb", - "vinyl" - ] - } -} diff --git a/node_modules/is-number/LICENSE b/node_modules/is-number/LICENSE deleted file mode 100644 index 9af4a67..0000000 --- a/node_modules/is-number/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-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/is-number/README.md b/node_modules/is-number/README.md deleted file mode 100644 index eb8149e..0000000 --- a/node_modules/is-number/README.md +++ /dev/null @@ -1,187 +0,0 @@ -# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![NPM total downloads](https://img.shields.io/npm/dt/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-number) - -> Returns true if the value is a finite number. - -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 is-number -``` - -## Why is this needed? - -In JavaScript, it's not always as straightforward as it should be to reliably check if a value is a number. It's common for devs to use `+`, `-`, or `Number()` to cast a string value to a number (for example, when values are returned from user input, regex matches, parsers, etc). But there are many non-intuitive edge cases that yield unexpected results: - -```js -console.log(+[]); //=> 0 -console.log(+''); //=> 0 -console.log(+' '); //=> 0 -console.log(typeof NaN); //=> 'number' -``` - -This library offers a performant way to smooth out edge cases like these. - -## Usage - -```js -const isNumber = require('is-number'); -``` - -See the [tests](./test.js) for more examples. - -### true - -```js -isNumber(5e3); // true -isNumber(0xff); // true -isNumber(-1.1); // true -isNumber(0); // true -isNumber(1); // true -isNumber(1.1); // true -isNumber(10); // true -isNumber(10.10); // true -isNumber(100); // true -isNumber('-1.1'); // true -isNumber('0'); // true -isNumber('012'); // true -isNumber('0xff'); // true -isNumber('1'); // true -isNumber('1.1'); // true -isNumber('10'); // true -isNumber('10.10'); // true -isNumber('100'); // true -isNumber('5e3'); // true -isNumber(parseInt('012')); // true -isNumber(parseFloat('012')); // true -``` - -### False - -Everything else is false, as you would expect: - -```js -isNumber(Infinity); // false -isNumber(NaN); // false -isNumber(null); // false -isNumber(undefined); // false -isNumber(''); // false -isNumber(' '); // false -isNumber('foo'); // false -isNumber([1]); // false -isNumber([]); // false -isNumber(function () {}); // false -isNumber({}); // false -``` - -## Release history - -### 7.0.0 - -* Refactor. Now uses `.isFinite` if it exists. -* Performance is about the same as v6.0 when the value is a string or number. But it's now 3x-4x faster when the value is not a string or number. - -### 6.0.0 - -* Optimizations, thanks to @benaadams. - -### 5.0.0 - -**Breaking changes** - -* removed support for `instanceof Number` and `instanceof String` - -## Benchmarks - -As with all benchmarks, take these with a grain of salt. See the [benchmarks](./benchmark/index.js) for more detail. - -``` -# all -v7.0 x 413,222 ops/sec ±2.02% (86 runs sampled) -v6.0 x 111,061 ops/sec ±1.29% (85 runs sampled) -parseFloat x 317,596 ops/sec ±1.36% (86 runs sampled) -fastest is 'v7.0' - -# string -v7.0 x 3,054,496 ops/sec ±1.05% (89 runs sampled) -v6.0 x 2,957,781 ops/sec ±0.98% (88 runs sampled) -parseFloat x 3,071,060 ops/sec ±1.13% (88 runs sampled) -fastest is 'parseFloat,v7.0' - -# number -v7.0 x 3,146,895 ops/sec ±0.89% (89 runs sampled) -v6.0 x 3,214,038 ops/sec ±1.07% (89 runs sampled) -parseFloat x 3,077,588 ops/sec ±1.07% (87 runs sampled) -fastest is 'v6.0' -``` - -## 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-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.") -* [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. ") -* [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.") - -### Contributors - -| **Commits** | **Contributor** | -| --- | --- | -| 49 | [jonschlinkert](https://github.com/jonschlinkert) | -| 5 | [charlike-old](https://github.com/charlike-old) | -| 1 | [benaadams](https://github.com/benaadams) | -| 1 | [realityking](https://github.com/realityking) | - -### Author - -**Jon Schlinkert** - -* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) -* [GitHub Profile](https://github.com/jonschlinkert) -* [Twitter Profile](https://twitter.com/jonschlinkert) - -### License - -Copyright © 2018, [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 15, 2018._ \ No newline at end of file diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js deleted file mode 100644 index 27f19b7..0000000 --- a/node_modules/is-number/index.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * is-number - * - * Copyright (c) 2014-present, Jon Schlinkert. - * Released under the MIT License. - */ - -'use strict'; - -module.exports = function(num) { - if (typeof num === 'number') { - return num - num === 0; - } - if (typeof num === 'string' && num.trim() !== '') { - return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); - } - return false; -}; diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json deleted file mode 100644 index 3715072..0000000 --- a/node_modules/is-number/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "name": "is-number", - "description": "Returns true if a number or string value is a finite number. Useful for regex matches, parsing, user input, etc.", - "version": "7.0.0", - "homepage": "https://github.com/jonschlinkert/is-number", - "author": "Jon Schlinkert (https://github.com/jonschlinkert)", - "contributors": [ - "Jon Schlinkert (http://twitter.com/jonschlinkert)", - "Olsten Larck (https://i.am.charlike.online)", - "Rouven Weßling (www.rouvenwessling.de)" - ], - "repository": "jonschlinkert/is-number", - "bugs": { - "url": "https://github.com/jonschlinkert/is-number/issues" - }, - "license": "MIT", - "files": [ - "index.js" - ], - "main": "index.js", - "engines": { - "node": ">=0.12.0" - }, - "scripts": { - "test": "mocha" - }, - "devDependencies": { - "ansi": "^0.3.1", - "benchmark": "^2.1.4", - "gulp-format-md": "^1.0.0", - "mocha": "^3.5.3" - }, - "keywords": [ - "cast", - "check", - "coerce", - "coercion", - "finite", - "integer", - "is", - "isnan", - "is-nan", - "is-num", - "is-number", - "isnumber", - "isfinite", - "istype", - "kind", - "math", - "nan", - "num", - "number", - "numeric", - "parseFloat", - "parseInt", - "test", - "type", - "typeof", - "value" - ], - "verb": { - "toc": false, - "layout": "default", - "tasks": [ - "readme" - ], - "related": { - "list": [ - "is-plain-object", - "is-primitive", - "isobject", - "kind-of" - ] - }, - "plugins": [ - "gulp-format-md" - ], - "lint": { - "reflinks": true - } - } -} diff --git a/node_modules/jiti/LICENSE b/node_modules/jiti/LICENSE deleted file mode 100644 index e739abc..0000000 --- a/node_modules/jiti/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Pooya Parsa - -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/jiti/README.md b/node_modules/jiti/README.md deleted file mode 100644 index 2da8e4e..0000000 --- a/node_modules/jiti/README.md +++ /dev/null @@ -1,164 +0,0 @@ -# jiti - -[![npm version][npm-version-src]][npm-version-href] -[![npm downloads][npm-downloads-src]][npm-downloads-href] -[![bundle][bundle-src]][bundle-href] -[![License][license-src]][license-href] - -Runtime Typescript and ESM support for Node.js. - -> [!IMPORTANT] -> This is the support branch for jiti v1. Check out [jiti/main](https://github.com/unjs/jiti/tree/main) for the latest version and [unjs/jiti#174](https://github.com/unjs/jiti/issues/174) for the roadmap. - -## Features - -- Seamless typescript and ESM syntax support -- Seamless interoperability between ESM and CommonJS -- Synchronous API to replace `require` -- Super slim and zero dependency -- Smart syntax detection to avoid extra transforms -- CommonJS cache integration -- Filesystem transpile hard cache -- V8 compile cache -- Custom resolve alias - -## Usage - -### Programmatic - -```js -const jiti = require("jiti")(__filename); - -jiti("./path/to/file.ts"); -``` - -You can also pass options as second argument: - -```js -const jiti = require("jiti")(__filename, { debug: true }); -``` - -### CLI - -```bash -jiti index.ts -# or npx jiti index.ts -``` - -### Register require hook - -```bash -node -r jiti/register index.ts -``` - -Alternatively, you can register `jiti` as a require hook programmatically: - -```js -const jiti = require("jiti")(); -const unregister = jiti.register(); -``` - -## Options - -### `debug` - -- Type: Boolean -- Default: `false` -- Environment Variable: `JITI_DEBUG` - -Enable debug to see which files are transpiled - -### `cache` - -- Type: Boolean | String -- Default: `true` -- Environment Variable: `JITI_CACHE` - -Use transpile cache - -If set to `true` will use `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/node-jiti` - -### `esmResolve` - -- Type: Boolean | String -- Default: `false` -- Environment Variable: `JITI_ESM_RESOLVE` - -Using esm resolution algorithm to support `import` condition. - -### `transform` - -- Type: Function -- Default: Babel (lazy loaded) - -Transform function. See [src/babel](./src/babel.ts) for more details - -### `sourceMaps` - -- Type: Boolean -- Default `false` -- Environment Variable: `JITI_SOURCE_MAPS` - -Add inline source map to transformed source for better debugging. - -### `interopDefault` - -- Type: Boolean -- Default: `false` - -Return the `.default` export of a module at the top-level. - -### `alias` - -- Type: Object -- Default: - -- Environment Variable: `JITI_ALIAS` - -Custom alias map used to resolve ids. - -### `nativeModules` - -- Type: Array -- Default: ['typescript`] -- Environment Variable: `JITI_NATIVE_MODULES` - -List of modules (within `node_modules`) to always use native require for them. - -### `transformModules` - -- Type: Array -- Default: [] -- Environment Variable: `JITI_TRANSFORM_MODULES` - -List of modules (within `node_modules`) to transform them regardless of syntax. - -### `experimentalBun` - -- Type: Boolean -- Default: Enabled if `process.versions.bun` exists (Bun runtime) -- Environment Variable: `JITI_EXPERIMENTAL_BUN` - -Enable experimental native Bun support for transformations. - -## Development - -- Clone this repository -- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` -- Install dependencies using `pnpm install` -- Run `pnpm dev` -- Run `pnpm jiti ./test/path/to/file.ts` - -## License - -MIT. Made with 💖 - - - -[npm-version-src]: https://img.shields.io/npm/v/jiti?style=flat&colorA=18181B&colorB=F0DB4F -[npm-version-href]: https://npmjs.com/package/jiti -[npm-downloads-src]: https://img.shields.io/npm/dm/jiti?style=flat&colorA=18181B&colorB=F0DB4F -[npm-downloads-href]: https://npmjs.com/package/jiti -[bundle-src]: https://img.shields.io/bundlephobia/minzip/jiti?style=flat&colorA=18181B&colorB=F0DB4F -[bundle-href]: https://bundlephobia.com/result?p=h3 -[license-src]: https://img.shields.io/github/license/unjs/jiti.svg?style=flat&colorA=18181B&colorB=F0DB4F -[license-href]: https://github.com/unjs/jiti/blob/main/LICENSE diff --git a/node_modules/jiti/bin/jiti.js b/node_modules/jiti/bin/jiti.js deleted file mode 100755 index 2867c64..0000000 --- a/node_modules/jiti/bin/jiti.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -const { resolve } = require("node:path"); - -const script = process.argv.splice(2, 1)[0]; - -if (!script) { - - console.error("Usage: jiti [...arguments]"); - process.exit(1); -} - -const pwd = process.cwd(); -const jiti = require("..")(pwd); -const resolved = (process.argv[1] = jiti.resolve(resolve(pwd, script))); -jiti(resolved); diff --git a/node_modules/jiti/dist/babel.d.ts b/node_modules/jiti/dist/babel.d.ts deleted file mode 100644 index ea178d4..0000000 --- a/node_modules/jiti/dist/babel.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { TransformOptions, TRANSFORM_RESULT } from "./types"; -export default function transform(opts: TransformOptions): TRANSFORM_RESULT; diff --git a/node_modules/jiti/dist/babel.js b/node_modules/jiti/dist/babel.js deleted file mode 100644 index f59843c..0000000 --- a/node_modules/jiti/dist/babel.js +++ /dev/null @@ -1,227 +0,0 @@ -(()=>{var __webpack_modules__={"./node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping/dist/remapping.umd.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=function(traceMapping,genMapping){"use strict";const SOURCELESS_MAPPING=SegmentObject("",-1,-1,"",null,!1),EMPTY_SOURCES=[];function SegmentObject(source,line,column,name,content,ignore){return{source,line,column,name,content,ignore}}function Source(map,sources,source,content,ignore){return{map,sources,source,content,ignore}}function MapSource(map,sources){return Source(map,sources,"",null,!1)}function OriginalSource(source,content,ignore){return Source(null,EMPTY_SOURCES,source,content,ignore)}function traceMappings(tree){const gen=new genMapping.GenMapping({file:tree.map.file}),{sources:rootSources,map}=tree,rootNames=map.names,rootMappings=traceMapping.decodedMappings(map);for(let i=0;inew traceMapping.TraceMap(m,""))),map=maps.pop();for(let i=0;i1)throw new Error(`Transformation map ${i} must have exactly one source file.\nDid you specify these with the most recent transformation maps first?`);let tree=build(map,loader,"",0);for(let i=maps.length-1;i>=0;i--)tree=MapSource(maps[i],[tree]);return tree}function build(map,loader,importer,importerDepth){const{resolvedSources,sourcesContent,ignoreList}=map,depth=importerDepth+1;return MapSource(map,resolvedSources.map(((sourceFile,i)=>{const ctx={importer,depth,source:sourceFile||"",content:void 0,ignore:void 0},sourceMap=loader(ctx.source,ctx),{source,content,ignore}=ctx;return sourceMap?build(new traceMapping.TraceMap(sourceMap,source),loader,source,depth):OriginalSource(source,void 0!==content?content:sourcesContent?sourcesContent[i]:null,void 0!==ignore?ignore:!!ignoreList&&ignoreList.includes(i))})))}class SourceMap{constructor(map,options){const out=options.decodedMappings?genMapping.toDecodedMap(map):genMapping.toEncodedMap(map);this.version=out.version,this.file=out.file,this.mappings=out.mappings,this.names=out.names,this.ignoreList=out.ignoreList,this.sourceRoot=out.sourceRoot,this.sources=out.sources,options.excludeContent||(this.sourcesContent=out.sourcesContent)}toString(){return JSON.stringify(this)}}function remapping(input,loader,options){const opts="object"==typeof options?options:{excludeContent:!!options,decodedMappings:!1},tree=buildSourceMapTree(input,loader);return new SourceMap(traceMappings(tree),opts)}return remapping}(__webpack_require__("./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"),__webpack_require__("./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.8/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"))},"./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files lazy recursive":module=>{function webpackEmptyAsyncContext(req){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}))}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files lazy recursive",module.exports=webpackEmptyAsyncContext},"./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files sync recursive":module=>{function webpackEmptyContext(req){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files sync recursive",module.exports=webpackEmptyContext},"./node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.26.0/node_modules/@babel/plugin-syntax-class-properties/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _default=(0,__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.25.9/node_modules/@babel/helper-plugin-utils/lib/index.js").declare)((api=>(api.assertVersion(7),{name:"syntax-class-properties",manipulateOptions(opts,parserOpts){parserOpts.plugins.push("classProperties","classPrivateProperties","classPrivateMethods")}})));exports.default=_default},"./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.8/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js":function(__unused_webpack_module,exports,__webpack_require__){!function(exports,setArray,sourcemapCodec,traceMapping){"use strict";const COLUMN=0,SOURCES_INDEX=1,SOURCE_LINE=2,SOURCE_COLUMN=3,NAMES_INDEX=4,NO_NAME=-1;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,this._ignoreList=new setArray.SetArray}}function cast(map){return map}function addSegment(map,genLine,genColumn,source,sourceLine,sourceColumn,name,content){return addSegmentInternal(!1,map,genLine,genColumn,source,sourceLine,sourceColumn,name,content)}function addMapping(map,mapping){return addMappingInternal(!1,map,mapping)}const maybeAddSegment=(map,genLine,genColumn,source,sourceLine,sourceColumn,name,content)=>addSegmentInternal(!0,map,genLine,genColumn,source,sourceLine,sourceColumn,name,content),maybeAddMapping=(map,mapping)=>addMappingInternal(!0,map,mapping);function setSourceContent(map,source,content){const{_sources:sources,_sourcesContent:sourcesContent}=cast(map);sourcesContent[setArray.put(sources,source)]=content}function setIgnore(map,source,ignore=!0){const{_sources:sources,_sourcesContent:sourcesContent,_ignoreList:ignoreList}=cast(map),index=setArray.put(sources,source);index===sourcesContent.length&&(sourcesContent[index]=null),ignore?setArray.put(ignoreList,index):setArray.remove(ignoreList,index)}function toDecodedMap(map){const{_mappings:mappings,_sources:sources,_sourcesContent:sourcesContent,_names:names,_ignoreList:ignoreList}=cast(map);return removeEmptyFinalLines(mappings),{version:3,file:map.file||void 0,names:names.array,sourceRoot:map.sourceRoot||void 0,sources:sources.array,sourcesContent,mappings,ignoreList:ignoreList.array}}function toEncodedMap(map){const decoded=toDecodedMap(map);return Object.assign(Object.assign({},decoded),{mappings:sourcemapCodec.encode(decoded.mappings)})}function fromMap(input){const map=new traceMapping.TraceMap(input),gen=new GenMapping({file:map.file,sourceRoot:map.sourceRoot});return putAll(cast(gen)._names,map.names),putAll(cast(gen)._sources,map.sources),cast(gen)._sourcesContent=map.sourcesContent||map.sources.map((()=>null)),cast(gen)._mappings=traceMapping.decodedMappings(map),map.ignoreList&&putAll(cast(gen)._ignoreList,map.ignoreList),gen}function allMappings(map){const out=[],{_mappings:mappings,_sources:sources,_names:names}=cast(map);for(let i=0;i=0&&!(genColumn>=line[i][COLUMN]);index=i--);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&&!(mappings[i].length>0);len=i,i--);leninputType&&(inputType=baseType)}normalizePath(url,inputType);const queryHash=url.query+url.hash;switch(inputType){case 2:case 3:return queryHash;case 4:{const path=url.path.slice(1);return path?isRelative(base||input)&&!isRelative(path)?"./"+path+queryHash:path+queryHash:queryHash||"."}case 5:return url.path+queryHash;default:return url.scheme+"//"+url.user+url.host+url.port+url.path+queryHash}}return resolve}()},"./node_modules/.pnpm/@jridgewell+set-array@1.2.1/node_modules/@jridgewell/set-array/dist/set-array.umd.js":function(__unused_webpack_module,exports){!function(exports){"use strict";class SetArray{constructor(){this._indexes={__proto__:null},this.array=[]}}function cast(set){return set}function get(setarr,key){return cast(setarr)._indexes[key]}function put(setarr,key){const index=get(setarr,key);if(void 0!==index)return index;const{array,_indexes:indexes}=cast(setarr),length=array.push(key);return indexes[key]=length-1}function pop(setarr){const{array,_indexes:indexes}=cast(setarr);0!==array.length&&(indexes[array.pop()]=void 0)}function remove(setarr,key){const index=get(setarr,key);if(void 0===index)return;const{array,_indexes:indexes}=cast(setarr);for(let i=index+1;i>>=1,shouldNegate&&(value=-2147483648|-value),relative+value}function encodeInteger(builder,num,relative){let delta=num-relative;delta=delta<0?-delta<<1|1:delta<<1;do{let clamped=31δdelta>>>=5,delta>0&&(clamped|=32),builder.write(intToChar[clamped])}while(delta>0);return num}function hasMoreVlq(reader,max){return!(reader.pos>=max)&&reader.peek()!==comma}const bufLength=16384,td="undefined"!=typeof TextDecoder?new TextDecoder:"undefined"!=typeof Buffer?{decode:buf=>Buffer.from(buf.buffer,buf.byteOffset,buf.byteLength).toString()}:{decode(buf){let out="";for(let i=0;i0?out+td.decode(buffer.subarray(0,pos)):out}}class StringReader{constructor(buffer){this.pos=0,this.buffer=buffer}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(char){const{buffer,pos}=this,idx=buffer.indexOf(char,pos);return-1===idx?buffer.length:idx}}const EMPTY=[];function decodeOriginalScopes(input){const{length}=input,reader=new StringReader(input),scopes=[],stack=[];let line=0;for(;reader.pos0&&writer.write(comma),state[0]=encodeInteger(writer,startLine,state[0]),encodeInteger(writer,startColumn,0),encodeInteger(writer,kind,0),encodeInteger(writer,6===scope.length?1:0,0),6===scope.length&&encodeInteger(writer,scope[5],0);for(const v of vars)encodeInteger(writer,v,0);for(index++;indexendLine||l===endLine&&c>=endColumn)break;index=_encodeOriginalScopes(scopes,index,writer,state)}return writer.write(comma),state[0]=encodeInteger(writer,endLine,state[0]),encodeInteger(writer,endColumn,0),index}function decodeGeneratedRanges(input){const{length}=input,reader=new StringReader(input),ranges=[],stack=[];let genLine=0,definitionSourcesIndex=0,definitionScopeIndex=0,callsiteSourcesIndex=0,callsiteLine=0,callsiteColumn=0,bindingLine=0,bindingColumn=0;do{const semi=reader.indexOf(";");let genColumn=0;for(;reader.posexpressionsCount;i--){const prevBl=bindingLine;bindingLine=decodeInteger(reader,bindingLine),bindingColumn=decodeInteger(reader,bindingLine===prevBl?bindingColumn:0);const expression=decodeInteger(reader,0);expressionRanges.push([expression,bindingLine,bindingColumn])}}else expressionRanges=[[expressionsCount]];bindings.push(expressionRanges)}while(hasMoreVlq(reader,semi))}range.bindings=bindings,ranges.push(range),stack.push(range)}genLine++,reader.pos=semi+1}while(reader.pos0&&writer.write(comma),state[1]=encodeInteger(writer,range[1],state[1]),encodeInteger(writer,(6===range.length?1:0)|(callsite?2:0)|(isScope?4:0),0),6===range.length){const{4:sourcesIndex,5:scopesIndex}=range;sourcesIndex!==state[2]&&(state[3]=0),state[2]=encodeInteger(writer,sourcesIndex,state[2]),state[3]=encodeInteger(writer,scopesIndex,state[3])}if(callsite){const{0:sourcesIndex,1:callLine,2:callColumn}=range.callsite;sourcesIndex!==state[4]?(state[5]=0,state[6]=0):callLine!==state[5]&&(state[6]=0),state[4]=encodeInteger(writer,sourcesIndex,state[4]),state[5]=encodeInteger(writer,callLine,state[5]),state[6]=encodeInteger(writer,callColumn,state[6])}if(bindings)for(const binding of bindings){binding.length>1&&encodeInteger(writer,-binding.length,0),encodeInteger(writer,binding[0][0],0);let bindingStartLine=startLine,bindingStartColumn=startColumn;for(let i=1;iendLine||l===endLine&&c>=endColumn)break;index=_encodeGeneratedRanges(ranges,index,writer,state)}return state[0]0&&writer.write(semicolon),0===line.length)continue;let genColumn=0;for(let j=0;j0&&writer.write(comma),genColumn=encodeInteger(writer,segment[0],genColumn),1!==segment.length&&(sourcesIndex=encodeInteger(writer,segment[1],sourcesIndex),sourceLine=encodeInteger(writer,segment[2],sourceLine),sourceColumn=encodeInteger(writer,segment[3],sourceColumn),4!==segment.length&&(namesIndex=encodeInteger(writer,segment[4],namesIndex)))}}return writer.flush()}exports.decode=decode,exports.decodeGeneratedRanges=decodeGeneratedRanges,exports.decodeOriginalScopes=decodeOriginalScopes,exports.encode=encode,exports.encodeGeneratedRanges=encodeGeneratedRanges,exports.encodeOriginalScopes=encodeOriginalScopes,Object.defineProperty(exports,"__esModule",{value:!0})}(exports)},"./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js":function(__unused_webpack_module,exports,__webpack_require__){!function(exports,sourcemapCodec,resolveUri){"use strict";function resolve(input,base){return base&&!base.endsWith("/")&&(base+="/"),resolveUri(input,base)}function stripFilename(path){if(!path)return"";const index=path.lastIndexOf("/");return path.slice(0,index+1)}const COLUMN=0,SOURCES_INDEX=1,SOURCE_LINE=2,SOURCE_COLUMN=3,NAMES_INDEX=4,REV_GENERATED_LINE=1,REV_GENERATED_COLUMN=2;function maybeSort(mappings,owned){const unsortedIndex=nextUnsortedSegmentLine(mappings,0);if(unsortedIndex===mappings.length)return mappings;owned||(mappings=mappings.slice());for(let i=unsortedIndex;i>1),cmp=haystack[mid][COLUMN]-needle;if(0===cmp)return found=!0,mid;cmp<0?low=mid+1:high=mid-1}return found=!1,low-1}function upperBound(haystack,needle,index){for(let i=index+1;i=0&&haystack[i][COLUMN]===needle;index=i--);return index}function memoizedState(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function memoizedBinarySearch(haystack,needle,state,key){const{lastKey,lastNeedle,lastIndex}=state;let low=0,high=haystack.length-1;if(key===lastKey){if(needle===lastNeedle)return found=-1!==lastIndex&&haystack[lastIndex][COLUMN]===needle,lastIndex;needle>=lastNeedle?low=-1===lastIndex?0:lastIndex:high=lastIndex}return state.lastKey=key,state.lastNeedle=needle,state.lastIndex=binarySearch(haystack,needle,low,high)}function buildBySources(decoded,memos){const sources=memos.map(buildNullArray);for(let i=0;iindex;i--)array[i]=array[i-1];array[index]=value}function buildNullArray(){return{__proto__:null}}const AnyMap=function(map,mapUrl){const parsed=parse(map);if(!("sections"in parsed))return new TraceMap(parsed,mapUrl);const mappings=[],sources=[],sourcesContent=[],names=[],ignoreList=[];return recurse(parsed,mapUrl,mappings,sources,sourcesContent,names,ignoreList,0,0,1/0,1/0),presortedDecodedMap({version:3,file:parsed.file,names,sources,sourcesContent,mappings,ignoreList})};function parse(map){return"string"==typeof map?JSON.parse(map):map}function recurse(input,mapUrl,mappings,sources,sourcesContent,names,ignoreList,lineOffset,columnOffset,stopLine,stopColumn){const{sections}=input;for(let i=0;istopLine)return;const out=getLine(mappings,lineI),cOffset=0===i?columnOffset:0,line=decoded[i];for(let j=0;j=stopColumn)return;if(1===seg.length){out.push([column]);continue}const sourcesIndex=sourcesOffset+seg[SOURCES_INDEX],sourceLine=seg[SOURCE_LINE],sourceColumn=seg[SOURCE_COLUMN];out.push(4===seg.length?[column,sourcesIndex,sourceLine,sourceColumn]:[column,sourcesIndex,sourceLine,sourceColumn,namesOffset+seg[NAMES_INDEX]])}}}function append(arr,other){for(let i=0;iresolve(s||"",from)));const{mappings}=parsed;"string"==typeof mappings?(this._encoded=mappings,this._decoded=void 0):(this._encoded=void 0,this._decoded=maybeSort(mappings,isString)),this._decodedMemo=memoizedState(),this._bySources=void 0,this._bySourceMemos=void 0}}function cast(map){return map}function encodedMappings(map){var _a,_b;return null!==(_a=(_b=cast(map))._encoded)&&void 0!==_a?_a:_b._encoded=sourcemapCodec.encode(cast(map)._decoded)}function decodedMappings(map){var _a;return(_a=cast(map))._decoded||(_a._decoded=sourcemapCodec.decode(cast(map)._encoded))}function traceSegment(map,line,column){const decoded=decodedMappings(map);if(line>=decoded.length)return null;const segments=decoded[line],index=traceSegmentInternal(segments,cast(map)._decodedMemo,line,column,GREATEST_LOWER_BOUND);return-1===index?null:segments[index]}function originalPositionFor(map,needle){let{line,column,bias}=needle;if(line--,line<0)throw new Error(LINE_GTR_ZERO);if(column<0)throw new Error(COL_GTR_EQ_ZERO);const decoded=decodedMappings(map);if(line>=decoded.length)return OMapping(null,null,null,null);const segments=decoded[line],index=traceSegmentInternal(segments,cast(map)._decodedMemo,line,column,bias||GREATEST_LOWER_BOUND);if(-1===index)return OMapping(null,null,null,null);const segment=segments[index];if(1===segment.length)return OMapping(null,null,null,null);const{names,resolvedSources}=map;return OMapping(resolvedSources[segment[SOURCES_INDEX]],segment[SOURCE_LINE]+1,segment[SOURCE_COLUMN],5===segment.length?names[segment[NAMES_INDEX]]:null)}function generatedPositionFor(map,needle){const{source,line,column,bias}=needle;return generatedPosition(map,source,line,column,bias||GREATEST_LOWER_BOUND,!1)}function allGeneratedPositionsFor(map,needle){const{source,line,column,bias}=needle;return generatedPosition(map,source,line,column,bias||LEAST_UPPER_BOUND,!0)}function eachMapping(map,cb){const decoded=decodedMappings(map),{names,resolvedSources}=map;for(let i=0;i{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(api){var transformImport=(0,_utils.createDynamicImportTransform)(api);return{manipulateOptions:function(opts,parserOpts){parserOpts.plugins.push("dynamicImport")},visitor:{Import:function(path){transformImport(this,path)}}}};var _utils=__webpack_require__("./node_modules/.pnpm/babel-plugin-dynamic-import-node@2.3.3/node_modules/babel-plugin-dynamic-import-node/lib/utils.js");module.exports=exports.default},"./node_modules/.pnpm/babel-plugin-dynamic-import-node@2.3.3/node_modules/babel-plugin-dynamic-import-node/lib/utils.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _slicedToArray=function(arr,i){if(Array.isArray(arr))return arr;if(Symbol.iterator in Object(arr))return function(arr,i){var _arr=[],_n=!0,_d=!1,_e=void 0;try{for(var _s,_i=arr[Symbol.iterator]();!(_n=(_s=_i.next()).done)&&(_arr.push(_s.value),!i||_arr.length!==i);_n=!0);}catch(err){_d=!0,_e=err}finally{try{!_n&&_i.return&&_i.return()}finally{if(_d)throw _e}}return _arr}(arr,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")};function getImportSource(t,callNode){var importArguments=callNode.arguments,importPath=_slicedToArray(importArguments,1)[0];return t.isStringLiteral(importPath)||t.isTemplateLiteral(importPath)?(t.removeComments(importPath),importPath):t.templateLiteral([t.templateElement({raw:"",cooked:""}),t.templateElement({raw:"",cooked:""},!0)],importArguments)}exports.getImportSource=getImportSource,exports.createDynamicImportTransform=function(_ref){var template=_ref.template,t=_ref.types,builders={static:{interop:template("Promise.resolve().then(() => INTEROP(require(SOURCE)))"),noInterop:template("Promise.resolve().then(() => require(SOURCE))")},dynamic:{interop:template("Promise.resolve(SOURCE).then(s => INTEROP(require(s)))"),noInterop:template("Promise.resolve(SOURCE).then(s => require(s))")}},visited="function"==typeof WeakSet&&new WeakSet;return function(context,path){if(visited){if(visited.has(path))return;visited.add(path)}var node,SOURCE=getImportSource(t,path.parent),builder=(node=SOURCE,t.isStringLiteral(node)||t.isTemplateLiteral(node)&&0===node.expressions.length?builders.static:builders.dynamic),newImport=context.opts.noInterop?builder.noInterop({SOURCE}):builder.interop({SOURCE,INTEROP:context.addHelper("interopRequireWildcard")});path.parentPath.replaceWith(newImport)}}},"./node_modules/.pnpm/babel-plugin-parameter-decorator@1.0.16/node_modules/babel-plugin-parameter-decorator/lib/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";var _path=__webpack_require__("path");function isInType(path){switch(path.parent.type){case"TSTypeReference":case"TSQualifiedName":case"TSExpressionWithTypeArguments":case"TSTypeQuery":return!0;default:return!1}}module.exports=function(_ref){var types=_ref.types,decoratorExpressionForConstructor=function(decorator,param){return function(className){var resultantDecorator=types.callExpression(decorator.expression,[types.Identifier(className),types.Identifier("undefined"),types.NumericLiteral(param.key)]),resultantDecoratorWithFallback=types.logicalExpression("||",resultantDecorator,types.Identifier(className)),assignment=types.assignmentExpression("=",types.Identifier(className),resultantDecoratorWithFallback);return types.expressionStatement(assignment)}},decoratorExpressionForMethod=function(decorator,param){return function(className,functionName){var resultantDecorator=types.callExpression(decorator.expression,[types.Identifier("".concat(className,".prototype")),types.StringLiteral(functionName),types.NumericLiteral(param.key)]);return types.expressionStatement(resultantDecorator)}};return{visitor:{Program:function(path,state){var extension=(0,_path.extname)(state.file.opts.filename);".ts"!==extension&&".tsx"!==extension||function(){var decorators=Object.create(null);path.node.body.filter((function(it){var type=it.type,declaration=it.declaration;switch(type){case"ClassDeclaration":return!0;case"ExportNamedDeclaration":case"ExportDefaultDeclaration":return declaration&&"ClassDeclaration"===declaration.type;default:return!1}})).map((function(it){return"ClassDeclaration"===it.type?it:it.declaration})).forEach((function(clazz){clazz.body.body.forEach((function(body){(body.params||[]).forEach((function(param){(param.decorators||[]).forEach((function(decorator){decorator.expression.callee?decorators[decorator.expression.callee.name]=decorator:decorators[decorator.expression.name]=decorator}))}))}))}));var _iteratorNormalCompletion=!0,_didIteratorError=!1,_iteratorError=void 0;try{for(var _step,_iterator=path.get("body")[Symbol.iterator]();!(_iteratorNormalCompletion=(_step=_iterator.next()).done);_iteratorNormalCompletion=!0){var stmt=_step.value;if("ImportDeclaration"===stmt.node.type){if(0===stmt.node.specifiers.length)continue;var _iteratorNormalCompletion2=!0,_didIteratorError2=!1,_iteratorError2=void 0;try{for(var _step2,_loop=function(){var specifier=_step2.value,binding=stmt.scope.getBinding(specifier.local.name);binding.referencePaths.length?binding.referencePaths.reduce((function(prev,next){return prev||isInType(next)}),!1)&&Object.keys(decorators).forEach((function(k){var decorator=decorators[k];(decorator.expression.arguments||[]).forEach((function(arg){arg.name===specifier.local.name&&binding.referencePaths.push({parent:decorator.expression})}))})):decorators[specifier.local.name]&&binding.referencePaths.push({parent:decorators[specifier.local.name]})},_iterator2=stmt.node.specifiers[Symbol.iterator]();!(_iteratorNormalCompletion2=(_step2=_iterator2.next()).done);_iteratorNormalCompletion2=!0)_loop()}catch(err){_didIteratorError2=!0,_iteratorError2=err}finally{try{_iteratorNormalCompletion2||null==_iterator2.return||_iterator2.return()}finally{if(_didIteratorError2)throw _iteratorError2}}}}}catch(err){_didIteratorError=!0,_iteratorError=err}finally{try{_iteratorNormalCompletion||null==_iterator.return||_iterator.return()}finally{if(_didIteratorError)throw _iteratorError}}}()},Function:function(path){var functionName="";path.node.id?functionName=path.node.id.name:path.node.key&&(functionName=path.node.key.name),(path.get("params")||[]).slice().forEach((function(param){var decorators=param.node.decorators||[],transformable=decorators.length;if(decorators.slice().forEach((function(decorator){if("ClassMethod"===path.type){var classIdentifier,parentNode=path.parentPath.parentPath,classDeclaration=path.findParent((function(p){return"ClassDeclaration"===p.type}));if(classDeclaration?classIdentifier=classDeclaration.node.id.name:(parentNode.insertAfter(null),classIdentifier=function(path){var assignment=path.findParent((function(p){return"AssignmentExpression"===p.node.type}));return"SequenceExpression"===assignment.node.right.type?assignment.node.right.expressions[1].name:"ClassExpression"===assignment.node.right.type?assignment.node.left.name:null}(path)),"constructor"===functionName){var expression=decoratorExpressionForConstructor(decorator,param)(classIdentifier);parentNode.insertAfter(expression)}else{var _expression=decoratorExpressionForMethod(decorator,param)(classIdentifier,functionName);parentNode.insertAfter(_expression)}}else{var className=path.findParent((function(p){return"VariableDeclarator"===p.node.type})).node.id.name;if(functionName===className){var _expression2=decoratorExpressionForConstructor(decorator,param)(className);if("body"===path.parentKey)path.insertAfter(_expression2);else path.findParent((function(p){return"body"===p.parentKey})).insertAfter(_expression2)}else{var classParent=path.findParent((function(p){return"CallExpression"===p.node.type})),_expression3=decoratorExpressionForMethod(decorator,param)(className,functionName);classParent.insertAfter(_expression3)}}})),transformable){var replacement=function(path){switch(path.node.type){case"ObjectPattern":return types.ObjectPattern(path.node.properties);case"AssignmentPattern":return types.AssignmentPattern(path.node.left,path.node.right);case"TSParameterProperty":return types.Identifier(path.node.parameter.name);default:return types.Identifier(path.node.name)}}(param);param.replaceWith(replacement)}}))}}}}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.26.0_@babel+traverse@7.26.4/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/metadataVisitor.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.metadataVisitor=function(classPath,path){const field=path.node,classNode=classPath.node;switch(field.type){case"ClassMethod":const decorators="constructor"===field.kind?classNode.decorators:field.decorators;if(!decorators||0===decorators.length)return;decorators.push(createMetadataDesignDecorator("design:type",_core.types.identifier("Function"))),decorators.push(createMetadataDesignDecorator("design:paramtypes",_core.types.arrayExpression(field.params.map((param=>(0,_serializeType.serializeType)(classPath,param))))));break;case"ClassProperty":if(!field.decorators||0===field.decorators.length)return;if(!field.typeAnnotation||"TSTypeAnnotation"!==field.typeAnnotation.type)return;field.decorators.push(createMetadataDesignDecorator("design:type",(0,_serializeType.serializeType)(classPath,field)))}};var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js"),_serializeType=__webpack_require__("./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.26.0_@babel+traverse@7.26.4/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/serializeType.js");function createMetadataDesignDecorator(design,typeArg){return _core.types.decorator(_core.types.callExpression(_core.types.memberExpression(_core.types.identifier("Reflect"),_core.types.identifier("metadata")),[_core.types.stringLiteral(design),typeArg]))}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.26.0_@babel+traverse@7.26.4/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/serializeType.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.serializeType=function(classPath,param){const node=getTypedNode(param);if(null==node)return createVoidZero();if(!node.typeAnnotation||"TSTypeAnnotation"!==node.typeAnnotation.type)return createVoidZero();const annotation=node.typeAnnotation.typeAnnotation;return serializeTypeNode(classPath.node.id?classPath.node.id.name:"",annotation)},exports.isClassType=isClassType;var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js");function createVoidZero(){return _core.types.unaryExpression("void",_core.types.numericLiteral(0))}function getTypedNode(param){return null==param?null:"ClassProperty"===param.type||"Identifier"===param.type||"ObjectPattern"===param.type?param:"AssignmentPattern"===param.type&&"Identifier"===param.left.type?param.left:"TSParameterProperty"===param.type?getTypedNode(param.parameter):null}function serializeTypeReferenceNode(className,node){const reference=serializeReference(node.typeName);return isClassType(className,reference)?_core.types.identifier("Object"):_core.types.conditionalExpression(_core.types.binaryExpression("===",_core.types.unaryExpression("typeof",reference),_core.types.stringLiteral("undefined")),_core.types.identifier("Object"),_core.types.cloneDeep(reference))}function isClassType(className,node){switch(node.type){case"Identifier":return node.name===className;case"MemberExpression":return isClassType(className,node.object);default:throw new Error(`The property expression at ${node.start} is not valid as a Type to be used in Reflect.metadata`)}}function serializeReference(typeName){return"Identifier"===typeName.type?_core.types.identifier(typeName.name):_core.types.memberExpression(serializeReference(typeName.left),typeName.right)}function serializeTypeNode(className,node){if(void 0===node)return _core.types.identifier("Object");switch(node.type){case"TSVoidKeyword":case"TSUndefinedKeyword":case"TSNullKeyword":case"TSNeverKeyword":return createVoidZero();case"TSParenthesizedType":return serializeTypeNode(className,node.typeAnnotation);case"TSFunctionType":case"TSConstructorType":return _core.types.identifier("Function");case"TSArrayType":case"TSTupleType":return _core.types.identifier("Array");case"TSTypePredicate":case"TSBooleanKeyword":return _core.types.identifier("Boolean");case"TSStringKeyword":return _core.types.identifier("String");case"TSObjectKeyword":return _core.types.identifier("Object");case"TSLiteralType":switch(node.literal.type){case"StringLiteral":return _core.types.identifier("String");case"NumericLiteral":return _core.types.identifier("Number");case"BooleanLiteral":return _core.types.identifier("Boolean");default:throw new Error("Bad type for decorator"+node.literal)}case"TSNumberKeyword":case"TSBigIntKeyword":return _core.types.identifier("Number");case"TSSymbolKeyword":return _core.types.identifier("Symbol");case"TSTypeReference":return serializeTypeReferenceNode(className,node);case"TSIntersectionType":case"TSUnionType":return serializeTypeList(className,node.types);case"TSConditionalType":return serializeTypeList(className,[node.trueType,node.falseType]);case"TSTypeQuery":case"TSTypeOperator":case"TSIndexedAccessType":case"TSMappedType":case"TSTypeLiteral":case"TSAnyKeyword":case"TSUnknownKeyword":case"TSThisType":break;default:throw new Error("Bad type for decorator")}return _core.types.identifier("Object")}function serializeTypeList(className,types){let serializedUnion;for(let typeNode of types){for(;"TSParenthesizedType"===typeNode.type;)typeNode=typeNode.typeAnnotation;if("TSNeverKeyword"===typeNode.type)continue;if("TSNullKeyword"===typeNode.type||"TSUndefinedKeyword"===typeNode.type)continue;const serializedIndividual=serializeTypeNode(className,typeNode);if(_core.types.isIdentifier(serializedIndividual)&&"Object"===serializedIndividual.name)return serializedIndividual;if(serializedUnion){if(!_core.types.isIdentifier(serializedUnion)||!_core.types.isIdentifier(serializedIndividual)||serializedUnion.name!==serializedIndividual.name)return _core.types.identifier("Object")}else serializedUnion=serializedIndividual}return serializedUnion||createVoidZero()}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.26.0_@babel+traverse@7.26.4/node_modules/babel-plugin-transform-typescript-metadata/lib/parameter/parameterVisitor.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.parameterVisitor=function(classPath,path){if("ClassMethod"!==path.type)return;if("ClassMethod"!==path.node.type)return;if("Identifier"!==path.node.key.type)return;const methodPath=path;(methodPath.get("params")||[]).slice().forEach((function(param){let resultantDecorator;null!=("Identifier"===param.node.type||"ObjectPattern"===param.node.type?param.node:"TSParameterProperty"===param.node.type&&"Identifier"===param.node.parameter.type?param.node.parameter:null)&&((param.node.decorators||[]).slice().forEach((function(decorator){"constructor"===methodPath.node.kind?(resultantDecorator=createParamDecorator(param.key,decorator.expression,!0),classPath.node.decorators||(classPath.node.decorators=[]),classPath.node.decorators.push(resultantDecorator)):(resultantDecorator=createParamDecorator(param.key,decorator.expression,!1),methodPath.node.decorators||(methodPath.node.decorators=[]),methodPath.node.decorators.push(resultantDecorator))})),resultantDecorator&&(param.node.decorators=null))}))};var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js");function createParamDecorator(paramIndex,decoratorExpression,isConstructor=!1){return _core.types.decorator(_core.types.functionExpression(null,[_core.types.identifier("target"),_core.types.identifier("key")],_core.types.blockStatement([_core.types.returnStatement(_core.types.callExpression(decoratorExpression,[_core.types.identifier("target"),_core.types.identifier(isConstructor?"undefined":"key"),_core.types.numericLiteral(paramIndex)]))])))}},"./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.26.0_@babel+traverse@7.26.4/node_modules/babel-plugin-transform-typescript-metadata/lib/plugin.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _helperPluginUtils=__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.25.9/node_modules/@babel/helper-plugin-utils/lib/index.js"),_parameterVisitor=__webpack_require__("./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.26.0_@babel+traverse@7.26.4/node_modules/babel-plugin-transform-typescript-metadata/lib/parameter/parameterVisitor.js"),_metadataVisitor=__webpack_require__("./node_modules/.pnpm/babel-plugin-transform-typescript-metadata@0.3.2_@babel+core@7.26.0_@babel+traverse@7.26.4/node_modules/babel-plugin-transform-typescript-metadata/lib/metadata/metadataVisitor.js"),_default=(0,_helperPluginUtils.declare)((api=>(api.assertVersion(7),{visitor:{Program(programPath){programPath.traverse({ClassDeclaration(path){for(const field of path.get("body").get("body"))"ClassMethod"!==field.type&&"ClassProperty"!==field.type||((0,_parameterVisitor.parameterVisitor)(path,field),(0,_metadataVisitor.metadataVisitor)(path,field));path.parentPath.scope.crawl()}})}}})));exports.default=_default},"./node_modules/.pnpm/convert-source-map@2.0.0/node_modules/convert-source-map/index.js":(__unused_webpack_module,exports)=>{"use strict";var decodeBase64;function Converter(sm,opts){(opts=opts||{}).hasComment&&(sm=function(sm){return sm.split(",").pop()}(sm)),"base64"===opts.encoding?sm=decodeBase64(sm):"uri"===opts.encoding&&(sm=decodeURIComponent(sm)),(opts.isJSON||opts.encoding)&&(sm=JSON.parse(sm)),this.sourcemap=sm}function makeConverter(sm){return new Converter(sm,{isJSON:!0})}Object.defineProperty(exports,"commentRegex",{get:function(){return/^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/gm}}),Object.defineProperty(exports,"mapFileCommentRegex",{get:function(){return/(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/gm}}),decodeBase64="undefined"!=typeof Buffer?"function"==typeof Buffer.from?function(base64){return Buffer.from(base64,"base64").toString()}:function(base64){if("number"==typeof value)throw new TypeError("The value to decode must not be of type number.");return new Buffer(base64,"base64").toString()}:function(base64){return decodeURIComponent(escape(atob(base64)))},Converter.prototype.toJSON=function(space){return JSON.stringify(this.sourcemap,null,space)},"undefined"!=typeof Buffer?"function"==typeof Buffer.from?Converter.prototype.toBase64=function(){var json=this.toJSON();return Buffer.from(json,"utf8").toString("base64")}:Converter.prototype.toBase64=function(){var json=this.toJSON();if("number"==typeof json)throw new TypeError("The json to encode must not be of type number.");return new Buffer(json,"utf8").toString("base64")}:Converter.prototype.toBase64=function(){var json=this.toJSON();return btoa(unescape(encodeURIComponent(json)))},Converter.prototype.toURI=function(){var json=this.toJSON();return encodeURIComponent(json)},Converter.prototype.toComment=function(options){var encoding,content,data;return null!=options&&"uri"===options.encoding?(encoding="",content=this.toURI()):(encoding=";base64",content=this.toBase64()),data="sourceMappingURL=data:application/json;charset=utf-8"+encoding+","+content,null!=options&&options.multiline?"/*# "+data+" */":"//# "+data},Converter.prototype.toObject=function(){return JSON.parse(this.toJSON())},Converter.prototype.addProperty=function(key,value){if(this.sourcemap.hasOwnProperty(key))throw new Error('property "'+key+'" already exists on the sourcemap, use set property instead');return this.setProperty(key,value)},Converter.prototype.setProperty=function(key,value){return this.sourcemap[key]=value,this},Converter.prototype.getProperty=function(key){return this.sourcemap[key]},exports.fromObject=function(obj){return new Converter(obj)},exports.fromJSON=function(json){return new Converter(json,{isJSON:!0})},exports.fromURI=function(uri){return new Converter(uri,{encoding:"uri"})},exports.fromBase64=function(base64){return new Converter(base64,{encoding:"base64"})},exports.fromComment=function(comment){var m;return new Converter(comment=comment.replace(/^\/\*/g,"//").replace(/\*\/$/g,""),{encoding:(m=exports.commentRegex.exec(comment))&&m[4]||"uri",hasComment:!0})},exports.fromMapFileComment=function(comment,read){if("string"==typeof read)throw new Error("String directory paths are no longer supported with `fromMapFileComment`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var sm=function(sm,read){var r=exports.mapFileCommentRegex.exec(sm),filename=r[1]||r[2];try{return null!=(sm=read(filename))&&"function"==typeof sm.catch?sm.catch(throwError):sm}catch(e){throwError(e)}function throwError(e){throw new Error("An error occurred while trying to read the map file at "+filename+"\n"+e.stack)}}(comment,read);return null!=sm&&"function"==typeof sm.then?sm.then(makeConverter):makeConverter(sm)},exports.fromSource=function(content){var m=content.match(exports.commentRegex);return m?exports.fromComment(m.pop()):null},exports.fromMapFileSource=function(content,read){if("string"==typeof read)throw new Error("String directory paths are no longer supported with `fromMapFileSource`\nPlease review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading");var m=content.match(exports.mapFileCommentRegex);return m?exports.fromMapFileComment(m.pop(),read):null},exports.removeComments=function(src){return src.replace(exports.commentRegex,"")},exports.removeMapFileComments=function(src){return src.replace(exports.mapFileCommentRegex,"")},exports.generateMapFileComment=function(file,options){var data="sourceMappingURL="+file;return options&&options.multiline?"/*# "+data+" */":"//# "+data}},"./node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js":(module,exports,__webpack_require__)=>{exports.formatArgs=function(args){if(args[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+args[0]+(this.useColors?"%c ":" ")+"+"+module.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;args.splice(1,0,c,"color: inherit");let index=0,lastC=0;args[0].replace(/%[a-zA-Z%]/g,(match=>{"%%"!==match&&(index++,"%c"===match&&(lastC=index))})),args.splice(lastC,0,c)},exports.save=function(namespaces){try{namespaces?exports.storage.setItem("debug",namespaces):exports.storage.removeItem("debug")}catch(error){}},exports.load=function(){let r;try{r=exports.storage.getItem("debug")}catch(error){}!r&&"undefined"!=typeof process&&"env"in process&&(r=process.env.DEBUG);return r},exports.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let m;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(m=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(m[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},exports.storage=function(){try{return localStorage}catch(error){}}(),exports.destroy=(()=>{let warned=!1;return()=>{warned||(warned=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),exports.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],exports.log=console.debug||console.log||(()=>{}),module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports);const{formatters}=module.exports;formatters.j=function(v){try{return JSON.stringify(v)}catch(error){return"[UnexpectedJSONParseError]: "+error.message}}},"./node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js":(module,__unused_webpack_exports,__webpack_require__)=>{module.exports=function(env){function createDebug(namespace){let prevTime,namespacesCache,enabledCache,enableOverride=null;function debug(...args){if(!debug.enabled)return;const self=debug,curr=Number(new Date),ms=curr-(prevTime||curr);self.diff=ms,self.prev=prevTime,self.curr=curr,prevTime=curr,args[0]=createDebug.coerce(args[0]),"string"!=typeof args[0]&&args.unshift("%O");let index=0;args[0]=args[0].replace(/%([a-zA-Z%])/g,((match,format)=>{if("%%"===match)return"%";index++;const formatter=createDebug.formatters[format];if("function"==typeof formatter){const val=args[index];match=formatter.call(self,val),args.splice(index,1),index--}return match})),createDebug.formatArgs.call(self,args);(self.log||createDebug.log).apply(self,args)}return debug.namespace=namespace,debug.useColors=createDebug.useColors(),debug.color=createDebug.selectColor(namespace),debug.extend=extend,debug.destroy=createDebug.destroy,Object.defineProperty(debug,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==enableOverride?enableOverride:(namespacesCache!==createDebug.namespaces&&(namespacesCache=createDebug.namespaces,enabledCache=createDebug.enabled(namespace)),enabledCache),set:v=>{enableOverride=v}}),"function"==typeof createDebug.init&&createDebug.init(debug),debug}function extend(namespace,delimiter){const newDebug=createDebug(this.namespace+(void 0===delimiter?":":delimiter)+namespace);return newDebug.log=this.log,newDebug}function matchesTemplate(search,template){let searchIndex=0,templateIndex=0,starIndex=-1,matchIndex=0;for(;searchIndex"-"+namespace))].join(",");return createDebug.enable(""),namespaces},createDebug.enable=function(namespaces){createDebug.save(namespaces),createDebug.namespaces=namespaces,createDebug.names=[],createDebug.skips=[];const split=("string"==typeof namespaces?namespaces:"").trim().replace(" ",",").split(",").filter(Boolean);for(const ns of split)"-"===ns[0]?createDebug.skips.push(ns.slice(1)):createDebug.names.push(ns)},createDebug.enabled=function(name){for(const skip of createDebug.skips)if(matchesTemplate(name,skip))return!1;for(const ns of createDebug.names)if(matchesTemplate(name,ns))return!0;return!1},createDebug.humanize=__webpack_require__("./node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"),createDebug.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(env).forEach((key=>{createDebug[key]=env[key]})),createDebug.names=[],createDebug.skips=[],createDebug.formatters={},createDebug.selectColor=function(namespace){let hash=0;for(let i=0;i{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js"):module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js")},"./node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js":(module,exports,__webpack_require__)=>{const tty=__webpack_require__("tty"),util=__webpack_require__("util");exports.init=function(debug){debug.inspectOpts={};const keys=Object.keys(exports.inspectOpts);for(let i=0;i{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),exports.colors=[6,2,3,4,5,1];try{const supportsColor=__webpack_require__("./node_modules/.pnpm/supports-color@7.2.0/node_modules/supports-color/index.js");supportsColor&&(supportsColor.stderr||supportsColor).level>=2&&(exports.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(error){}exports.inspectOpts=Object.keys(process.env).filter((key=>/^debug_/i.test(key))).reduce(((obj,key)=>{const prop=key.substring(6).toLowerCase().replace(/_([a-z])/g,((_,k)=>k.toUpperCase()));let val=process.env[key];return val=!!/^(yes|on|true|enabled)$/i.test(val)||!/^(no|off|false|disabled)$/i.test(val)&&("null"===val?null:Number(val)),obj[prop]=val,obj}),{}),module.exports=__webpack_require__("./node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports);const{formatters}=module.exports;formatters.o=function(v){return this.inspectOpts.colors=this.useColors,util.inspect(v,this.inspectOpts).split("\n").map((str=>str.trim())).join(" ")},formatters.O=function(v){return this.inspectOpts.colors=this.useColors,util.inspect(v,this.inspectOpts)}},"./node_modules/.pnpm/gensync@1.0.0-beta.2/node_modules/gensync/index.js":module=>{"use strict";const GENSYNC_START=Symbol.for("gensync:v1:start"),GENSYNC_SUSPEND=Symbol.for("gensync:v1:suspend");function assertTypeof(type,name,value,allowUndefined){if(typeof value===type||allowUndefined&&void 0===value)return;let msg;throw msg=allowUndefined?`Expected opts.${name} to be either a ${type}, or undefined.`:`Expected opts.${name} to be a ${type}.`,makeError(msg,"GENSYNC_OPTIONS_ERROR")}function makeError(msg,code){return Object.assign(new Error(msg),{code})}function buildOperation({name,arity,sync,async}){return setFunctionMetadata(name,arity,(function*(...args){const resume=yield GENSYNC_START;if(!resume){return sync.call(this,args)}let result;try{async.call(this,args,(value=>{result||(result={value},resume())}),(err=>{result||(result={err},resume())}))}catch(err){result={err},resume()}if(yield GENSYNC_SUSPEND,result.hasOwnProperty("err"))throw result.err;return result.value}))}function evaluateSync(gen){let value;for(;!({value}=gen.next()).done;)assertStart(value,gen);return value}function evaluateAsync(gen,resolve,reject){!function step(){try{let value;for(;!({value}=gen.next()).done;){assertStart(value,gen);let sync=!0,didSyncResume=!1;const out=gen.next((()=>{sync?didSyncResume=!0:step()}));if(sync=!1,assertSuspend(out,gen),!didSyncResume)return}return resolve(value)}catch(err){return reject(err)}}()}function assertStart(value,gen){value!==GENSYNC_START&&throwError(gen,makeError(`Got unexpected yielded value in gensync generator: ${JSON.stringify(value)}. Did you perhaps mean to use 'yield*' instead of 'yield'?`,"GENSYNC_EXPECTED_START"))}function assertSuspend({value,done},gen){(done||value!==GENSYNC_SUSPEND)&&throwError(gen,makeError(done?"Unexpected generator completion. If you get this, it is probably a gensync bug.":`Expected GENSYNC_SUSPEND, got ${JSON.stringify(value)}. If you get this, it is probably a gensync bug.`,"GENSYNC_EXPECTED_SUSPEND"))}function throwError(gen,err){throw gen.throw&&gen.throw(err),err}function setFunctionMetadata(name,arity,fn){if("string"==typeof name){const nameDesc=Object.getOwnPropertyDescriptor(fn,"name");nameDesc&&!nameDesc.configurable||Object.defineProperty(fn,"name",Object.assign(nameDesc||{},{configurable:!0,value:name}))}if("number"==typeof arity){const lengthDesc=Object.getOwnPropertyDescriptor(fn,"length");lengthDesc&&!lengthDesc.configurable||Object.defineProperty(fn,"length",Object.assign(lengthDesc||{},{configurable:!0,value:arity}))}return fn}module.exports=Object.assign((function(optsOrFn){let genFn=optsOrFn;return genFn="function"!=typeof optsOrFn?function({name,arity,sync,async,errback}){if(assertTypeof("string","name",name,!0),assertTypeof("number","arity",arity,!0),assertTypeof("function","sync",sync),assertTypeof("function","async",async,!0),assertTypeof("function","errback",errback,!0),async&&errback)throw makeError("Expected one of either opts.async or opts.errback, but got _both_.","GENSYNC_OPTIONS_ERROR");if("string"!=typeof name){let fnName;errback&&errback.name&&"errback"!==errback.name&&(fnName=errback.name),async&&async.name&&"async"!==async.name&&(fnName=async.name.replace(/Async$/,"")),sync&&sync.name&&"sync"!==sync.name&&(fnName=sync.name.replace(/Sync$/,"")),"string"==typeof fnName&&(name=fnName)}"number"!=typeof arity&&(arity=sync.length);return buildOperation({name,arity,sync:function(args){return sync.apply(this,args)},async:function(args,resolve,reject){async?async.apply(this,args).then(resolve,reject):errback?errback.call(this,...args,((err,value)=>{null==err?resolve(value):reject(err)})):resolve(sync.apply(this,args))}})}(optsOrFn):function(genFn){return setFunctionMetadata(genFn.name,genFn.length,(function(...args){return genFn.apply(this,args)}))}(optsOrFn),Object.assign(genFn,function(genFn){const fns={sync:function(...args){return evaluateSync(genFn.apply(this,args))},async:function(...args){return new Promise(((resolve,reject)=>{evaluateAsync(genFn.apply(this,args),resolve,reject)}))},errback:function(...args){const cb=args.pop();if("function"!=typeof cb)throw makeError("Asynchronous function called without callback","GENSYNC_ERRBACK_NO_CALLBACK");let gen;try{gen=genFn.apply(this,args)}catch(err){return void cb(err)}evaluateAsync(gen,(val=>cb(void 0,val)),(err=>cb(err)))}};return fns}(genFn))}),{all:buildOperation({name:"all",arity:1,sync:function(args){return Array.from(args[0]).map((item=>evaluateSync(item)))},async:function(args,resolve,reject){const items=Array.from(args[0]);if(0===items.length)return void Promise.resolve().then((()=>resolve([])));let count=0;const results=items.map((()=>{}));items.forEach(((item,i)=>{evaluateAsync(item,(val=>{results[i]=val,count+=1,count===results.length&&resolve(results)}),reject)}))}}),race:buildOperation({name:"race",arity:1,sync:function(args){const items=Array.from(args[0]);if(0===items.length)throw makeError("Must race at least 1 item","GENSYNC_RACE_NONEMPTY");return evaluateSync(items[0])},async:function(args,resolve,reject){const items=Array.from(args[0]);if(0===items.length)throw makeError("Must race at least 1 item","GENSYNC_RACE_NONEMPTY");for(const item of items)evaluateAsync(item,resolve,reject)}})})},"./node_modules/.pnpm/globals@11.12.0/node_modules/globals/index.js":(module,__unused_webpack_exports,__webpack_require__)=>{"use strict";module.exports=__webpack_require__("./node_modules/.pnpm/globals@11.12.0/node_modules/globals/globals.json")},"./node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js":module=>{"use strict";module.exports=(flag,argv=process.argv)=>{const prefix=flag.startsWith("-")?"":1===flag.length?"-":"--",position=argv.indexOf(prefix+flag),terminatorPosition=argv.indexOf("--");return-1!==position&&(-1===terminatorPosition||position{"use strict";const object={},hasOwnProperty=object.hasOwnProperty,forOwn=(object,callback)=>{for(const key in object)hasOwnProperty.call(object,key)&&callback(key,object[key])},fourHexEscape=hex=>"\\u"+("0000"+hex).slice(-4),hexadecimal=(code,lowercase)=>{let hexadecimal=code.toString(16);return lowercase?hexadecimal:hexadecimal.toUpperCase()},toString=object.toString,isArray=Array.isArray,isBigInt=value=>"bigint"==typeof value,singleEscapes={"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},regexSingleEscape=/[\\\b\f\n\r\t]/,regexDigit=/[0-9]/,regexWhitespace=/[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,escapeEverythingRegex=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^]/g,escapeNonAsciiRegex=/([\uD800-\uDBFF][\uDC00-\uDFFF])|([\uD800-\uDFFF])|(['"`])|[^ !#-&\(-\[\]-_a-~]/g,jsesc=(argument,options)=>{const increaseIndentation=()=>{oldIndent=indent,++options.indentLevel,indent=options.indent.repeat(options.indentLevel)},defaults={escapeEverything:!1,minimal:!1,isScriptContext:!1,quotes:"single",wrap:!1,es6:!1,json:!1,compact:!0,lowercaseHex:!1,numbers:"decimal",indent:"\t",indentLevel:0,__inline1__:!1,__inline2__:!1},json=options&&options.json;var destination,source;json&&(defaults.quotes="double",defaults.wrap=!0),destination=defaults,"single"!=(options=(source=options)?(forOwn(source,((key,value)=>{destination[key]=value})),destination):destination).quotes&&"double"!=options.quotes&&"backtick"!=options.quotes&&(options.quotes="single");const quote="double"==options.quotes?'"':"backtick"==options.quotes?"`":"'",compact=options.compact,lowercaseHex=options.lowercaseHex;let indent=options.indent.repeat(options.indentLevel),oldIndent="";const inline1=options.__inline1__,inline2=options.__inline2__,newLine=compact?"":"\n";let result,isEmpty=!0;const useBinNumbers="binary"==options.numbers,useOctNumbers="octal"==options.numbers,useDecNumbers="decimal"==options.numbers,useHexNumbers="hexadecimal"==options.numbers;if(json&&argument&&(value=>"function"==typeof value)(argument.toJSON)&&(argument=argument.toJSON()),!(value=>"string"==typeof value||"[object String]"==toString.call(value))(argument)){if((value=>"[object Map]"==toString.call(value))(argument))return 0==argument.size?"new Map()":(compact||(options.__inline1__=!0,options.__inline2__=!1),"new Map("+jsesc(Array.from(argument),options)+")");if((value=>"[object Set]"==toString.call(value))(argument))return 0==argument.size?"new Set()":"new Set("+jsesc(Array.from(argument),options)+")";if((value=>"function"==typeof Buffer&&Buffer.isBuffer(value))(argument))return 0==argument.length?"Buffer.from([])":"Buffer.from("+jsesc(Array.from(argument),options)+")";if(isArray(argument))return result=[],options.wrap=!0,inline1&&(options.__inline1__=!1,options.__inline2__=!0),inline2||increaseIndentation(),((array,callback)=>{const length=array.length;let index=-1;for(;++index{isEmpty=!1,inline2&&(options.__inline2__=!1),result.push((compact||inline2?"":indent)+jsesc(value,options))})),isEmpty?"[]":inline2?"["+result.join(", ")+"]":"["+newLine+result.join(","+newLine)+newLine+(compact?"":oldIndent)+"]";if((value=>"number"==typeof value||"[object Number]"==toString.call(value))(argument)||isBigInt(argument)){if(json)return JSON.stringify(Number(argument));let result;if(useDecNumbers)result=String(argument);else if(useHexNumbers){let hexadecimal=argument.toString(16);lowercaseHex||(hexadecimal=hexadecimal.toUpperCase()),result="0x"+hexadecimal}else useBinNumbers?result="0b"+argument.toString(2):useOctNumbers&&(result="0o"+argument.toString(8));return isBigInt(argument)?result+"n":result}return isBigInt(argument)?json?JSON.stringify(Number(argument)):argument+"n":(value=>"[object Object]"==toString.call(value))(argument)?(result=[],options.wrap=!0,increaseIndentation(),forOwn(argument,((key,value)=>{isEmpty=!1,result.push((compact?"":indent)+jsesc(key,options)+":"+(compact?"":" ")+jsesc(value,options))})),isEmpty?"{}":"{"+newLine+result.join(","+newLine)+newLine+(compact?"":oldIndent)+"}"):json?JSON.stringify(argument)||"null":String(argument)}const regex=options.escapeEverything?escapeEverythingRegex:escapeNonAsciiRegex;return result=argument.replace(regex,((char,pair,lone,quoteChar,index,string)=>{if(pair){if(options.minimal)return pair;const first=pair.charCodeAt(0),second=pair.charCodeAt(1);if(options.es6){return"\\u{"+hexadecimal(1024*(first-55296)+second-56320+65536,lowercaseHex)+"}"}return fourHexEscape(hexadecimal(first,lowercaseHex))+fourHexEscape(hexadecimal(second,lowercaseHex))}if(lone)return fourHexEscape(hexadecimal(lone.charCodeAt(0),lowercaseHex));if("\0"==char&&!json&&!regexDigit.test(string.charAt(index+1)))return"\\0";if(quoteChar)return quoteChar==quote||options.escapeEverything?"\\"+quoteChar:quoteChar;if(regexSingleEscape.test(char))return singleEscapes[char];if(options.minimal&&!regexWhitespace.test(char))return char;const hex=hexadecimal(char.charCodeAt(0),lowercaseHex);return json||hex.length>2?fourHexEscape(hex):"\\x"+("00"+hex).slice(-2)})),"`"==quote&&(result=result.replace(/\$\{/g,"\\${")),options.isScriptContext&&(result=result.replace(/<\/(script|style)/gi,"<\\/$1").replace(/ - --------------------------------------------------------------------------------- - - - - - -## 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. - -* `ignoreInvalidMapping`: Optional. When `true`, instead of throwing error on - invalid mapping, it will be ignored. - -```js -var generator = new sourceMap.SourceMapGenerator({ - file: "my-generated-javascript-file.js", - sourceRoot: "http://example.com/app/js/" -}); -``` - -#### SourceMapGenerator.fromSourceMap(sourceMapConsumer, sourceMapGeneratorOptions) - -Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance. - -* `sourceMapConsumer` The SourceMap. - -* `sourceMapGeneratorOptions` options that will be passed to the SourceMapGenerator constructor which used under the hood. - -```js -var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer, { - ignoreInvalidMapping: true, -}); -``` - -#### 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-js/lib/array-set.js b/node_modules/source-map-js/lib/array-set.js deleted file mode 100644 index fbd5c81..0000000 --- a/node_modules/source-map-js/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-js/lib/base64-vlq.js b/node_modules/source-map-js/lib/base64-vlq.js deleted file mode 100644 index 612b404..0000000 --- a/node_modules/source-map-js/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-js/lib/base64.js b/node_modules/source-map-js/lib/base64.js deleted file mode 100644 index 8aa86b3..0000000 --- a/node_modules/source-map-js/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-js/lib/binary-search.js b/node_modules/source-map-js/lib/binary-search.js deleted file mode 100644 index 010ac94..0000000 --- a/node_modules/source-map-js/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-js/lib/mapping-list.js b/node_modules/source-map-js/lib/mapping-list.js deleted file mode 100644 index 06d1274..0000000 --- a/node_modules/source-map-js/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-js/lib/quick-sort.js b/node_modules/source-map-js/lib/quick-sort.js deleted file mode 100644 index 23f9eda..0000000 --- a/node_modules/source-map-js/lib/quick-sort.js +++ /dev/null @@ -1,132 +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`. - -function SortTemplate(comparator) { - -/** - * 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, false) <= 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); - } -} - - return doQuickSort; -} - -function cloneSort(comparator) { - let template = SortTemplate.toString(); - let templateFn = new Function(`return ${template}`)(); - return templateFn(comparator); -} - -/** - * 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. - */ - -let sortCache = new WeakMap(); -exports.quickSort = function (ary, comparator, start = 0) { - let doQuickSort = sortCache.get(comparator); - if (doQuickSort === void 0) { - doQuickSort = cloneSort(comparator); - sortCache.set(comparator, doQuickSort); - } - doQuickSort(ary, comparator, start, ary.length - 1); -}; diff --git a/node_modules/source-map-js/lib/source-map-consumer.d.ts b/node_modules/source-map-js/lib/source-map-consumer.d.ts deleted file mode 100644 index 744bda7..0000000 --- a/node_modules/source-map-js/lib/source-map-consumer.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SourceMapConsumer } from '..'; diff --git a/node_modules/source-map-js/lib/source-map-consumer.js b/node_modules/source-map-js/lib/source-map-consumer.js deleted file mode 100644 index ee66114..0000000 --- a/node_modules/source-map-js/lib/source-map-consumer.js +++ /dev/null @@ -1,1188 +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; - var boundCallback = aCallback.bind(context); - var names = this._names; - var sources = this._sources; - var sourceMapURL = this._sourceMapURL; - - for (var i = 0, n = mappings.length; i < n; i++) { - var mapping = mappings[i]; - var source = mapping.source === null ? null : sources.at(mapping.source); - if(source !== null) { - source = util.computeSourceURL(sourceRoot, source, sourceMapURL); - } - boundCallback({ - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : names.at(mapping.name) - }); - } - }; - -/** - * 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). - */ - -const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine; -function sortGenerated(array, start) { - let l = array.length; - let n = array.length - start; - if (n <= 1) { - return; - } else if (n == 2) { - let a = array[start]; - let b = array[start + 1]; - if (compareGenerated(a, b) > 0) { - array[start] = b; - array[start + 1] = a; - } - } else if (n < 20) { - for (let i = start; i < l; i++) { - for (let j = i; j > start; j--) { - let a = array[j - 1]; - let b = array[j]; - if (compareGenerated(a, b) <= 0) { - break; - } - array[j - 1] = b; - array[j] = a; - } - } - } else { - quickSort(array, compareGenerated, start); - } -} -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; - - let subarrayStart = 0; - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - - sortGenerated(generatedMappings, subarrayStart); - subarrayStart = generatedMappings.length; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - 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'); - } - - // 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') { - let currentSource = mapping.source; - while (originalMappings.length <= currentSource) { - originalMappings.push(null); - } - if (originalMappings[currentSource] === null) { - originalMappings[currentSource] = []; - } - originalMappings[currentSource].push(mapping); - } - } - } - - sortGenerated(generatedMappings, subarrayStart); - this.__generatedMappings = generatedMappings; - - for (var i = 0; i < originalMappings.length; i++) { - if (originalMappings[i] != null) { - quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource); - } - } - this.__originalMappings = [].concat(...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 || 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); - if(source !== null) { - 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-js/lib/source-map-generator.d.ts b/node_modules/source-map-js/lib/source-map-generator.d.ts deleted file mode 100644 index f59d70a..0000000 --- a/node_modules/source-map-js/lib/source-map-generator.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SourceMapGenerator } from '..'; diff --git a/node_modules/source-map-js/lib/source-map-generator.js b/node_modules/source-map-js/lib/source-map-generator.js deleted file mode 100644 index bab04ff..0000000 --- a/node_modules/source-map-js/lib/source-map-generator.js +++ /dev/null @@ -1,444 +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._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', 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, generatorOps) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, { - 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) { - if (this._validateMapping(generated, original, source, name) === false) { - return; - } - } - - 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') { - var message = '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 (this._ignoreInvalidMapping) { - if (typeof console !== 'undefined' && console.warn) { - console.warn(message); - } - return false; - } else { - throw new Error(message); - } - } - - 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 { - var message = 'Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - }); - - if (this._ignoreInvalidMapping) { - if (typeof console !== 'undefined' && console.warn) { - console.warn(message); - } - return false; - } else { - throw new Error(message) - } - } - }; - -/** - * 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-js/lib/source-node.d.ts b/node_modules/source-map-js/lib/source-node.d.ts deleted file mode 100644 index 4df6a1a..0000000 --- a/node_modules/source-map-js/lib/source-node.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { SourceNode } from '..'; diff --git a/node_modules/source-map-js/lib/source-node.js b/node_modules/source-map-js/lib/source-node.js deleted file mode 100644 index 8bcdbe3..0000000 --- a/node_modules/source-map-js/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-js/lib/util.js b/node_modules/source-map-js/lib/util.js deleted file mode 100644 index 430e2d0..0000000 --- a/node_modules/source-map-js/lib/util.js +++ /dev/null @@ -1,594 +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; - -var MAX_CACHED_INPUTS = 32; - -/** - * Takes some function `f(input) -> result` and returns a memoized version of - * `f`. - * - * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The - * memoization is a dumb-simple, linear least-recently-used cache. - */ -function lruMemoize(f) { - var cache = []; - - return function(input) { - for (var i = 0; i < cache.length; i++) { - if (cache[i].input === input) { - var temp = cache[0]; - cache[0] = cache[i]; - cache[i] = temp; - return cache[0].result; - } - } - - var result = f(input); - - cache.unshift({ - input, - result, - }); - - if (cache.length > MAX_CACHED_INPUTS) { - cache.pop(); - } - - return result; - }; -} - -/** - * 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. - */ -var normalize = lruMemoize(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); - // Split the path into parts between `/` characters. This is much faster than - // using `.split(/\/+/g)`. - var parts = []; - var start = 0; - var i = 0; - while (true) { - start = i; - i = path.indexOf("/", start); - if (i === -1) { - parts.push(path.slice(start)); - break; - } else { - parts.push(path.slice(start, i)); - while (i < path.length && path[i] === "/") { - i++; - } - } - } - - 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; - -function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) { - var 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.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource; - -/** - * 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 compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) { - var 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.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine; - -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-js/package.json b/node_modules/source-map-js/package.json deleted file mode 100644 index f58dbeb..0000000 --- a/node_modules/source-map-js/package.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "name": "source-map-js", - "description": "Generates and consumes source maps", - "version": "1.2.1", - "homepage": "https://github.com/7rulnik/source-map-js", - "author": "Valentin 7rulnik Semirulnik ", - "contributors": [ - "Nick Fitzgerald ", - "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": "7rulnik/source-map-js", - "main": "./source-map.js", - "files": [ - "source-map.js", - "source-map.d.ts", - "lib/" - ], - "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": { - "clean-publish": "^3.1.0", - "doctoc": "^0.15.0", - "webpack": "^1.12.0" - }, - "clean-publish": { - "cleanDocs": true - }, - "typings": "source-map.d.ts" -} diff --git a/node_modules/source-map-js/source-map.d.ts b/node_modules/source-map-js/source-map.d.ts deleted file mode 100644 index ec8892f..0000000 --- a/node_modules/source-map-js/source-map.d.ts +++ /dev/null @@ -1,104 +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 | null; - generatedLine: number; - generatedColumn: number; - originalLine: number | null; - originalColumn: number | null; - name: string | null; -} - -export class SourceMapConsumer { - static GENERATED_ORDER: number; - static ORIGINAL_ORDER: number; - - static GREATEST_LOWER_BOUND: number; - static LEAST_UPPER_BOUND: number; - - constructor(rawSourceMap: RawSourceMap); - readonly file: string | undefined | null; - readonly sourceRoot: string | undefined | null; - readonly sourcesContent: readonly string[] | null | undefined; - readonly sources: readonly string[] - - computeColumnSpans(): void; - originalPositionFor(generatedPosition: FindPosition): MappedPosition; - generatedPositionFor(originalPosition: SourceFindPosition): LineRange; - allGeneratedPositionsFor(originalPosition: MappedPosition): Position[]; - hasContentsOfAllSources(): boolean; - sourceContentFor(source: string, returnNullOnMissing?: boolean): string | null; - eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void; -} - -export interface Mapping { - generated: Position; - original?: Position | null; - source?: string | null; - name?: string | null; -} - -export class SourceMapGenerator { - constructor(startOfSourceMap?: StartOfSourceMap); - static fromSourceMap(sourceMapConsumer: SourceMapConsumer, startOfSourceMap?: StartOfSourceMap): SourceMapGenerator; - addMapping(mapping: Mapping): void; - setSourceContent(sourceFile: string, sourceContent: string | null | undefined): void; - applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void; - toString(): string; - toJSON(): RawSourceMap; -} - -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-js/source-map.js b/node_modules/source-map-js/source-map.js deleted file mode 100644 index bc88fe8..0000000 --- a/node_modules/source-map-js/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/sucrase/LICENSE b/node_modules/sucrase/LICENSE deleted file mode 100644 index 06d77d6..0000000 --- a/node_modules/sucrase/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2012-2018 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. diff --git a/node_modules/sucrase/README.md b/node_modules/sucrase/README.md deleted file mode 100644 index c45138a..0000000 --- a/node_modules/sucrase/README.md +++ /dev/null @@ -1,295 +0,0 @@ -# Sucrase - -[![Build Status](https://github.com/alangpierce/sucrase/workflows/All%20tests/badge.svg)](https://github.com/alangpierce/sucrase/actions) -[![npm version](https://img.shields.io/npm/v/sucrase.svg)](https://www.npmjs.com/package/sucrase) -[![Install Size](https://packagephobia.now.sh/badge?p=sucrase)](https://packagephobia.now.sh/result?p=sucrase) -[![MIT License](https://img.shields.io/npm/l/express.svg?maxAge=2592000)](LICENSE) -[![Join the chat at https://gitter.im/sucrasejs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sucrasejs/Lobby) - -## [Try it out](https://sucrase.io) - -## Quick usage - -```bash -yarn add --dev sucrase # Or npm install --save-dev sucrase -node -r sucrase/register main.ts -``` - -Using the [ts-node](https://github.com/TypeStrong/ts-node) integration: - -```bash -yarn add --dev sucrase ts-node typescript -./node_modules/.bin/ts-node --transpiler sucrase/ts-node-plugin main.ts -``` - -## Project overview - -Sucrase is an alternative to Babel that allows super-fast development builds. -Instead of compiling a large range of JS features to be able to work in Internet -Explorer, Sucrase assumes that you're developing with a recent browser or recent -Node.js version, so it focuses on compiling non-standard language extensions: -JSX, TypeScript, and Flow. Because of this smaller scope, Sucrase can get away -with an architecture that is much more performant but less extensible and -maintainable. Sucrase's parser is forked from Babel's parser (so Sucrase is -indebted to Babel and wouldn't be possible without it) and trims it down to a -focused subset of what Babel solves. If it fits your use case, hopefully Sucrase -can speed up your development experience! - -**Sucrase has been extensively tested.** It can successfully build -the [Benchling](https://benchling.com/) frontend code, -[Babel](https://github.com/babel/babel), -[React](https://github.com/facebook/react), -[TSLint](https://github.com/palantir/tslint), -[Apollo client](https://github.com/apollographql/apollo-client), and -[decaffeinate](https://github.com/decaffeinate/decaffeinate) -with all tests passing, about 1 million lines of code total. - -**Sucrase is about 20x faster than Babel.** Here's one measurement of how -Sucrase compares with other tools when compiling the Jest codebase 3 times, -about 360k lines of code total: - -```text - Time Speed -Sucrase 0.57 seconds 636975 lines per second -swc 1.19 seconds 304526 lines per second -esbuild 1.45 seconds 248692 lines per second -TypeScript 8.98 seconds 40240 lines per second -Babel 9.18 seconds 39366 lines per second -``` - -Details: Measured on July 2022. Tools run in single-threaded mode without warm-up. See the -[benchmark code](https://github.com/alangpierce/sucrase/blob/main/benchmark/benchmark.ts) -for methodology and caveats. - -## Transforms - -The main configuration option in Sucrase is an array of transform names. These -transforms are available: - -* **jsx**: Enables JSX syntax. By default, JSX is transformed to `React.createClass`, - but may be preserved or transformed to `_jsx()` by setting the `jsxRuntime` option. - Also adds `createReactClass` display names and JSX context information. -* **typescript**: Compiles TypeScript code to JavaScript, removing type - annotations and handling features like enums. Does not check types. Sucrase - transforms each file independently, so you should enable the `isolatedModules` - TypeScript flag so that the typechecker will disallow the few features like - `const enum`s that need cross-file compilation. The Sucrase option `keepUnusedImports` - can be used to disable all automatic removal of imports and exports, analogous to TS - `verbatimModuleSyntax`. -* **flow**: Removes Flow type annotations. Does not check types. -* **imports**: Transforms ES Modules (`import`/`export`) to CommonJS - (`require`/`module.exports`) using the same approach as Babel and TypeScript - with `--esModuleInterop`. If `preserveDynamicImport` is specified in the Sucrase - options, then dynamic `import` expressions are left alone, which is particularly - useful in Node to load ESM-only libraries. If `preserveDynamicImport` is not - specified, `import` expressions are transformed into a promise-wrapped call to - `require`. -* **react-hot-loader**: Performs the equivalent of the `react-hot-loader/babel` - transform in the [react-hot-loader](https://github.com/gaearon/react-hot-loader) - project. This enables advanced hot reloading use cases such as editing of - bound methods. -* **jest**: Hoist desired [jest](https://jestjs.io/) method calls above imports in - the same way as [babel-plugin-jest-hoist](https://github.com/facebook/jest/tree/master/packages/babel-plugin-jest-hoist). - Does not validate the arguments passed to `jest.mock`, but the same rules still apply. - -When the `imports` transform is *not* specified (i.e. when targeting ESM), the -`injectCreateRequireForImportRequire` option can be specified to transform TS -`import foo = require("foo");` in a way that matches the -[TypeScript 4.7 behavior](https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#commonjs-interoperability) -with `module: nodenext`. - -These newer JS features are transformed by default: - -* [Optional chaining](https://github.com/tc39/proposal-optional-chaining): `a?.b` -* [Nullish coalescing](https://github.com/tc39/proposal-nullish-coalescing): `a ?? b` -* [Class fields](https://github.com/tc39/proposal-class-fields): `class C { x = 1; }`. - This includes static fields but not the `#x` private field syntax. -* [Numeric separators](https://github.com/tc39/proposal-numeric-separator): - `const n = 1_234;` -* [Optional catch binding](https://github.com/tc39/proposal-optional-catch-binding): - `try { doThing(); } catch { }`. - -If your target runtime supports these features, you can specify -`disableESTransforms: true` so that Sucrase preserves the syntax rather than -trying to transform it. Note that transpiled and standard class fields behave -slightly differently; see the -[TypeScript 3.7 release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier) -for details. If you use TypeScript, you can enable the TypeScript option -`useDefineForClassFields` to enable error checking related to these differences. - -### Unsupported syntax - -All JS syntax not mentioned above will "pass through" and needs to be supported -by your JS runtime. For example: - -* Decorators, private fields, `throw` expressions, generator arrow functions, - and `do` expressions are all unsupported in browsers and Node (as of this - writing), and Sucrase doesn't make an attempt to transpile them. -* Object rest/spread, async functions, and async iterators are all recent - features that should work fine, but might cause issues if you use older - versions of tools like webpack. BigInt and newer regex features may or may not - work, based on your tooling. - -### JSX Options - -By default, JSX is compiled to React functions in development mode. This can be -configured with a few options: - -* **jsxRuntime**: A string specifying the transform mode, which can be one of three values: - * `"classic"` (default): The original JSX transform that calls `React.createElement` by default. - To configure for non-React use cases, specify: - * **jsxPragma**: Element creation function, defaults to `React.createElement`. - * **jsxFragmentPragma**: Fragment component, defaults to `React.Fragment`. - * `"automatic"`: The [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) - introduced with React 17, which calls `jsx` functions and auto-adds import statements. - To configure for non-React use cases, specify: - * **jsxImportSource**: Package name for auto-generated import statements, defaults to `react`. - * `"preserve"`: Don't transform JSX, and instead emit it as-is in the output code. -* **production**: If `true`, use production version of functions and don't include debugging - information. When using React in production mode with the automatic transform, this *must* be - set to true to avoid an error about `jsxDEV` being missing. - -### Legacy CommonJS interop - -Two legacy modes can be used with the `imports` transform: - -* **enableLegacyTypeScriptModuleInterop**: Use the default TypeScript approach - to CommonJS interop instead of assuming that TypeScript's `--esModuleInterop` - flag is enabled. For example, if a CJS module exports a function, legacy - TypeScript interop requires you to write `import * as add from './add';`, - while Babel, Webpack, Node.js, and TypeScript with `--esModuleInterop` require - you to write `import add from './add';`. As mentioned in the - [docs](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-form-commonjs-modules-with---esmoduleinterop), - the TypeScript team recommends you always use `--esModuleInterop`. -* **enableLegacyBabel5ModuleInterop**: Use the Babel 5 approach to CommonJS - interop, so that you can run `require('./MyModule')` instead of - `require('./MyModule').default`. Analogous to - [babel-plugin-add-module-exports](https://github.com/59naga/babel-plugin-add-module-exports). - -## Usage - -### Tool integrations - -* [Webpack](https://github.com/alangpierce/sucrase/tree/main/integrations/webpack-loader) -* [Gulp](https://github.com/alangpierce/sucrase/tree/main/integrations/gulp-plugin) -* [Jest](https://github.com/alangpierce/sucrase/tree/main/integrations/jest-plugin) -* [Rollup](https://github.com/rollup/plugins/tree/master/packages/sucrase) -* [Broccoli](https://github.com/stefanpenner/broccoli-sucrase) - -### Usage in Node - -The most robust way is to use the Sucrase plugin for [ts-node](https://github.com/TypeStrong/ts-node), -which has various Node integrations and configures Sucrase via `tsconfig.json`: -```bash -ts-node --transpiler sucrase/ts-node-plugin -``` - -For projects that don't target ESM, Sucrase also has a require hook with some -reasonable defaults that can be accessed in a few ways: - -* From code: `require("sucrase/register");` -* When invoking Node: `node -r sucrase/register main.ts` -* As a separate binary: `sucrase-node main.ts` - -Options can be passed to the require hook via a `SUCRASE_OPTIONS` environment -variable holding a JSON string of options. - -### Compiling a project to JS - -For simple use cases, Sucrase comes with a `sucrase` CLI that mirrors your -directory structure to an output directory: -```bash -sucrase ./srcDir -d ./outDir --transforms typescript,imports -``` - -### Usage from code - -For any advanced use cases, Sucrase can be called from JS directly: - -```js -import {transform} from "sucrase"; -const compiledCode = transform(code, {transforms: ["typescript", "imports"]}).code; -``` - -## What Sucrase is not - -Sucrase is intended to be useful for the most common cases, but it does not aim -to have nearly the scope and versatility of Babel. Some specific examples: - -* Sucrase does not check your code for errors. Sucrase's contract is that if you - give it valid code, it will produce valid JS code. If you give it invalid - code, it might produce invalid code, it might produce valid code, or it might - give an error. Always use Sucrase with a linter or typechecker, which is more - suited for error-checking. -* Sucrase is not pluginizable. With the current architecture, transforms need to - be explicitly written to cooperate with each other, so each additional - transform takes significant extra work. -* Sucrase is not good for prototyping language extensions and upcoming language - features. Its faster architecture makes new transforms more difficult to write - and more fragile. -* Sucrase will never produce code for old browsers like IE. Compiling code down - to ES5 is much more complicated than any transformation that Sucrase needs to - do. -* Sucrase is hesitant to implement upcoming JS features, although some of them - make sense to implement for pragmatic reasons. Its main focus is on language - extensions (JSX, TypeScript, Flow) that will never be supported by JS - runtimes. -* Like Babel, Sucrase is not a typechecker, and must process each file in - isolation. For example, TypeScript `const enum`s are treated as regular - `enum`s rather than inlining across files. -* You should think carefully before using Sucrase in production. Sucrase is - mostly beneficial in development, and in many cases, Babel or tsc will be more - suitable for production builds. - -See the [Project Vision](./docs/PROJECT_VISION.md) document for more details on -the philosophy behind Sucrase. - -## Motivation - -As JavaScript implementations mature, it becomes more and more reasonable to -disable Babel transforms, especially in development when you know that you're -targeting a modern runtime. You might hope that you could simplify and speed up -the build step by eventually disabling Babel entirely, but this isn't possible -if you're using a non-standard language extension like JSX, TypeScript, or Flow. -Unfortunately, disabling most transforms in Babel doesn't speed it up as much as -you might expect. To understand, let's take a look at how Babel works: - -1. Tokenize the input source code into a token stream. -2. Parse the token stream into an AST. -3. Walk the AST to compute the scope information for each variable. -4. Apply all transform plugins in a single traversal, resulting in a new AST. -5. Print the resulting AST. - -Only step 4 gets faster when disabling plugins, so there's always a fixed cost -to running Babel regardless of how many transforms are enabled. - -Sucrase bypasses most of these steps, and works like this: - -1. Tokenize the input source code into a token stream using a trimmed-down fork - of the Babel parser. This fork does not produce a full AST, but still - produces meaningful token metadata specifically designed for the later - transforms. -2. Scan through the tokens, computing preliminary information like all - imported/exported names. -3. Run the transform by doing a pass through the tokens and performing a number - of careful find-and-replace operations, like replacing ` 0 || - importInfo.namedExports.length > 0 - ) { - continue; - } - const names = [ - ...importInfo.defaultNames, - ...importInfo.wildcardNames, - ...importInfo.namedImports.map(({localName}) => localName), - ]; - if (names.every((name) => this.shouldAutomaticallyElideImportedName(name))) { - this.importsToReplace.set(path, ""); - } - } - } - - shouldAutomaticallyElideImportedName(name) { - return ( - this.isTypeScriptTransformEnabled && - !this.keepUnusedImports && - !this.nonTypeIdentifiers.has(name) - ); - } - - generateImportReplacements() { - for (const [path, importInfo] of this.importInfoByPath.entries()) { - const { - defaultNames, - wildcardNames, - namedImports, - namedExports, - exportStarNames, - hasStarExport, - } = importInfo; - - if ( - defaultNames.length === 0 && - wildcardNames.length === 0 && - namedImports.length === 0 && - namedExports.length === 0 && - exportStarNames.length === 0 && - !hasStarExport - ) { - // Import is never used, so don't even assign a name. - this.importsToReplace.set(path, `require('${path}');`); - continue; - } - - const primaryImportName = this.getFreeIdentifierForPath(path); - let secondaryImportName; - if (this.enableLegacyTypeScriptModuleInterop) { - secondaryImportName = primaryImportName; - } else { - secondaryImportName = - wildcardNames.length > 0 ? wildcardNames[0] : this.getFreeIdentifierForPath(path); - } - let requireCode = `var ${primaryImportName} = require('${path}');`; - if (wildcardNames.length > 0) { - for (const wildcardName of wildcardNames) { - const moduleExpr = this.enableLegacyTypeScriptModuleInterop - ? primaryImportName - : `${this.helperManager.getHelperName("interopRequireWildcard")}(${primaryImportName})`; - requireCode += ` var ${wildcardName} = ${moduleExpr};`; - } - } else if (exportStarNames.length > 0 && secondaryImportName !== primaryImportName) { - requireCode += ` var ${secondaryImportName} = ${this.helperManager.getHelperName( - "interopRequireWildcard", - )}(${primaryImportName});`; - } else if (defaultNames.length > 0 && secondaryImportName !== primaryImportName) { - requireCode += ` var ${secondaryImportName} = ${this.helperManager.getHelperName( - "interopRequireDefault", - )}(${primaryImportName});`; - } - - for (const {importedName, localName} of namedExports) { - requireCode += ` ${this.helperManager.getHelperName( - "createNamedExportFrom", - )}(${primaryImportName}, '${localName}', '${importedName}');`; - } - for (const exportStarName of exportStarNames) { - requireCode += ` exports.${exportStarName} = ${secondaryImportName};`; - } - if (hasStarExport) { - requireCode += ` ${this.helperManager.getHelperName( - "createStarExport", - )}(${primaryImportName});`; - } - - this.importsToReplace.set(path, requireCode); - - for (const defaultName of defaultNames) { - this.identifierReplacements.set(defaultName, `${secondaryImportName}.default`); - } - for (const {importedName, localName} of namedImports) { - this.identifierReplacements.set(localName, `${primaryImportName}.${importedName}`); - } - } - } - - getFreeIdentifierForPath(path) { - const components = path.split("/"); - const lastComponent = components[components.length - 1]; - const baseName = lastComponent.replace(/\W/g, ""); - return this.nameManager.claimFreeName(`_${baseName}`); - } - - preprocessImportAtIndex(index) { - const defaultNames = []; - const wildcardNames = []; - const namedImports = []; - - index++; - if ( - (this.tokens.matchesContextualAtIndex(index, _keywords.ContextualKeyword._type) || - this.tokens.matches1AtIndex(index, _types.TokenType._typeof)) && - !this.tokens.matches1AtIndex(index + 1, _types.TokenType.comma) && - !this.tokens.matchesContextualAtIndex(index + 1, _keywords.ContextualKeyword._from) - ) { - // import type declaration, so no need to process anything. - return; - } - - if (this.tokens.matches1AtIndex(index, _types.TokenType.parenL)) { - // Dynamic import, so nothing to do - return; - } - - if (this.tokens.matches1AtIndex(index, _types.TokenType.name)) { - defaultNames.push(this.tokens.identifierNameAtIndex(index)); - index++; - if (this.tokens.matches1AtIndex(index, _types.TokenType.comma)) { - index++; - } - } - - if (this.tokens.matches1AtIndex(index, _types.TokenType.star)) { - // * as - index += 2; - wildcardNames.push(this.tokens.identifierNameAtIndex(index)); - index++; - } - - if (this.tokens.matches1AtIndex(index, _types.TokenType.braceL)) { - const result = this.getNamedImports(index + 1); - index = result.newIndex; - - for (const namedImport of result.namedImports) { - // Treat {default as X} as a default import to ensure usage of require interop helper - if (namedImport.importedName === "default") { - defaultNames.push(namedImport.localName); - } else { - namedImports.push(namedImport); - } - } - } - - if (this.tokens.matchesContextualAtIndex(index, _keywords.ContextualKeyword._from)) { - index++; - } - - if (!this.tokens.matches1AtIndex(index, _types.TokenType.string)) { - throw new Error("Expected string token at the end of import statement."); - } - const path = this.tokens.stringValueAtIndex(index); - const importInfo = this.getImportInfo(path); - importInfo.defaultNames.push(...defaultNames); - importInfo.wildcardNames.push(...wildcardNames); - importInfo.namedImports.push(...namedImports); - if (defaultNames.length === 0 && wildcardNames.length === 0 && namedImports.length === 0) { - importInfo.hasBareImport = true; - } - } - - preprocessExportAtIndex(index) { - if ( - this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType._var) || - this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType._let) || - this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType._const) - ) { - this.preprocessVarExportAtIndex(index); - } else if ( - this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType._function) || - this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType._class) - ) { - const exportName = this.tokens.identifierNameAtIndex(index + 2); - this.addExportBinding(exportName, exportName); - } else if (this.tokens.matches3AtIndex(index, _types.TokenType._export, _types.TokenType.name, _types.TokenType._function)) { - const exportName = this.tokens.identifierNameAtIndex(index + 3); - this.addExportBinding(exportName, exportName); - } else if (this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType.braceL)) { - this.preprocessNamedExportAtIndex(index); - } else if (this.tokens.matches2AtIndex(index, _types.TokenType._export, _types.TokenType.star)) { - this.preprocessExportStarAtIndex(index); - } - } - - preprocessVarExportAtIndex(index) { - let depth = 0; - // Handle cases like `export let {x} = y;`, starting at the open-brace in that case. - for (let i = index + 2; ; i++) { - if ( - this.tokens.matches1AtIndex(i, _types.TokenType.braceL) || - this.tokens.matches1AtIndex(i, _types.TokenType.dollarBraceL) || - this.tokens.matches1AtIndex(i, _types.TokenType.bracketL) - ) { - depth++; - } else if ( - this.tokens.matches1AtIndex(i, _types.TokenType.braceR) || - this.tokens.matches1AtIndex(i, _types.TokenType.bracketR) - ) { - depth--; - } else if (depth === 0 && !this.tokens.matches1AtIndex(i, _types.TokenType.name)) { - break; - } else if (this.tokens.matches1AtIndex(1, _types.TokenType.eq)) { - const endIndex = this.tokens.currentToken().rhsEndIndex; - if (endIndex == null) { - throw new Error("Expected = token with an end index."); - } - i = endIndex - 1; - } else { - const token = this.tokens.tokens[i]; - if (_tokenizer.isDeclaration.call(void 0, token)) { - const exportName = this.tokens.identifierNameAtIndex(i); - this.identifierReplacements.set(exportName, `exports.${exportName}`); - } - } - } - } - - /** - * Walk this export statement just in case it's an export...from statement. - * If it is, combine it into the import info for that path. Otherwise, just - * bail out; it'll be handled later. - */ - preprocessNamedExportAtIndex(index) { - // export { - index += 2; - const {newIndex, namedImports} = this.getNamedImports(index); - index = newIndex; - - if (this.tokens.matchesContextualAtIndex(index, _keywords.ContextualKeyword._from)) { - index++; - } else { - // Reinterpret "a as b" to be local/exported rather than imported/local. - for (const {importedName: localName, localName: exportedName} of namedImports) { - this.addExportBinding(localName, exportedName); - } - return; - } - - if (!this.tokens.matches1AtIndex(index, _types.TokenType.string)) { - throw new Error("Expected string token at the end of import statement."); - } - const path = this.tokens.stringValueAtIndex(index); - const importInfo = this.getImportInfo(path); - importInfo.namedExports.push(...namedImports); - } - - preprocessExportStarAtIndex(index) { - let exportedName = null; - if (this.tokens.matches3AtIndex(index, _types.TokenType._export, _types.TokenType.star, _types.TokenType._as)) { - // export * as - index += 3; - exportedName = this.tokens.identifierNameAtIndex(index); - // foo from - index += 2; - } else { - // export * from - index += 3; - } - if (!this.tokens.matches1AtIndex(index, _types.TokenType.string)) { - throw new Error("Expected string token at the end of star export statement."); - } - const path = this.tokens.stringValueAtIndex(index); - const importInfo = this.getImportInfo(path); - if (exportedName !== null) { - importInfo.exportStarNames.push(exportedName); - } else { - importInfo.hasStarExport = true; - } - } - - getNamedImports(index) { - const namedImports = []; - while (true) { - if (this.tokens.matches1AtIndex(index, _types.TokenType.braceR)) { - index++; - break; - } - - const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, this.tokens, index); - index = specifierInfo.endIndex; - if (!specifierInfo.isType) { - namedImports.push({ - importedName: specifierInfo.leftName, - localName: specifierInfo.rightName, - }); - } - - if (this.tokens.matches2AtIndex(index, _types.TokenType.comma, _types.TokenType.braceR)) { - index += 2; - break; - } else if (this.tokens.matches1AtIndex(index, _types.TokenType.braceR)) { - index++; - break; - } else if (this.tokens.matches1AtIndex(index, _types.TokenType.comma)) { - index++; - } else { - throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[index])}`); - } - } - return {newIndex: index, namedImports}; - } - - /** - * Get a mutable import info object for this path, creating one if it doesn't - * exist yet. - */ - getImportInfo(path) { - const existingInfo = this.importInfoByPath.get(path); - if (existingInfo) { - return existingInfo; - } - const newInfo = { - defaultNames: [], - wildcardNames: [], - namedImports: [], - namedExports: [], - hasBareImport: false, - exportStarNames: [], - hasStarExport: false, - }; - this.importInfoByPath.set(path, newInfo); - return newInfo; - } - - addExportBinding(localName, exportedName) { - if (!this.exportBindingsByLocalName.has(localName)) { - this.exportBindingsByLocalName.set(localName, []); - } - this.exportBindingsByLocalName.get(localName).push(exportedName); - } - - /** - * Return the code to use for the import for this path, or the empty string if - * the code has already been "claimed" by a previous import. - */ - claimImportCode(importPath) { - const result = this.importsToReplace.get(importPath); - this.importsToReplace.set(importPath, ""); - return result || ""; - } - - getIdentifierReplacement(identifierName) { - return this.identifierReplacements.get(identifierName) || null; - } - - /** - * Return a string like `exports.foo = exports.bar`. - */ - resolveExportBinding(assignedName) { - const exportedNames = this.exportBindingsByLocalName.get(assignedName); - if (!exportedNames || exportedNames.length === 0) { - return null; - } - return exportedNames.map((exportedName) => `exports.${exportedName}`).join(" = "); - } - - /** - * Return all imported/exported names where we might be interested in whether usages of those - * names are shadowed. - */ - getGlobalNames() { - return new Set([ - ...this.identifierReplacements.keys(), - ...this.exportBindingsByLocalName.keys(), - ]); - } -} exports.default = CJSImportProcessor; diff --git a/node_modules/sucrase/dist/HelperManager.js b/node_modules/sucrase/dist/HelperManager.js deleted file mode 100644 index 6dcc9c9..0000000 --- a/node_modules/sucrase/dist/HelperManager.js +++ /dev/null @@ -1,176 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); - -const HELPERS = { - require: ` - import {createRequire as CREATE_REQUIRE_NAME} from "module"; - const require = CREATE_REQUIRE_NAME(import.meta.url); - `, - interopRequireWildcard: ` - function interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } else { - var newObj = {}; - if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - return newObj; - } - } - `, - interopRequireDefault: ` - function interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - `, - createNamedExportFrom: ` - function createNamedExportFrom(obj, localName, importedName) { - Object.defineProperty(exports, localName, {enumerable: true, configurable: true, get: () => obj[importedName]}); - } - `, - // Note that TypeScript and Babel do this differently; TypeScript does a simple existence - // check in the exports object and does a plain assignment, whereas Babel uses - // defineProperty and builds an object of explicitly-exported names so that star exports can - // always take lower precedence. For now, we do the easier TypeScript thing. - createStarExport: ` - function createStarExport(obj) { - Object.keys(obj) - .filter((key) => key !== "default" && key !== "__esModule") - .forEach((key) => { - if (exports.hasOwnProperty(key)) { - return; - } - Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); - }); - } - `, - nullishCoalesce: ` - function nullishCoalesce(lhs, rhsFn) { - if (lhs != null) { - return lhs; - } else { - return rhsFn(); - } - } - `, - asyncNullishCoalesce: ` - async function asyncNullishCoalesce(lhs, rhsFn) { - if (lhs != null) { - return lhs; - } else { - return await rhsFn(); - } - } - `, - optionalChain: ` - function optionalChain(ops) { - let lastAccessLHS = undefined; - let value = ops[0]; - let i = 1; - while (i < ops.length) { - const op = ops[i]; - const fn = ops[i + 1]; - i += 2; - if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { - return undefined; - } - if (op === 'access' || op === 'optionalAccess') { - lastAccessLHS = value; - value = fn(value); - } else if (op === 'call' || op === 'optionalCall') { - value = fn((...args) => value.call(lastAccessLHS, ...args)); - lastAccessLHS = undefined; - } - } - return value; - } - `, - asyncOptionalChain: ` - async function asyncOptionalChain(ops) { - let lastAccessLHS = undefined; - let value = ops[0]; - let i = 1; - while (i < ops.length) { - const op = ops[i]; - const fn = ops[i + 1]; - i += 2; - if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { - return undefined; - } - if (op === 'access' || op === 'optionalAccess') { - lastAccessLHS = value; - value = await fn(value); - } else if (op === 'call' || op === 'optionalCall') { - value = await fn((...args) => value.call(lastAccessLHS, ...args)); - lastAccessLHS = undefined; - } - } - return value; - } - `, - optionalChainDelete: ` - function optionalChainDelete(ops) { - const result = OPTIONAL_CHAIN_NAME(ops); - return result == null ? true : result; - } - `, - asyncOptionalChainDelete: ` - async function asyncOptionalChainDelete(ops) { - const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops); - return result == null ? true : result; - } - `, -}; - - class HelperManager { - __init() {this.helperNames = {}} - __init2() {this.createRequireName = null} - constructor( nameManager) {;this.nameManager = nameManager;HelperManager.prototype.__init.call(this);HelperManager.prototype.__init2.call(this);} - - getHelperName(baseName) { - let helperName = this.helperNames[baseName]; - if (helperName) { - return helperName; - } - helperName = this.nameManager.claimFreeName(`_${baseName}`); - this.helperNames[baseName] = helperName; - return helperName; - } - - emitHelpers() { - let resultCode = ""; - if (this.helperNames.optionalChainDelete) { - this.getHelperName("optionalChain"); - } - if (this.helperNames.asyncOptionalChainDelete) { - this.getHelperName("asyncOptionalChain"); - } - for (const [baseName, helperCodeTemplate] of Object.entries(HELPERS)) { - const helperName = this.helperNames[baseName]; - let helperCode = helperCodeTemplate; - if (baseName === "optionalChainDelete") { - helperCode = helperCode.replace("OPTIONAL_CHAIN_NAME", this.helperNames.optionalChain); - } else if (baseName === "asyncOptionalChainDelete") { - helperCode = helperCode.replace( - "ASYNC_OPTIONAL_CHAIN_NAME", - this.helperNames.asyncOptionalChain, - ); - } else if (baseName === "require") { - if (this.createRequireName === null) { - this.createRequireName = this.nameManager.claimFreeName("_createRequire"); - } - helperCode = helperCode.replace(/CREATE_REQUIRE_NAME/g, this.createRequireName); - } - if (helperName) { - resultCode += " "; - resultCode += helperCode.replace(baseName, helperName).replace(/\s+/g, " ").trim(); - } - } - return resultCode; - } -} exports.HelperManager = HelperManager; diff --git a/node_modules/sucrase/dist/NameManager.js b/node_modules/sucrase/dist/NameManager.js deleted file mode 100644 index 0ebbe28..0000000 --- a/node_modules/sucrase/dist/NameManager.js +++ /dev/null @@ -1,27 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _getIdentifierNames = require('./util/getIdentifierNames'); var _getIdentifierNames2 = _interopRequireDefault(_getIdentifierNames); - - class NameManager { - __init() {this.usedNames = new Set()} - - constructor(code, tokens) {;NameManager.prototype.__init.call(this); - this.usedNames = new Set(_getIdentifierNames2.default.call(void 0, code, tokens)); - } - - claimFreeName(name) { - const newName = this.findFreeName(name); - this.usedNames.add(newName); - return newName; - } - - findFreeName(name) { - if (!this.usedNames.has(name)) { - return name; - } - let suffixNum = 2; - while (this.usedNames.has(name + String(suffixNum))) { - suffixNum++; - } - return name + String(suffixNum); - } -} exports.default = NameManager; diff --git a/node_modules/sucrase/dist/Options-gen-types.js b/node_modules/sucrase/dist/Options-gen-types.js deleted file mode 100644 index 438d198..0000000 --- a/node_modules/sucrase/dist/Options-gen-types.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }/** - * This module was automatically generated by `ts-interface-builder` - */ -var _tsinterfacechecker = require('ts-interface-checker'); var t = _interopRequireWildcard(_tsinterfacechecker); -// tslint:disable:object-literal-key-quotes - - const Transform = t.union( - t.lit("jsx"), - t.lit("typescript"), - t.lit("flow"), - t.lit("imports"), - t.lit("react-hot-loader"), - t.lit("jest"), -); exports.Transform = Transform; - - const SourceMapOptions = t.iface([], { - compiledFilename: "string", -}); exports.SourceMapOptions = SourceMapOptions; - - const Options = t.iface([], { - transforms: t.array("Transform"), - disableESTransforms: t.opt("boolean"), - jsxRuntime: t.opt(t.union(t.lit("classic"), t.lit("automatic"), t.lit("preserve"))), - production: t.opt("boolean"), - jsxImportSource: t.opt("string"), - jsxPragma: t.opt("string"), - jsxFragmentPragma: t.opt("string"), - keepUnusedImports: t.opt("boolean"), - preserveDynamicImport: t.opt("boolean"), - injectCreateRequireForImportRequire: t.opt("boolean"), - enableLegacyTypeScriptModuleInterop: t.opt("boolean"), - enableLegacyBabel5ModuleInterop: t.opt("boolean"), - sourceMapOptions: t.opt("SourceMapOptions"), - filePath: t.opt("string"), -}); exports.Options = Options; - -const exportedTypeSuite = { - Transform: exports.Transform, - SourceMapOptions: exports.SourceMapOptions, - Options: exports.Options, -}; -exports. default = exportedTypeSuite; diff --git a/node_modules/sucrase/dist/Options.js b/node_modules/sucrase/dist/Options.js deleted file mode 100644 index 15855c4..0000000 --- a/node_modules/sucrase/dist/Options.js +++ /dev/null @@ -1,101 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _tsinterfacechecker = require('ts-interface-checker'); - -var _Optionsgentypes = require('./Options-gen-types'); var _Optionsgentypes2 = _interopRequireDefault(_Optionsgentypes); - -const {Options: OptionsChecker} = _tsinterfacechecker.createCheckers.call(void 0, _Optionsgentypes2.default); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function validateOptions(options) { - OptionsChecker.strictCheck(options); -} exports.validateOptions = validateOptions; diff --git a/node_modules/sucrase/dist/TokenProcessor.js b/node_modules/sucrase/dist/TokenProcessor.js deleted file mode 100644 index 58fdd98..0000000 --- a/node_modules/sucrase/dist/TokenProcessor.js +++ /dev/null @@ -1,357 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - -var _types = require('./parser/tokenizer/types'); -var _isAsyncOperation = require('./util/isAsyncOperation'); var _isAsyncOperation2 = _interopRequireDefault(_isAsyncOperation); - - - - - - - - - - - - class TokenProcessor { - __init() {this.resultCode = ""} - // Array mapping input token index to optional string index position in the - // output code. - __init2() {this.resultMappings = new Array(this.tokens.length)} - __init3() {this.tokenIndex = 0} - - constructor( - code, - tokens, - isFlowEnabled, - disableESTransforms, - helperManager, - ) {;this.code = code;this.tokens = tokens;this.isFlowEnabled = isFlowEnabled;this.disableESTransforms = disableESTransforms;this.helperManager = helperManager;TokenProcessor.prototype.__init.call(this);TokenProcessor.prototype.__init2.call(this);TokenProcessor.prototype.__init3.call(this);} - - /** - * Snapshot the token state in a way that can be restored later, useful for - * things like lookahead. - * - * resultMappings do not need to be copied since in all use cases, they will - * be overwritten anyway after restore. - */ - snapshot() { - return { - resultCode: this.resultCode, - tokenIndex: this.tokenIndex, - }; - } - - restoreToSnapshot(snapshot) { - this.resultCode = snapshot.resultCode; - this.tokenIndex = snapshot.tokenIndex; - } - - /** - * Remove and return the code generated since the snapshot, leaving the - * current token position in-place. Unlike most TokenProcessor operations, - * this operation can result in input/output line number mismatches because - * the removed code may contain newlines, so this operation should be used - * sparingly. - */ - dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot) { - const result = this.resultCode.slice(snapshot.resultCode.length); - this.resultCode = snapshot.resultCode; - return result; - } - - reset() { - this.resultCode = ""; - this.resultMappings = new Array(this.tokens.length); - this.tokenIndex = 0; - } - - matchesContextualAtIndex(index, contextualKeyword) { - return ( - this.matches1AtIndex(index, _types.TokenType.name) && - this.tokens[index].contextualKeyword === contextualKeyword - ); - } - - identifierNameAtIndex(index) { - // TODO: We need to process escapes since technically you can have unicode escapes in variable - // names. - return this.identifierNameForToken(this.tokens[index]); - } - - identifierNameAtRelativeIndex(relativeIndex) { - return this.identifierNameForToken(this.tokenAtRelativeIndex(relativeIndex)); - } - - identifierName() { - return this.identifierNameForToken(this.currentToken()); - } - - identifierNameForToken(token) { - return this.code.slice(token.start, token.end); - } - - rawCodeForToken(token) { - return this.code.slice(token.start, token.end); - } - - stringValueAtIndex(index) { - return this.stringValueForToken(this.tokens[index]); - } - - stringValue() { - return this.stringValueForToken(this.currentToken()); - } - - stringValueForToken(token) { - // This is used to identify when two imports are the same and to resolve TypeScript enum keys. - // Ideally we'd process escapes within the strings, but for now we pretty much take the raw - // code. - return this.code.slice(token.start + 1, token.end - 1); - } - - matches1AtIndex(index, t1) { - return this.tokens[index].type === t1; - } - - matches2AtIndex(index, t1, t2) { - return this.tokens[index].type === t1 && this.tokens[index + 1].type === t2; - } - - matches3AtIndex(index, t1, t2, t3) { - return ( - this.tokens[index].type === t1 && - this.tokens[index + 1].type === t2 && - this.tokens[index + 2].type === t3 - ); - } - - matches1(t1) { - return this.tokens[this.tokenIndex].type === t1; - } - - matches2(t1, t2) { - return this.tokens[this.tokenIndex].type === t1 && this.tokens[this.tokenIndex + 1].type === t2; - } - - matches3(t1, t2, t3) { - return ( - this.tokens[this.tokenIndex].type === t1 && - this.tokens[this.tokenIndex + 1].type === t2 && - this.tokens[this.tokenIndex + 2].type === t3 - ); - } - - matches4(t1, t2, t3, t4) { - return ( - this.tokens[this.tokenIndex].type === t1 && - this.tokens[this.tokenIndex + 1].type === t2 && - this.tokens[this.tokenIndex + 2].type === t3 && - this.tokens[this.tokenIndex + 3].type === t4 - ); - } - - matches5(t1, t2, t3, t4, t5) { - return ( - this.tokens[this.tokenIndex].type === t1 && - this.tokens[this.tokenIndex + 1].type === t2 && - this.tokens[this.tokenIndex + 2].type === t3 && - this.tokens[this.tokenIndex + 3].type === t4 && - this.tokens[this.tokenIndex + 4].type === t5 - ); - } - - matchesContextual(contextualKeyword) { - return this.matchesContextualAtIndex(this.tokenIndex, contextualKeyword); - } - - matchesContextIdAndLabel(type, contextId) { - return this.matches1(type) && this.currentToken().contextId === contextId; - } - - previousWhitespaceAndComments() { - let whitespaceAndComments = this.code.slice( - this.tokenIndex > 0 ? this.tokens[this.tokenIndex - 1].end : 0, - this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex].start : this.code.length, - ); - if (this.isFlowEnabled) { - whitespaceAndComments = whitespaceAndComments.replace(/@flow/g, ""); - } - return whitespaceAndComments; - } - - replaceToken(newCode) { - this.resultCode += this.previousWhitespaceAndComments(); - this.appendTokenPrefix(); - this.resultMappings[this.tokenIndex] = this.resultCode.length; - this.resultCode += newCode; - this.appendTokenSuffix(); - this.tokenIndex++; - } - - replaceTokenTrimmingLeftWhitespace(newCode) { - this.resultCode += this.previousWhitespaceAndComments().replace(/[^\r\n]/g, ""); - this.appendTokenPrefix(); - this.resultMappings[this.tokenIndex] = this.resultCode.length; - this.resultCode += newCode; - this.appendTokenSuffix(); - this.tokenIndex++; - } - - removeInitialToken() { - this.replaceToken(""); - } - - removeToken() { - this.replaceTokenTrimmingLeftWhitespace(""); - } - - /** - * Remove all code until the next }, accounting for balanced braces. - */ - removeBalancedCode() { - let braceDepth = 0; - while (!this.isAtEnd()) { - if (this.matches1(_types.TokenType.braceL)) { - braceDepth++; - } else if (this.matches1(_types.TokenType.braceR)) { - if (braceDepth === 0) { - return; - } - braceDepth--; - } - this.removeToken(); - } - } - - copyExpectedToken(tokenType) { - if (this.tokens[this.tokenIndex].type !== tokenType) { - throw new Error(`Expected token ${tokenType}`); - } - this.copyToken(); - } - - copyToken() { - this.resultCode += this.previousWhitespaceAndComments(); - this.appendTokenPrefix(); - this.resultMappings[this.tokenIndex] = this.resultCode.length; - this.resultCode += this.code.slice( - this.tokens[this.tokenIndex].start, - this.tokens[this.tokenIndex].end, - ); - this.appendTokenSuffix(); - this.tokenIndex++; - } - - copyTokenWithPrefix(prefix) { - this.resultCode += this.previousWhitespaceAndComments(); - this.appendTokenPrefix(); - this.resultCode += prefix; - this.resultMappings[this.tokenIndex] = this.resultCode.length; - this.resultCode += this.code.slice( - this.tokens[this.tokenIndex].start, - this.tokens[this.tokenIndex].end, - ); - this.appendTokenSuffix(); - this.tokenIndex++; - } - - appendTokenPrefix() { - const token = this.currentToken(); - if (token.numNullishCoalesceStarts || token.isOptionalChainStart) { - token.isAsyncOperation = _isAsyncOperation2.default.call(void 0, this); - } - if (this.disableESTransforms) { - return; - } - if (token.numNullishCoalesceStarts) { - for (let i = 0; i < token.numNullishCoalesceStarts; i++) { - if (token.isAsyncOperation) { - this.resultCode += "await "; - this.resultCode += this.helperManager.getHelperName("asyncNullishCoalesce"); - } else { - this.resultCode += this.helperManager.getHelperName("nullishCoalesce"); - } - this.resultCode += "("; - } - } - if (token.isOptionalChainStart) { - if (token.isAsyncOperation) { - this.resultCode += "await "; - } - if (this.tokenIndex > 0 && this.tokenAtRelativeIndex(-1).type === _types.TokenType._delete) { - if (token.isAsyncOperation) { - this.resultCode += this.helperManager.getHelperName("asyncOptionalChainDelete"); - } else { - this.resultCode += this.helperManager.getHelperName("optionalChainDelete"); - } - } else if (token.isAsyncOperation) { - this.resultCode += this.helperManager.getHelperName("asyncOptionalChain"); - } else { - this.resultCode += this.helperManager.getHelperName("optionalChain"); - } - this.resultCode += "(["; - } - } - - appendTokenSuffix() { - const token = this.currentToken(); - if (token.isOptionalChainEnd && !this.disableESTransforms) { - this.resultCode += "])"; - } - if (token.numNullishCoalesceEnds && !this.disableESTransforms) { - for (let i = 0; i < token.numNullishCoalesceEnds; i++) { - this.resultCode += "))"; - } - } - } - - appendCode(code) { - this.resultCode += code; - } - - currentToken() { - return this.tokens[this.tokenIndex]; - } - - currentTokenCode() { - const token = this.currentToken(); - return this.code.slice(token.start, token.end); - } - - tokenAtRelativeIndex(relativeIndex) { - return this.tokens[this.tokenIndex + relativeIndex]; - } - - currentIndex() { - return this.tokenIndex; - } - - /** - * Move to the next token. Only suitable in preprocessing steps. When - * generating new code, you should use copyToken or removeToken. - */ - nextToken() { - if (this.tokenIndex === this.tokens.length) { - throw new Error("Unexpectedly reached end of input."); - } - this.tokenIndex++; - } - - previousToken() { - this.tokenIndex--; - } - - finish() { - if (this.tokenIndex !== this.tokens.length) { - throw new Error("Tried to finish processing tokens before reaching the end."); - } - this.resultCode += this.previousWhitespaceAndComments(); - return {code: this.resultCode, mappings: this.resultMappings}; - } - - isAtEnd() { - return this.tokenIndex === this.tokens.length; - } -} exports.default = TokenProcessor; diff --git a/node_modules/sucrase/dist/cli.js b/node_modules/sucrase/dist/cli.js deleted file mode 100644 index 9334615..0000000 --- a/node_modules/sucrase/dist/cli.js +++ /dev/null @@ -1,317 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/* eslint-disable no-console */ -var _commander = require('commander'); var _commander2 = _interopRequireDefault(_commander); -var _tinyglobby = require('tinyglobby'); -var _fs = require('mz/fs'); -var _path = require('path'); - -var _index = require('./index'); - - - - - - - - - - - - function run() { - _commander2.default - .description(`Sucrase: super-fast Babel alternative.`) - .usage("[options] ") - .option( - "-d, --out-dir ", - "Compile an input directory of modules into an output directory.", - ) - .option( - "-p, --project ", - "Compile a TypeScript project, will read from tsconfig.json in ", - ) - .option("--out-extension ", "File extension to use for all output files.", "js") - .option("--exclude-dirs ", "Names of directories that should not be traversed.") - .option("-q, --quiet", "Don't print the names of converted files.") - .option("-t, --transforms ", "Comma-separated list of transforms to run.") - .option("--disable-es-transforms", "Opt out of all ES syntax transforms.") - .option("--jsx-runtime ", "Transformation mode for the JSX transform.") - .option("--production", "Disable debugging information from JSX in output.") - .option( - "--jsx-import-source ", - "Automatic JSX transform import path prefix, defaults to `React.Fragment`.", - ) - .option( - "--jsx-pragma ", - "Classic JSX transform element creation function, defaults to `React.createElement`.", - ) - .option( - "--jsx-fragment-pragma ", - "Classic JSX transform fragment component, defaults to `React.Fragment`.", - ) - .option("--keep-unused-imports", "Disable automatic removal of type-only imports/exports.") - .option("--preserve-dynamic-import", "Don't transpile dynamic import() to require.") - .option( - "--inject-create-require-for-import-require", - "Use `createRequire` when transpiling TS `import = require` to ESM.", - ) - .option( - "--enable-legacy-typescript-module-interop", - "Use default TypeScript ESM/CJS interop strategy.", - ) - .option("--enable-legacy-babel5-module-interop", "Use Babel 5 ESM/CJS interop strategy.") - .parse(process.argv); - - if (_commander2.default.project) { - if ( - _commander2.default.outDir || - _commander2.default.transforms || - _commander2.default.args[0] || - _commander2.default.enableLegacyTypescriptModuleInterop - ) { - console.error( - "If TypeScript project is specified, out directory, transforms, source " + - "directory, and --enable-legacy-typescript-module-interop may not be specified.", - ); - process.exit(1); - } - } else { - if (!_commander2.default.outDir) { - console.error("Out directory is required"); - process.exit(1); - } - - if (!_commander2.default.transforms) { - console.error("Transforms option is required."); - process.exit(1); - } - - if (!_commander2.default.args[0]) { - console.error("Source directory is required."); - process.exit(1); - } - } - - const options = { - outDirPath: _commander2.default.outDir, - srcDirPath: _commander2.default.args[0], - project: _commander2.default.project, - outExtension: _commander2.default.outExtension, - excludeDirs: _commander2.default.excludeDirs ? _commander2.default.excludeDirs.split(",") : [], - quiet: _commander2.default.quiet, - sucraseOptions: { - transforms: _commander2.default.transforms ? _commander2.default.transforms.split(",") : [], - disableESTransforms: _commander2.default.disableEsTransforms, - jsxRuntime: _commander2.default.jsxRuntime, - production: _commander2.default.production, - jsxImportSource: _commander2.default.jsxImportSource, - jsxPragma: _commander2.default.jsxPragma || "React.createElement", - jsxFragmentPragma: _commander2.default.jsxFragmentPragma || "React.Fragment", - keepUnusedImports: _commander2.default.keepUnusedImports, - preserveDynamicImport: _commander2.default.preserveDynamicImport, - injectCreateRequireForImportRequire: _commander2.default.injectCreateRequireForImportRequire, - enableLegacyTypeScriptModuleInterop: _commander2.default.enableLegacyTypescriptModuleInterop, - enableLegacyBabel5ModuleInterop: _commander2.default.enableLegacyBabel5ModuleInterop, - }, - }; - - buildDirectory(options).catch((e) => { - process.exitCode = 1; - console.error(e); - }); -} exports.default = run; - - - - - - -async function findFiles(options) { - const outDirPath = options.outDirPath; - const srcDirPath = options.srcDirPath; - - const extensions = options.sucraseOptions.transforms.includes("typescript") - ? [".ts", ".tsx"] - : [".js", ".jsx"]; - - if (!(await _fs.exists.call(void 0, outDirPath))) { - await _fs.mkdir.call(void 0, outDirPath); - } - - const outArr = []; - for (const child of await _fs.readdir.call(void 0, srcDirPath)) { - if (["node_modules", ".git"].includes(child) || options.excludeDirs.includes(child)) { - continue; - } - const srcChildPath = _path.join.call(void 0, srcDirPath, child); - const outChildPath = _path.join.call(void 0, outDirPath, child); - if ((await _fs.stat.call(void 0, srcChildPath)).isDirectory()) { - const innerOptions = {...options}; - innerOptions.srcDirPath = srcChildPath; - innerOptions.outDirPath = outChildPath; - const innerFiles = await findFiles(innerOptions); - outArr.push(...innerFiles); - } else if (extensions.some((ext) => srcChildPath.endsWith(ext))) { - const outPath = outChildPath.replace(/\.\w+$/, `.${options.outExtension}`); - outArr.push({ - srcPath: srcChildPath, - outPath, - }); - } - } - - return outArr; -} - -async function runGlob(options) { - const tsConfigPath = _path.join.call(void 0, options.project, "tsconfig.json"); - - let str; - try { - str = await _fs.readFile.call(void 0, tsConfigPath, "utf8"); - } catch (err) { - console.error("Could not find project tsconfig.json"); - console.error(` --project=${options.project}`); - console.error(err); - process.exit(1); - } - const json = JSON.parse(str); - - const foundFiles = []; - - const files = json.files; - const include = json.include; - - const absProject = _path.join.call(void 0, process.cwd(), options.project); - const outDirs = []; - - if (!(await _fs.exists.call(void 0, options.outDirPath))) { - await _fs.mkdir.call(void 0, options.outDirPath); - } - - if (files) { - for (const file of files) { - if (file.endsWith(".d.ts")) { - continue; - } - if (!file.endsWith(".ts") && !file.endsWith(".js")) { - continue; - } - - const srcFile = _path.join.call(void 0, absProject, file); - const outFile = _path.join.call(void 0, options.outDirPath, file); - const outPath = outFile.replace(/\.\w+$/, `.${options.outExtension}`); - - const outDir = _path.dirname.call(void 0, outPath); - if (!outDirs.includes(outDir)) { - outDirs.push(outDir); - } - - foundFiles.push({ - srcPath: srcFile, - outPath, - }); - } - } - if (include) { - for (const pattern of include) { - const globFiles = await _tinyglobby.glob.call(void 0, _path.join.call(void 0, absProject, pattern), {expandDirectories: false}); - for (const file of globFiles) { - if (!file.endsWith(".ts") && !file.endsWith(".js")) { - continue; - } - if (file.endsWith(".d.ts")) { - continue; - } - - const relativeFile = _path.relative.call(void 0, absProject, file); - const outFile = _path.join.call(void 0, options.outDirPath, relativeFile); - const outPath = outFile.replace(/\.\w+$/, `.${options.outExtension}`); - - const outDir = _path.dirname.call(void 0, outPath); - if (!outDirs.includes(outDir)) { - outDirs.push(outDir); - } - - foundFiles.push({ - srcPath: file, - outPath, - }); - } - } - } - - for (const outDirPath of outDirs) { - if (!(await _fs.exists.call(void 0, outDirPath))) { - await _fs.mkdir.call(void 0, outDirPath); - } - } - - // TODO: read exclude - - return foundFiles; -} - -async function updateOptionsFromProject(options) { - /** - * Read the project information and assign the following. - * - outDirPath - * - transform: imports - * - transform: typescript - * - enableLegacyTypescriptModuleInterop: true/false. - */ - - const tsConfigPath = _path.join.call(void 0, options.project, "tsconfig.json"); - - let str; - try { - str = await _fs.readFile.call(void 0, tsConfigPath, "utf8"); - } catch (err) { - console.error("Could not find project tsconfig.json"); - console.error(` --project=${options.project}`); - console.error(err); - process.exit(1); - } - const json = JSON.parse(str); - const sucraseOpts = options.sucraseOptions; - if (!sucraseOpts.transforms.includes("typescript")) { - sucraseOpts.transforms.push("typescript"); - } - - const compilerOpts = json.compilerOptions; - if (compilerOpts.outDir) { - options.outDirPath = _path.join.call(void 0, process.cwd(), options.project, compilerOpts.outDir); - } - if (compilerOpts.esModuleInterop !== true) { - sucraseOpts.enableLegacyTypeScriptModuleInterop = true; - } - if (compilerOpts.module === "commonjs") { - if (!sucraseOpts.transforms.includes("imports")) { - sucraseOpts.transforms.push("imports"); - } - } -} - -async function buildDirectory(options) { - let files; - if (options.outDirPath && options.srcDirPath) { - files = await findFiles(options); - } else if (options.project) { - await updateOptionsFromProject(options); - files = await runGlob(options); - } else { - console.error("Project or Source directory required."); - process.exit(1); - } - - for (const file of files) { - await buildFile(file.srcPath, file.outPath, options); - } -} - -async function buildFile(srcPath, outPath, options) { - if (!options.quiet) { - console.log(`${srcPath} -> ${outPath}`); - } - const code = (await _fs.readFile.call(void 0, srcPath)).toString(); - const transformedCode = _index.transform.call(void 0, code, {...options.sucraseOptions, filePath: srcPath}).code; - await _fs.writeFile.call(void 0, outPath, transformedCode); -} diff --git a/node_modules/sucrase/dist/computeSourceMap.js b/node_modules/sucrase/dist/computeSourceMap.js deleted file mode 100644 index 567ddbb..0000000 --- a/node_modules/sucrase/dist/computeSourceMap.js +++ /dev/null @@ -1,89 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _genmapping = require('@jridgewell/gen-mapping'); - - - -var _charcodes = require('./parser/util/charcodes'); - - - - - - - - - - - - -/** - * Generate a source map indicating that each line maps directly to the original line, - * with the tokens in their new positions. - */ - function computeSourceMap( - {code: generatedCode, mappings: rawMappings}, - filePath, - options, - source, - tokens, -) { - const sourceColumns = computeSourceColumns(source, tokens); - const map = new (0, _genmapping.GenMapping)({file: options.compiledFilename}); - let tokenIndex = 0; - // currentMapping is the output source index for the current input token being - // considered. - let currentMapping = rawMappings[0]; - while (currentMapping === undefined && tokenIndex < rawMappings.length - 1) { - tokenIndex++; - currentMapping = rawMappings[tokenIndex]; - } - let line = 0; - let lineStart = 0; - if (currentMapping !== lineStart) { - _genmapping.maybeAddSegment.call(void 0, map, line, 0, filePath, line, 0); - } - for (let i = 0; i < generatedCode.length; i++) { - if (i === currentMapping) { - const genColumn = currentMapping - lineStart; - const sourceColumn = sourceColumns[tokenIndex]; - _genmapping.maybeAddSegment.call(void 0, map, line, genColumn, filePath, line, sourceColumn); - while ( - (currentMapping === i || currentMapping === undefined) && - tokenIndex < rawMappings.length - 1 - ) { - tokenIndex++; - currentMapping = rawMappings[tokenIndex]; - } - } - if (generatedCode.charCodeAt(i) === _charcodes.charCodes.lineFeed) { - line++; - lineStart = i + 1; - if (currentMapping !== lineStart) { - _genmapping.maybeAddSegment.call(void 0, map, line, 0, filePath, line, 0); - } - } - } - const {sourceRoot, sourcesContent, ...sourceMap} = _genmapping.toEncodedMap.call(void 0, map); - return sourceMap ; -} exports.default = computeSourceMap; - -/** - * Create an array mapping each token index to the 0-based column of the start - * position of the token. - */ -function computeSourceColumns(code, tokens) { - const sourceColumns = new Array(tokens.length); - let tokenIndex = 0; - let currentMapping = tokens[tokenIndex].start; - let lineStart = 0; - for (let i = 0; i < code.length; i++) { - if (i === currentMapping) { - sourceColumns[tokenIndex] = currentMapping - lineStart; - tokenIndex++; - currentMapping = tokens[tokenIndex].start; - } - if (code.charCodeAt(i) === _charcodes.charCodes.lineFeed) { - lineStart = i + 1; - } - } - return sourceColumns; -} diff --git a/node_modules/sucrase/dist/esm/CJSImportProcessor.js b/node_modules/sucrase/dist/esm/CJSImportProcessor.js deleted file mode 100644 index d8b7803..0000000 --- a/node_modules/sucrase/dist/esm/CJSImportProcessor.js +++ /dev/null @@ -1,456 +0,0 @@ - - - -import {isDeclaration} from "./parser/tokenizer"; -import {ContextualKeyword} from "./parser/tokenizer/keywords"; -import {TokenType as tt} from "./parser/tokenizer/types"; - -import getImportExportSpecifierInfo from "./util/getImportExportSpecifierInfo"; -import {getNonTypeIdentifiers} from "./util/getNonTypeIdentifiers"; - - - - - - - - - - - - - - - - -/** - * Class responsible for preprocessing and bookkeeping import and export declarations within the - * file. - * - * TypeScript uses a simpler mechanism that does not use functions like interopRequireDefault and - * interopRequireWildcard, so we also allow that mode for compatibility. - */ -export default class CJSImportProcessor { - __init() {this.nonTypeIdentifiers = new Set()} - __init2() {this.importInfoByPath = new Map()} - __init3() {this.importsToReplace = new Map()} - __init4() {this.identifierReplacements = new Map()} - __init5() {this.exportBindingsByLocalName = new Map()} - - constructor( - nameManager, - tokens, - enableLegacyTypeScriptModuleInterop, - options, - isTypeScriptTransformEnabled, - keepUnusedImports, - helperManager, - ) {;this.nameManager = nameManager;this.tokens = tokens;this.enableLegacyTypeScriptModuleInterop = enableLegacyTypeScriptModuleInterop;this.options = options;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.keepUnusedImports = keepUnusedImports;this.helperManager = helperManager;CJSImportProcessor.prototype.__init.call(this);CJSImportProcessor.prototype.__init2.call(this);CJSImportProcessor.prototype.__init3.call(this);CJSImportProcessor.prototype.__init4.call(this);CJSImportProcessor.prototype.__init5.call(this);} - - preprocessTokens() { - for (let i = 0; i < this.tokens.tokens.length; i++) { - if ( - this.tokens.matches1AtIndex(i, tt._import) && - !this.tokens.matches3AtIndex(i, tt._import, tt.name, tt.eq) - ) { - this.preprocessImportAtIndex(i); - } - if ( - this.tokens.matches1AtIndex(i, tt._export) && - !this.tokens.matches2AtIndex(i, tt._export, tt.eq) - ) { - this.preprocessExportAtIndex(i); - } - } - this.generateImportReplacements(); - } - - /** - * In TypeScript, import statements that only import types should be removed. - * This includes `import {} from 'foo';`, but not `import 'foo';`. - */ - pruneTypeOnlyImports() { - this.nonTypeIdentifiers = getNonTypeIdentifiers(this.tokens, this.options); - for (const [path, importInfo] of this.importInfoByPath.entries()) { - if ( - importInfo.hasBareImport || - importInfo.hasStarExport || - importInfo.exportStarNames.length > 0 || - importInfo.namedExports.length > 0 - ) { - continue; - } - const names = [ - ...importInfo.defaultNames, - ...importInfo.wildcardNames, - ...importInfo.namedImports.map(({localName}) => localName), - ]; - if (names.every((name) => this.shouldAutomaticallyElideImportedName(name))) { - this.importsToReplace.set(path, ""); - } - } - } - - shouldAutomaticallyElideImportedName(name) { - return ( - this.isTypeScriptTransformEnabled && - !this.keepUnusedImports && - !this.nonTypeIdentifiers.has(name) - ); - } - - generateImportReplacements() { - for (const [path, importInfo] of this.importInfoByPath.entries()) { - const { - defaultNames, - wildcardNames, - namedImports, - namedExports, - exportStarNames, - hasStarExport, - } = importInfo; - - if ( - defaultNames.length === 0 && - wildcardNames.length === 0 && - namedImports.length === 0 && - namedExports.length === 0 && - exportStarNames.length === 0 && - !hasStarExport - ) { - // Import is never used, so don't even assign a name. - this.importsToReplace.set(path, `require('${path}');`); - continue; - } - - const primaryImportName = this.getFreeIdentifierForPath(path); - let secondaryImportName; - if (this.enableLegacyTypeScriptModuleInterop) { - secondaryImportName = primaryImportName; - } else { - secondaryImportName = - wildcardNames.length > 0 ? wildcardNames[0] : this.getFreeIdentifierForPath(path); - } - let requireCode = `var ${primaryImportName} = require('${path}');`; - if (wildcardNames.length > 0) { - for (const wildcardName of wildcardNames) { - const moduleExpr = this.enableLegacyTypeScriptModuleInterop - ? primaryImportName - : `${this.helperManager.getHelperName("interopRequireWildcard")}(${primaryImportName})`; - requireCode += ` var ${wildcardName} = ${moduleExpr};`; - } - } else if (exportStarNames.length > 0 && secondaryImportName !== primaryImportName) { - requireCode += ` var ${secondaryImportName} = ${this.helperManager.getHelperName( - "interopRequireWildcard", - )}(${primaryImportName});`; - } else if (defaultNames.length > 0 && secondaryImportName !== primaryImportName) { - requireCode += ` var ${secondaryImportName} = ${this.helperManager.getHelperName( - "interopRequireDefault", - )}(${primaryImportName});`; - } - - for (const {importedName, localName} of namedExports) { - requireCode += ` ${this.helperManager.getHelperName( - "createNamedExportFrom", - )}(${primaryImportName}, '${localName}', '${importedName}');`; - } - for (const exportStarName of exportStarNames) { - requireCode += ` exports.${exportStarName} = ${secondaryImportName};`; - } - if (hasStarExport) { - requireCode += ` ${this.helperManager.getHelperName( - "createStarExport", - )}(${primaryImportName});`; - } - - this.importsToReplace.set(path, requireCode); - - for (const defaultName of defaultNames) { - this.identifierReplacements.set(defaultName, `${secondaryImportName}.default`); - } - for (const {importedName, localName} of namedImports) { - this.identifierReplacements.set(localName, `${primaryImportName}.${importedName}`); - } - } - } - - getFreeIdentifierForPath(path) { - const components = path.split("/"); - const lastComponent = components[components.length - 1]; - const baseName = lastComponent.replace(/\W/g, ""); - return this.nameManager.claimFreeName(`_${baseName}`); - } - - preprocessImportAtIndex(index) { - const defaultNames = []; - const wildcardNames = []; - const namedImports = []; - - index++; - if ( - (this.tokens.matchesContextualAtIndex(index, ContextualKeyword._type) || - this.tokens.matches1AtIndex(index, tt._typeof)) && - !this.tokens.matches1AtIndex(index + 1, tt.comma) && - !this.tokens.matchesContextualAtIndex(index + 1, ContextualKeyword._from) - ) { - // import type declaration, so no need to process anything. - return; - } - - if (this.tokens.matches1AtIndex(index, tt.parenL)) { - // Dynamic import, so nothing to do - return; - } - - if (this.tokens.matches1AtIndex(index, tt.name)) { - defaultNames.push(this.tokens.identifierNameAtIndex(index)); - index++; - if (this.tokens.matches1AtIndex(index, tt.comma)) { - index++; - } - } - - if (this.tokens.matches1AtIndex(index, tt.star)) { - // * as - index += 2; - wildcardNames.push(this.tokens.identifierNameAtIndex(index)); - index++; - } - - if (this.tokens.matches1AtIndex(index, tt.braceL)) { - const result = this.getNamedImports(index + 1); - index = result.newIndex; - - for (const namedImport of result.namedImports) { - // Treat {default as X} as a default import to ensure usage of require interop helper - if (namedImport.importedName === "default") { - defaultNames.push(namedImport.localName); - } else { - namedImports.push(namedImport); - } - } - } - - if (this.tokens.matchesContextualAtIndex(index, ContextualKeyword._from)) { - index++; - } - - if (!this.tokens.matches1AtIndex(index, tt.string)) { - throw new Error("Expected string token at the end of import statement."); - } - const path = this.tokens.stringValueAtIndex(index); - const importInfo = this.getImportInfo(path); - importInfo.defaultNames.push(...defaultNames); - importInfo.wildcardNames.push(...wildcardNames); - importInfo.namedImports.push(...namedImports); - if (defaultNames.length === 0 && wildcardNames.length === 0 && namedImports.length === 0) { - importInfo.hasBareImport = true; - } - } - - preprocessExportAtIndex(index) { - if ( - this.tokens.matches2AtIndex(index, tt._export, tt._var) || - this.tokens.matches2AtIndex(index, tt._export, tt._let) || - this.tokens.matches2AtIndex(index, tt._export, tt._const) - ) { - this.preprocessVarExportAtIndex(index); - } else if ( - this.tokens.matches2AtIndex(index, tt._export, tt._function) || - this.tokens.matches2AtIndex(index, tt._export, tt._class) - ) { - const exportName = this.tokens.identifierNameAtIndex(index + 2); - this.addExportBinding(exportName, exportName); - } else if (this.tokens.matches3AtIndex(index, tt._export, tt.name, tt._function)) { - const exportName = this.tokens.identifierNameAtIndex(index + 3); - this.addExportBinding(exportName, exportName); - } else if (this.tokens.matches2AtIndex(index, tt._export, tt.braceL)) { - this.preprocessNamedExportAtIndex(index); - } else if (this.tokens.matches2AtIndex(index, tt._export, tt.star)) { - this.preprocessExportStarAtIndex(index); - } - } - - preprocessVarExportAtIndex(index) { - let depth = 0; - // Handle cases like `export let {x} = y;`, starting at the open-brace in that case. - for (let i = index + 2; ; i++) { - if ( - this.tokens.matches1AtIndex(i, tt.braceL) || - this.tokens.matches1AtIndex(i, tt.dollarBraceL) || - this.tokens.matches1AtIndex(i, tt.bracketL) - ) { - depth++; - } else if ( - this.tokens.matches1AtIndex(i, tt.braceR) || - this.tokens.matches1AtIndex(i, tt.bracketR) - ) { - depth--; - } else if (depth === 0 && !this.tokens.matches1AtIndex(i, tt.name)) { - break; - } else if (this.tokens.matches1AtIndex(1, tt.eq)) { - const endIndex = this.tokens.currentToken().rhsEndIndex; - if (endIndex == null) { - throw new Error("Expected = token with an end index."); - } - i = endIndex - 1; - } else { - const token = this.tokens.tokens[i]; - if (isDeclaration(token)) { - const exportName = this.tokens.identifierNameAtIndex(i); - this.identifierReplacements.set(exportName, `exports.${exportName}`); - } - } - } - } - - /** - * Walk this export statement just in case it's an export...from statement. - * If it is, combine it into the import info for that path. Otherwise, just - * bail out; it'll be handled later. - */ - preprocessNamedExportAtIndex(index) { - // export { - index += 2; - const {newIndex, namedImports} = this.getNamedImports(index); - index = newIndex; - - if (this.tokens.matchesContextualAtIndex(index, ContextualKeyword._from)) { - index++; - } else { - // Reinterpret "a as b" to be local/exported rather than imported/local. - for (const {importedName: localName, localName: exportedName} of namedImports) { - this.addExportBinding(localName, exportedName); - } - return; - } - - if (!this.tokens.matches1AtIndex(index, tt.string)) { - throw new Error("Expected string token at the end of import statement."); - } - const path = this.tokens.stringValueAtIndex(index); - const importInfo = this.getImportInfo(path); - importInfo.namedExports.push(...namedImports); - } - - preprocessExportStarAtIndex(index) { - let exportedName = null; - if (this.tokens.matches3AtIndex(index, tt._export, tt.star, tt._as)) { - // export * as - index += 3; - exportedName = this.tokens.identifierNameAtIndex(index); - // foo from - index += 2; - } else { - // export * from - index += 3; - } - if (!this.tokens.matches1AtIndex(index, tt.string)) { - throw new Error("Expected string token at the end of star export statement."); - } - const path = this.tokens.stringValueAtIndex(index); - const importInfo = this.getImportInfo(path); - if (exportedName !== null) { - importInfo.exportStarNames.push(exportedName); - } else { - importInfo.hasStarExport = true; - } - } - - getNamedImports(index) { - const namedImports = []; - while (true) { - if (this.tokens.matches1AtIndex(index, tt.braceR)) { - index++; - break; - } - - const specifierInfo = getImportExportSpecifierInfo(this.tokens, index); - index = specifierInfo.endIndex; - if (!specifierInfo.isType) { - namedImports.push({ - importedName: specifierInfo.leftName, - localName: specifierInfo.rightName, - }); - } - - if (this.tokens.matches2AtIndex(index, tt.comma, tt.braceR)) { - index += 2; - break; - } else if (this.tokens.matches1AtIndex(index, tt.braceR)) { - index++; - break; - } else if (this.tokens.matches1AtIndex(index, tt.comma)) { - index++; - } else { - throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.tokens[index])}`); - } - } - return {newIndex: index, namedImports}; - } - - /** - * Get a mutable import info object for this path, creating one if it doesn't - * exist yet. - */ - getImportInfo(path) { - const existingInfo = this.importInfoByPath.get(path); - if (existingInfo) { - return existingInfo; - } - const newInfo = { - defaultNames: [], - wildcardNames: [], - namedImports: [], - namedExports: [], - hasBareImport: false, - exportStarNames: [], - hasStarExport: false, - }; - this.importInfoByPath.set(path, newInfo); - return newInfo; - } - - addExportBinding(localName, exportedName) { - if (!this.exportBindingsByLocalName.has(localName)) { - this.exportBindingsByLocalName.set(localName, []); - } - this.exportBindingsByLocalName.get(localName).push(exportedName); - } - - /** - * Return the code to use for the import for this path, or the empty string if - * the code has already been "claimed" by a previous import. - */ - claimImportCode(importPath) { - const result = this.importsToReplace.get(importPath); - this.importsToReplace.set(importPath, ""); - return result || ""; - } - - getIdentifierReplacement(identifierName) { - return this.identifierReplacements.get(identifierName) || null; - } - - /** - * Return a string like `exports.foo = exports.bar`. - */ - resolveExportBinding(assignedName) { - const exportedNames = this.exportBindingsByLocalName.get(assignedName); - if (!exportedNames || exportedNames.length === 0) { - return null; - } - return exportedNames.map((exportedName) => `exports.${exportedName}`).join(" = "); - } - - /** - * Return all imported/exported names where we might be interested in whether usages of those - * names are shadowed. - */ - getGlobalNames() { - return new Set([ - ...this.identifierReplacements.keys(), - ...this.exportBindingsByLocalName.keys(), - ]); - } -} diff --git a/node_modules/sucrase/dist/esm/HelperManager.js b/node_modules/sucrase/dist/esm/HelperManager.js deleted file mode 100644 index 7964db3..0000000 --- a/node_modules/sucrase/dist/esm/HelperManager.js +++ /dev/null @@ -1,176 +0,0 @@ - - -const HELPERS = { - require: ` - import {createRequire as CREATE_REQUIRE_NAME} from "module"; - const require = CREATE_REQUIRE_NAME(import.meta.url); - `, - interopRequireWildcard: ` - function interopRequireWildcard(obj) { - if (obj && obj.__esModule) { - return obj; - } else { - var newObj = {}; - if (obj != null) { - for (var key in obj) { - if (Object.prototype.hasOwnProperty.call(obj, key)) { - newObj[key] = obj[key]; - } - } - } - newObj.default = obj; - return newObj; - } - } - `, - interopRequireDefault: ` - function interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { default: obj }; - } - `, - createNamedExportFrom: ` - function createNamedExportFrom(obj, localName, importedName) { - Object.defineProperty(exports, localName, {enumerable: true, configurable: true, get: () => obj[importedName]}); - } - `, - // Note that TypeScript and Babel do this differently; TypeScript does a simple existence - // check in the exports object and does a plain assignment, whereas Babel uses - // defineProperty and builds an object of explicitly-exported names so that star exports can - // always take lower precedence. For now, we do the easier TypeScript thing. - createStarExport: ` - function createStarExport(obj) { - Object.keys(obj) - .filter((key) => key !== "default" && key !== "__esModule") - .forEach((key) => { - if (exports.hasOwnProperty(key)) { - return; - } - Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); - }); - } - `, - nullishCoalesce: ` - function nullishCoalesce(lhs, rhsFn) { - if (lhs != null) { - return lhs; - } else { - return rhsFn(); - } - } - `, - asyncNullishCoalesce: ` - async function asyncNullishCoalesce(lhs, rhsFn) { - if (lhs != null) { - return lhs; - } else { - return await rhsFn(); - } - } - `, - optionalChain: ` - function optionalChain(ops) { - let lastAccessLHS = undefined; - let value = ops[0]; - let i = 1; - while (i < ops.length) { - const op = ops[i]; - const fn = ops[i + 1]; - i += 2; - if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { - return undefined; - } - if (op === 'access' || op === 'optionalAccess') { - lastAccessLHS = value; - value = fn(value); - } else if (op === 'call' || op === 'optionalCall') { - value = fn((...args) => value.call(lastAccessLHS, ...args)); - lastAccessLHS = undefined; - } - } - return value; - } - `, - asyncOptionalChain: ` - async function asyncOptionalChain(ops) { - let lastAccessLHS = undefined; - let value = ops[0]; - let i = 1; - while (i < ops.length) { - const op = ops[i]; - const fn = ops[i + 1]; - i += 2; - if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { - return undefined; - } - if (op === 'access' || op === 'optionalAccess') { - lastAccessLHS = value; - value = await fn(value); - } else if (op === 'call' || op === 'optionalCall') { - value = await fn((...args) => value.call(lastAccessLHS, ...args)); - lastAccessLHS = undefined; - } - } - return value; - } - `, - optionalChainDelete: ` - function optionalChainDelete(ops) { - const result = OPTIONAL_CHAIN_NAME(ops); - return result == null ? true : result; - } - `, - asyncOptionalChainDelete: ` - async function asyncOptionalChainDelete(ops) { - const result = await ASYNC_OPTIONAL_CHAIN_NAME(ops); - return result == null ? true : result; - } - `, -}; - -export class HelperManager { - __init() {this.helperNames = {}} - __init2() {this.createRequireName = null} - constructor( nameManager) {;this.nameManager = nameManager;HelperManager.prototype.__init.call(this);HelperManager.prototype.__init2.call(this);} - - getHelperName(baseName) { - let helperName = this.helperNames[baseName]; - if (helperName) { - return helperName; - } - helperName = this.nameManager.claimFreeName(`_${baseName}`); - this.helperNames[baseName] = helperName; - return helperName; - } - - emitHelpers() { - let resultCode = ""; - if (this.helperNames.optionalChainDelete) { - this.getHelperName("optionalChain"); - } - if (this.helperNames.asyncOptionalChainDelete) { - this.getHelperName("asyncOptionalChain"); - } - for (const [baseName, helperCodeTemplate] of Object.entries(HELPERS)) { - const helperName = this.helperNames[baseName]; - let helperCode = helperCodeTemplate; - if (baseName === "optionalChainDelete") { - helperCode = helperCode.replace("OPTIONAL_CHAIN_NAME", this.helperNames.optionalChain); - } else if (baseName === "asyncOptionalChainDelete") { - helperCode = helperCode.replace( - "ASYNC_OPTIONAL_CHAIN_NAME", - this.helperNames.asyncOptionalChain, - ); - } else if (baseName === "require") { - if (this.createRequireName === null) { - this.createRequireName = this.nameManager.claimFreeName("_createRequire"); - } - helperCode = helperCode.replace(/CREATE_REQUIRE_NAME/g, this.createRequireName); - } - if (helperName) { - resultCode += " "; - resultCode += helperCode.replace(baseName, helperName).replace(/\s+/g, " ").trim(); - } - } - return resultCode; - } -} diff --git a/node_modules/sucrase/dist/esm/NameManager.js b/node_modules/sucrase/dist/esm/NameManager.js deleted file mode 100644 index 47d2c9f..0000000 --- a/node_modules/sucrase/dist/esm/NameManager.js +++ /dev/null @@ -1,27 +0,0 @@ - -import getIdentifierNames from "./util/getIdentifierNames"; - -export default class NameManager { - __init() {this.usedNames = new Set()} - - constructor(code, tokens) {;NameManager.prototype.__init.call(this); - this.usedNames = new Set(getIdentifierNames(code, tokens)); - } - - claimFreeName(name) { - const newName = this.findFreeName(name); - this.usedNames.add(newName); - return newName; - } - - findFreeName(name) { - if (!this.usedNames.has(name)) { - return name; - } - let suffixNum = 2; - while (this.usedNames.has(name + String(suffixNum))) { - suffixNum++; - } - return name + String(suffixNum); - } -} diff --git a/node_modules/sucrase/dist/esm/Options-gen-types.js b/node_modules/sucrase/dist/esm/Options-gen-types.js deleted file mode 100644 index 5c39c2c..0000000 --- a/node_modules/sucrase/dist/esm/Options-gen-types.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This module was automatically generated by `ts-interface-builder` - */ -import * as t from "ts-interface-checker"; -// tslint:disable:object-literal-key-quotes - -export const Transform = t.union( - t.lit("jsx"), - t.lit("typescript"), - t.lit("flow"), - t.lit("imports"), - t.lit("react-hot-loader"), - t.lit("jest"), -); - -export const SourceMapOptions = t.iface([], { - compiledFilename: "string", -}); - -export const Options = t.iface([], { - transforms: t.array("Transform"), - disableESTransforms: t.opt("boolean"), - jsxRuntime: t.opt(t.union(t.lit("classic"), t.lit("automatic"), t.lit("preserve"))), - production: t.opt("boolean"), - jsxImportSource: t.opt("string"), - jsxPragma: t.opt("string"), - jsxFragmentPragma: t.opt("string"), - keepUnusedImports: t.opt("boolean"), - preserveDynamicImport: t.opt("boolean"), - injectCreateRequireForImportRequire: t.opt("boolean"), - enableLegacyTypeScriptModuleInterop: t.opt("boolean"), - enableLegacyBabel5ModuleInterop: t.opt("boolean"), - sourceMapOptions: t.opt("SourceMapOptions"), - filePath: t.opt("string"), -}); - -const exportedTypeSuite = { - Transform, - SourceMapOptions, - Options, -}; -export default exportedTypeSuite; diff --git a/node_modules/sucrase/dist/esm/Options.js b/node_modules/sucrase/dist/esm/Options.js deleted file mode 100644 index 83ee83d..0000000 --- a/node_modules/sucrase/dist/esm/Options.js +++ /dev/null @@ -1,101 +0,0 @@ -import {createCheckers} from "ts-interface-checker"; - -import OptionsGenTypes from "./Options-gen-types"; - -const {Options: OptionsChecker} = createCheckers(OptionsGenTypes); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -export function validateOptions(options) { - OptionsChecker.strictCheck(options); -} diff --git a/node_modules/sucrase/dist/esm/TokenProcessor.js b/node_modules/sucrase/dist/esm/TokenProcessor.js deleted file mode 100644 index 5335f23..0000000 --- a/node_modules/sucrase/dist/esm/TokenProcessor.js +++ /dev/null @@ -1,357 +0,0 @@ - - - -import { TokenType as tt} from "./parser/tokenizer/types"; -import isAsyncOperation from "./util/isAsyncOperation"; - - - - - - - - - - - -export default class TokenProcessor { - __init() {this.resultCode = ""} - // Array mapping input token index to optional string index position in the - // output code. - __init2() {this.resultMappings = new Array(this.tokens.length)} - __init3() {this.tokenIndex = 0} - - constructor( - code, - tokens, - isFlowEnabled, - disableESTransforms, - helperManager, - ) {;this.code = code;this.tokens = tokens;this.isFlowEnabled = isFlowEnabled;this.disableESTransforms = disableESTransforms;this.helperManager = helperManager;TokenProcessor.prototype.__init.call(this);TokenProcessor.prototype.__init2.call(this);TokenProcessor.prototype.__init3.call(this);} - - /** - * Snapshot the token state in a way that can be restored later, useful for - * things like lookahead. - * - * resultMappings do not need to be copied since in all use cases, they will - * be overwritten anyway after restore. - */ - snapshot() { - return { - resultCode: this.resultCode, - tokenIndex: this.tokenIndex, - }; - } - - restoreToSnapshot(snapshot) { - this.resultCode = snapshot.resultCode; - this.tokenIndex = snapshot.tokenIndex; - } - - /** - * Remove and return the code generated since the snapshot, leaving the - * current token position in-place. Unlike most TokenProcessor operations, - * this operation can result in input/output line number mismatches because - * the removed code may contain newlines, so this operation should be used - * sparingly. - */ - dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot) { - const result = this.resultCode.slice(snapshot.resultCode.length); - this.resultCode = snapshot.resultCode; - return result; - } - - reset() { - this.resultCode = ""; - this.resultMappings = new Array(this.tokens.length); - this.tokenIndex = 0; - } - - matchesContextualAtIndex(index, contextualKeyword) { - return ( - this.matches1AtIndex(index, tt.name) && - this.tokens[index].contextualKeyword === contextualKeyword - ); - } - - identifierNameAtIndex(index) { - // TODO: We need to process escapes since technically you can have unicode escapes in variable - // names. - return this.identifierNameForToken(this.tokens[index]); - } - - identifierNameAtRelativeIndex(relativeIndex) { - return this.identifierNameForToken(this.tokenAtRelativeIndex(relativeIndex)); - } - - identifierName() { - return this.identifierNameForToken(this.currentToken()); - } - - identifierNameForToken(token) { - return this.code.slice(token.start, token.end); - } - - rawCodeForToken(token) { - return this.code.slice(token.start, token.end); - } - - stringValueAtIndex(index) { - return this.stringValueForToken(this.tokens[index]); - } - - stringValue() { - return this.stringValueForToken(this.currentToken()); - } - - stringValueForToken(token) { - // This is used to identify when two imports are the same and to resolve TypeScript enum keys. - // Ideally we'd process escapes within the strings, but for now we pretty much take the raw - // code. - return this.code.slice(token.start + 1, token.end - 1); - } - - matches1AtIndex(index, t1) { - return this.tokens[index].type === t1; - } - - matches2AtIndex(index, t1, t2) { - return this.tokens[index].type === t1 && this.tokens[index + 1].type === t2; - } - - matches3AtIndex(index, t1, t2, t3) { - return ( - this.tokens[index].type === t1 && - this.tokens[index + 1].type === t2 && - this.tokens[index + 2].type === t3 - ); - } - - matches1(t1) { - return this.tokens[this.tokenIndex].type === t1; - } - - matches2(t1, t2) { - return this.tokens[this.tokenIndex].type === t1 && this.tokens[this.tokenIndex + 1].type === t2; - } - - matches3(t1, t2, t3) { - return ( - this.tokens[this.tokenIndex].type === t1 && - this.tokens[this.tokenIndex + 1].type === t2 && - this.tokens[this.tokenIndex + 2].type === t3 - ); - } - - matches4(t1, t2, t3, t4) { - return ( - this.tokens[this.tokenIndex].type === t1 && - this.tokens[this.tokenIndex + 1].type === t2 && - this.tokens[this.tokenIndex + 2].type === t3 && - this.tokens[this.tokenIndex + 3].type === t4 - ); - } - - matches5(t1, t2, t3, t4, t5) { - return ( - this.tokens[this.tokenIndex].type === t1 && - this.tokens[this.tokenIndex + 1].type === t2 && - this.tokens[this.tokenIndex + 2].type === t3 && - this.tokens[this.tokenIndex + 3].type === t4 && - this.tokens[this.tokenIndex + 4].type === t5 - ); - } - - matchesContextual(contextualKeyword) { - return this.matchesContextualAtIndex(this.tokenIndex, contextualKeyword); - } - - matchesContextIdAndLabel(type, contextId) { - return this.matches1(type) && this.currentToken().contextId === contextId; - } - - previousWhitespaceAndComments() { - let whitespaceAndComments = this.code.slice( - this.tokenIndex > 0 ? this.tokens[this.tokenIndex - 1].end : 0, - this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex].start : this.code.length, - ); - if (this.isFlowEnabled) { - whitespaceAndComments = whitespaceAndComments.replace(/@flow/g, ""); - } - return whitespaceAndComments; - } - - replaceToken(newCode) { - this.resultCode += this.previousWhitespaceAndComments(); - this.appendTokenPrefix(); - this.resultMappings[this.tokenIndex] = this.resultCode.length; - this.resultCode += newCode; - this.appendTokenSuffix(); - this.tokenIndex++; - } - - replaceTokenTrimmingLeftWhitespace(newCode) { - this.resultCode += this.previousWhitespaceAndComments().replace(/[^\r\n]/g, ""); - this.appendTokenPrefix(); - this.resultMappings[this.tokenIndex] = this.resultCode.length; - this.resultCode += newCode; - this.appendTokenSuffix(); - this.tokenIndex++; - } - - removeInitialToken() { - this.replaceToken(""); - } - - removeToken() { - this.replaceTokenTrimmingLeftWhitespace(""); - } - - /** - * Remove all code until the next }, accounting for balanced braces. - */ - removeBalancedCode() { - let braceDepth = 0; - while (!this.isAtEnd()) { - if (this.matches1(tt.braceL)) { - braceDepth++; - } else if (this.matches1(tt.braceR)) { - if (braceDepth === 0) { - return; - } - braceDepth--; - } - this.removeToken(); - } - } - - copyExpectedToken(tokenType) { - if (this.tokens[this.tokenIndex].type !== tokenType) { - throw new Error(`Expected token ${tokenType}`); - } - this.copyToken(); - } - - copyToken() { - this.resultCode += this.previousWhitespaceAndComments(); - this.appendTokenPrefix(); - this.resultMappings[this.tokenIndex] = this.resultCode.length; - this.resultCode += this.code.slice( - this.tokens[this.tokenIndex].start, - this.tokens[this.tokenIndex].end, - ); - this.appendTokenSuffix(); - this.tokenIndex++; - } - - copyTokenWithPrefix(prefix) { - this.resultCode += this.previousWhitespaceAndComments(); - this.appendTokenPrefix(); - this.resultCode += prefix; - this.resultMappings[this.tokenIndex] = this.resultCode.length; - this.resultCode += this.code.slice( - this.tokens[this.tokenIndex].start, - this.tokens[this.tokenIndex].end, - ); - this.appendTokenSuffix(); - this.tokenIndex++; - } - - appendTokenPrefix() { - const token = this.currentToken(); - if (token.numNullishCoalesceStarts || token.isOptionalChainStart) { - token.isAsyncOperation = isAsyncOperation(this); - } - if (this.disableESTransforms) { - return; - } - if (token.numNullishCoalesceStarts) { - for (let i = 0; i < token.numNullishCoalesceStarts; i++) { - if (token.isAsyncOperation) { - this.resultCode += "await "; - this.resultCode += this.helperManager.getHelperName("asyncNullishCoalesce"); - } else { - this.resultCode += this.helperManager.getHelperName("nullishCoalesce"); - } - this.resultCode += "("; - } - } - if (token.isOptionalChainStart) { - if (token.isAsyncOperation) { - this.resultCode += "await "; - } - if (this.tokenIndex > 0 && this.tokenAtRelativeIndex(-1).type === tt._delete) { - if (token.isAsyncOperation) { - this.resultCode += this.helperManager.getHelperName("asyncOptionalChainDelete"); - } else { - this.resultCode += this.helperManager.getHelperName("optionalChainDelete"); - } - } else if (token.isAsyncOperation) { - this.resultCode += this.helperManager.getHelperName("asyncOptionalChain"); - } else { - this.resultCode += this.helperManager.getHelperName("optionalChain"); - } - this.resultCode += "(["; - } - } - - appendTokenSuffix() { - const token = this.currentToken(); - if (token.isOptionalChainEnd && !this.disableESTransforms) { - this.resultCode += "])"; - } - if (token.numNullishCoalesceEnds && !this.disableESTransforms) { - for (let i = 0; i < token.numNullishCoalesceEnds; i++) { - this.resultCode += "))"; - } - } - } - - appendCode(code) { - this.resultCode += code; - } - - currentToken() { - return this.tokens[this.tokenIndex]; - } - - currentTokenCode() { - const token = this.currentToken(); - return this.code.slice(token.start, token.end); - } - - tokenAtRelativeIndex(relativeIndex) { - return this.tokens[this.tokenIndex + relativeIndex]; - } - - currentIndex() { - return this.tokenIndex; - } - - /** - * Move to the next token. Only suitable in preprocessing steps. When - * generating new code, you should use copyToken or removeToken. - */ - nextToken() { - if (this.tokenIndex === this.tokens.length) { - throw new Error("Unexpectedly reached end of input."); - } - this.tokenIndex++; - } - - previousToken() { - this.tokenIndex--; - } - - finish() { - if (this.tokenIndex !== this.tokens.length) { - throw new Error("Tried to finish processing tokens before reaching the end."); - } - this.resultCode += this.previousWhitespaceAndComments(); - return {code: this.resultCode, mappings: this.resultMappings}; - } - - isAtEnd() { - return this.tokenIndex === this.tokens.length; - } -} diff --git a/node_modules/sucrase/dist/esm/cli.js b/node_modules/sucrase/dist/esm/cli.js deleted file mode 100644 index 08acead..0000000 --- a/node_modules/sucrase/dist/esm/cli.js +++ /dev/null @@ -1,317 +0,0 @@ -/* eslint-disable no-console */ -import commander from "commander"; -import {glob} from "tinyglobby"; -import {exists, mkdir, readdir, readFile, stat, writeFile} from "mz/fs"; -import {dirname, join, relative} from "path"; - -import { transform} from "./index"; - - - - - - - - - - - -export default function run() { - commander - .description(`Sucrase: super-fast Babel alternative.`) - .usage("[options] ") - .option( - "-d, --out-dir ", - "Compile an input directory of modules into an output directory.", - ) - .option( - "-p, --project ", - "Compile a TypeScript project, will read from tsconfig.json in ", - ) - .option("--out-extension ", "File extension to use for all output files.", "js") - .option("--exclude-dirs ", "Names of directories that should not be traversed.") - .option("-q, --quiet", "Don't print the names of converted files.") - .option("-t, --transforms ", "Comma-separated list of transforms to run.") - .option("--disable-es-transforms", "Opt out of all ES syntax transforms.") - .option("--jsx-runtime ", "Transformation mode for the JSX transform.") - .option("--production", "Disable debugging information from JSX in output.") - .option( - "--jsx-import-source ", - "Automatic JSX transform import path prefix, defaults to `React.Fragment`.", - ) - .option( - "--jsx-pragma ", - "Classic JSX transform element creation function, defaults to `React.createElement`.", - ) - .option( - "--jsx-fragment-pragma ", - "Classic JSX transform fragment component, defaults to `React.Fragment`.", - ) - .option("--keep-unused-imports", "Disable automatic removal of type-only imports/exports.") - .option("--preserve-dynamic-import", "Don't transpile dynamic import() to require.") - .option( - "--inject-create-require-for-import-require", - "Use `createRequire` when transpiling TS `import = require` to ESM.", - ) - .option( - "--enable-legacy-typescript-module-interop", - "Use default TypeScript ESM/CJS interop strategy.", - ) - .option("--enable-legacy-babel5-module-interop", "Use Babel 5 ESM/CJS interop strategy.") - .parse(process.argv); - - if (commander.project) { - if ( - commander.outDir || - commander.transforms || - commander.args[0] || - commander.enableLegacyTypescriptModuleInterop - ) { - console.error( - "If TypeScript project is specified, out directory, transforms, source " + - "directory, and --enable-legacy-typescript-module-interop may not be specified.", - ); - process.exit(1); - } - } else { - if (!commander.outDir) { - console.error("Out directory is required"); - process.exit(1); - } - - if (!commander.transforms) { - console.error("Transforms option is required."); - process.exit(1); - } - - if (!commander.args[0]) { - console.error("Source directory is required."); - process.exit(1); - } - } - - const options = { - outDirPath: commander.outDir, - srcDirPath: commander.args[0], - project: commander.project, - outExtension: commander.outExtension, - excludeDirs: commander.excludeDirs ? commander.excludeDirs.split(",") : [], - quiet: commander.quiet, - sucraseOptions: { - transforms: commander.transforms ? commander.transforms.split(",") : [], - disableESTransforms: commander.disableEsTransforms, - jsxRuntime: commander.jsxRuntime, - production: commander.production, - jsxImportSource: commander.jsxImportSource, - jsxPragma: commander.jsxPragma || "React.createElement", - jsxFragmentPragma: commander.jsxFragmentPragma || "React.Fragment", - keepUnusedImports: commander.keepUnusedImports, - preserveDynamicImport: commander.preserveDynamicImport, - injectCreateRequireForImportRequire: commander.injectCreateRequireForImportRequire, - enableLegacyTypeScriptModuleInterop: commander.enableLegacyTypescriptModuleInterop, - enableLegacyBabel5ModuleInterop: commander.enableLegacyBabel5ModuleInterop, - }, - }; - - buildDirectory(options).catch((e) => { - process.exitCode = 1; - console.error(e); - }); -} - - - - - - -async function findFiles(options) { - const outDirPath = options.outDirPath; - const srcDirPath = options.srcDirPath; - - const extensions = options.sucraseOptions.transforms.includes("typescript") - ? [".ts", ".tsx"] - : [".js", ".jsx"]; - - if (!(await exists(outDirPath))) { - await mkdir(outDirPath); - } - - const outArr = []; - for (const child of await readdir(srcDirPath)) { - if (["node_modules", ".git"].includes(child) || options.excludeDirs.includes(child)) { - continue; - } - const srcChildPath = join(srcDirPath, child); - const outChildPath = join(outDirPath, child); - if ((await stat(srcChildPath)).isDirectory()) { - const innerOptions = {...options}; - innerOptions.srcDirPath = srcChildPath; - innerOptions.outDirPath = outChildPath; - const innerFiles = await findFiles(innerOptions); - outArr.push(...innerFiles); - } else if (extensions.some((ext) => srcChildPath.endsWith(ext))) { - const outPath = outChildPath.replace(/\.\w+$/, `.${options.outExtension}`); - outArr.push({ - srcPath: srcChildPath, - outPath, - }); - } - } - - return outArr; -} - -async function runGlob(options) { - const tsConfigPath = join(options.project, "tsconfig.json"); - - let str; - try { - str = await readFile(tsConfigPath, "utf8"); - } catch (err) { - console.error("Could not find project tsconfig.json"); - console.error(` --project=${options.project}`); - console.error(err); - process.exit(1); - } - const json = JSON.parse(str); - - const foundFiles = []; - - const files = json.files; - const include = json.include; - - const absProject = join(process.cwd(), options.project); - const outDirs = []; - - if (!(await exists(options.outDirPath))) { - await mkdir(options.outDirPath); - } - - if (files) { - for (const file of files) { - if (file.endsWith(".d.ts")) { - continue; - } - if (!file.endsWith(".ts") && !file.endsWith(".js")) { - continue; - } - - const srcFile = join(absProject, file); - const outFile = join(options.outDirPath, file); - const outPath = outFile.replace(/\.\w+$/, `.${options.outExtension}`); - - const outDir = dirname(outPath); - if (!outDirs.includes(outDir)) { - outDirs.push(outDir); - } - - foundFiles.push({ - srcPath: srcFile, - outPath, - }); - } - } - if (include) { - for (const pattern of include) { - const globFiles = await glob(join(absProject, pattern), {expandDirectories: false}); - for (const file of globFiles) { - if (!file.endsWith(".ts") && !file.endsWith(".js")) { - continue; - } - if (file.endsWith(".d.ts")) { - continue; - } - - const relativeFile = relative(absProject, file); - const outFile = join(options.outDirPath, relativeFile); - const outPath = outFile.replace(/\.\w+$/, `.${options.outExtension}`); - - const outDir = dirname(outPath); - if (!outDirs.includes(outDir)) { - outDirs.push(outDir); - } - - foundFiles.push({ - srcPath: file, - outPath, - }); - } - } - } - - for (const outDirPath of outDirs) { - if (!(await exists(outDirPath))) { - await mkdir(outDirPath); - } - } - - // TODO: read exclude - - return foundFiles; -} - -async function updateOptionsFromProject(options) { - /** - * Read the project information and assign the following. - * - outDirPath - * - transform: imports - * - transform: typescript - * - enableLegacyTypescriptModuleInterop: true/false. - */ - - const tsConfigPath = join(options.project, "tsconfig.json"); - - let str; - try { - str = await readFile(tsConfigPath, "utf8"); - } catch (err) { - console.error("Could not find project tsconfig.json"); - console.error(` --project=${options.project}`); - console.error(err); - process.exit(1); - } - const json = JSON.parse(str); - const sucraseOpts = options.sucraseOptions; - if (!sucraseOpts.transforms.includes("typescript")) { - sucraseOpts.transforms.push("typescript"); - } - - const compilerOpts = json.compilerOptions; - if (compilerOpts.outDir) { - options.outDirPath = join(process.cwd(), options.project, compilerOpts.outDir); - } - if (compilerOpts.esModuleInterop !== true) { - sucraseOpts.enableLegacyTypeScriptModuleInterop = true; - } - if (compilerOpts.module === "commonjs") { - if (!sucraseOpts.transforms.includes("imports")) { - sucraseOpts.transforms.push("imports"); - } - } -} - -async function buildDirectory(options) { - let files; - if (options.outDirPath && options.srcDirPath) { - files = await findFiles(options); - } else if (options.project) { - await updateOptionsFromProject(options); - files = await runGlob(options); - } else { - console.error("Project or Source directory required."); - process.exit(1); - } - - for (const file of files) { - await buildFile(file.srcPath, file.outPath, options); - } -} - -async function buildFile(srcPath, outPath, options) { - if (!options.quiet) { - console.log(`${srcPath} -> ${outPath}`); - } - const code = (await readFile(srcPath)).toString(); - const transformedCode = transform(code, {...options.sucraseOptions, filePath: srcPath}).code; - await writeFile(outPath, transformedCode); -} diff --git a/node_modules/sucrase/dist/esm/computeSourceMap.js b/node_modules/sucrase/dist/esm/computeSourceMap.js deleted file mode 100644 index 699ea78..0000000 --- a/node_modules/sucrase/dist/esm/computeSourceMap.js +++ /dev/null @@ -1,89 +0,0 @@ -import {GenMapping, maybeAddSegment, toEncodedMap} from "@jridgewell/gen-mapping"; - - - -import {charCodes} from "./parser/util/charcodes"; - - - - - - - - - - - - -/** - * Generate a source map indicating that each line maps directly to the original line, - * with the tokens in their new positions. - */ -export default function computeSourceMap( - {code: generatedCode, mappings: rawMappings}, - filePath, - options, - source, - tokens, -) { - const sourceColumns = computeSourceColumns(source, tokens); - const map = new GenMapping({file: options.compiledFilename}); - let tokenIndex = 0; - // currentMapping is the output source index for the current input token being - // considered. - let currentMapping = rawMappings[0]; - while (currentMapping === undefined && tokenIndex < rawMappings.length - 1) { - tokenIndex++; - currentMapping = rawMappings[tokenIndex]; - } - let line = 0; - let lineStart = 0; - if (currentMapping !== lineStart) { - maybeAddSegment(map, line, 0, filePath, line, 0); - } - for (let i = 0; i < generatedCode.length; i++) { - if (i === currentMapping) { - const genColumn = currentMapping - lineStart; - const sourceColumn = sourceColumns[tokenIndex]; - maybeAddSegment(map, line, genColumn, filePath, line, sourceColumn); - while ( - (currentMapping === i || currentMapping === undefined) && - tokenIndex < rawMappings.length - 1 - ) { - tokenIndex++; - currentMapping = rawMappings[tokenIndex]; - } - } - if (generatedCode.charCodeAt(i) === charCodes.lineFeed) { - line++; - lineStart = i + 1; - if (currentMapping !== lineStart) { - maybeAddSegment(map, line, 0, filePath, line, 0); - } - } - } - const {sourceRoot, sourcesContent, ...sourceMap} = toEncodedMap(map); - return sourceMap ; -} - -/** - * Create an array mapping each token index to the 0-based column of the start - * position of the token. - */ -function computeSourceColumns(code, tokens) { - const sourceColumns = new Array(tokens.length); - let tokenIndex = 0; - let currentMapping = tokens[tokenIndex].start; - let lineStart = 0; - for (let i = 0; i < code.length; i++) { - if (i === currentMapping) { - sourceColumns[tokenIndex] = currentMapping - lineStart; - tokenIndex++; - currentMapping = tokens[tokenIndex].start; - } - if (code.charCodeAt(i) === charCodes.lineFeed) { - lineStart = i + 1; - } - } - return sourceColumns; -} diff --git a/node_modules/sucrase/dist/esm/identifyShadowedGlobals.js b/node_modules/sucrase/dist/esm/identifyShadowedGlobals.js deleted file mode 100644 index f953633..0000000 --- a/node_modules/sucrase/dist/esm/identifyShadowedGlobals.js +++ /dev/null @@ -1,98 +0,0 @@ -import { - isBlockScopedDeclaration, - isFunctionScopedDeclaration, - isNonTopLevelDeclaration, -} from "./parser/tokenizer"; - -import {TokenType as tt} from "./parser/tokenizer/types"; - - -/** - * Traverse the given tokens and modify them if necessary to indicate that some names shadow global - * variables. - */ -export default function identifyShadowedGlobals( - tokens, - scopes, - globalNames, -) { - if (!hasShadowedGlobals(tokens, globalNames)) { - return; - } - markShadowedGlobals(tokens, scopes, globalNames); -} - -/** - * We can do a fast up-front check to see if there are any declarations to global names. If not, - * then there's no point in computing scope assignments. - */ -// Exported for testing. -export function hasShadowedGlobals(tokens, globalNames) { - for (const token of tokens.tokens) { - if ( - token.type === tt.name && - !token.isType && - isNonTopLevelDeclaration(token) && - globalNames.has(tokens.identifierNameForToken(token)) - ) { - return true; - } - } - return false; -} - -function markShadowedGlobals( - tokens, - scopes, - globalNames, -) { - const scopeStack = []; - let scopeIndex = scopes.length - 1; - // Scopes were generated at completion time, so they're sorted by end index, so we can maintain a - // good stack by going backwards through them. - for (let i = tokens.tokens.length - 1; ; i--) { - while (scopeStack.length > 0 && scopeStack[scopeStack.length - 1].startTokenIndex === i + 1) { - scopeStack.pop(); - } - while (scopeIndex >= 0 && scopes[scopeIndex].endTokenIndex === i + 1) { - scopeStack.push(scopes[scopeIndex]); - scopeIndex--; - } - // Process scopes after the last iteration so we can make sure we pop all of them. - if (i < 0) { - break; - } - - const token = tokens.tokens[i]; - const name = tokens.identifierNameForToken(token); - if (scopeStack.length > 1 && !token.isType && token.type === tt.name && globalNames.has(name)) { - if (isBlockScopedDeclaration(token)) { - markShadowedForScope(scopeStack[scopeStack.length - 1], tokens, name); - } else if (isFunctionScopedDeclaration(token)) { - let stackIndex = scopeStack.length - 1; - while (stackIndex > 0 && !scopeStack[stackIndex].isFunctionScope) { - stackIndex--; - } - if (stackIndex < 0) { - throw new Error("Did not find parent function scope."); - } - markShadowedForScope(scopeStack[stackIndex], tokens, name); - } - } - } - if (scopeStack.length > 0) { - throw new Error("Expected empty scope stack after processing file."); - } -} - -function markShadowedForScope(scope, tokens, name) { - for (let i = scope.startTokenIndex; i < scope.endTokenIndex; i++) { - const token = tokens.tokens[i]; - if ( - (token.type === tt.name || token.type === tt.jsxName) && - tokens.identifierNameForToken(token) === name - ) { - token.shadowsGlobal = true; - } - } -} diff --git a/node_modules/sucrase/dist/esm/index.js b/node_modules/sucrase/dist/esm/index.js deleted file mode 100644 index 99e1e8a..0000000 --- a/node_modules/sucrase/dist/esm/index.js +++ /dev/null @@ -1,133 +0,0 @@ -import CJSImportProcessor from "./CJSImportProcessor"; -import computeSourceMap, {} from "./computeSourceMap"; -import {HelperManager} from "./HelperManager"; -import identifyShadowedGlobals from "./identifyShadowedGlobals"; -import NameManager from "./NameManager"; -import {validateOptions} from "./Options"; - -import {parse} from "./parser"; - -import TokenProcessor from "./TokenProcessor"; -import RootTransformer from "./transformers/RootTransformer"; -import formatTokens from "./util/formatTokens"; -import getTSImportedNames from "./util/getTSImportedNames"; - - - - - - - - - - - - - - -; - -export function getVersion() { - /* istanbul ignore next */ - return "3.35.1"; -} - -export function transform(code, options) { - validateOptions(options); - try { - const sucraseContext = getSucraseContext(code, options); - const transformer = new RootTransformer( - sucraseContext, - options.transforms, - Boolean(options.enableLegacyBabel5ModuleInterop), - options, - ); - const transformerResult = transformer.transform(); - let result = {code: transformerResult.code}; - if (options.sourceMapOptions) { - if (!options.filePath) { - throw new Error("filePath must be specified when generating a source map."); - } - result = { - ...result, - sourceMap: computeSourceMap( - transformerResult, - options.filePath, - options.sourceMapOptions, - code, - sucraseContext.tokenProcessor.tokens, - ), - }; - } - return result; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } catch (e) { - if (options.filePath) { - e.message = `Error transforming ${options.filePath}: ${e.message}`; - } - throw e; - } -} - -/** - * Return a string representation of the sucrase tokens, mostly useful for - * diagnostic purposes. - */ -export function getFormattedTokens(code, options) { - const tokens = getSucraseContext(code, options).tokenProcessor.tokens; - return formatTokens(code, tokens); -} - -/** - * Call into the parser/tokenizer and do some further preprocessing: - * - Come up with a set of used names so that we can assign new names. - * - Preprocess all import/export statements so we know which globals we are interested in. - * - Compute situations where any of those globals are shadowed. - * - * In the future, some of these preprocessing steps can be skipped based on what actual work is - * being done. - */ -function getSucraseContext(code, options) { - const isJSXEnabled = options.transforms.includes("jsx"); - const isTypeScriptEnabled = options.transforms.includes("typescript"); - const isFlowEnabled = options.transforms.includes("flow"); - const disableESTransforms = options.disableESTransforms === true; - const file = parse(code, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled); - const tokens = file.tokens; - const scopes = file.scopes; - - const nameManager = new NameManager(code, tokens); - const helperManager = new HelperManager(nameManager); - const tokenProcessor = new TokenProcessor( - code, - tokens, - isFlowEnabled, - disableESTransforms, - helperManager, - ); - const enableLegacyTypeScriptModuleInterop = Boolean(options.enableLegacyTypeScriptModuleInterop); - - let importProcessor = null; - if (options.transforms.includes("imports")) { - importProcessor = new CJSImportProcessor( - nameManager, - tokenProcessor, - enableLegacyTypeScriptModuleInterop, - options, - options.transforms.includes("typescript"), - Boolean(options.keepUnusedImports), - helperManager, - ); - importProcessor.preprocessTokens(); - // We need to mark shadowed globals after processing imports so we know that the globals are, - // but before type-only import pruning, since that relies on shadowing information. - identifyShadowedGlobals(tokenProcessor, scopes, importProcessor.getGlobalNames()); - if (options.transforms.includes("typescript") && !options.keepUnusedImports) { - importProcessor.pruneTypeOnlyImports(); - } - } else if (options.transforms.includes("typescript") && !options.keepUnusedImports) { - // Shadowed global detection is needed for TS implicit elision of imported names. - identifyShadowedGlobals(tokenProcessor, scopes, getTSImportedNames(tokenProcessor)); - } - return {tokenProcessor, scopes, nameManager, importProcessor, helperManager}; -} diff --git a/node_modules/sucrase/dist/esm/parser/index.js b/node_modules/sucrase/dist/esm/parser/index.js deleted file mode 100644 index 5074ae4..0000000 --- a/node_modules/sucrase/dist/esm/parser/index.js +++ /dev/null @@ -1,31 +0,0 @@ - - -import {augmentError, initParser, state} from "./traverser/base"; -import {parseFile} from "./traverser/index"; - -export class File { - - - - constructor(tokens, scopes) { - this.tokens = tokens; - this.scopes = scopes; - } -} - -export function parse( - input, - isJSXEnabled, - isTypeScriptEnabled, - isFlowEnabled, -) { - if (isFlowEnabled && isTypeScriptEnabled) { - throw new Error("Cannot combine flow and typescript plugins."); - } - initParser(input, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled); - const result = parseFile(); - if (state.error) { - throw augmentError(state.error); - } - return result; -} diff --git a/node_modules/sucrase/dist/esm/parser/plugins/flow.js b/node_modules/sucrase/dist/esm/parser/plugins/flow.js deleted file mode 100644 index 66295d1..0000000 --- a/node_modules/sucrase/dist/esm/parser/plugins/flow.js +++ /dev/null @@ -1,1105 +0,0 @@ -/* eslint max-len: 0 */ - -import { - eat, - lookaheadType, - lookaheadTypeAndKeyword, - match, - next, - popTypeContext, - pushTypeContext, - -} from "../tokenizer/index"; -import {ContextualKeyword} from "../tokenizer/keywords"; -import {TokenType, TokenType as tt} from "../tokenizer/types"; -import {input, state} from "../traverser/base"; -import { - baseParseMaybeAssign, - baseParseSubscript, - baseParseSubscripts, - parseArrow, - parseArrowExpression, - parseCallExpressionArguments, - parseExprAtom, - parseExpression, - parseFunctionBody, - parseIdentifier, - parseLiteral, - -} from "../traverser/expression"; -import { - baseParseExportStar, - parseExport, - parseExportFrom, - parseExportSpecifiers, - parseFunctionParams, - parseImport, - parseStatement, -} from "../traverser/statement"; -import { - canInsertSemicolon, - eatContextual, - expect, - expectContextual, - isContextual, - isLookaheadContextual, - semicolon, - unexpected, -} from "../traverser/util"; - -function isMaybeDefaultImport(lookahead) { - return ( - (lookahead.type === tt.name || !!(lookahead.type & TokenType.IS_KEYWORD)) && - lookahead.contextualKeyword !== ContextualKeyword._from - ); -} - -function flowParseTypeInitialiser(tok) { - const oldIsType = pushTypeContext(0); - expect(tok || tt.colon); - flowParseType(); - popTypeContext(oldIsType); -} - -function flowParsePredicate() { - expect(tt.modulo); - expectContextual(ContextualKeyword._checks); - if (eat(tt.parenL)) { - parseExpression(); - expect(tt.parenR); - } -} - -function flowParseTypeAndPredicateInitialiser() { - const oldIsType = pushTypeContext(0); - expect(tt.colon); - if (match(tt.modulo)) { - flowParsePredicate(); - } else { - flowParseType(); - if (match(tt.modulo)) { - flowParsePredicate(); - } - } - popTypeContext(oldIsType); -} - -function flowParseDeclareClass() { - next(); - flowParseInterfaceish(/* isClass */ true); -} - -function flowParseDeclareFunction() { - next(); - parseIdentifier(); - - if (match(tt.lessThan)) { - flowParseTypeParameterDeclaration(); - } - - expect(tt.parenL); - flowParseFunctionTypeParams(); - expect(tt.parenR); - - flowParseTypeAndPredicateInitialiser(); - - semicolon(); -} - -function flowParseDeclare() { - if (match(tt._class)) { - flowParseDeclareClass(); - } else if (match(tt._function)) { - flowParseDeclareFunction(); - } else if (match(tt._var)) { - flowParseDeclareVariable(); - } else if (eatContextual(ContextualKeyword._module)) { - if (eat(tt.dot)) { - flowParseDeclareModuleExports(); - } else { - flowParseDeclareModule(); - } - } else if (isContextual(ContextualKeyword._type)) { - flowParseDeclareTypeAlias(); - } else if (isContextual(ContextualKeyword._opaque)) { - flowParseDeclareOpaqueType(); - } else if (isContextual(ContextualKeyword._interface)) { - flowParseDeclareInterface(); - } else if (match(tt._export)) { - flowParseDeclareExportDeclaration(); - } else { - unexpected(); - } -} - -function flowParseDeclareVariable() { - next(); - flowParseTypeAnnotatableIdentifier(); - semicolon(); -} - -function flowParseDeclareModule() { - if (match(tt.string)) { - parseExprAtom(); - } else { - parseIdentifier(); - } - - expect(tt.braceL); - while (!match(tt.braceR) && !state.error) { - if (match(tt._import)) { - next(); - parseImport(); - } else { - unexpected(); - } - } - expect(tt.braceR); -} - -function flowParseDeclareExportDeclaration() { - expect(tt._export); - - if (eat(tt._default)) { - if (match(tt._function) || match(tt._class)) { - // declare export default class ... - // declare export default function ... - flowParseDeclare(); - } else { - // declare export default [type]; - flowParseType(); - semicolon(); - } - } else if ( - match(tt._var) || // declare export var ... - match(tt._function) || // declare export function ... - match(tt._class) || // declare export class ... - isContextual(ContextualKeyword._opaque) // declare export opaque .. - ) { - flowParseDeclare(); - } else if ( - match(tt.star) || // declare export * from '' - match(tt.braceL) || // declare export {} ... - isContextual(ContextualKeyword._interface) || // declare export interface ... - isContextual(ContextualKeyword._type) || // declare export type ... - isContextual(ContextualKeyword._opaque) // declare export opaque type ... - ) { - parseExport(); - } else { - unexpected(); - } -} - -function flowParseDeclareModuleExports() { - expectContextual(ContextualKeyword._exports); - flowParseTypeAnnotation(); - semicolon(); -} - -function flowParseDeclareTypeAlias() { - next(); - flowParseTypeAlias(); -} - -function flowParseDeclareOpaqueType() { - next(); - flowParseOpaqueType(true); -} - -function flowParseDeclareInterface() { - next(); - flowParseInterfaceish(); -} - -// Interfaces - -function flowParseInterfaceish(isClass = false) { - flowParseRestrictedIdentifier(); - - if (match(tt.lessThan)) { - flowParseTypeParameterDeclaration(); - } - - if (eat(tt._extends)) { - do { - flowParseInterfaceExtends(); - } while (!isClass && eat(tt.comma)); - } - - if (isContextual(ContextualKeyword._mixins)) { - next(); - do { - flowParseInterfaceExtends(); - } while (eat(tt.comma)); - } - - if (isContextual(ContextualKeyword._implements)) { - next(); - do { - flowParseInterfaceExtends(); - } while (eat(tt.comma)); - } - - flowParseObjectType(isClass, false, isClass); -} - -function flowParseInterfaceExtends() { - flowParseQualifiedTypeIdentifier(false); - if (match(tt.lessThan)) { - flowParseTypeParameterInstantiation(); - } -} - -function flowParseInterface() { - flowParseInterfaceish(); -} - -function flowParseRestrictedIdentifier() { - parseIdentifier(); -} - -function flowParseTypeAlias() { - flowParseRestrictedIdentifier(); - - if (match(tt.lessThan)) { - flowParseTypeParameterDeclaration(); - } - - flowParseTypeInitialiser(tt.eq); - semicolon(); -} - -function flowParseOpaqueType(declare) { - expectContextual(ContextualKeyword._type); - flowParseRestrictedIdentifier(); - - if (match(tt.lessThan)) { - flowParseTypeParameterDeclaration(); - } - - // Parse the supertype - if (match(tt.colon)) { - flowParseTypeInitialiser(tt.colon); - } - - if (!declare) { - flowParseTypeInitialiser(tt.eq); - } - semicolon(); -} - -function flowParseTypeParameter() { - flowParseVariance(); - flowParseTypeAnnotatableIdentifier(); - - if (eat(tt.eq)) { - flowParseType(); - } -} - -export function flowParseTypeParameterDeclaration() { - const oldIsType = pushTypeContext(0); - // istanbul ignore else: this condition is already checked at all call sites - if (match(tt.lessThan) || match(tt.typeParameterStart)) { - next(); - } else { - unexpected(); - } - - do { - flowParseTypeParameter(); - if (!match(tt.greaterThan)) { - expect(tt.comma); - } - } while (!match(tt.greaterThan) && !state.error); - expect(tt.greaterThan); - popTypeContext(oldIsType); -} - -function flowParseTypeParameterInstantiation() { - const oldIsType = pushTypeContext(0); - expect(tt.lessThan); - while (!match(tt.greaterThan) && !state.error) { - flowParseType(); - if (!match(tt.greaterThan)) { - expect(tt.comma); - } - } - expect(tt.greaterThan); - popTypeContext(oldIsType); -} - -function flowParseInterfaceType() { - expectContextual(ContextualKeyword._interface); - if (eat(tt._extends)) { - do { - flowParseInterfaceExtends(); - } while (eat(tt.comma)); - } - flowParseObjectType(false, false, false); -} - -function flowParseObjectPropertyKey() { - if (match(tt.num) || match(tt.string)) { - parseExprAtom(); - } else { - parseIdentifier(); - } -} - -function flowParseObjectTypeIndexer() { - // Note: bracketL has already been consumed - if (lookaheadType() === tt.colon) { - flowParseObjectPropertyKey(); - flowParseTypeInitialiser(); - } else { - flowParseType(); - } - expect(tt.bracketR); - flowParseTypeInitialiser(); -} - -function flowParseObjectTypeInternalSlot() { - // Note: both bracketL have already been consumed - flowParseObjectPropertyKey(); - expect(tt.bracketR); - expect(tt.bracketR); - if (match(tt.lessThan) || match(tt.parenL)) { - flowParseObjectTypeMethodish(); - } else { - eat(tt.question); - flowParseTypeInitialiser(); - } -} - -function flowParseObjectTypeMethodish() { - if (match(tt.lessThan)) { - flowParseTypeParameterDeclaration(); - } - - expect(tt.parenL); - while (!match(tt.parenR) && !match(tt.ellipsis) && !state.error) { - flowParseFunctionTypeParam(); - if (!match(tt.parenR)) { - expect(tt.comma); - } - } - - if (eat(tt.ellipsis)) { - flowParseFunctionTypeParam(); - } - expect(tt.parenR); - flowParseTypeInitialiser(); -} - -function flowParseObjectTypeCallProperty() { - flowParseObjectTypeMethodish(); -} - -function flowParseObjectType(allowStatic, allowExact, allowProto) { - let endDelim; - if (allowExact && match(tt.braceBarL)) { - expect(tt.braceBarL); - endDelim = tt.braceBarR; - } else { - expect(tt.braceL); - endDelim = tt.braceR; - } - - while (!match(endDelim) && !state.error) { - if (allowProto && isContextual(ContextualKeyword._proto)) { - const lookahead = lookaheadType(); - if (lookahead !== tt.colon && lookahead !== tt.question) { - next(); - allowStatic = false; - } - } - if (allowStatic && isContextual(ContextualKeyword._static)) { - const lookahead = lookaheadType(); - if (lookahead !== tt.colon && lookahead !== tt.question) { - next(); - } - } - - flowParseVariance(); - - if (eat(tt.bracketL)) { - if (eat(tt.bracketL)) { - flowParseObjectTypeInternalSlot(); - } else { - flowParseObjectTypeIndexer(); - } - } else if (match(tt.parenL) || match(tt.lessThan)) { - flowParseObjectTypeCallProperty(); - } else { - if (isContextual(ContextualKeyword._get) || isContextual(ContextualKeyword._set)) { - const lookahead = lookaheadType(); - if (lookahead === tt.name || lookahead === tt.string || lookahead === tt.num) { - next(); - } - } - - flowParseObjectTypeProperty(); - } - - flowObjectTypeSemicolon(); - } - - expect(endDelim); -} - -function flowParseObjectTypeProperty() { - if (match(tt.ellipsis)) { - expect(tt.ellipsis); - if (!eat(tt.comma)) { - eat(tt.semi); - } - // Explicit inexact object syntax. - if (match(tt.braceR)) { - return; - } - flowParseType(); - } else { - flowParseObjectPropertyKey(); - if (match(tt.lessThan) || match(tt.parenL)) { - // This is a method property - flowParseObjectTypeMethodish(); - } else { - eat(tt.question); - flowParseTypeInitialiser(); - } - } -} - -function flowObjectTypeSemicolon() { - if (!eat(tt.semi) && !eat(tt.comma) && !match(tt.braceR) && !match(tt.braceBarR)) { - unexpected(); - } -} - -function flowParseQualifiedTypeIdentifier(initialIdAlreadyParsed) { - if (!initialIdAlreadyParsed) { - parseIdentifier(); - } - while (eat(tt.dot)) { - parseIdentifier(); - } -} - -function flowParseGenericType() { - flowParseQualifiedTypeIdentifier(true); - if (match(tt.lessThan)) { - flowParseTypeParameterInstantiation(); - } -} - -function flowParseTypeofType() { - expect(tt._typeof); - flowParsePrimaryType(); -} - -function flowParseTupleType() { - expect(tt.bracketL); - // We allow trailing commas - while (state.pos < input.length && !match(tt.bracketR)) { - flowParseType(); - if (match(tt.bracketR)) { - break; - } - expect(tt.comma); - } - expect(tt.bracketR); -} - -function flowParseFunctionTypeParam() { - const lookahead = lookaheadType(); - if (lookahead === tt.colon || lookahead === tt.question) { - parseIdentifier(); - eat(tt.question); - flowParseTypeInitialiser(); - } else { - flowParseType(); - } -} - -function flowParseFunctionTypeParams() { - while (!match(tt.parenR) && !match(tt.ellipsis) && !state.error) { - flowParseFunctionTypeParam(); - if (!match(tt.parenR)) { - expect(tt.comma); - } - } - if (eat(tt.ellipsis)) { - flowParseFunctionTypeParam(); - } -} - -// The parsing of types roughly parallels the parsing of expressions, and -// primary types are kind of like primary expressions...they're the -// primitives with which other types are constructed. -function flowParsePrimaryType() { - let isGroupedType = false; - const oldNoAnonFunctionType = state.noAnonFunctionType; - - switch (state.type) { - case tt.name: { - if (isContextual(ContextualKeyword._interface)) { - flowParseInterfaceType(); - return; - } - parseIdentifier(); - flowParseGenericType(); - return; - } - - case tt.braceL: - flowParseObjectType(false, false, false); - return; - - case tt.braceBarL: - flowParseObjectType(false, true, false); - return; - - case tt.bracketL: - flowParseTupleType(); - return; - - case tt.lessThan: - flowParseTypeParameterDeclaration(); - expect(tt.parenL); - flowParseFunctionTypeParams(); - expect(tt.parenR); - expect(tt.arrow); - flowParseType(); - return; - - case tt.parenL: - next(); - - // Check to see if this is actually a grouped type - if (!match(tt.parenR) && !match(tt.ellipsis)) { - if (match(tt.name)) { - const token = lookaheadType(); - isGroupedType = token !== tt.question && token !== tt.colon; - } else { - isGroupedType = true; - } - } - - if (isGroupedType) { - state.noAnonFunctionType = false; - flowParseType(); - state.noAnonFunctionType = oldNoAnonFunctionType; - - // A `,` or a `) =>` means this is an anonymous function type - if ( - state.noAnonFunctionType || - !(match(tt.comma) || (match(tt.parenR) && lookaheadType() === tt.arrow)) - ) { - expect(tt.parenR); - return; - } else { - // Eat a comma if there is one - eat(tt.comma); - } - } - - flowParseFunctionTypeParams(); - - expect(tt.parenR); - expect(tt.arrow); - flowParseType(); - return; - - case tt.minus: - next(); - parseLiteral(); - return; - - case tt.string: - case tt.num: - case tt._true: - case tt._false: - case tt._null: - case tt._this: - case tt._void: - case tt.star: - next(); - return; - - default: - if (state.type === tt._typeof) { - flowParseTypeofType(); - return; - } else if (state.type & TokenType.IS_KEYWORD) { - next(); - state.tokens[state.tokens.length - 1].type = tt.name; - return; - } - } - - unexpected(); -} - -function flowParsePostfixType() { - flowParsePrimaryType(); - while (!canInsertSemicolon() && (match(tt.bracketL) || match(tt.questionDot))) { - eat(tt.questionDot); - expect(tt.bracketL); - if (eat(tt.bracketR)) { - // Array type - } else { - // Indexed access type - flowParseType(); - expect(tt.bracketR); - } - } -} - -function flowParsePrefixType() { - if (eat(tt.question)) { - flowParsePrefixType(); - } else { - flowParsePostfixType(); - } -} - -function flowParseAnonFunctionWithoutParens() { - flowParsePrefixType(); - if (!state.noAnonFunctionType && eat(tt.arrow)) { - flowParseType(); - } -} - -function flowParseIntersectionType() { - eat(tt.bitwiseAND); - flowParseAnonFunctionWithoutParens(); - while (eat(tt.bitwiseAND)) { - flowParseAnonFunctionWithoutParens(); - } -} - -function flowParseUnionType() { - eat(tt.bitwiseOR); - flowParseIntersectionType(); - while (eat(tt.bitwiseOR)) { - flowParseIntersectionType(); - } -} - -function flowParseType() { - flowParseUnionType(); -} - -export function flowParseTypeAnnotation() { - flowParseTypeInitialiser(); -} - -function flowParseTypeAnnotatableIdentifier() { - parseIdentifier(); - if (match(tt.colon)) { - flowParseTypeAnnotation(); - } -} - -export function flowParseVariance() { - if (match(tt.plus) || match(tt.minus)) { - next(); - state.tokens[state.tokens.length - 1].isType = true; - } -} - -// ================================== -// Overrides -// ================================== - -export function flowParseFunctionBodyAndFinish(funcContextId) { - // For arrow functions, `parseArrow` handles the return type itself. - if (match(tt.colon)) { - flowParseTypeAndPredicateInitialiser(); - } - - parseFunctionBody(false, funcContextId); -} - -export function flowParseSubscript( - startTokenIndex, - noCalls, - stopState, -) { - if (match(tt.questionDot) && lookaheadType() === tt.lessThan) { - if (noCalls) { - stopState.stop = true; - return; - } - next(); - flowParseTypeParameterInstantiation(); - expect(tt.parenL); - parseCallExpressionArguments(); - return; - } else if (!noCalls && match(tt.lessThan)) { - const snapshot = state.snapshot(); - flowParseTypeParameterInstantiation(); - expect(tt.parenL); - parseCallExpressionArguments(); - if (state.error) { - state.restoreFromSnapshot(snapshot); - } else { - return; - } - } - baseParseSubscript(startTokenIndex, noCalls, stopState); -} - -export function flowStartParseNewArguments() { - if (match(tt.lessThan)) { - const snapshot = state.snapshot(); - flowParseTypeParameterInstantiation(); - if (state.error) { - state.restoreFromSnapshot(snapshot); - } - } -} - -// interfaces -export function flowTryParseStatement() { - if (match(tt.name) && state.contextualKeyword === ContextualKeyword._interface) { - const oldIsType = pushTypeContext(0); - next(); - flowParseInterface(); - popTypeContext(oldIsType); - return true; - } else if (isContextual(ContextualKeyword._enum)) { - flowParseEnumDeclaration(); - return true; - } - return false; -} - -export function flowTryParseExportDefaultExpression() { - if (isContextual(ContextualKeyword._enum)) { - flowParseEnumDeclaration(); - return true; - } - return false; -} - -// declares, interfaces and type aliases -export function flowParseIdentifierStatement(contextualKeyword) { - if (contextualKeyword === ContextualKeyword._declare) { - if ( - match(tt._class) || - match(tt.name) || - match(tt._function) || - match(tt._var) || - match(tt._export) - ) { - const oldIsType = pushTypeContext(1); - flowParseDeclare(); - popTypeContext(oldIsType); - } - } else if (match(tt.name)) { - if (contextualKeyword === ContextualKeyword._interface) { - const oldIsType = pushTypeContext(1); - flowParseInterface(); - popTypeContext(oldIsType); - } else if (contextualKeyword === ContextualKeyword._type) { - const oldIsType = pushTypeContext(1); - flowParseTypeAlias(); - popTypeContext(oldIsType); - } else if (contextualKeyword === ContextualKeyword._opaque) { - const oldIsType = pushTypeContext(1); - flowParseOpaqueType(false); - popTypeContext(oldIsType); - } - } - semicolon(); -} - -// export type -export function flowShouldParseExportDeclaration() { - return ( - isContextual(ContextualKeyword._type) || - isContextual(ContextualKeyword._interface) || - isContextual(ContextualKeyword._opaque) || - isContextual(ContextualKeyword._enum) - ); -} - -export function flowShouldDisallowExportDefaultSpecifier() { - return ( - match(tt.name) && - (state.contextualKeyword === ContextualKeyword._type || - state.contextualKeyword === ContextualKeyword._interface || - state.contextualKeyword === ContextualKeyword._opaque || - state.contextualKeyword === ContextualKeyword._enum) - ); -} - -export function flowParseExportDeclaration() { - if (isContextual(ContextualKeyword._type)) { - const oldIsType = pushTypeContext(1); - next(); - - if (match(tt.braceL)) { - // export type { foo, bar }; - parseExportSpecifiers(); - parseExportFrom(); - } else { - // export type Foo = Bar; - flowParseTypeAlias(); - } - popTypeContext(oldIsType); - } else if (isContextual(ContextualKeyword._opaque)) { - const oldIsType = pushTypeContext(1); - next(); - // export opaque type Foo = Bar; - flowParseOpaqueType(false); - popTypeContext(oldIsType); - } else if (isContextual(ContextualKeyword._interface)) { - const oldIsType = pushTypeContext(1); - next(); - flowParseInterface(); - popTypeContext(oldIsType); - } else { - parseStatement(true); - } -} - -export function flowShouldParseExportStar() { - return match(tt.star) || (isContextual(ContextualKeyword._type) && lookaheadType() === tt.star); -} - -export function flowParseExportStar() { - if (eatContextual(ContextualKeyword._type)) { - const oldIsType = pushTypeContext(2); - baseParseExportStar(); - popTypeContext(oldIsType); - } else { - baseParseExportStar(); - } -} - -// parse a the super class type parameters and implements -export function flowAfterParseClassSuper(hasSuper) { - if (hasSuper && match(tt.lessThan)) { - flowParseTypeParameterInstantiation(); - } - if (isContextual(ContextualKeyword._implements)) { - const oldIsType = pushTypeContext(0); - next(); - state.tokens[state.tokens.length - 1].type = tt._implements; - do { - flowParseRestrictedIdentifier(); - if (match(tt.lessThan)) { - flowParseTypeParameterInstantiation(); - } - } while (eat(tt.comma)); - popTypeContext(oldIsType); - } -} - -// parse type parameters for object method shorthand -export function flowStartParseObjPropValue() { - // method shorthand - if (match(tt.lessThan)) { - flowParseTypeParameterDeclaration(); - if (!match(tt.parenL)) unexpected(); - } -} - -export function flowParseAssignableListItemTypes() { - const oldIsType = pushTypeContext(0); - eat(tt.question); - if (match(tt.colon)) { - flowParseTypeAnnotation(); - } - popTypeContext(oldIsType); -} - -// parse typeof and type imports -export function flowStartParseImportSpecifiers() { - if (match(tt._typeof) || isContextual(ContextualKeyword._type)) { - const lh = lookaheadTypeAndKeyword(); - if (isMaybeDefaultImport(lh) || lh.type === tt.braceL || lh.type === tt.star) { - next(); - } - } -} - -// parse import-type/typeof shorthand -export function flowParseImportSpecifier() { - const isTypeKeyword = - state.contextualKeyword === ContextualKeyword._type || state.type === tt._typeof; - if (isTypeKeyword) { - next(); - } else { - parseIdentifier(); - } - - if (isContextual(ContextualKeyword._as) && !isLookaheadContextual(ContextualKeyword._as)) { - parseIdentifier(); - if (isTypeKeyword && !match(tt.name) && !(state.type & TokenType.IS_KEYWORD)) { - // `import {type as ,` or `import {type as }` - } else { - // `import {type as foo` - parseIdentifier(); - } - } else { - if (isTypeKeyword && (match(tt.name) || !!(state.type & TokenType.IS_KEYWORD))) { - // `import {type foo` - parseIdentifier(); - } - if (eatContextual(ContextualKeyword._as)) { - parseIdentifier(); - } - } -} - -// parse function type parameters - function foo() {} -export function flowStartParseFunctionParams() { - // Originally this checked if the method is a getter/setter, but if it was, we'd crash soon - // anyway, so don't try to propagate that information. - if (match(tt.lessThan)) { - const oldIsType = pushTypeContext(0); - flowParseTypeParameterDeclaration(); - popTypeContext(oldIsType); - } -} - -// parse flow type annotations on variable declarator heads - let foo: string = bar -export function flowAfterParseVarHead() { - if (match(tt.colon)) { - flowParseTypeAnnotation(); - } -} - -// parse the return type of an async arrow function - let foo = (async (): number => {}); -export function flowStartParseAsyncArrowFromCallExpression() { - if (match(tt.colon)) { - const oldNoAnonFunctionType = state.noAnonFunctionType; - state.noAnonFunctionType = true; - flowParseTypeAnnotation(); - state.noAnonFunctionType = oldNoAnonFunctionType; - } -} - -// We need to support type parameter declarations for arrow functions. This -// is tricky. There are three situations we need to handle -// -// 1. This is either JSX or an arrow function. We'll try JSX first. If that -// fails, we'll try an arrow function. If that fails, we'll throw the JSX -// error. -// 2. This is an arrow function. We'll parse the type parameter declaration, -// parse the rest, make sure the rest is an arrow function, and go from -// there -// 3. This is neither. Just call the super method -export function flowParseMaybeAssign(noIn, isWithinParens) { - if (match(tt.lessThan)) { - const snapshot = state.snapshot(); - let wasArrow = baseParseMaybeAssign(noIn, isWithinParens); - if (state.error) { - state.restoreFromSnapshot(snapshot); - state.type = tt.typeParameterStart; - } else { - return wasArrow; - } - - const oldIsType = pushTypeContext(0); - flowParseTypeParameterDeclaration(); - popTypeContext(oldIsType); - wasArrow = baseParseMaybeAssign(noIn, isWithinParens); - if (wasArrow) { - return true; - } - unexpected(); - } - - return baseParseMaybeAssign(noIn, isWithinParens); -} - -// handle return types for arrow functions -export function flowParseArrow() { - if (match(tt.colon)) { - const oldIsType = pushTypeContext(0); - const snapshot = state.snapshot(); - - const oldNoAnonFunctionType = state.noAnonFunctionType; - state.noAnonFunctionType = true; - flowParseTypeAndPredicateInitialiser(); - state.noAnonFunctionType = oldNoAnonFunctionType; - - if (canInsertSemicolon()) unexpected(); - if (!match(tt.arrow)) unexpected(); - - if (state.error) { - state.restoreFromSnapshot(snapshot); - } - popTypeContext(oldIsType); - } - return eat(tt.arrow); -} - -export function flowParseSubscripts(startTokenIndex, noCalls = false) { - if ( - state.tokens[state.tokens.length - 1].contextualKeyword === ContextualKeyword._async && - match(tt.lessThan) - ) { - const snapshot = state.snapshot(); - const wasArrow = parseAsyncArrowWithTypeParameters(); - if (wasArrow && !state.error) { - return; - } - state.restoreFromSnapshot(snapshot); - } - - baseParseSubscripts(startTokenIndex, noCalls); -} - -// Returns true if there was an arrow function here. -function parseAsyncArrowWithTypeParameters() { - state.scopeDepth++; - const startTokenIndex = state.tokens.length; - parseFunctionParams(); - if (!parseArrow()) { - return false; - } - parseArrowExpression(startTokenIndex); - return true; -} - -function flowParseEnumDeclaration() { - expectContextual(ContextualKeyword._enum); - state.tokens[state.tokens.length - 1].type = tt._enum; - parseIdentifier(); - flowParseEnumBody(); -} - -function flowParseEnumBody() { - if (eatContextual(ContextualKeyword._of)) { - next(); - } - expect(tt.braceL); - flowParseEnumMembers(); - expect(tt.braceR); -} - -function flowParseEnumMembers() { - while (!match(tt.braceR) && !state.error) { - if (eat(tt.ellipsis)) { - break; - } - flowParseEnumMember(); - if (!match(tt.braceR)) { - expect(tt.comma); - } - } -} - -function flowParseEnumMember() { - parseIdentifier(); - if (eat(tt.eq)) { - // Flow enum values are always just one token (a string, number, or boolean literal). - next(); - } -} diff --git a/node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js b/node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js deleted file mode 100644 index 83f3983..0000000 --- a/node_modules/sucrase/dist/esm/parser/plugins/jsx/index.js +++ /dev/null @@ -1,367 +0,0 @@ -import { - eat, - finishToken, - getTokenFromCode, - IdentifierRole, - JSXRole, - match, - next, - skipSpace, - Token, -} from "../../tokenizer/index"; -import {TokenType as tt} from "../../tokenizer/types"; -import {input, isTypeScriptEnabled, state} from "../../traverser/base"; -import {parseExpression, parseMaybeAssign} from "../../traverser/expression"; -import {expect, unexpected} from "../../traverser/util"; -import {charCodes} from "../../util/charcodes"; -import {IS_IDENTIFIER_CHAR, IS_IDENTIFIER_START} from "../../util/identifier"; -import {tsTryParseJSXTypeArgument} from "../typescript"; - -/** - * Read token with JSX contents. - * - * In addition to detecting jsxTagStart and also regular tokens that might be - * part of an expression, this code detects the start and end of text ranges - * within JSX children. In order to properly count the number of children, we - * distinguish jsxText from jsxEmptyText, which is a text range that simplifies - * to the empty string after JSX whitespace trimming. - * - * It turns out that a JSX text range will simplify to the empty string if and - * only if both of these conditions hold: - * - The range consists entirely of whitespace characters (only counting space, - * tab, \r, and \n). - * - The range has at least one newline. - * This can be proven by analyzing any implementation of whitespace trimming, - * e.g. formatJSXTextLiteral in Sucrase or cleanJSXElementLiteralChild in Babel. - */ -function jsxReadToken() { - let sawNewline = false; - let sawNonWhitespace = false; - while (true) { - if (state.pos >= input.length) { - unexpected("Unterminated JSX contents"); - return; - } - - const ch = input.charCodeAt(state.pos); - if (ch === charCodes.lessThan || ch === charCodes.leftCurlyBrace) { - if (state.pos === state.start) { - if (ch === charCodes.lessThan) { - state.pos++; - finishToken(tt.jsxTagStart); - return; - } - getTokenFromCode(ch); - return; - } - if (sawNewline && !sawNonWhitespace) { - finishToken(tt.jsxEmptyText); - } else { - finishToken(tt.jsxText); - } - return; - } - - // This is part of JSX text. - if (ch === charCodes.lineFeed) { - sawNewline = true; - } else if (ch !== charCodes.space && ch !== charCodes.carriageReturn && ch !== charCodes.tab) { - sawNonWhitespace = true; - } - state.pos++; - } -} - -function jsxReadString(quote) { - state.pos++; - for (;;) { - if (state.pos >= input.length) { - unexpected("Unterminated string constant"); - return; - } - - const ch = input.charCodeAt(state.pos); - if (ch === quote) { - state.pos++; - break; - } - state.pos++; - } - finishToken(tt.string); -} - -// Read a JSX identifier (valid tag or attribute name). -// -// Optimized version since JSX identifiers can't contain -// escape characters and so can be read as single slice. -// Also assumes that first character was already checked -// by isIdentifierStart in readToken. - -function jsxReadWord() { - let ch; - do { - if (state.pos > input.length) { - unexpected("Unexpectedly reached the end of input."); - return; - } - ch = input.charCodeAt(++state.pos); - } while (IS_IDENTIFIER_CHAR[ch] || ch === charCodes.dash); - finishToken(tt.jsxName); -} - -// Parse next token as JSX identifier -function jsxParseIdentifier() { - nextJSXTagToken(); -} - -// Parse namespaced identifier. -function jsxParseNamespacedName(identifierRole) { - jsxParseIdentifier(); - if (!eat(tt.colon)) { - // Plain identifier, so this is an access. - state.tokens[state.tokens.length - 1].identifierRole = identifierRole; - return; - } - // Process the second half of the namespaced name. - jsxParseIdentifier(); -} - -// Parses element name in any form - namespaced, member -// or single identifier. -function jsxParseElementName() { - const firstTokenIndex = state.tokens.length; - jsxParseNamespacedName(IdentifierRole.Access); - let hadDot = false; - while (match(tt.dot)) { - hadDot = true; - nextJSXTagToken(); - jsxParseIdentifier(); - } - // For tags like
with a lowercase letter and no dots, the name is - // actually *not* an identifier access, since it's referring to a built-in - // tag name. Remove the identifier role in this case so that it's not - // accidentally transformed by the imports transform when preserving JSX. - if (!hadDot) { - const firstToken = state.tokens[firstTokenIndex]; - const firstChar = input.charCodeAt(firstToken.start); - if (firstChar >= charCodes.lowercaseA && firstChar <= charCodes.lowercaseZ) { - firstToken.identifierRole = null; - } - } -} - -// Parses any type of JSX attribute value. -function jsxParseAttributeValue() { - switch (state.type) { - case tt.braceL: - next(); - parseExpression(); - nextJSXTagToken(); - return; - - case tt.jsxTagStart: - jsxParseElement(); - nextJSXTagToken(); - return; - - case tt.string: - nextJSXTagToken(); - return; - - default: - unexpected("JSX value should be either an expression or a quoted JSX text"); - } -} - -// Parse JSX spread child, after already processing the { -// Does not parse the closing } -function jsxParseSpreadChild() { - expect(tt.ellipsis); - parseExpression(); -} - -// Parses JSX opening tag starting after "<". -// Returns true if the tag was self-closing. -// Does not parse the last token. -function jsxParseOpeningElement(initialTokenIndex) { - if (match(tt.jsxTagEnd)) { - // This is an open-fragment. - return false; - } - jsxParseElementName(); - if (isTypeScriptEnabled) { - tsTryParseJSXTypeArgument(); - } - let hasSeenPropSpread = false; - while (!match(tt.slash) && !match(tt.jsxTagEnd) && !state.error) { - if (eat(tt.braceL)) { - hasSeenPropSpread = true; - expect(tt.ellipsis); - parseMaybeAssign(); - // } - nextJSXTagToken(); - continue; - } - if ( - hasSeenPropSpread && - state.end - state.start === 3 && - input.charCodeAt(state.start) === charCodes.lowercaseK && - input.charCodeAt(state.start + 1) === charCodes.lowercaseE && - input.charCodeAt(state.start + 2) === charCodes.lowercaseY - ) { - state.tokens[initialTokenIndex].jsxRole = JSXRole.KeyAfterPropSpread; - } - jsxParseNamespacedName(IdentifierRole.ObjectKey); - if (match(tt.eq)) { - nextJSXTagToken(); - jsxParseAttributeValue(); - } - } - const isSelfClosing = match(tt.slash); - if (isSelfClosing) { - // / - nextJSXTagToken(); - } - return isSelfClosing; -} - -// Parses JSX closing tag starting after " 1) { - state.tokens[initialTokenIndex].jsxRole = JSXRole.StaticChildren; - } - } - return; - } - numExplicitChildren++; - jsxParseElementAt(); - nextJSXExprToken(); - break; - - case tt.jsxText: - numExplicitChildren++; - nextJSXExprToken(); - break; - - case tt.jsxEmptyText: - nextJSXExprToken(); - break; - - case tt.braceL: - next(); - if (match(tt.ellipsis)) { - jsxParseSpreadChild(); - nextJSXExprToken(); - // Spread children are a mechanism to explicitly mark children as - // static, so count it as 2 children to satisfy the "more than one - // child" condition. - numExplicitChildren += 2; - } else { - // If we see {}, this is an empty pseudo-expression that doesn't - // count as a child. - if (!match(tt.braceR)) { - numExplicitChildren++; - parseExpression(); - } - nextJSXExprToken(); - } - - break; - - // istanbul ignore next - should never happen - default: - unexpected(); - return; - } - } - } -} - -// Parses entire JSX element from current position. -// Does not parse the last token. -export function jsxParseElement() { - nextJSXTagToken(); - jsxParseElementAt(); -} - -// ================================== -// Overrides -// ================================== - -export function nextJSXTagToken() { - state.tokens.push(new Token()); - skipSpace(); - state.start = state.pos; - const code = input.charCodeAt(state.pos); - - if (IS_IDENTIFIER_START[code]) { - jsxReadWord(); - } else if (code === charCodes.quotationMark || code === charCodes.apostrophe) { - jsxReadString(code); - } else { - // The following tokens are just one character each. - ++state.pos; - switch (code) { - case charCodes.greaterThan: - finishToken(tt.jsxTagEnd); - break; - case charCodes.lessThan: - finishToken(tt.jsxTagStart); - break; - case charCodes.slash: - finishToken(tt.slash); - break; - case charCodes.equalsTo: - finishToken(tt.eq); - break; - case charCodes.leftCurlyBrace: - finishToken(tt.braceL); - break; - case charCodes.dot: - finishToken(tt.dot); - break; - case charCodes.colon: - finishToken(tt.colon); - break; - default: - unexpected(); - } - } -} - -function nextJSXExprToken() { - state.tokens.push(new Token()); - state.start = state.pos; - jsxReadToken(); -} diff --git a/node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js b/node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js deleted file mode 100644 index c6a0741..0000000 --- a/node_modules/sucrase/dist/esm/parser/plugins/jsx/xhtml.js +++ /dev/null @@ -1,256 +0,0 @@ -// Use a Map rather than object to avoid unexpected __proto__ access. -export default new Map([ - ["quot", "\u0022"], - ["amp", "&"], - ["apos", "\u0027"], - ["lt", "<"], - ["gt", ">"], - ["nbsp", "\u00A0"], - ["iexcl", "\u00A1"], - ["cent", "\u00A2"], - ["pound", "\u00A3"], - ["curren", "\u00A4"], - ["yen", "\u00A5"], - ["brvbar", "\u00A6"], - ["sect", "\u00A7"], - ["uml", "\u00A8"], - ["copy", "\u00A9"], - ["ordf", "\u00AA"], - ["laquo", "\u00AB"], - ["not", "\u00AC"], - ["shy", "\u00AD"], - ["reg", "\u00AE"], - ["macr", "\u00AF"], - ["deg", "\u00B0"], - ["plusmn", "\u00B1"], - ["sup2", "\u00B2"], - ["sup3", "\u00B3"], - ["acute", "\u00B4"], - ["micro", "\u00B5"], - ["para", "\u00B6"], - ["middot", "\u00B7"], - ["cedil", "\u00B8"], - ["sup1", "\u00B9"], - ["ordm", "\u00BA"], - ["raquo", "\u00BB"], - ["frac14", "\u00BC"], - ["frac12", "\u00BD"], - ["frac34", "\u00BE"], - ["iquest", "\u00BF"], - ["Agrave", "\u00C0"], - ["Aacute", "\u00C1"], - ["Acirc", "\u00C2"], - ["Atilde", "\u00C3"], - ["Auml", "\u00C4"], - ["Aring", "\u00C5"], - ["AElig", "\u00C6"], - ["Ccedil", "\u00C7"], - ["Egrave", "\u00C8"], - ["Eacute", "\u00C9"], - ["Ecirc", "\u00CA"], - ["Euml", "\u00CB"], - ["Igrave", "\u00CC"], - ["Iacute", "\u00CD"], - ["Icirc", "\u00CE"], - ["Iuml", "\u00CF"], - ["ETH", "\u00D0"], - ["Ntilde", "\u00D1"], - ["Ograve", "\u00D2"], - ["Oacute", "\u00D3"], - ["Ocirc", "\u00D4"], - ["Otilde", "\u00D5"], - ["Ouml", "\u00D6"], - ["times", "\u00D7"], - ["Oslash", "\u00D8"], - ["Ugrave", "\u00D9"], - ["Uacute", "\u00DA"], - ["Ucirc", "\u00DB"], - ["Uuml", "\u00DC"], - ["Yacute", "\u00DD"], - ["THORN", "\u00DE"], - ["szlig", "\u00DF"], - ["agrave", "\u00E0"], - ["aacute", "\u00E1"], - ["acirc", "\u00E2"], - ["atilde", "\u00E3"], - ["auml", "\u00E4"], - ["aring", "\u00E5"], - ["aelig", "\u00E6"], - ["ccedil", "\u00E7"], - ["egrave", "\u00E8"], - ["eacute", "\u00E9"], - ["ecirc", "\u00EA"], - ["euml", "\u00EB"], - ["igrave", "\u00EC"], - ["iacute", "\u00ED"], - ["icirc", "\u00EE"], - ["iuml", "\u00EF"], - ["eth", "\u00F0"], - ["ntilde", "\u00F1"], - ["ograve", "\u00F2"], - ["oacute", "\u00F3"], - ["ocirc", "\u00F4"], - ["otilde", "\u00F5"], - ["ouml", "\u00F6"], - ["divide", "\u00F7"], - ["oslash", "\u00F8"], - ["ugrave", "\u00F9"], - ["uacute", "\u00FA"], - ["ucirc", "\u00FB"], - ["uuml", "\u00FC"], - ["yacute", "\u00FD"], - ["thorn", "\u00FE"], - ["yuml", "\u00FF"], - ["OElig", "\u0152"], - ["oelig", "\u0153"], - ["Scaron", "\u0160"], - ["scaron", "\u0161"], - ["Yuml", "\u0178"], - ["fnof", "\u0192"], - ["circ", "\u02C6"], - ["tilde", "\u02DC"], - ["Alpha", "\u0391"], - ["Beta", "\u0392"], - ["Gamma", "\u0393"], - ["Delta", "\u0394"], - ["Epsilon", "\u0395"], - ["Zeta", "\u0396"], - ["Eta", "\u0397"], - ["Theta", "\u0398"], - ["Iota", "\u0399"], - ["Kappa", "\u039A"], - ["Lambda", "\u039B"], - ["Mu", "\u039C"], - ["Nu", "\u039D"], - ["Xi", "\u039E"], - ["Omicron", "\u039F"], - ["Pi", "\u03A0"], - ["Rho", "\u03A1"], - ["Sigma", "\u03A3"], - ["Tau", "\u03A4"], - ["Upsilon", "\u03A5"], - ["Phi", "\u03A6"], - ["Chi", "\u03A7"], - ["Psi", "\u03A8"], - ["Omega", "\u03A9"], - ["alpha", "\u03B1"], - ["beta", "\u03B2"], - ["gamma", "\u03B3"], - ["delta", "\u03B4"], - ["epsilon", "\u03B5"], - ["zeta", "\u03B6"], - ["eta", "\u03B7"], - ["theta", "\u03B8"], - ["iota", "\u03B9"], - ["kappa", "\u03BA"], - ["lambda", "\u03BB"], - ["mu", "\u03BC"], - ["nu", "\u03BD"], - ["xi", "\u03BE"], - ["omicron", "\u03BF"], - ["pi", "\u03C0"], - ["rho", "\u03C1"], - ["sigmaf", "\u03C2"], - ["sigma", "\u03C3"], - ["tau", "\u03C4"], - ["upsilon", "\u03C5"], - ["phi", "\u03C6"], - ["chi", "\u03C7"], - ["psi", "\u03C8"], - ["omega", "\u03C9"], - ["thetasym", "\u03D1"], - ["upsih", "\u03D2"], - ["piv", "\u03D6"], - ["ensp", "\u2002"], - ["emsp", "\u2003"], - ["thinsp", "\u2009"], - ["zwnj", "\u200C"], - ["zwj", "\u200D"], - ["lrm", "\u200E"], - ["rlm", "\u200F"], - ["ndash", "\u2013"], - ["mdash", "\u2014"], - ["lsquo", "\u2018"], - ["rsquo", "\u2019"], - ["sbquo", "\u201A"], - ["ldquo", "\u201C"], - ["rdquo", "\u201D"], - ["bdquo", "\u201E"], - ["dagger", "\u2020"], - ["Dagger", "\u2021"], - ["bull", "\u2022"], - ["hellip", "\u2026"], - ["permil", "\u2030"], - ["prime", "\u2032"], - ["Prime", "\u2033"], - ["lsaquo", "\u2039"], - ["rsaquo", "\u203A"], - ["oline", "\u203E"], - ["frasl", "\u2044"], - ["euro", "\u20AC"], - ["image", "\u2111"], - ["weierp", "\u2118"], - ["real", "\u211C"], - ["trade", "\u2122"], - ["alefsym", "\u2135"], - ["larr", "\u2190"], - ["uarr", "\u2191"], - ["rarr", "\u2192"], - ["darr", "\u2193"], - ["harr", "\u2194"], - ["crarr", "\u21B5"], - ["lArr", "\u21D0"], - ["uArr", "\u21D1"], - ["rArr", "\u21D2"], - ["dArr", "\u21D3"], - ["hArr", "\u21D4"], - ["forall", "\u2200"], - ["part", "\u2202"], - ["exist", "\u2203"], - ["empty", "\u2205"], - ["nabla", "\u2207"], - ["isin", "\u2208"], - ["notin", "\u2209"], - ["ni", "\u220B"], - ["prod", "\u220F"], - ["sum", "\u2211"], - ["minus", "\u2212"], - ["lowast", "\u2217"], - ["radic", "\u221A"], - ["prop", "\u221D"], - ["infin", "\u221E"], - ["ang", "\u2220"], - ["and", "\u2227"], - ["or", "\u2228"], - ["cap", "\u2229"], - ["cup", "\u222A"], - ["int", "\u222B"], - ["there4", "\u2234"], - ["sim", "\u223C"], - ["cong", "\u2245"], - ["asymp", "\u2248"], - ["ne", "\u2260"], - ["equiv", "\u2261"], - ["le", "\u2264"], - ["ge", "\u2265"], - ["sub", "\u2282"], - ["sup", "\u2283"], - ["nsub", "\u2284"], - ["sube", "\u2286"], - ["supe", "\u2287"], - ["oplus", "\u2295"], - ["otimes", "\u2297"], - ["perp", "\u22A5"], - ["sdot", "\u22C5"], - ["lceil", "\u2308"], - ["rceil", "\u2309"], - ["lfloor", "\u230A"], - ["rfloor", "\u230B"], - ["lang", "\u2329"], - ["rang", "\u232A"], - ["loz", "\u25CA"], - ["spades", "\u2660"], - ["clubs", "\u2663"], - ["hearts", "\u2665"], - ["diams", "\u2666"], -]); diff --git a/node_modules/sucrase/dist/esm/parser/plugins/types.js b/node_modules/sucrase/dist/esm/parser/plugins/types.js deleted file mode 100644 index 78e4af4..0000000 --- a/node_modules/sucrase/dist/esm/parser/plugins/types.js +++ /dev/null @@ -1,37 +0,0 @@ -import {eatTypeToken, lookaheadType, match} from "../tokenizer/index"; -import {TokenType as tt} from "../tokenizer/types"; -import {isFlowEnabled, isTypeScriptEnabled} from "../traverser/base"; -import {baseParseConditional} from "../traverser/expression"; -import {flowParseTypeAnnotation} from "./flow"; -import {tsParseTypeAnnotation} from "./typescript"; - -/** - * Common parser code for TypeScript and Flow. - */ - -// An apparent conditional expression could actually be an optional parameter in an arrow function. -export function typedParseConditional(noIn) { - // If we see ?:, this can't possibly be a valid conditional. typedParseParenItem will be called - // later to finish off the arrow parameter. We also need to handle bare ? tokens for optional - // parameters without type annotations, i.e. ?, and ?) . - if (match(tt.question)) { - const nextType = lookaheadType(); - if (nextType === tt.colon || nextType === tt.comma || nextType === tt.parenR) { - return; - } - } - baseParseConditional(noIn); -} - -// Note: These "type casts" are *not* valid TS expressions. -// But we parse them here and change them when completing the arrow function. -export function typedParseParenItem() { - eatTypeToken(tt.question); - if (match(tt.colon)) { - if (isTypeScriptEnabled) { - tsParseTypeAnnotation(); - } else if (isFlowEnabled) { - flowParseTypeAnnotation(); - } - } -} diff --git a/node_modules/sucrase/dist/esm/parser/plugins/typescript.js b/node_modules/sucrase/dist/esm/parser/plugins/typescript.js deleted file mode 100644 index f64ca67..0000000 --- a/node_modules/sucrase/dist/esm/parser/plugins/typescript.js +++ /dev/null @@ -1,1632 +0,0 @@ -import { - eat, - finishToken, - IdentifierRole, - lookaheadType, - lookaheadTypeAndKeyword, - match, - next, - nextTemplateToken, - popTypeContext, - pushTypeContext, - rescan_gt, -} from "../tokenizer/index"; -import {ContextualKeyword} from "../tokenizer/keywords"; -import {TokenType, TokenType as tt} from "../tokenizer/types"; -import {isJSXEnabled, state} from "../traverser/base"; -import { - atPossibleAsync, - baseParseMaybeAssign, - baseParseSubscript, - parseCallExpressionArguments, - parseExprAtom, - parseExpression, - parseFunctionBody, - parseIdentifier, - parseLiteral, - parseMaybeAssign, - parseMaybeUnary, - parsePropertyName, - parseTemplate, - -} from "../traverser/expression"; -import {parseBindingIdentifier, parseBindingList, parseImportedIdentifier} from "../traverser/lval"; -import { - baseParseMaybeDecoratorArguments, - parseBlockBody, - parseClass, - parseFunction, - parseFunctionParams, - parseStatement, - parseVarStatement, -} from "../traverser/statement"; -import { - canInsertSemicolon, - eatContextual, - expect, - expectContextual, - hasPrecedingLineBreak, - isContextual, - isLineTerminator, - isLookaheadContextual, - semicolon, - unexpected, -} from "../traverser/util"; -import {nextJSXTagToken} from "./jsx"; - -function tsIsIdentifier() { - // TODO: actually a bit more complex in TypeScript, but shouldn't matter. - // See https://github.com/Microsoft/TypeScript/issues/15008 - return match(tt.name); -} - -function isLiteralPropertyName() { - return ( - match(tt.name) || - Boolean(state.type & TokenType.IS_KEYWORD) || - match(tt.string) || - match(tt.num) || - match(tt.bigint) || - match(tt.decimal) - ); -} - -function tsNextTokenCanFollowModifier() { - // Note: TypeScript's implementation is much more complicated because - // more things are considered modifiers there. - // This implementation only handles modifiers not handled by babylon itself. And "static". - // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method... - const snapshot = state.snapshot(); - - next(); - const canFollowModifier = - (match(tt.bracketL) || - match(tt.braceL) || - match(tt.star) || - match(tt.ellipsis) || - match(tt.hash) || - isLiteralPropertyName()) && - !hasPrecedingLineBreak(); - - if (canFollowModifier) { - return true; - } else { - state.restoreFromSnapshot(snapshot); - return false; - } -} - -export function tsParseModifiers(allowedModifiers) { - while (true) { - const modifier = tsParseModifier(allowedModifiers); - if (modifier === null) { - break; - } - } -} - -/** Parses a modifier matching one the given modifier names. */ -export function tsParseModifier( - allowedModifiers, -) { - if (!match(tt.name)) { - return null; - } - - const modifier = state.contextualKeyword; - if (allowedModifiers.indexOf(modifier) !== -1 && tsNextTokenCanFollowModifier()) { - switch (modifier) { - case ContextualKeyword._readonly: - state.tokens[state.tokens.length - 1].type = tt._readonly; - break; - case ContextualKeyword._abstract: - state.tokens[state.tokens.length - 1].type = tt._abstract; - break; - case ContextualKeyword._static: - state.tokens[state.tokens.length - 1].type = tt._static; - break; - case ContextualKeyword._public: - state.tokens[state.tokens.length - 1].type = tt._public; - break; - case ContextualKeyword._private: - state.tokens[state.tokens.length - 1].type = tt._private; - break; - case ContextualKeyword._protected: - state.tokens[state.tokens.length - 1].type = tt._protected; - break; - case ContextualKeyword._override: - state.tokens[state.tokens.length - 1].type = tt._override; - break; - case ContextualKeyword._declare: - state.tokens[state.tokens.length - 1].type = tt._declare; - break; - default: - break; - } - return modifier; - } - return null; -} - -function tsParseEntityName() { - parseIdentifier(); - while (eat(tt.dot)) { - parseIdentifier(); - } -} - -function tsParseTypeReference() { - tsParseEntityName(); - if (!hasPrecedingLineBreak() && match(tt.lessThan)) { - tsParseTypeArguments(); - } -} - -function tsParseThisTypePredicate() { - next(); - tsParseTypeAnnotation(); -} - -function tsParseThisTypeNode() { - next(); -} - -function tsParseTypeQuery() { - expect(tt._typeof); - if (match(tt._import)) { - tsParseImportType(); - } else { - tsParseEntityName(); - } - if (!hasPrecedingLineBreak() && match(tt.lessThan)) { - tsParseTypeArguments(); - } -} - -function tsParseImportType() { - expect(tt._import); - expect(tt.parenL); - expect(tt.string); - expect(tt.parenR); - if (eat(tt.dot)) { - tsParseEntityName(); - } - if (match(tt.lessThan)) { - tsParseTypeArguments(); - } -} - -function tsParseTypeParameter() { - eat(tt._const); - const hadIn = eat(tt._in); - const hadOut = eatContextual(ContextualKeyword._out); - eat(tt._const); - if ((hadIn || hadOut) && !match(tt.name)) { - // The "in" or "out" keyword must have actually been the type parameter - // name, so set it as the name. - state.tokens[state.tokens.length - 1].type = tt.name; - } else { - parseIdentifier(); - } - - if (eat(tt._extends)) { - tsParseType(); - } - if (eat(tt.eq)) { - tsParseType(); - } -} - -export function tsTryParseTypeParameters() { - if (match(tt.lessThan)) { - tsParseTypeParameters(); - } -} - -function tsParseTypeParameters() { - const oldIsType = pushTypeContext(0); - if (match(tt.lessThan) || match(tt.typeParameterStart)) { - next(); - } else { - unexpected(); - } - - while (!eat(tt.greaterThan) && !state.error) { - tsParseTypeParameter(); - eat(tt.comma); - } - popTypeContext(oldIsType); -} - -// Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`, -// but here it's always false, because this is only used for types. -function tsFillSignature(returnToken) { - // Arrow fns *must* have return token (`=>`). Normal functions can omit it. - const returnTokenRequired = returnToken === tt.arrow; - tsTryParseTypeParameters(); - expect(tt.parenL); - // Create a scope even though we're doing type parsing so we don't accidentally - // treat params as top-level bindings. - state.scopeDepth++; - tsParseBindingListForSignature(false /* isBlockScope */); - state.scopeDepth--; - if (returnTokenRequired) { - tsParseTypeOrTypePredicateAnnotation(returnToken); - } else if (match(returnToken)) { - tsParseTypeOrTypePredicateAnnotation(returnToken); - } -} - -function tsParseBindingListForSignature(isBlockScope) { - parseBindingList(tt.parenR, isBlockScope); -} - -function tsParseTypeMemberSemicolon() { - if (!eat(tt.comma)) { - semicolon(); - } -} - -function tsParseSignatureMember() { - tsFillSignature(tt.colon); - tsParseTypeMemberSemicolon(); -} - -function tsIsUnambiguouslyIndexSignature() { - const snapshot = state.snapshot(); - next(); // Skip '{' - const isIndexSignature = eat(tt.name) && match(tt.colon); - state.restoreFromSnapshot(snapshot); - return isIndexSignature; -} - -function tsTryParseIndexSignature() { - if (!(match(tt.bracketL) && tsIsUnambiguouslyIndexSignature())) { - return false; - } - - const oldIsType = pushTypeContext(0); - - expect(tt.bracketL); - parseIdentifier(); - tsParseTypeAnnotation(); - expect(tt.bracketR); - - tsTryParseTypeAnnotation(); - tsParseTypeMemberSemicolon(); - - popTypeContext(oldIsType); - return true; -} - -function tsParsePropertyOrMethodSignature(isReadonly) { - eat(tt.question); - - if (!isReadonly && (match(tt.parenL) || match(tt.lessThan))) { - tsFillSignature(tt.colon); - tsParseTypeMemberSemicolon(); - } else { - tsTryParseTypeAnnotation(); - tsParseTypeMemberSemicolon(); - } -} - -function tsParseTypeMember() { - if (match(tt.parenL) || match(tt.lessThan)) { - // call signature - tsParseSignatureMember(); - return; - } - if (match(tt._new)) { - next(); - if (match(tt.parenL) || match(tt.lessThan)) { - // constructor signature - tsParseSignatureMember(); - } else { - tsParsePropertyOrMethodSignature(false); - } - return; - } - const readonly = !!tsParseModifier([ContextualKeyword._readonly]); - - const found = tsTryParseIndexSignature(); - if (found) { - return; - } - if ( - (isContextual(ContextualKeyword._get) || isContextual(ContextualKeyword._set)) && - tsNextTokenCanFollowModifier() - ) { - // This is a getter/setter on a type. The tsNextTokenCanFollowModifier - // function already called next() for us, so continue parsing the name. - } - parsePropertyName(-1 /* Types don't need context IDs. */); - tsParsePropertyOrMethodSignature(readonly); -} - -function tsParseTypeLiteral() { - tsParseObjectTypeMembers(); -} - -function tsParseObjectTypeMembers() { - expect(tt.braceL); - while (!eat(tt.braceR) && !state.error) { - tsParseTypeMember(); - } -} - -function tsLookaheadIsStartOfMappedType() { - const snapshot = state.snapshot(); - const isStartOfMappedType = tsIsStartOfMappedType(); - state.restoreFromSnapshot(snapshot); - return isStartOfMappedType; -} - -function tsIsStartOfMappedType() { - next(); - if (eat(tt.plus) || eat(tt.minus)) { - return isContextual(ContextualKeyword._readonly); - } - if (isContextual(ContextualKeyword._readonly)) { - next(); - } - if (!match(tt.bracketL)) { - return false; - } - next(); - if (!tsIsIdentifier()) { - return false; - } - next(); - return match(tt._in); -} - -function tsParseMappedTypeParameter() { - parseIdentifier(); - expect(tt._in); - tsParseType(); -} - -function tsParseMappedType() { - expect(tt.braceL); - if (match(tt.plus) || match(tt.minus)) { - next(); - expectContextual(ContextualKeyword._readonly); - } else { - eatContextual(ContextualKeyword._readonly); - } - expect(tt.bracketL); - tsParseMappedTypeParameter(); - if (eatContextual(ContextualKeyword._as)) { - tsParseType(); - } - expect(tt.bracketR); - if (match(tt.plus) || match(tt.minus)) { - next(); - expect(tt.question); - } else { - eat(tt.question); - } - tsTryParseType(); - semicolon(); - expect(tt.braceR); -} - -function tsParseTupleType() { - expect(tt.bracketL); - while (!eat(tt.bracketR) && !state.error) { - // Do not validate presence of either none or only labeled elements - tsParseTupleElementType(); - eat(tt.comma); - } -} - -function tsParseTupleElementType() { - // parses `...TsType[]` - if (eat(tt.ellipsis)) { - tsParseType(); - } else { - // parses `TsType?` - tsParseType(); - eat(tt.question); - } - - // The type we parsed above was actually a label - if (eat(tt.colon)) { - // Labeled tuple types must affix the label with `...` or `?`, so no need to handle those here - tsParseType(); - } -} - -function tsParseParenthesizedType() { - expect(tt.parenL); - tsParseType(); - expect(tt.parenR); -} - -function tsParseTemplateLiteralType() { - // Finish `, read quasi - nextTemplateToken(); - // Finish quasi, read ${ - nextTemplateToken(); - while (!match(tt.backQuote) && !state.error) { - expect(tt.dollarBraceL); - tsParseType(); - // Finish }, read quasi - nextTemplateToken(); - // Finish quasi, read either ${ or ` - nextTemplateToken(); - } - next(); -} - -var FunctionType; (function (FunctionType) { - const TSFunctionType = 0; FunctionType[FunctionType["TSFunctionType"] = TSFunctionType] = "TSFunctionType"; - const TSConstructorType = TSFunctionType + 1; FunctionType[FunctionType["TSConstructorType"] = TSConstructorType] = "TSConstructorType"; - const TSAbstractConstructorType = TSConstructorType + 1; FunctionType[FunctionType["TSAbstractConstructorType"] = TSAbstractConstructorType] = "TSAbstractConstructorType"; -})(FunctionType || (FunctionType = {})); - -function tsParseFunctionOrConstructorType(type) { - if (type === FunctionType.TSAbstractConstructorType) { - expectContextual(ContextualKeyword._abstract); - } - if (type === FunctionType.TSConstructorType || type === FunctionType.TSAbstractConstructorType) { - expect(tt._new); - } - const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext; - state.inDisallowConditionalTypesContext = false; - tsFillSignature(tt.arrow); - state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; -} - -function tsParseNonArrayType() { - switch (state.type) { - case tt.name: - tsParseTypeReference(); - return; - case tt._void: - case tt._null: - next(); - return; - case tt.string: - case tt.num: - case tt.bigint: - case tt.decimal: - case tt._true: - case tt._false: - parseLiteral(); - return; - case tt.minus: - next(); - parseLiteral(); - return; - case tt._this: { - tsParseThisTypeNode(); - if (isContextual(ContextualKeyword._is) && !hasPrecedingLineBreak()) { - tsParseThisTypePredicate(); - } - return; - } - case tt._typeof: - tsParseTypeQuery(); - return; - case tt._import: - tsParseImportType(); - return; - case tt.braceL: - if (tsLookaheadIsStartOfMappedType()) { - tsParseMappedType(); - } else { - tsParseTypeLiteral(); - } - return; - case tt.bracketL: - tsParseTupleType(); - return; - case tt.parenL: - tsParseParenthesizedType(); - return; - case tt.backQuote: - tsParseTemplateLiteralType(); - return; - default: - if (state.type & TokenType.IS_KEYWORD) { - next(); - state.tokens[state.tokens.length - 1].type = tt.name; - return; - } - break; - } - - unexpected(); -} - -function tsParseArrayTypeOrHigher() { - tsParseNonArrayType(); - while (!hasPrecedingLineBreak() && eat(tt.bracketL)) { - if (!eat(tt.bracketR)) { - // If we hit ] immediately, this is an array type, otherwise it's an indexed access type. - tsParseType(); - expect(tt.bracketR); - } - } -} - -function tsParseInferType() { - expectContextual(ContextualKeyword._infer); - parseIdentifier(); - if (match(tt._extends)) { - // Infer type constraints introduce an ambiguity about whether the "extends" - // is a constraint for this infer type or is another conditional type. - const snapshot = state.snapshot(); - expect(tt._extends); - const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext; - state.inDisallowConditionalTypesContext = true; - tsParseType(); - state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; - if (state.error || (!state.inDisallowConditionalTypesContext && match(tt.question))) { - state.restoreFromSnapshot(snapshot); - } - } -} - -function tsParseTypeOperatorOrHigher() { - if ( - isContextual(ContextualKeyword._keyof) || - isContextual(ContextualKeyword._unique) || - isContextual(ContextualKeyword._readonly) - ) { - next(); - tsParseTypeOperatorOrHigher(); - } else if (isContextual(ContextualKeyword._infer)) { - tsParseInferType(); - } else { - const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext; - state.inDisallowConditionalTypesContext = false; - tsParseArrayTypeOrHigher(); - state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; - } -} - -function tsParseIntersectionTypeOrHigher() { - eat(tt.bitwiseAND); - tsParseTypeOperatorOrHigher(); - if (match(tt.bitwiseAND)) { - while (eat(tt.bitwiseAND)) { - tsParseTypeOperatorOrHigher(); - } - } -} - -function tsParseUnionTypeOrHigher() { - eat(tt.bitwiseOR); - tsParseIntersectionTypeOrHigher(); - if (match(tt.bitwiseOR)) { - while (eat(tt.bitwiseOR)) { - tsParseIntersectionTypeOrHigher(); - } - } -} - -function tsIsStartOfFunctionType() { - if (match(tt.lessThan)) { - return true; - } - return match(tt.parenL) && tsLookaheadIsUnambiguouslyStartOfFunctionType(); -} - -function tsSkipParameterStart() { - if (match(tt.name) || match(tt._this)) { - next(); - return true; - } - // If this is a possible array/object destructure, walk to the matching bracket/brace. - // The next token after will tell us definitively whether this is a function param. - if (match(tt.braceL) || match(tt.bracketL)) { - let depth = 1; - next(); - while (depth > 0 && !state.error) { - if (match(tt.braceL) || match(tt.bracketL)) { - depth++; - } else if (match(tt.braceR) || match(tt.bracketR)) { - depth--; - } - next(); - } - return true; - } - return false; -} - -function tsLookaheadIsUnambiguouslyStartOfFunctionType() { - const snapshot = state.snapshot(); - const isUnambiguouslyStartOfFunctionType = tsIsUnambiguouslyStartOfFunctionType(); - state.restoreFromSnapshot(snapshot); - return isUnambiguouslyStartOfFunctionType; -} - -function tsIsUnambiguouslyStartOfFunctionType() { - next(); - if (match(tt.parenR) || match(tt.ellipsis)) { - // ( ) - // ( ... - return true; - } - if (tsSkipParameterStart()) { - if (match(tt.colon) || match(tt.comma) || match(tt.question) || match(tt.eq)) { - // ( xxx : - // ( xxx , - // ( xxx ? - // ( xxx = - return true; - } - if (match(tt.parenR)) { - next(); - if (match(tt.arrow)) { - // ( xxx ) => - return true; - } - } - } - return false; -} - -function tsParseTypeOrTypePredicateAnnotation(returnToken) { - const oldIsType = pushTypeContext(0); - expect(returnToken); - const finishedReturn = tsParseTypePredicateOrAssertsPrefix(); - if (!finishedReturn) { - tsParseType(); - } - popTypeContext(oldIsType); -} - -function tsTryParseTypeOrTypePredicateAnnotation() { - if (match(tt.colon)) { - tsParseTypeOrTypePredicateAnnotation(tt.colon); - } -} - -export function tsTryParseTypeAnnotation() { - if (match(tt.colon)) { - tsParseTypeAnnotation(); - } -} - -function tsTryParseType() { - if (eat(tt.colon)) { - tsParseType(); - } -} - -/** - * Detect a few special return syntax cases: `x is T`, `asserts x`, `asserts x is T`, - * `asserts this is T`. - * - * Returns true if we parsed the return type, false if there's still a type to be parsed. - */ -function tsParseTypePredicateOrAssertsPrefix() { - const snapshot = state.snapshot(); - if (isContextual(ContextualKeyword._asserts)) { - // Normally this is `asserts x is T`, but at this point, it might be `asserts is T` (a user- - // defined type guard on the `asserts` variable) or just a type called `asserts`. - next(); - if (eatContextual(ContextualKeyword._is)) { - // If we see `asserts is`, then this must be of the form `asserts is T`, since - // `asserts is is T` isn't valid. - tsParseType(); - return true; - } else if (tsIsIdentifier() || match(tt._this)) { - next(); - if (eatContextual(ContextualKeyword._is)) { - // If we see `is`, then this is `asserts x is T`. Otherwise, it's `asserts x`. - tsParseType(); - } - return true; - } else { - // Regular type, so bail out and start type parsing from scratch. - state.restoreFromSnapshot(snapshot); - return false; - } - } else if (tsIsIdentifier() || match(tt._this)) { - // This is a regular identifier, which may or may not have "is" after it. - next(); - if (isContextual(ContextualKeyword._is) && !hasPrecedingLineBreak()) { - next(); - tsParseType(); - return true; - } else { - // Regular type, so bail out and start type parsing from scratch. - state.restoreFromSnapshot(snapshot); - return false; - } - } - return false; -} - -export function tsParseTypeAnnotation() { - const oldIsType = pushTypeContext(0); - expect(tt.colon); - tsParseType(); - popTypeContext(oldIsType); -} - -export function tsParseType() { - tsParseNonConditionalType(); - if (state.inDisallowConditionalTypesContext || hasPrecedingLineBreak() || !eat(tt._extends)) { - return; - } - // extends type - const oldInDisallowConditionalTypesContext = state.inDisallowConditionalTypesContext; - state.inDisallowConditionalTypesContext = true; - tsParseNonConditionalType(); - state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; - - expect(tt.question); - // true type - tsParseType(); - expect(tt.colon); - // false type - tsParseType(); -} - -function isAbstractConstructorSignature() { - return isContextual(ContextualKeyword._abstract) && lookaheadType() === tt._new; -} - -export function tsParseNonConditionalType() { - if (tsIsStartOfFunctionType()) { - tsParseFunctionOrConstructorType(FunctionType.TSFunctionType); - return; - } - if (match(tt._new)) { - // As in `new () => Date` - tsParseFunctionOrConstructorType(FunctionType.TSConstructorType); - return; - } else if (isAbstractConstructorSignature()) { - // As in `abstract new () => Date` - tsParseFunctionOrConstructorType(FunctionType.TSAbstractConstructorType); - return; - } - tsParseUnionTypeOrHigher(); -} - -export function tsParseTypeAssertion() { - const oldIsType = pushTypeContext(1); - tsParseType(); - expect(tt.greaterThan); - popTypeContext(oldIsType); - parseMaybeUnary(); -} - -export function tsTryParseJSXTypeArgument() { - if (eat(tt.jsxTagStart)) { - state.tokens[state.tokens.length - 1].type = tt.typeParameterStart; - const oldIsType = pushTypeContext(1); - while (!match(tt.greaterThan) && !state.error) { - tsParseType(); - eat(tt.comma); - } - // Process >, but the one after needs to be parsed JSX-style. - nextJSXTagToken(); - popTypeContext(oldIsType); - } -} - -function tsParseHeritageClause() { - while (!match(tt.braceL) && !state.error) { - tsParseExpressionWithTypeArguments(); - eat(tt.comma); - } -} - -function tsParseExpressionWithTypeArguments() { - // Note: TS uses parseLeftHandSideExpressionOrHigher, - // then has grammar errors later if it's not an EntityName. - tsParseEntityName(); - if (match(tt.lessThan)) { - tsParseTypeArguments(); - } -} - -function tsParseInterfaceDeclaration() { - parseBindingIdentifier(false); - tsTryParseTypeParameters(); - if (eat(tt._extends)) { - tsParseHeritageClause(); - } - tsParseObjectTypeMembers(); -} - -function tsParseTypeAliasDeclaration() { - parseBindingIdentifier(false); - tsTryParseTypeParameters(); - expect(tt.eq); - tsParseType(); - semicolon(); -} - -function tsParseEnumMember() { - // Computed property names are grammar errors in an enum, so accept just string literal or identifier. - if (match(tt.string)) { - parseLiteral(); - } else { - parseIdentifier(); - } - if (eat(tt.eq)) { - const eqIndex = state.tokens.length - 1; - parseMaybeAssign(); - state.tokens[eqIndex].rhsEndIndex = state.tokens.length; - } -} - -function tsParseEnumDeclaration() { - parseBindingIdentifier(false); - expect(tt.braceL); - while (!eat(tt.braceR) && !state.error) { - tsParseEnumMember(); - eat(tt.comma); - } -} - -function tsParseModuleBlock() { - expect(tt.braceL); - parseBlockBody(/* end */ tt.braceR); -} - -function tsParseModuleOrNamespaceDeclaration() { - parseBindingIdentifier(false); - if (eat(tt.dot)) { - tsParseModuleOrNamespaceDeclaration(); - } else { - tsParseModuleBlock(); - } -} - -function tsParseAmbientExternalModuleDeclaration() { - if (isContextual(ContextualKeyword._global)) { - parseIdentifier(); - } else if (match(tt.string)) { - parseExprAtom(); - } else { - unexpected(); - } - - if (match(tt.braceL)) { - tsParseModuleBlock(); - } else { - semicolon(); - } -} - -export function tsParseImportEqualsDeclaration() { - parseImportedIdentifier(); - expect(tt.eq); - tsParseModuleReference(); - semicolon(); -} - -function tsIsExternalModuleReference() { - return isContextual(ContextualKeyword._require) && lookaheadType() === tt.parenL; -} - -function tsParseModuleReference() { - if (tsIsExternalModuleReference()) { - tsParseExternalModuleReference(); - } else { - tsParseEntityName(); - } -} - -function tsParseExternalModuleReference() { - expectContextual(ContextualKeyword._require); - expect(tt.parenL); - if (!match(tt.string)) { - unexpected(); - } - parseLiteral(); - expect(tt.parenR); -} - -// Utilities - -// Returns true if a statement matched. -function tsTryParseDeclare() { - if (isLineTerminator()) { - return false; - } - switch (state.type) { - case tt._function: { - const oldIsType = pushTypeContext(1); - next(); - // We don't need to precisely get the function start here, since it's only used to mark - // the function as a type if it's bodiless, and it's already a type here. - const functionStart = state.start; - parseFunction(functionStart, /* isStatement */ true); - popTypeContext(oldIsType); - return true; - } - case tt._class: { - const oldIsType = pushTypeContext(1); - parseClass(/* isStatement */ true, /* optionalId */ false); - popTypeContext(oldIsType); - return true; - } - case tt._const: { - if (match(tt._const) && isLookaheadContextual(ContextualKeyword._enum)) { - const oldIsType = pushTypeContext(1); - // `const enum = 0;` not allowed because "enum" is a strict mode reserved word. - expect(tt._const); - expectContextual(ContextualKeyword._enum); - state.tokens[state.tokens.length - 1].type = tt._enum; - tsParseEnumDeclaration(); - popTypeContext(oldIsType); - return true; - } - } - // falls through - case tt._var: - case tt._let: { - const oldIsType = pushTypeContext(1); - parseVarStatement(state.type !== tt._var); - popTypeContext(oldIsType); - return true; - } - case tt.name: { - const oldIsType = pushTypeContext(1); - const contextualKeyword = state.contextualKeyword; - let matched = false; - if (contextualKeyword === ContextualKeyword._global) { - tsParseAmbientExternalModuleDeclaration(); - matched = true; - } else { - matched = tsParseDeclaration(contextualKeyword, /* isBeforeToken */ true); - } - popTypeContext(oldIsType); - return matched; - } - default: - return false; - } -} - -// Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`. -// Returns true if it matched a declaration. -function tsTryParseExportDeclaration() { - return tsParseDeclaration(state.contextualKeyword, /* isBeforeToken */ true); -} - -// Returns true if it matched a statement. -function tsParseExpressionStatement(contextualKeyword) { - switch (contextualKeyword) { - case ContextualKeyword._declare: { - const declareTokenIndex = state.tokens.length - 1; - const matched = tsTryParseDeclare(); - if (matched) { - state.tokens[declareTokenIndex].type = tt._declare; - return true; - } - break; - } - case ContextualKeyword._global: - // `global { }` (with no `declare`) may appear inside an ambient module declaration. - // Would like to use tsParseAmbientExternalModuleDeclaration here, but already ran past "global". - if (match(tt.braceL)) { - tsParseModuleBlock(); - return true; - } - break; - - default: - return tsParseDeclaration(contextualKeyword, /* isBeforeToken */ false); - } - return false; -} - -/** - * Common code for parsing a declaration. - * - * isBeforeToken indicates that the current parser state is at the contextual - * keyword (and that it is not yet emitted) rather than reading the token after - * it. When isBeforeToken is true, we may be preceded by an `export` token and - * should include that token in a type context we create, e.g. to handle - * `export interface` or `export type`. (This is a bit of a hack and should be - * cleaned up at some point.) - * - * Returns true if it matched a declaration. - */ -function tsParseDeclaration(contextualKeyword, isBeforeToken) { - switch (contextualKeyword) { - case ContextualKeyword._abstract: - if (tsCheckLineTerminator(isBeforeToken) && match(tt._class)) { - state.tokens[state.tokens.length - 1].type = tt._abstract; - parseClass(/* isStatement */ true, /* optionalId */ false); - return true; - } - break; - - case ContextualKeyword._enum: - if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) { - state.tokens[state.tokens.length - 1].type = tt._enum; - tsParseEnumDeclaration(); - return true; - } - break; - - case ContextualKeyword._interface: - if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) { - // `next` is true in "export" and "declare" contexts, so we want to remove that token - // as well. - const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1); - tsParseInterfaceDeclaration(); - popTypeContext(oldIsType); - return true; - } - break; - - case ContextualKeyword._module: - if (tsCheckLineTerminator(isBeforeToken)) { - if (match(tt.string)) { - const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1); - tsParseAmbientExternalModuleDeclaration(); - popTypeContext(oldIsType); - return true; - } else if (match(tt.name)) { - const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1); - tsParseModuleOrNamespaceDeclaration(); - popTypeContext(oldIsType); - return true; - } - } - break; - - case ContextualKeyword._namespace: - if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) { - const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1); - tsParseModuleOrNamespaceDeclaration(); - popTypeContext(oldIsType); - return true; - } - break; - - case ContextualKeyword._type: - if (tsCheckLineTerminator(isBeforeToken) && match(tt.name)) { - const oldIsType = pushTypeContext(isBeforeToken ? 2 : 1); - tsParseTypeAliasDeclaration(); - popTypeContext(oldIsType); - return true; - } - break; - - default: - break; - } - return false; -} - -function tsCheckLineTerminator(isBeforeToken) { - if (isBeforeToken) { - // Babel checks hasFollowingLineBreak here and returns false, but this - // doesn't actually come up, e.g. `export interface` can never be on its own - // line in valid code. - next(); - return true; - } else { - return !isLineTerminator(); - } -} - -// Returns true if there was a generic async arrow function. -function tsTryParseGenericAsyncArrowFunction() { - const snapshot = state.snapshot(); - - tsParseTypeParameters(); - parseFunctionParams(); - tsTryParseTypeOrTypePredicateAnnotation(); - expect(tt.arrow); - - if (state.error) { - state.restoreFromSnapshot(snapshot); - return false; - } - - parseFunctionBody(true); - return true; -} - -/** - * If necessary, hack the tokenizer state so that this bitshift was actually a - * less-than token, then keep parsing. This should only be used in situations - * where we restore from snapshot on error (which reverts this change) or - * where bitshift would be illegal anyway (e.g. in a class "extends" clause). - * - * This hack is useful to handle situations like foo<() => void>() where - * there can legitimately be two open-angle-brackets in a row in TS. - */ -function tsParseTypeArgumentsWithPossibleBitshift() { - if (state.type === tt.bitShiftL) { - state.pos -= 1; - finishToken(tt.lessThan); - } - tsParseTypeArguments(); -} - -function tsParseTypeArguments() { - const oldIsType = pushTypeContext(0); - expect(tt.lessThan); - while (!match(tt.greaterThan) && !state.error) { - tsParseType(); - eat(tt.comma); - } - if (!oldIsType) { - // If the type arguments are present in an expression context, e.g. - // f(), then the > sign should be tokenized as a non-type token. - // In particular, f(a < b, c >= d) should parse the >= as a single token, - // resulting in a syntax error and fallback to the non-type-args - // interpretation. In the success case, even though the > is tokenized as a - // non-type token, it still must be marked as a type token so that it is - // erased. - popTypeContext(oldIsType); - rescan_gt(); - expect(tt.greaterThan); - state.tokens[state.tokens.length - 1].isType = true; - } else { - expect(tt.greaterThan); - popTypeContext(oldIsType); - } -} - -export function tsIsDeclarationStart() { - if (match(tt.name)) { - switch (state.contextualKeyword) { - case ContextualKeyword._abstract: - case ContextualKeyword._declare: - case ContextualKeyword._enum: - case ContextualKeyword._interface: - case ContextualKeyword._module: - case ContextualKeyword._namespace: - case ContextualKeyword._type: - return true; - default: - break; - } - } - - return false; -} - -// ====================================================== -// OVERRIDES -// ====================================================== - -export function tsParseFunctionBodyAndFinish(functionStart, funcContextId) { - // For arrow functions, `parseArrow` handles the return type itself. - if (match(tt.colon)) { - tsParseTypeOrTypePredicateAnnotation(tt.colon); - } - - // The original code checked the node type to make sure this function type allows a missing - // body, but we skip that to avoid sending around the node type. We instead just use the - // allowExpressionBody boolean to make sure it's not an arrow function. - if (!match(tt.braceL) && isLineTerminator()) { - // Retroactively mark the function declaration as a type. - let i = state.tokens.length - 1; - while ( - i >= 0 && - (state.tokens[i].start >= functionStart || - state.tokens[i].type === tt._default || - state.tokens[i].type === tt._export) - ) { - state.tokens[i].isType = true; - i--; - } - return; - } - - parseFunctionBody(false, funcContextId); -} - -export function tsParseSubscript( - startTokenIndex, - noCalls, - stopState, -) { - if (!hasPrecedingLineBreak() && eat(tt.bang)) { - state.tokens[state.tokens.length - 1].type = tt.nonNullAssertion; - return; - } - - if (match(tt.lessThan) || match(tt.bitShiftL)) { - // There are number of things we are going to "maybe" parse, like type arguments on - // tagged template expressions. If any of them fail, walk it back and continue. - const snapshot = state.snapshot(); - - if (!noCalls && atPossibleAsync()) { - // Almost certainly this is a generic async function `async () => ... - // But it might be a call with a type argument `async();` - const asyncArrowFn = tsTryParseGenericAsyncArrowFunction(); - if (asyncArrowFn) { - return; - } - } - tsParseTypeArgumentsWithPossibleBitshift(); - if (!noCalls && eat(tt.parenL)) { - // With f(), the subscriptStartIndex marker is on the ( token. - state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - parseCallExpressionArguments(); - } else if (match(tt.backQuote)) { - // Tagged template with a type argument. - parseTemplate(); - } else if ( - // The remaining possible case is an instantiation expression, e.g. - // Array . Check for a few cases that would disqualify it and - // cause us to bail out. - // a>c is not (a)>c, but a<(b>>c) - state.type === tt.greaterThan || - // ac is (ac - (state.type !== tt.parenL && - Boolean(state.type & TokenType.IS_EXPRESSION_START) && - !hasPrecedingLineBreak()) - ) { - // Bail out. We have something like ac, which is not an expression with - // type arguments but an (a < b) > c comparison. - unexpected(); - } - - if (state.error) { - state.restoreFromSnapshot(snapshot); - } else { - return; - } - } else if (!noCalls && match(tt.questionDot) && lookaheadType() === tt.lessThan) { - // If we see f?.<, then this must be an optional call with a type argument. - next(); - state.tokens[startTokenIndex].isOptionalChainStart = true; - // With f?.(), the subscriptStartIndex marker is on the ?. token. - state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - - tsParseTypeArguments(); - expect(tt.parenL); - parseCallExpressionArguments(); - } - baseParseSubscript(startTokenIndex, noCalls, stopState); -} - -export function tsTryParseExport() { - if (eat(tt._import)) { - // One of these cases: - // export import A = B; - // export import type A = require("A"); - if (isContextual(ContextualKeyword._type) && lookaheadType() !== tt.eq) { - // Eat a `type` token, unless it's actually an identifier name. - expectContextual(ContextualKeyword._type); - } - tsParseImportEqualsDeclaration(); - return true; - } else if (eat(tt.eq)) { - // `export = x;` - parseExpression(); - semicolon(); - return true; - } else if (eatContextual(ContextualKeyword._as)) { - // `export as namespace A;` - // See `parseNamespaceExportDeclaration` in TypeScript's own parser - expectContextual(ContextualKeyword._namespace); - parseIdentifier(); - semicolon(); - return true; - } else { - if (isContextual(ContextualKeyword._type)) { - const nextType = lookaheadType(); - // export type {foo} from 'a'; - // export type * from 'a';' - // export type * as ns from 'a';' - if (nextType === tt.braceL || nextType === tt.star) { - next(); - } - } - return false; - } -} - -/** - * Parse a TS import specifier, which may be prefixed with "type" and may be of - * the form `foo as bar`. - * - * The number of identifier-like tokens we see happens to be enough to uniquely - * identify the form, so simply count the number of identifiers rather than - * matching the words `type` or `as`. This is particularly important because - * `type` and `as` could each actually be plain identifiers rather than - * keywords. - */ -export function tsParseImportSpecifier() { - parseIdentifier(); - if (match(tt.comma) || match(tt.braceR)) { - // import {foo} - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration; - return; - } - parseIdentifier(); - if (match(tt.comma) || match(tt.braceR)) { - // import {type foo} - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration; - state.tokens[state.tokens.length - 2].isType = true; - state.tokens[state.tokens.length - 1].isType = true; - return; - } - parseIdentifier(); - if (match(tt.comma) || match(tt.braceR)) { - // import {foo as bar} - state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ImportAccess; - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration; - return; - } - parseIdentifier(); - // import {type foo as bar} - state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ImportAccess; - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration; - state.tokens[state.tokens.length - 4].isType = true; - state.tokens[state.tokens.length - 3].isType = true; - state.tokens[state.tokens.length - 2].isType = true; - state.tokens[state.tokens.length - 1].isType = true; -} - -/** - * Just like named import specifiers, export specifiers can have from 1 to 4 - * tokens, inclusive, and the number of tokens determines the role of each token. - */ -export function tsParseExportSpecifier() { - parseIdentifier(); - if (match(tt.comma) || match(tt.braceR)) { - // export {foo} - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ExportAccess; - return; - } - parseIdentifier(); - if (match(tt.comma) || match(tt.braceR)) { - // export {type foo} - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ExportAccess; - state.tokens[state.tokens.length - 2].isType = true; - state.tokens[state.tokens.length - 1].isType = true; - return; - } - parseIdentifier(); - if (match(tt.comma) || match(tt.braceR)) { - // export {foo as bar} - state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ExportAccess; - return; - } - parseIdentifier(); - // export {type foo as bar} - state.tokens[state.tokens.length - 3].identifierRole = IdentifierRole.ExportAccess; - state.tokens[state.tokens.length - 4].isType = true; - state.tokens[state.tokens.length - 3].isType = true; - state.tokens[state.tokens.length - 2].isType = true; - state.tokens[state.tokens.length - 1].isType = true; -} - -export function tsTryParseExportDefaultExpression() { - if (isContextual(ContextualKeyword._abstract) && lookaheadType() === tt._class) { - state.type = tt._abstract; - next(); // Skip "abstract" - parseClass(true, true); - return true; - } - if (isContextual(ContextualKeyword._interface)) { - // Make sure "export default" are considered type tokens so the whole thing is removed. - const oldIsType = pushTypeContext(2); - tsParseDeclaration(ContextualKeyword._interface, true); - popTypeContext(oldIsType); - return true; - } - return false; -} - -export function tsTryParseStatementContent() { - if (state.type === tt._const) { - const ahead = lookaheadTypeAndKeyword(); - if (ahead.type === tt.name && ahead.contextualKeyword === ContextualKeyword._enum) { - expect(tt._const); - expectContextual(ContextualKeyword._enum); - state.tokens[state.tokens.length - 1].type = tt._enum; - tsParseEnumDeclaration(); - return true; - } - } - return false; -} - -export function tsTryParseClassMemberWithIsStatic(isStatic) { - const memberStartIndexAfterStatic = state.tokens.length; - tsParseModifiers([ - ContextualKeyword._abstract, - ContextualKeyword._readonly, - ContextualKeyword._declare, - ContextualKeyword._static, - ContextualKeyword._override, - ]); - - const modifiersEndIndex = state.tokens.length; - const found = tsTryParseIndexSignature(); - if (found) { - // Index signatures are type declarations, so set the modifier tokens as - // type tokens. Most tokens could be assumed to be type tokens, but `static` - // is ambiguous unless we set it explicitly here. - const memberStartIndex = isStatic - ? memberStartIndexAfterStatic - 1 - : memberStartIndexAfterStatic; - for (let i = memberStartIndex; i < modifiersEndIndex; i++) { - state.tokens[i].isType = true; - } - return true; - } - return false; -} - -// Note: The reason we do this in `parseIdentifierStatement` and not `parseStatement` -// is that e.g. `type()` is valid JS, so we must try parsing that first. -// If it's really a type, we will parse `type` as the statement, and can correct it here -// by parsing the rest. -export function tsParseIdentifierStatement(contextualKeyword) { - const matched = tsParseExpressionStatement(contextualKeyword); - if (!matched) { - semicolon(); - } -} - -export function tsParseExportDeclaration() { - // "export declare" is equivalent to just "export". - const isDeclare = eatContextual(ContextualKeyword._declare); - if (isDeclare) { - state.tokens[state.tokens.length - 1].type = tt._declare; - } - - let matchedDeclaration = false; - if (match(tt.name)) { - if (isDeclare) { - const oldIsType = pushTypeContext(2); - matchedDeclaration = tsTryParseExportDeclaration(); - popTypeContext(oldIsType); - } else { - matchedDeclaration = tsTryParseExportDeclaration(); - } - } - if (!matchedDeclaration) { - if (isDeclare) { - const oldIsType = pushTypeContext(2); - parseStatement(true); - popTypeContext(oldIsType); - } else { - parseStatement(true); - } - } -} - -export function tsAfterParseClassSuper(hasSuper) { - if (hasSuper && (match(tt.lessThan) || match(tt.bitShiftL))) { - tsParseTypeArgumentsWithPossibleBitshift(); - } - if (eatContextual(ContextualKeyword._implements)) { - state.tokens[state.tokens.length - 1].type = tt._implements; - const oldIsType = pushTypeContext(1); - tsParseHeritageClause(); - popTypeContext(oldIsType); - } -} - -export function tsStartParseObjPropValue() { - tsTryParseTypeParameters(); -} - -export function tsStartParseFunctionParams() { - tsTryParseTypeParameters(); -} - -// `let x: number;` -export function tsAfterParseVarHead() { - const oldIsType = pushTypeContext(0); - if (!hasPrecedingLineBreak()) { - eat(tt.bang); - } - tsTryParseTypeAnnotation(); - popTypeContext(oldIsType); -} - -// parse the return type of an async arrow function - let foo = (async (): number => {}); -export function tsStartParseAsyncArrowFromCallExpression() { - if (match(tt.colon)) { - tsParseTypeAnnotation(); - } -} - -// Returns true if the expression was an arrow function. -export function tsParseMaybeAssign(noIn, isWithinParens) { - // Note: When the JSX plugin is on, type assertions (` x`) aren't valid syntax. - if (isJSXEnabled) { - return tsParseMaybeAssignWithJSX(noIn, isWithinParens); - } else { - return tsParseMaybeAssignWithoutJSX(noIn, isWithinParens); - } -} - -export function tsParseMaybeAssignWithJSX(noIn, isWithinParens) { - if (!match(tt.lessThan)) { - return baseParseMaybeAssign(noIn, isWithinParens); - } - - // Prefer to parse JSX if possible. But may be an arrow fn. - const snapshot = state.snapshot(); - let wasArrow = baseParseMaybeAssign(noIn, isWithinParens); - if (state.error) { - state.restoreFromSnapshot(snapshot); - } else { - return wasArrow; - } - - // Otherwise, try as type-parameterized arrow function. - state.type = tt.typeParameterStart; - // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`. - tsParseTypeParameters(); - wasArrow = baseParseMaybeAssign(noIn, isWithinParens); - if (!wasArrow) { - unexpected(); - } - - return wasArrow; -} - -export function tsParseMaybeAssignWithoutJSX(noIn, isWithinParens) { - if (!match(tt.lessThan)) { - return baseParseMaybeAssign(noIn, isWithinParens); - } - - const snapshot = state.snapshot(); - // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`. - tsParseTypeParameters(); - const wasArrow = baseParseMaybeAssign(noIn, isWithinParens); - if (!wasArrow) { - unexpected(); - } - if (state.error) { - state.restoreFromSnapshot(snapshot); - } else { - return wasArrow; - } - - // Try parsing a type cast instead of an arrow function. - // This will start with a type assertion (via parseMaybeUnary). - // But don't directly call `tsParseTypeAssertion` because we want to handle any binary after it. - return baseParseMaybeAssign(noIn, isWithinParens); -} - -export function tsParseArrow() { - if (match(tt.colon)) { - // This is different from how the TS parser does it. - // TS uses lookahead. Babylon parses it as a parenthesized expression and converts. - const snapshot = state.snapshot(); - - tsParseTypeOrTypePredicateAnnotation(tt.colon); - if (canInsertSemicolon()) unexpected(); - if (!match(tt.arrow)) unexpected(); - - if (state.error) { - state.restoreFromSnapshot(snapshot); - } - } - return eat(tt.arrow); -} - -// Allow type annotations inside of a parameter list. -export function tsParseAssignableListItemTypes() { - const oldIsType = pushTypeContext(0); - eat(tt.question); - tsTryParseTypeAnnotation(); - popTypeContext(oldIsType); -} - -export function tsParseMaybeDecoratorArguments() { - if (match(tt.lessThan) || match(tt.bitShiftL)) { - tsParseTypeArgumentsWithPossibleBitshift(); - } - baseParseMaybeDecoratorArguments(); -} diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/index.js b/node_modules/sucrase/dist/esm/parser/tokenizer/index.js deleted file mode 100644 index 69f286a..0000000 --- a/node_modules/sucrase/dist/esm/parser/tokenizer/index.js +++ /dev/null @@ -1,1004 +0,0 @@ -/* eslint max-len: 0 */ - -import {input, isFlowEnabled, state} from "../traverser/base"; -import {unexpected} from "../traverser/util"; -import {charCodes} from "../util/charcodes"; -import {IS_IDENTIFIER_CHAR, IS_IDENTIFIER_START} from "../util/identifier"; -import {IS_WHITESPACE, skipWhiteSpace} from "../util/whitespace"; -import {ContextualKeyword} from "./keywords"; -import readWord from "./readWord"; -import { TokenType as tt} from "./types"; - -export var IdentifierRole; (function (IdentifierRole) { - const Access = 0; IdentifierRole[IdentifierRole["Access"] = Access] = "Access"; - const ExportAccess = Access + 1; IdentifierRole[IdentifierRole["ExportAccess"] = ExportAccess] = "ExportAccess"; - const TopLevelDeclaration = ExportAccess + 1; IdentifierRole[IdentifierRole["TopLevelDeclaration"] = TopLevelDeclaration] = "TopLevelDeclaration"; - const FunctionScopedDeclaration = TopLevelDeclaration + 1; IdentifierRole[IdentifierRole["FunctionScopedDeclaration"] = FunctionScopedDeclaration] = "FunctionScopedDeclaration"; - const BlockScopedDeclaration = FunctionScopedDeclaration + 1; IdentifierRole[IdentifierRole["BlockScopedDeclaration"] = BlockScopedDeclaration] = "BlockScopedDeclaration"; - const ObjectShorthandTopLevelDeclaration = BlockScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandTopLevelDeclaration"] = ObjectShorthandTopLevelDeclaration] = "ObjectShorthandTopLevelDeclaration"; - const ObjectShorthandFunctionScopedDeclaration = ObjectShorthandTopLevelDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandFunctionScopedDeclaration"] = ObjectShorthandFunctionScopedDeclaration] = "ObjectShorthandFunctionScopedDeclaration"; - const ObjectShorthandBlockScopedDeclaration = ObjectShorthandFunctionScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandBlockScopedDeclaration"] = ObjectShorthandBlockScopedDeclaration] = "ObjectShorthandBlockScopedDeclaration"; - const ObjectShorthand = ObjectShorthandBlockScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthand"] = ObjectShorthand] = "ObjectShorthand"; - // Any identifier bound in an import statement, e.g. both A and b from - // `import A, * as b from 'A';` - const ImportDeclaration = ObjectShorthand + 1; IdentifierRole[IdentifierRole["ImportDeclaration"] = ImportDeclaration] = "ImportDeclaration"; - const ObjectKey = ImportDeclaration + 1; IdentifierRole[IdentifierRole["ObjectKey"] = ObjectKey] = "ObjectKey"; - // The `foo` in `import {foo as bar} from "./abc";`. - const ImportAccess = ObjectKey + 1; IdentifierRole[IdentifierRole["ImportAccess"] = ImportAccess] = "ImportAccess"; -})(IdentifierRole || (IdentifierRole = {})); - -/** - * Extra information on jsxTagStart tokens, used to determine which of the three - * jsx functions are called in the automatic transform. - */ -export var JSXRole; (function (JSXRole) { - // The element is self-closing or has a body that resolves to empty. We - // shouldn't emit children at all in this case. - const NoChildren = 0; JSXRole[JSXRole["NoChildren"] = NoChildren] = "NoChildren"; - // The element has a single explicit child, which might still be an arbitrary - // expression like an array. We should emit that expression as the children. - const OneChild = NoChildren + 1; JSXRole[JSXRole["OneChild"] = OneChild] = "OneChild"; - // The element has at least two explicitly-specified children or has spread - // children, so child positions are assumed to be "static". We should wrap - // these children in an array. - const StaticChildren = OneChild + 1; JSXRole[JSXRole["StaticChildren"] = StaticChildren] = "StaticChildren"; - // The element has a prop named "key" after a prop spread, so we should fall - // back to the createElement function. - const KeyAfterPropSpread = StaticChildren + 1; JSXRole[JSXRole["KeyAfterPropSpread"] = KeyAfterPropSpread] = "KeyAfterPropSpread"; -})(JSXRole || (JSXRole = {})); - -export function isDeclaration(token) { - const role = token.identifierRole; - return ( - role === IdentifierRole.TopLevelDeclaration || - role === IdentifierRole.FunctionScopedDeclaration || - role === IdentifierRole.BlockScopedDeclaration || - role === IdentifierRole.ObjectShorthandTopLevelDeclaration || - role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration || - role === IdentifierRole.ObjectShorthandBlockScopedDeclaration - ); -} - -export function isNonTopLevelDeclaration(token) { - const role = token.identifierRole; - return ( - role === IdentifierRole.FunctionScopedDeclaration || - role === IdentifierRole.BlockScopedDeclaration || - role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration || - role === IdentifierRole.ObjectShorthandBlockScopedDeclaration - ); -} - -export function isTopLevelDeclaration(token) { - const role = token.identifierRole; - return ( - role === IdentifierRole.TopLevelDeclaration || - role === IdentifierRole.ObjectShorthandTopLevelDeclaration || - role === IdentifierRole.ImportDeclaration - ); -} - -export function isBlockScopedDeclaration(token) { - const role = token.identifierRole; - // Treat top-level declarations as block scope since the distinction doesn't matter here. - return ( - role === IdentifierRole.TopLevelDeclaration || - role === IdentifierRole.BlockScopedDeclaration || - role === IdentifierRole.ObjectShorthandTopLevelDeclaration || - role === IdentifierRole.ObjectShorthandBlockScopedDeclaration - ); -} - -export function isFunctionScopedDeclaration(token) { - const role = token.identifierRole; - return ( - role === IdentifierRole.FunctionScopedDeclaration || - role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration - ); -} - -export function isObjectShorthandDeclaration(token) { - return ( - token.identifierRole === IdentifierRole.ObjectShorthandTopLevelDeclaration || - token.identifierRole === IdentifierRole.ObjectShorthandBlockScopedDeclaration || - token.identifierRole === IdentifierRole.ObjectShorthandFunctionScopedDeclaration - ); -} - -// Object type used to represent tokens. Note that normally, tokens -// simply exist as properties on the parser object. This is only -// used for the onToken callback and the external tokenizer. -export class Token { - constructor() { - this.type = state.type; - this.contextualKeyword = state.contextualKeyword; - this.start = state.start; - this.end = state.end; - this.scopeDepth = state.scopeDepth; - this.isType = state.isType; - this.identifierRole = null; - this.jsxRole = null; - this.shadowsGlobal = false; - this.isAsyncOperation = false; - this.contextId = null; - this.rhsEndIndex = null; - this.isExpression = false; - this.numNullishCoalesceStarts = 0; - this.numNullishCoalesceEnds = 0; - this.isOptionalChainStart = false; - this.isOptionalChainEnd = false; - this.subscriptStartIndex = null; - this.nullishStartIndex = null; - } - - - - - - - - - - // Initially false for all tokens, then may be computed in a follow-up step that does scope - // analysis. - - // Initially false for all tokens, but may be set during transform to mark it as containing an - // await operation. - - - // For assignments, the index of the RHS. For export tokens, the end of the export. - - // For class tokens, records if the class is a class expression or a class statement. - - // Number of times to insert a `nullishCoalesce(` snippet before this token. - - // Number of times to insert a `)` snippet after this token. - - // If true, insert an `optionalChain([` snippet before this token. - - // If true, insert a `])` snippet after this token. - - // Tag for `.`, `?.`, `[`, `?.[`, `(`, and `?.(` to denote the "root" token for this - // subscript chain. This can be used to determine if this chain is an optional chain. - - // Tag for `??` operators to denote the root token for this nullish coalescing call. - -} - -// ## Tokenizer - -// Move to the next token -export function next() { - state.tokens.push(new Token()); - nextToken(); -} - -// Call instead of next when inside a template, since that needs to be handled differently. -export function nextTemplateToken() { - state.tokens.push(new Token()); - state.start = state.pos; - readTmplToken(); -} - -// The tokenizer never parses regexes by default. Instead, the parser is responsible for -// instructing it to parse a regex when we see a slash at the start of an expression. -export function retokenizeSlashAsRegex() { - if (state.type === tt.assign) { - --state.pos; - } - readRegexp(); -} - -export function pushTypeContext(existingTokensInType) { - for (let i = state.tokens.length - existingTokensInType; i < state.tokens.length; i++) { - state.tokens[i].isType = true; - } - const oldIsType = state.isType; - state.isType = true; - return oldIsType; -} - -export function popTypeContext(oldIsType) { - state.isType = oldIsType; -} - -export function eat(type) { - if (match(type)) { - next(); - return true; - } else { - return false; - } -} - -export function eatTypeToken(tokenType) { - const oldIsType = state.isType; - state.isType = true; - eat(tokenType); - state.isType = oldIsType; -} - -export function match(type) { - return state.type === type; -} - -export function lookaheadType() { - const snapshot = state.snapshot(); - next(); - const type = state.type; - state.restoreFromSnapshot(snapshot); - return type; -} - -export class TypeAndKeyword { - - - constructor(type, contextualKeyword) { - this.type = type; - this.contextualKeyword = contextualKeyword; - } -} - -export function lookaheadTypeAndKeyword() { - const snapshot = state.snapshot(); - next(); - const type = state.type; - const contextualKeyword = state.contextualKeyword; - state.restoreFromSnapshot(snapshot); - return new TypeAndKeyword(type, contextualKeyword); -} - -export function nextTokenStart() { - return nextTokenStartSince(state.pos); -} - -export function nextTokenStartSince(pos) { - skipWhiteSpace.lastIndex = pos; - const skip = skipWhiteSpace.exec(input); - return pos + skip[0].length; -} - -export function lookaheadCharCode() { - return input.charCodeAt(nextTokenStart()); -} - -// Read a single token, updating the parser object's token-related -// properties. -export function nextToken() { - skipSpace(); - state.start = state.pos; - if (state.pos >= input.length) { - const tokens = state.tokens; - // We normally run past the end a bit, but if we're way past the end, avoid an infinite loop. - // Also check the token positions rather than the types since sometimes we rewrite the token - // type to something else. - if ( - tokens.length >= 2 && - tokens[tokens.length - 1].start >= input.length && - tokens[tokens.length - 2].start >= input.length - ) { - unexpected("Unexpectedly reached the end of input."); - } - finishToken(tt.eof); - return; - } - readToken(input.charCodeAt(state.pos)); -} - -function readToken(code) { - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if ( - IS_IDENTIFIER_START[code] || - code === charCodes.backslash || - (code === charCodes.atSign && input.charCodeAt(state.pos + 1) === charCodes.atSign) - ) { - readWord(); - } else { - getTokenFromCode(code); - } -} - -function skipBlockComment() { - while ( - input.charCodeAt(state.pos) !== charCodes.asterisk || - input.charCodeAt(state.pos + 1) !== charCodes.slash - ) { - state.pos++; - if (state.pos > input.length) { - unexpected("Unterminated comment", state.pos - 2); - return; - } - } - state.pos += 2; -} - -export function skipLineComment(startSkip) { - let ch = input.charCodeAt((state.pos += startSkip)); - if (state.pos < input.length) { - while ( - ch !== charCodes.lineFeed && - ch !== charCodes.carriageReturn && - ch !== charCodes.lineSeparator && - ch !== charCodes.paragraphSeparator && - ++state.pos < input.length - ) { - ch = input.charCodeAt(state.pos); - } - } -} - -// Called at the start of the parse and after every token. Skips -// whitespace and comments. -export function skipSpace() { - while (state.pos < input.length) { - const ch = input.charCodeAt(state.pos); - switch (ch) { - case charCodes.carriageReturn: - if (input.charCodeAt(state.pos + 1) === charCodes.lineFeed) { - ++state.pos; - } - - case charCodes.lineFeed: - case charCodes.lineSeparator: - case charCodes.paragraphSeparator: - ++state.pos; - break; - - case charCodes.slash: - switch (input.charCodeAt(state.pos + 1)) { - case charCodes.asterisk: - state.pos += 2; - skipBlockComment(); - break; - - case charCodes.slash: - skipLineComment(2); - break; - - default: - return; - } - break; - - default: - if (IS_WHITESPACE[ch]) { - ++state.pos; - } else { - return; - } - } - } -} - -// Called at the end of every token. Sets various fields, and skips the space after the token, so -// that the next one's `start` will point at the right position. -export function finishToken( - type, - contextualKeyword = ContextualKeyword.NONE, -) { - state.end = state.pos; - state.type = type; - state.contextualKeyword = contextualKeyword; -} - -// ### Token reading - -// This is the function that is called to fetch the next token. It -// is somewhat obscure, because it works in character codes rather -// than characters, and because operator parsing has been inlined -// into it. -// -// All in the name of speed. -function readToken_dot() { - const nextChar = input.charCodeAt(state.pos + 1); - if (nextChar >= charCodes.digit0 && nextChar <= charCodes.digit9) { - readNumber(true); - return; - } - - if (nextChar === charCodes.dot && input.charCodeAt(state.pos + 2) === charCodes.dot) { - state.pos += 3; - finishToken(tt.ellipsis); - } else { - ++state.pos; - finishToken(tt.dot); - } -} - -function readToken_slash() { - const nextChar = input.charCodeAt(state.pos + 1); - if (nextChar === charCodes.equalsTo) { - finishOp(tt.assign, 2); - } else { - finishOp(tt.slash, 1); - } -} - -function readToken_mult_modulo(code) { - // '%*' - let tokenType = code === charCodes.asterisk ? tt.star : tt.modulo; - let width = 1; - let nextChar = input.charCodeAt(state.pos + 1); - - // Exponentiation operator ** - if (code === charCodes.asterisk && nextChar === charCodes.asterisk) { - width++; - nextChar = input.charCodeAt(state.pos + 2); - tokenType = tt.exponent; - } - - // Match *= or %=, disallowing *=> which can be valid in flow. - if ( - nextChar === charCodes.equalsTo && - input.charCodeAt(state.pos + 2) !== charCodes.greaterThan - ) { - width++; - tokenType = tt.assign; - } - - finishOp(tokenType, width); -} - -function readToken_pipe_amp(code) { - // '|&' - const nextChar = input.charCodeAt(state.pos + 1); - - if (nextChar === code) { - if (input.charCodeAt(state.pos + 2) === charCodes.equalsTo) { - // ||= or &&= - finishOp(tt.assign, 3); - } else { - // || or && - finishOp(code === charCodes.verticalBar ? tt.logicalOR : tt.logicalAND, 2); - } - return; - } - - if (code === charCodes.verticalBar) { - // '|>' - if (nextChar === charCodes.greaterThan) { - finishOp(tt.pipeline, 2); - return; - } else if (nextChar === charCodes.rightCurlyBrace && isFlowEnabled) { - // '|}' - finishOp(tt.braceBarR, 2); - return; - } - } - - if (nextChar === charCodes.equalsTo) { - finishOp(tt.assign, 2); - return; - } - - finishOp(code === charCodes.verticalBar ? tt.bitwiseOR : tt.bitwiseAND, 1); -} - -function readToken_caret() { - // '^' - const nextChar = input.charCodeAt(state.pos + 1); - if (nextChar === charCodes.equalsTo) { - finishOp(tt.assign, 2); - } else { - finishOp(tt.bitwiseXOR, 1); - } -} - -function readToken_plus_min(code) { - // '+-' - const nextChar = input.charCodeAt(state.pos + 1); - - if (nextChar === code) { - // Tentatively call this a prefix operator, but it might be changed to postfix later. - finishOp(tt.preIncDec, 2); - return; - } - - if (nextChar === charCodes.equalsTo) { - finishOp(tt.assign, 2); - } else if (code === charCodes.plusSign) { - finishOp(tt.plus, 1); - } else { - finishOp(tt.minus, 1); - } -} - -function readToken_lt() { - const nextChar = input.charCodeAt(state.pos + 1); - - if (nextChar === charCodes.lessThan) { - if (input.charCodeAt(state.pos + 2) === charCodes.equalsTo) { - finishOp(tt.assign, 3); - return; - } - // We see <<, but need to be really careful about whether to treat it as a - // true left-shift or as two < tokens. - if (state.isType) { - // Within a type, << might come up in a snippet like `Array<() => void>`, - // so treat it as two < tokens. Importantly, this should only override << - // rather than other tokens like <= . If we treated <= as < in a type - // context, then the snippet `a as T <= 1` would incorrectly start parsing - // a type argument on T. We don't need to worry about `a as T << 1` - // because TypeScript disallows that syntax. - finishOp(tt.lessThan, 1); - } else { - // Outside a type, this might be a true left-shift operator, or it might - // still be two open-type-arg tokens, such as in `f<() => void>()`. We - // look at the token while considering the `f`, so we don't yet know that - // we're in a type context. In this case, we initially tokenize as a - // left-shift and correct after-the-fact as necessary in - // tsParseTypeArgumentsWithPossibleBitshift . - finishOp(tt.bitShiftL, 2); - } - return; - } - - if (nextChar === charCodes.equalsTo) { - // <= - finishOp(tt.relationalOrEqual, 2); - } else { - finishOp(tt.lessThan, 1); - } -} - -function readToken_gt() { - if (state.isType) { - // Avoid right-shift for things like `Array>` and - // greater-than-or-equal for things like `const a: Array=[];`. - finishOp(tt.greaterThan, 1); - return; - } - - const nextChar = input.charCodeAt(state.pos + 1); - - if (nextChar === charCodes.greaterThan) { - const size = input.charCodeAt(state.pos + 2) === charCodes.greaterThan ? 3 : 2; - if (input.charCodeAt(state.pos + size) === charCodes.equalsTo) { - finishOp(tt.assign, size + 1); - return; - } - finishOp(tt.bitShiftR, size); - return; - } - - if (nextChar === charCodes.equalsTo) { - // >= - finishOp(tt.relationalOrEqual, 2); - } else { - finishOp(tt.greaterThan, 1); - } -} - -/** - * Reinterpret a possible > token when transitioning from a type to a non-type - * context. - * - * This comes up in two situations where >= needs to be treated as one token: - * - After an `as` expression, like in the code `a as T >= 1`. - * - In a type argument in an expression context, e.g. `f(a < b, c >= d)`, we - * need to see the token as >= so that we get an error and backtrack to - * normal expression parsing. - * - * Other situations require >= to be seen as two tokens, e.g. - * `const x: Array=[];`, so it's important to treat > as its own token in - * typical type parsing situations. - */ -export function rescan_gt() { - if (state.type === tt.greaterThan) { - state.pos -= 1; - readToken_gt(); - } -} - -function readToken_eq_excl(code) { - // '=!' - const nextChar = input.charCodeAt(state.pos + 1); - if (nextChar === charCodes.equalsTo) { - finishOp(tt.equality, input.charCodeAt(state.pos + 2) === charCodes.equalsTo ? 3 : 2); - return; - } - if (code === charCodes.equalsTo && nextChar === charCodes.greaterThan) { - // '=>' - state.pos += 2; - finishToken(tt.arrow); - return; - } - finishOp(code === charCodes.equalsTo ? tt.eq : tt.bang, 1); -} - -function readToken_question() { - // '?' - const nextChar = input.charCodeAt(state.pos + 1); - const nextChar2 = input.charCodeAt(state.pos + 2); - if ( - nextChar === charCodes.questionMark && - // In Flow (but not TypeScript), ??string is a valid type that should be - // tokenized as two individual ? tokens. - !(isFlowEnabled && state.isType) - ) { - if (nextChar2 === charCodes.equalsTo) { - // '??=' - finishOp(tt.assign, 3); - } else { - // '??' - finishOp(tt.nullishCoalescing, 2); - } - } else if ( - nextChar === charCodes.dot && - !(nextChar2 >= charCodes.digit0 && nextChar2 <= charCodes.digit9) - ) { - // '.' not followed by a number - state.pos += 2; - finishToken(tt.questionDot); - } else { - ++state.pos; - finishToken(tt.question); - } -} - -export function getTokenFromCode(code) { - switch (code) { - case charCodes.numberSign: - ++state.pos; - finishToken(tt.hash); - return; - - // The interpretation of a dot depends on whether it is followed - // by a digit or another two dots. - - case charCodes.dot: - readToken_dot(); - return; - - // Punctuation tokens. - case charCodes.leftParenthesis: - ++state.pos; - finishToken(tt.parenL); - return; - case charCodes.rightParenthesis: - ++state.pos; - finishToken(tt.parenR); - return; - case charCodes.semicolon: - ++state.pos; - finishToken(tt.semi); - return; - case charCodes.comma: - ++state.pos; - finishToken(tt.comma); - return; - case charCodes.leftSquareBracket: - ++state.pos; - finishToken(tt.bracketL); - return; - case charCodes.rightSquareBracket: - ++state.pos; - finishToken(tt.bracketR); - return; - - case charCodes.leftCurlyBrace: - if (isFlowEnabled && input.charCodeAt(state.pos + 1) === charCodes.verticalBar) { - finishOp(tt.braceBarL, 2); - } else { - ++state.pos; - finishToken(tt.braceL); - } - return; - - case charCodes.rightCurlyBrace: - ++state.pos; - finishToken(tt.braceR); - return; - - case charCodes.colon: - if (input.charCodeAt(state.pos + 1) === charCodes.colon) { - finishOp(tt.doubleColon, 2); - } else { - ++state.pos; - finishToken(tt.colon); - } - return; - - case charCodes.questionMark: - readToken_question(); - return; - case charCodes.atSign: - ++state.pos; - finishToken(tt.at); - return; - - case charCodes.graveAccent: - ++state.pos; - finishToken(tt.backQuote); - return; - - case charCodes.digit0: { - const nextChar = input.charCodeAt(state.pos + 1); - // '0x', '0X', '0o', '0O', '0b', '0B' - if ( - nextChar === charCodes.lowercaseX || - nextChar === charCodes.uppercaseX || - nextChar === charCodes.lowercaseO || - nextChar === charCodes.uppercaseO || - nextChar === charCodes.lowercaseB || - nextChar === charCodes.uppercaseB - ) { - readRadixNumber(); - return; - } - } - // Anything else beginning with a digit is an integer, octal - // number, or float. - case charCodes.digit1: - case charCodes.digit2: - case charCodes.digit3: - case charCodes.digit4: - case charCodes.digit5: - case charCodes.digit6: - case charCodes.digit7: - case charCodes.digit8: - case charCodes.digit9: - readNumber(false); - return; - - // Quotes produce strings. - case charCodes.quotationMark: - case charCodes.apostrophe: - readString(code); - return; - - // Operators are parsed inline in tiny state machines. '=' (charCodes.equalsTo) is - // often referred to. `finishOp` simply skips the amount of - // characters it is given as second argument, and returns a token - // of the type given by its first argument. - - case charCodes.slash: - readToken_slash(); - return; - - case charCodes.percentSign: - case charCodes.asterisk: - readToken_mult_modulo(code); - return; - - case charCodes.verticalBar: - case charCodes.ampersand: - readToken_pipe_amp(code); - return; - - case charCodes.caret: - readToken_caret(); - return; - - case charCodes.plusSign: - case charCodes.dash: - readToken_plus_min(code); - return; - - case charCodes.lessThan: - readToken_lt(); - return; - - case charCodes.greaterThan: - readToken_gt(); - return; - - case charCodes.equalsTo: - case charCodes.exclamationMark: - readToken_eq_excl(code); - return; - - case charCodes.tilde: - finishOp(tt.tilde, 1); - return; - - default: - break; - } - - unexpected(`Unexpected character '${String.fromCharCode(code)}'`, state.pos); -} - -function finishOp(type, size) { - state.pos += size; - finishToken(type); -} - -function readRegexp() { - const start = state.pos; - let escaped = false; - let inClass = false; - for (;;) { - if (state.pos >= input.length) { - unexpected("Unterminated regular expression", start); - return; - } - const code = input.charCodeAt(state.pos); - if (escaped) { - escaped = false; - } else { - if (code === charCodes.leftSquareBracket) { - inClass = true; - } else if (code === charCodes.rightSquareBracket && inClass) { - inClass = false; - } else if (code === charCodes.slash && !inClass) { - break; - } - escaped = code === charCodes.backslash; - } - ++state.pos; - } - ++state.pos; - // Need to use `skipWord` because '\uXXXX' sequences are allowed here (don't ask). - skipWord(); - - finishToken(tt.regexp); -} - -/** - * Read a decimal integer. Note that this can't be unified with the similar code - * in readRadixNumber (which also handles hex digits) because "e" needs to be - * the end of the integer so that we can properly handle scientific notation. - */ -function readInt() { - while (true) { - const code = input.charCodeAt(state.pos); - if ((code >= charCodes.digit0 && code <= charCodes.digit9) || code === charCodes.underscore) { - state.pos++; - } else { - break; - } - } -} - -function readRadixNumber() { - state.pos += 2; // 0x - - // Walk to the end of the number, allowing hex digits. - while (true) { - const code = input.charCodeAt(state.pos); - if ( - (code >= charCodes.digit0 && code <= charCodes.digit9) || - (code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) || - (code >= charCodes.uppercaseA && code <= charCodes.uppercaseF) || - code === charCodes.underscore - ) { - state.pos++; - } else { - break; - } - } - - const nextChar = input.charCodeAt(state.pos); - if (nextChar === charCodes.lowercaseN) { - ++state.pos; - finishToken(tt.bigint); - } else { - finishToken(tt.num); - } -} - -// Read an integer, octal integer, or floating-point number. -function readNumber(startsWithDot) { - let isBigInt = false; - let isDecimal = false; - - if (!startsWithDot) { - readInt(); - } - - let nextChar = input.charCodeAt(state.pos); - if (nextChar === charCodes.dot) { - ++state.pos; - readInt(); - nextChar = input.charCodeAt(state.pos); - } - - if (nextChar === charCodes.uppercaseE || nextChar === charCodes.lowercaseE) { - nextChar = input.charCodeAt(++state.pos); - if (nextChar === charCodes.plusSign || nextChar === charCodes.dash) { - ++state.pos; - } - readInt(); - nextChar = input.charCodeAt(state.pos); - } - - if (nextChar === charCodes.lowercaseN) { - ++state.pos; - isBigInt = true; - } else if (nextChar === charCodes.lowercaseM) { - ++state.pos; - isDecimal = true; - } - - if (isBigInt) { - finishToken(tt.bigint); - return; - } - - if (isDecimal) { - finishToken(tt.decimal); - return; - } - - finishToken(tt.num); -} - -function readString(quote) { - state.pos++; - for (;;) { - if (state.pos >= input.length) { - unexpected("Unterminated string constant"); - return; - } - const ch = input.charCodeAt(state.pos); - if (ch === charCodes.backslash) { - state.pos++; - } else if (ch === quote) { - break; - } - state.pos++; - } - state.pos++; - finishToken(tt.string); -} - -// Reads template string tokens. -function readTmplToken() { - for (;;) { - if (state.pos >= input.length) { - unexpected("Unterminated template"); - return; - } - const ch = input.charCodeAt(state.pos); - if ( - ch === charCodes.graveAccent || - (ch === charCodes.dollarSign && input.charCodeAt(state.pos + 1) === charCodes.leftCurlyBrace) - ) { - if (state.pos === state.start && match(tt.template)) { - if (ch === charCodes.dollarSign) { - state.pos += 2; - finishToken(tt.dollarBraceL); - return; - } else { - ++state.pos; - finishToken(tt.backQuote); - return; - } - } - finishToken(tt.template); - return; - } - if (ch === charCodes.backslash) { - state.pos++; - } - state.pos++; - } -} - -// Skip to the end of the current word. Note that this is the same as the snippet at the end of -// readWord, but calling skipWord from readWord seems to slightly hurt performance from some rough -// measurements. -export function skipWord() { - while (state.pos < input.length) { - const ch = input.charCodeAt(state.pos); - if (IS_IDENTIFIER_CHAR[ch]) { - state.pos++; - } else if (ch === charCodes.backslash) { - // \u - state.pos += 2; - if (input.charCodeAt(state.pos) === charCodes.leftCurlyBrace) { - while ( - state.pos < input.length && - input.charCodeAt(state.pos) !== charCodes.rightCurlyBrace - ) { - state.pos++; - } - state.pos++; - } - } else { - break; - } - } -} diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js b/node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js deleted file mode 100644 index 0dcf1b0..0000000 --- a/node_modules/sucrase/dist/esm/parser/tokenizer/keywords.js +++ /dev/null @@ -1,43 +0,0 @@ -export var ContextualKeyword; (function (ContextualKeyword) { - const NONE = 0; ContextualKeyword[ContextualKeyword["NONE"] = NONE] = "NONE"; - const _abstract = NONE + 1; ContextualKeyword[ContextualKeyword["_abstract"] = _abstract] = "_abstract"; - const _accessor = _abstract + 1; ContextualKeyword[ContextualKeyword["_accessor"] = _accessor] = "_accessor"; - const _as = _accessor + 1; ContextualKeyword[ContextualKeyword["_as"] = _as] = "_as"; - const _assert = _as + 1; ContextualKeyword[ContextualKeyword["_assert"] = _assert] = "_assert"; - const _asserts = _assert + 1; ContextualKeyword[ContextualKeyword["_asserts"] = _asserts] = "_asserts"; - const _async = _asserts + 1; ContextualKeyword[ContextualKeyword["_async"] = _async] = "_async"; - const _await = _async + 1; ContextualKeyword[ContextualKeyword["_await"] = _await] = "_await"; - const _checks = _await + 1; ContextualKeyword[ContextualKeyword["_checks"] = _checks] = "_checks"; - const _constructor = _checks + 1; ContextualKeyword[ContextualKeyword["_constructor"] = _constructor] = "_constructor"; - const _declare = _constructor + 1; ContextualKeyword[ContextualKeyword["_declare"] = _declare] = "_declare"; - const _enum = _declare + 1; ContextualKeyword[ContextualKeyword["_enum"] = _enum] = "_enum"; - const _exports = _enum + 1; ContextualKeyword[ContextualKeyword["_exports"] = _exports] = "_exports"; - const _from = _exports + 1; ContextualKeyword[ContextualKeyword["_from"] = _from] = "_from"; - const _get = _from + 1; ContextualKeyword[ContextualKeyword["_get"] = _get] = "_get"; - const _global = _get + 1; ContextualKeyword[ContextualKeyword["_global"] = _global] = "_global"; - const _implements = _global + 1; ContextualKeyword[ContextualKeyword["_implements"] = _implements] = "_implements"; - const _infer = _implements + 1; ContextualKeyword[ContextualKeyword["_infer"] = _infer] = "_infer"; - const _interface = _infer + 1; ContextualKeyword[ContextualKeyword["_interface"] = _interface] = "_interface"; - const _is = _interface + 1; ContextualKeyword[ContextualKeyword["_is"] = _is] = "_is"; - const _keyof = _is + 1; ContextualKeyword[ContextualKeyword["_keyof"] = _keyof] = "_keyof"; - const _mixins = _keyof + 1; ContextualKeyword[ContextualKeyword["_mixins"] = _mixins] = "_mixins"; - const _module = _mixins + 1; ContextualKeyword[ContextualKeyword["_module"] = _module] = "_module"; - const _namespace = _module + 1; ContextualKeyword[ContextualKeyword["_namespace"] = _namespace] = "_namespace"; - const _of = _namespace + 1; ContextualKeyword[ContextualKeyword["_of"] = _of] = "_of"; - const _opaque = _of + 1; ContextualKeyword[ContextualKeyword["_opaque"] = _opaque] = "_opaque"; - const _out = _opaque + 1; ContextualKeyword[ContextualKeyword["_out"] = _out] = "_out"; - const _override = _out + 1; ContextualKeyword[ContextualKeyword["_override"] = _override] = "_override"; - const _private = _override + 1; ContextualKeyword[ContextualKeyword["_private"] = _private] = "_private"; - const _protected = _private + 1; ContextualKeyword[ContextualKeyword["_protected"] = _protected] = "_protected"; - const _proto = _protected + 1; ContextualKeyword[ContextualKeyword["_proto"] = _proto] = "_proto"; - const _public = _proto + 1; ContextualKeyword[ContextualKeyword["_public"] = _public] = "_public"; - const _readonly = _public + 1; ContextualKeyword[ContextualKeyword["_readonly"] = _readonly] = "_readonly"; - const _require = _readonly + 1; ContextualKeyword[ContextualKeyword["_require"] = _require] = "_require"; - const _satisfies = _require + 1; ContextualKeyword[ContextualKeyword["_satisfies"] = _satisfies] = "_satisfies"; - const _set = _satisfies + 1; ContextualKeyword[ContextualKeyword["_set"] = _set] = "_set"; - const _static = _set + 1; ContextualKeyword[ContextualKeyword["_static"] = _static] = "_static"; - const _symbol = _static + 1; ContextualKeyword[ContextualKeyword["_symbol"] = _symbol] = "_symbol"; - const _type = _symbol + 1; ContextualKeyword[ContextualKeyword["_type"] = _type] = "_type"; - const _unique = _type + 1; ContextualKeyword[ContextualKeyword["_unique"] = _unique] = "_unique"; - const _using = _unique + 1; ContextualKeyword[ContextualKeyword["_using"] = _using] = "_using"; -})(ContextualKeyword || (ContextualKeyword = {})); diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js b/node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js deleted file mode 100644 index cf3df89..0000000 --- a/node_modules/sucrase/dist/esm/parser/tokenizer/readWord.js +++ /dev/null @@ -1,64 +0,0 @@ -import {input, state} from "../traverser/base"; -import {charCodes} from "../util/charcodes"; -import {IS_IDENTIFIER_CHAR} from "../util/identifier"; -import {finishToken} from "./index"; -import {READ_WORD_TREE} from "./readWordTree"; -import {TokenType as tt} from "./types"; - -/** - * Read an identifier, producing either a name token or matching on one of the existing keywords. - * For performance, we pre-generate big decision tree that we traverse. Each node represents a - * prefix and has 27 values, where the first value is the token or contextual token, if any (-1 if - * not), and the other 26 values are the transitions to other nodes, or -1 to stop. - */ -export default function readWord() { - let treePos = 0; - let code = 0; - let pos = state.pos; - while (pos < input.length) { - code = input.charCodeAt(pos); - if (code < charCodes.lowercaseA || code > charCodes.lowercaseZ) { - break; - } - const next = READ_WORD_TREE[treePos + (code - charCodes.lowercaseA) + 1]; - if (next === -1) { - break; - } else { - treePos = next; - pos++; - } - } - - const keywordValue = READ_WORD_TREE[treePos]; - if (keywordValue > -1 && !IS_IDENTIFIER_CHAR[code]) { - state.pos = pos; - if (keywordValue & 1) { - finishToken(keywordValue >>> 1); - } else { - finishToken(tt.name, keywordValue >>> 1); - } - return; - } - - while (pos < input.length) { - const ch = input.charCodeAt(pos); - if (IS_IDENTIFIER_CHAR[ch]) { - pos++; - } else if (ch === charCodes.backslash) { - // \u - pos += 2; - if (input.charCodeAt(pos) === charCodes.leftCurlyBrace) { - while (pos < input.length && input.charCodeAt(pos) !== charCodes.rightCurlyBrace) { - pos++; - } - pos++; - } - } else if (ch === charCodes.atSign && input.charCodeAt(pos + 1) === charCodes.atSign) { - pos += 2; - } else { - break; - } - } - state.pos = pos; - finishToken(tt.name); -} diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js b/node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js deleted file mode 100644 index ffb8cac..0000000 --- a/node_modules/sucrase/dist/esm/parser/tokenizer/readWordTree.js +++ /dev/null @@ -1,671 +0,0 @@ -// Generated file, do not edit! Run "yarn generate" to re-generate this file. -import {ContextualKeyword} from "./keywords"; -import {TokenType as tt} from "./types"; - -// prettier-ignore -export const READ_WORD_TREE = new Int32Array([ - // "" - -1, 27, 783, 918, 1755, 2376, 2862, 3483, -1, 3699, -1, 4617, 4752, 4833, 5130, 5508, 5940, -1, 6480, 6939, 7749, 8181, 8451, 8613, -1, 8829, -1, - // "a" - -1, -1, 54, 243, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 432, -1, -1, -1, 675, -1, -1, -1, - // "ab" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, - // "abs" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, - // "abst" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 135, -1, -1, -1, -1, -1, -1, -1, -1, - // "abstr" - -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "abstra" - -1, -1, -1, 189, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "abstrac" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 216, -1, -1, -1, -1, -1, -1, - // "abstract" - ContextualKeyword._abstract << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ac" - -1, -1, -1, 270, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "acc" - -1, -1, -1, -1, -1, 297, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "acce" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, -1, -1, -1, -1, - // "acces" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, -1, -1, -1, -1, - // "access" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "accesso" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 405, -1, -1, -1, -1, -1, -1, -1, -1, - // "accessor" - ContextualKeyword._accessor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "as" - ContextualKeyword._as << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, 594, -1, - // "ass" - -1, -1, -1, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "asse" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, - // "asser" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 540, -1, -1, -1, -1, -1, -1, - // "assert" - ContextualKeyword._assert << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 567, -1, -1, -1, -1, -1, -1, -1, - // "asserts" - ContextualKeyword._asserts << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "asy" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "asyn" - -1, -1, -1, 648, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "async" - ContextualKeyword._async << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "aw" - -1, 702, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "awa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "awai" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 756, -1, -1, -1, -1, -1, -1, - // "await" - ContextualKeyword._await << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "b" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 810, -1, -1, -1, -1, -1, -1, -1, -1, - // "br" - -1, -1, -1, -1, -1, 837, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "bre" - -1, 864, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "brea" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 891, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "break" - (tt._break << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "c" - -1, 945, -1, -1, -1, -1, -1, -1, 1107, -1, -1, -1, 1242, -1, -1, 1350, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ca" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 972, 1026, -1, -1, -1, -1, -1, -1, - // "cas" - -1, -1, -1, -1, -1, 999, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "case" - (tt._case << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "cat" - -1, -1, -1, 1053, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "catc" - -1, -1, -1, -1, -1, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "catch" - (tt._catch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ch" - -1, -1, -1, -1, -1, 1134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "che" - -1, -1, -1, 1161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "chec" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1188, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "check" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1215, -1, -1, -1, -1, -1, -1, -1, - // "checks" - ContextualKeyword._checks << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "cl" - -1, 1269, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "cla" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1296, -1, -1, -1, -1, -1, -1, -1, - // "clas" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1323, -1, -1, -1, -1, -1, -1, -1, - // "class" - (tt._class << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "co" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1377, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "con" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, 1620, -1, -1, -1, -1, -1, -1, - // "cons" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1431, -1, -1, -1, -1, -1, -1, - // "const" - (tt._const << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1458, -1, -1, -1, -1, -1, -1, -1, -1, - // "constr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1485, -1, -1, -1, -1, -1, - // "constru" - -1, -1, -1, 1512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "construc" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1539, -1, -1, -1, -1, -1, -1, - // "construct" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1566, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "constructo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1593, -1, -1, -1, -1, -1, -1, -1, -1, - // "constructor" - ContextualKeyword._constructor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "cont" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1647, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "conti" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1674, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "contin" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1701, -1, -1, -1, -1, -1, - // "continu" - -1, -1, -1, -1, -1, 1728, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "continue" - (tt._continue << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "d" - -1, -1, -1, -1, -1, 1782, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "de" - -1, -1, 1809, 1971, -1, -1, 2106, -1, -1, -1, -1, -1, 2241, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "deb" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1836, -1, -1, -1, -1, -1, - // "debu" - -1, -1, -1, -1, -1, -1, -1, 1863, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "debug" - -1, -1, -1, -1, -1, -1, -1, 1890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "debugg" - -1, -1, -1, -1, -1, 1917, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "debugge" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1944, -1, -1, -1, -1, -1, -1, -1, -1, - // "debugger" - (tt._debugger << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "dec" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1998, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "decl" - -1, 2025, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "decla" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2052, -1, -1, -1, -1, -1, -1, -1, -1, - // "declar" - -1, -1, -1, -1, -1, 2079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "declare" - ContextualKeyword._declare << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "def" - -1, 2133, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "defa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2160, -1, -1, -1, -1, -1, - // "defau" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "defaul" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2214, -1, -1, -1, -1, -1, -1, - // "default" - (tt._default << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "del" - -1, -1, -1, -1, -1, 2268, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "dele" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2295, -1, -1, -1, -1, -1, -1, - // "delet" - -1, -1, -1, -1, -1, 2322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "delete" - (tt._delete << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "do" - (tt._do << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "e" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2403, -1, 2484, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2565, -1, -1, - // "el" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2430, -1, -1, -1, -1, -1, -1, -1, - // "els" - -1, -1, -1, -1, -1, 2457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "else" - (tt._else << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "en" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2511, -1, -1, -1, -1, -1, - // "enu" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "enum" - ContextualKeyword._enum << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ex" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2592, -1, -1, -1, 2727, -1, -1, -1, -1, -1, -1, - // "exp" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2619, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "expo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2646, -1, -1, -1, -1, -1, -1, -1, -1, - // "expor" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2673, -1, -1, -1, -1, -1, -1, - // "export" - (tt._export << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2700, -1, -1, -1, -1, -1, -1, -1, - // "exports" - ContextualKeyword._exports << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ext" - -1, -1, -1, -1, -1, 2754, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "exte" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2781, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "exten" - -1, -1, -1, -1, 2808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "extend" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2835, -1, -1, -1, -1, -1, -1, -1, - // "extends" - (tt._extends << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "f" - -1, 2889, -1, -1, -1, -1, -1, -1, -1, 2997, -1, -1, -1, -1, -1, 3159, -1, -1, 3213, -1, -1, 3294, -1, -1, -1, -1, -1, - // "fa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2916, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fal" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2943, -1, -1, -1, -1, -1, -1, -1, - // "fals" - -1, -1, -1, -1, -1, 2970, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "false" - (tt._false << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3024, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fin" - -1, 3051, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fina" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3078, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "final" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "finall" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3132, -1, - // "finally" - (tt._finally << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3186, -1, -1, -1, -1, -1, -1, -1, -1, - // "for" - (tt._for << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fro" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "from" - ContextualKeyword._from << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fu" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fun" - -1, -1, -1, 3348, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "func" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3375, -1, -1, -1, -1, -1, -1, - // "funct" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 3402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "functi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "functio" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3456, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "function" - (tt._function << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "g" - -1, -1, -1, -1, -1, 3510, -1, -1, -1, -1, -1, -1, 3564, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ge" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3537, -1, -1, -1, -1, -1, -1, - // "get" - ContextualKeyword._get << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "gl" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3591, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "glo" - -1, -1, 3618, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "glob" - -1, 3645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "globa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3672, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "global" - ContextualKeyword._global << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "i" - -1, -1, -1, -1, -1, -1, 3726, -1, -1, -1, -1, -1, -1, 3753, 4077, -1, -1, -1, -1, 4590, -1, -1, -1, -1, -1, -1, -1, - // "if" - (tt._if << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "im" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3780, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "imp" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3807, -1, -1, 3996, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "impl" - -1, -1, -1, -1, -1, 3834, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "imple" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "implem" - -1, -1, -1, -1, -1, 3888, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "impleme" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3915, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "implemen" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3942, -1, -1, -1, -1, -1, -1, - // "implement" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3969, -1, -1, -1, -1, -1, -1, -1, - // "implements" - ContextualKeyword._implements << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "impo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4023, -1, -1, -1, -1, -1, -1, -1, -1, - // "impor" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4050, -1, -1, -1, -1, -1, -1, - // "import" - (tt._import << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "in" - (tt._in << 1) + 1, -1, -1, -1, -1, -1, 4104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4185, 4401, -1, -1, -1, -1, -1, -1, - // "inf" - -1, -1, -1, -1, -1, 4131, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "infe" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4158, -1, -1, -1, -1, -1, -1, -1, -1, - // "infer" - ContextualKeyword._infer << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ins" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4212, -1, -1, -1, -1, -1, -1, - // "inst" - -1, 4239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "insta" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "instan" - -1, -1, -1, 4293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "instanc" - -1, -1, -1, -1, -1, 4320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "instance" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "instanceo" - -1, -1, -1, -1, -1, -1, 4374, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "instanceof" - (tt._instanceof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "int" - -1, -1, -1, -1, -1, 4428, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "inte" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4455, -1, -1, -1, -1, -1, -1, -1, -1, - // "inter" - -1, -1, -1, -1, -1, -1, 4482, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "interf" - -1, 4509, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "interfa" - -1, -1, -1, 4536, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "interfac" - -1, -1, -1, -1, -1, 4563, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "interface" - ContextualKeyword._interface << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "is" - ContextualKeyword._is << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "k" - -1, -1, -1, -1, -1, 4644, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ke" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4671, -1, - // "key" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4698, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "keyo" - -1, -1, -1, -1, -1, -1, 4725, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "keyof" - ContextualKeyword._keyof << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "l" - -1, -1, -1, -1, -1, 4779, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "le" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4806, -1, -1, -1, -1, -1, -1, - // "let" - (tt._let << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "m" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 4860, -1, -1, -1, -1, -1, 4995, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "mi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4887, -1, -1, - // "mix" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 4914, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "mixi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4941, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "mixin" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4968, -1, -1, -1, -1, -1, -1, -1, - // "mixins" - ContextualKeyword._mixins << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "mo" - -1, -1, -1, -1, 5022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "mod" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5049, -1, -1, -1, -1, -1, - // "modu" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5076, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "modul" - -1, -1, -1, -1, -1, 5103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "module" - ContextualKeyword._module << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "n" - -1, 5157, -1, -1, -1, 5373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5427, -1, -1, -1, -1, -1, - // "na" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "nam" - -1, -1, -1, -1, -1, 5211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "name" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5238, -1, -1, -1, -1, -1, -1, -1, - // "names" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5265, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "namesp" - -1, 5292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "namespa" - -1, -1, -1, 5319, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "namespac" - -1, -1, -1, -1, -1, 5346, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "namespace" - ContextualKeyword._namespace << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ne" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5400, -1, -1, -1, - // "new" - (tt._new << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "nu" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5454, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "nul" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5481, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "null" - (tt._null << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "o" - -1, -1, -1, -1, -1, -1, 5535, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5562, -1, -1, -1, -1, 5697, 5751, -1, -1, -1, -1, - // "of" - ContextualKeyword._of << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "op" - -1, 5589, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "opa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5616, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "opaq" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5643, -1, -1, -1, -1, -1, - // "opaqu" - -1, -1, -1, -1, -1, 5670, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "opaque" - ContextualKeyword._opaque << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ou" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5724, -1, -1, -1, -1, -1, -1, - // "out" - ContextualKeyword._out << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ov" - -1, -1, -1, -1, -1, 5778, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ove" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5805, -1, -1, -1, -1, -1, -1, -1, -1, - // "over" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5832, -1, -1, -1, -1, -1, -1, -1, -1, - // "overr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 5859, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "overri" - -1, -1, -1, -1, 5886, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "overrid" - -1, -1, -1, -1, -1, 5913, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "override" - ContextualKeyword._override << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "p" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5967, -1, -1, 6345, -1, -1, -1, -1, -1, - // "pr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 5994, -1, -1, -1, -1, -1, 6129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "pri" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6021, -1, -1, -1, -1, - // "priv" - -1, 6048, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "priva" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6075, -1, -1, -1, -1, -1, -1, - // "privat" - -1, -1, -1, -1, -1, 6102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "private" - ContextualKeyword._private << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "pro" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6156, -1, -1, -1, -1, -1, -1, - // "prot" - -1, -1, -1, -1, -1, 6183, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6318, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "prote" - -1, -1, -1, 6210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "protec" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6237, -1, -1, -1, -1, -1, -1, - // "protect" - -1, -1, -1, -1, -1, 6264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "protecte" - -1, -1, -1, -1, 6291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "protected" - ContextualKeyword._protected << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "proto" - ContextualKeyword._proto << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "pu" - -1, -1, 6372, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "pub" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6399, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "publ" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 6426, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "publi" - -1, -1, -1, 6453, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "public" - ContextualKeyword._public << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "r" - -1, -1, -1, -1, -1, 6507, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "re" - -1, 6534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6696, -1, -1, 6831, -1, -1, -1, -1, -1, -1, - // "rea" - -1, -1, -1, -1, 6561, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "read" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6588, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "reado" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "readon" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6642, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "readonl" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6669, -1, - // "readonly" - ContextualKeyword._readonly << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "req" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6723, -1, -1, -1, -1, -1, - // "requ" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 6750, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "requi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6777, -1, -1, -1, -1, -1, -1, -1, -1, - // "requir" - -1, -1, -1, -1, -1, 6804, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "require" - ContextualKeyword._require << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ret" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6858, -1, -1, -1, -1, -1, - // "retu" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6885, -1, -1, -1, -1, -1, -1, -1, -1, - // "retur" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6912, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "return" - (tt._return << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "s" - -1, 6966, -1, -1, -1, 7182, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7236, 7371, -1, 7479, -1, 7614, -1, - // "sa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6993, -1, -1, -1, -1, -1, -1, - // "sat" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7020, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sati" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7047, -1, -1, -1, -1, -1, -1, -1, - // "satis" - -1, -1, -1, -1, -1, -1, 7074, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "satisf" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "satisfi" - -1, -1, -1, -1, -1, 7128, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "satisfie" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7155, -1, -1, -1, -1, -1, -1, -1, - // "satisfies" - ContextualKeyword._satisfies << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "se" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7209, -1, -1, -1, -1, -1, -1, - // "set" - ContextualKeyword._set << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "st" - -1, 7263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sta" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7290, -1, -1, -1, -1, -1, -1, - // "stat" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7317, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "stati" - -1, -1, -1, 7344, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "static" - ContextualKeyword._static << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "su" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7398, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sup" - -1, -1, -1, -1, -1, 7425, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "supe" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7452, -1, -1, -1, -1, -1, -1, -1, -1, - // "super" - (tt._super << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sw" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7506, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "swi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7533, -1, -1, -1, -1, -1, -1, - // "swit" - -1, -1, -1, 7560, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "switc" - -1, -1, -1, -1, -1, -1, -1, -1, 7587, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "switch" - (tt._switch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sy" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7641, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sym" - -1, -1, 7668, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "symb" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7695, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "symbo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "symbol" - ContextualKeyword._symbol << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "t" - -1, -1, -1, -1, -1, -1, -1, -1, 7776, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7938, -1, -1, -1, -1, -1, -1, 8046, -1, - // "th" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7803, -1, -1, -1, -1, -1, -1, -1, -1, 7857, -1, -1, -1, -1, -1, -1, -1, -1, - // "thi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7830, -1, -1, -1, -1, -1, -1, -1, - // "this" - (tt._this << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "thr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "thro" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7911, -1, -1, -1, - // "throw" - (tt._throw << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "tr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7965, -1, -1, -1, 8019, -1, - // "tru" - -1, -1, -1, -1, -1, 7992, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "true" - (tt._true << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "try" - (tt._try << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ty" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8073, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "typ" - -1, -1, -1, -1, -1, 8100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "type" - ContextualKeyword._type << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8127, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "typeo" - -1, -1, -1, -1, -1, -1, 8154, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "typeof" - (tt._typeof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "u" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8208, -1, -1, -1, -1, 8343, -1, -1, -1, -1, -1, -1, -1, - // "un" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "uni" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8262, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "uniq" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8289, -1, -1, -1, -1, -1, - // "uniqu" - -1, -1, -1, -1, -1, 8316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "unique" - ContextualKeyword._unique << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "us" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "usi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8397, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "usin" - -1, -1, -1, -1, -1, -1, -1, 8424, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "using" - ContextualKeyword._using << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "v" - -1, 8478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8532, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "va" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8505, -1, -1, -1, -1, -1, -1, -1, -1, - // "var" - (tt._var << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "vo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8559, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "voi" - -1, -1, -1, -1, 8586, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "void" - (tt._void << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "w" - -1, -1, -1, -1, -1, -1, -1, -1, 8640, 8748, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "wh" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8667, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "whi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8694, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "whil" - -1, -1, -1, -1, -1, 8721, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "while" - (tt._while << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "wi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8775, -1, -1, -1, -1, -1, -1, - // "wit" - -1, -1, -1, -1, -1, -1, -1, -1, 8802, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "with" - (tt._with << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "y" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8856, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "yi" - -1, -1, -1, -1, -1, 8883, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "yie" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8910, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "yiel" - -1, -1, -1, -1, 8937, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "yield" - (tt._yield << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -]); diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/state.js b/node_modules/sucrase/dist/esm/parser/tokenizer/state.js deleted file mode 100644 index 940cde0..0000000 --- a/node_modules/sucrase/dist/esm/parser/tokenizer/state.js +++ /dev/null @@ -1,106 +0,0 @@ - -import {ContextualKeyword} from "./keywords"; -import { TokenType as tt} from "./types"; - -export class Scope { - - - - - constructor(startTokenIndex, endTokenIndex, isFunctionScope) { - this.startTokenIndex = startTokenIndex; - this.endTokenIndex = endTokenIndex; - this.isFunctionScope = isFunctionScope; - } -} - -export class StateSnapshot { - constructor( - potentialArrowAt, - noAnonFunctionType, - inDisallowConditionalTypesContext, - tokensLength, - scopesLength, - pos, - type, - contextualKeyword, - start, - end, - isType, - scopeDepth, - error, - ) {;this.potentialArrowAt = potentialArrowAt;this.noAnonFunctionType = noAnonFunctionType;this.inDisallowConditionalTypesContext = inDisallowConditionalTypesContext;this.tokensLength = tokensLength;this.scopesLength = scopesLength;this.pos = pos;this.type = type;this.contextualKeyword = contextualKeyword;this.start = start;this.end = end;this.isType = isType;this.scopeDepth = scopeDepth;this.error = error;} -} - -export default class State {constructor() { State.prototype.__init.call(this);State.prototype.__init2.call(this);State.prototype.__init3.call(this);State.prototype.__init4.call(this);State.prototype.__init5.call(this);State.prototype.__init6.call(this);State.prototype.__init7.call(this);State.prototype.__init8.call(this);State.prototype.__init9.call(this);State.prototype.__init10.call(this);State.prototype.__init11.call(this);State.prototype.__init12.call(this);State.prototype.__init13.call(this); } - // Used to signify the start of a potential arrow function - __init() {this.potentialArrowAt = -1} - - // Used by Flow to handle an edge case involving function type parsing. - __init2() {this.noAnonFunctionType = false} - - // Used by TypeScript to handle ambiguities when parsing conditional types. - __init3() {this.inDisallowConditionalTypesContext = false} - - // Token store. - __init4() {this.tokens = []} - - // Array of all observed scopes, ordered by their ending position. - __init5() {this.scopes = []} - - // The current position of the tokenizer in the input. - __init6() {this.pos = 0} - - // Information about the current token. - __init7() {this.type = tt.eof} - __init8() {this.contextualKeyword = ContextualKeyword.NONE} - __init9() {this.start = 0} - __init10() {this.end = 0} - - __init11() {this.isType = false} - __init12() {this.scopeDepth = 0} - - /** - * If the parser is in an error state, then the token is always tt.eof and all functions can - * keep executing but should be written so they don't get into an infinite loop in this situation. - * - * This approach, combined with the ability to snapshot and restore state, allows us to implement - * backtracking without exceptions and without needing to explicitly propagate error states - * everywhere. - */ - __init13() {this.error = null} - - snapshot() { - return new StateSnapshot( - this.potentialArrowAt, - this.noAnonFunctionType, - this.inDisallowConditionalTypesContext, - this.tokens.length, - this.scopes.length, - this.pos, - this.type, - this.contextualKeyword, - this.start, - this.end, - this.isType, - this.scopeDepth, - this.error, - ); - } - - restoreFromSnapshot(snapshot) { - this.potentialArrowAt = snapshot.potentialArrowAt; - this.noAnonFunctionType = snapshot.noAnonFunctionType; - this.inDisallowConditionalTypesContext = snapshot.inDisallowConditionalTypesContext; - this.tokens.length = snapshot.tokensLength; - this.scopes.length = snapshot.scopesLength; - this.pos = snapshot.pos; - this.type = snapshot.type; - this.contextualKeyword = snapshot.contextualKeyword; - this.start = snapshot.start; - this.end = snapshot.end; - this.isType = snapshot.isType; - this.scopeDepth = snapshot.scopeDepth; - this.error = snapshot.error; - } -} diff --git a/node_modules/sucrase/dist/esm/parser/tokenizer/types.js b/node_modules/sucrase/dist/esm/parser/tokenizer/types.js deleted file mode 100644 index 9746ad6..0000000 --- a/node_modules/sucrase/dist/esm/parser/tokenizer/types.js +++ /dev/null @@ -1,361 +0,0 @@ -// Generated file, do not edit! Run "yarn generate" to re-generate this file. -/* istanbul ignore file */ -/** - * Enum of all token types, with bit fields to signify meaningful properties. - */ -export var TokenType; (function (TokenType) { - // Precedence 0 means not an operator; otherwise it is a positive number up to 12. - const PRECEDENCE_MASK = 0xf; TokenType[TokenType["PRECEDENCE_MASK"] = PRECEDENCE_MASK] = "PRECEDENCE_MASK"; - const IS_KEYWORD = 1 << 4; TokenType[TokenType["IS_KEYWORD"] = IS_KEYWORD] = "IS_KEYWORD"; - const IS_ASSIGN = 1 << 5; TokenType[TokenType["IS_ASSIGN"] = IS_ASSIGN] = "IS_ASSIGN"; - const IS_RIGHT_ASSOCIATIVE = 1 << 6; TokenType[TokenType["IS_RIGHT_ASSOCIATIVE"] = IS_RIGHT_ASSOCIATIVE] = "IS_RIGHT_ASSOCIATIVE"; - const IS_PREFIX = 1 << 7; TokenType[TokenType["IS_PREFIX"] = IS_PREFIX] = "IS_PREFIX"; - const IS_POSTFIX = 1 << 8; TokenType[TokenType["IS_POSTFIX"] = IS_POSTFIX] = "IS_POSTFIX"; - const IS_EXPRESSION_START = 1 << 9; TokenType[TokenType["IS_EXPRESSION_START"] = IS_EXPRESSION_START] = "IS_EXPRESSION_START"; - - const num = 512; TokenType[TokenType["num"] = num] = "num"; // num startsExpr - const bigint = 1536; TokenType[TokenType["bigint"] = bigint] = "bigint"; // bigint startsExpr - const decimal = 2560; TokenType[TokenType["decimal"] = decimal] = "decimal"; // decimal startsExpr - const regexp = 3584; TokenType[TokenType["regexp"] = regexp] = "regexp"; // regexp startsExpr - const string = 4608; TokenType[TokenType["string"] = string] = "string"; // string startsExpr - const name = 5632; TokenType[TokenType["name"] = name] = "name"; // name startsExpr - const eof = 6144; TokenType[TokenType["eof"] = eof] = "eof"; // eof - const bracketL = 7680; TokenType[TokenType["bracketL"] = bracketL] = "bracketL"; // [ startsExpr - const bracketR = 8192; TokenType[TokenType["bracketR"] = bracketR] = "bracketR"; // ] - const braceL = 9728; TokenType[TokenType["braceL"] = braceL] = "braceL"; // { startsExpr - const braceBarL = 10752; TokenType[TokenType["braceBarL"] = braceBarL] = "braceBarL"; // {| startsExpr - const braceR = 11264; TokenType[TokenType["braceR"] = braceR] = "braceR"; // } - const braceBarR = 12288; TokenType[TokenType["braceBarR"] = braceBarR] = "braceBarR"; // |} - const parenL = 13824; TokenType[TokenType["parenL"] = parenL] = "parenL"; // ( startsExpr - const parenR = 14336; TokenType[TokenType["parenR"] = parenR] = "parenR"; // ) - const comma = 15360; TokenType[TokenType["comma"] = comma] = "comma"; // , - const semi = 16384; TokenType[TokenType["semi"] = semi] = "semi"; // ; - const colon = 17408; TokenType[TokenType["colon"] = colon] = "colon"; // : - const doubleColon = 18432; TokenType[TokenType["doubleColon"] = doubleColon] = "doubleColon"; // :: - const dot = 19456; TokenType[TokenType["dot"] = dot] = "dot"; // . - const question = 20480; TokenType[TokenType["question"] = question] = "question"; // ? - const questionDot = 21504; TokenType[TokenType["questionDot"] = questionDot] = "questionDot"; // ?. - const arrow = 22528; TokenType[TokenType["arrow"] = arrow] = "arrow"; // => - const template = 23552; TokenType[TokenType["template"] = template] = "template"; // template - const ellipsis = 24576; TokenType[TokenType["ellipsis"] = ellipsis] = "ellipsis"; // ... - const backQuote = 25600; TokenType[TokenType["backQuote"] = backQuote] = "backQuote"; // ` - const dollarBraceL = 27136; TokenType[TokenType["dollarBraceL"] = dollarBraceL] = "dollarBraceL"; // ${ startsExpr - const at = 27648; TokenType[TokenType["at"] = at] = "at"; // @ - const hash = 29184; TokenType[TokenType["hash"] = hash] = "hash"; // # startsExpr - const eq = 29728; TokenType[TokenType["eq"] = eq] = "eq"; // = isAssign - const assign = 30752; TokenType[TokenType["assign"] = assign] = "assign"; // _= isAssign - const preIncDec = 32640; TokenType[TokenType["preIncDec"] = preIncDec] = "preIncDec"; // ++/-- prefix postfix startsExpr - const postIncDec = 33664; TokenType[TokenType["postIncDec"] = postIncDec] = "postIncDec"; // ++/-- prefix postfix startsExpr - const bang = 34432; TokenType[TokenType["bang"] = bang] = "bang"; // ! prefix startsExpr - const tilde = 35456; TokenType[TokenType["tilde"] = tilde] = "tilde"; // ~ prefix startsExpr - const pipeline = 35841; TokenType[TokenType["pipeline"] = pipeline] = "pipeline"; // |> prec:1 - const nullishCoalescing = 36866; TokenType[TokenType["nullishCoalescing"] = nullishCoalescing] = "nullishCoalescing"; // ?? prec:2 - const logicalOR = 37890; TokenType[TokenType["logicalOR"] = logicalOR] = "logicalOR"; // || prec:2 - const logicalAND = 38915; TokenType[TokenType["logicalAND"] = logicalAND] = "logicalAND"; // && prec:3 - const bitwiseOR = 39940; TokenType[TokenType["bitwiseOR"] = bitwiseOR] = "bitwiseOR"; // | prec:4 - const bitwiseXOR = 40965; TokenType[TokenType["bitwiseXOR"] = bitwiseXOR] = "bitwiseXOR"; // ^ prec:5 - const bitwiseAND = 41990; TokenType[TokenType["bitwiseAND"] = bitwiseAND] = "bitwiseAND"; // & prec:6 - const equality = 43015; TokenType[TokenType["equality"] = equality] = "equality"; // ==/!= prec:7 - const lessThan = 44040; TokenType[TokenType["lessThan"] = lessThan] = "lessThan"; // < prec:8 - const greaterThan = 45064; TokenType[TokenType["greaterThan"] = greaterThan] = "greaterThan"; // > prec:8 - const relationalOrEqual = 46088; TokenType[TokenType["relationalOrEqual"] = relationalOrEqual] = "relationalOrEqual"; // <=/>= prec:8 - const bitShiftL = 47113; TokenType[TokenType["bitShiftL"] = bitShiftL] = "bitShiftL"; // << prec:9 - const bitShiftR = 48137; TokenType[TokenType["bitShiftR"] = bitShiftR] = "bitShiftR"; // >>/>>> prec:9 - const plus = 49802; TokenType[TokenType["plus"] = plus] = "plus"; // + prec:10 prefix startsExpr - const minus = 50826; TokenType[TokenType["minus"] = minus] = "minus"; // - prec:10 prefix startsExpr - const modulo = 51723; TokenType[TokenType["modulo"] = modulo] = "modulo"; // % prec:11 startsExpr - const star = 52235; TokenType[TokenType["star"] = star] = "star"; // * prec:11 - const slash = 53259; TokenType[TokenType["slash"] = slash] = "slash"; // / prec:11 - const exponent = 54348; TokenType[TokenType["exponent"] = exponent] = "exponent"; // ** prec:12 rightAssociative - const jsxName = 55296; TokenType[TokenType["jsxName"] = jsxName] = "jsxName"; // jsxName - const jsxText = 56320; TokenType[TokenType["jsxText"] = jsxText] = "jsxText"; // jsxText - const jsxEmptyText = 57344; TokenType[TokenType["jsxEmptyText"] = jsxEmptyText] = "jsxEmptyText"; // jsxEmptyText - const jsxTagStart = 58880; TokenType[TokenType["jsxTagStart"] = jsxTagStart] = "jsxTagStart"; // jsxTagStart startsExpr - const jsxTagEnd = 59392; TokenType[TokenType["jsxTagEnd"] = jsxTagEnd] = "jsxTagEnd"; // jsxTagEnd - const typeParameterStart = 60928; TokenType[TokenType["typeParameterStart"] = typeParameterStart] = "typeParameterStart"; // typeParameterStart startsExpr - const nonNullAssertion = 61440; TokenType[TokenType["nonNullAssertion"] = nonNullAssertion] = "nonNullAssertion"; // nonNullAssertion - const _break = 62480; TokenType[TokenType["_break"] = _break] = "_break"; // break keyword - const _case = 63504; TokenType[TokenType["_case"] = _case] = "_case"; // case keyword - const _catch = 64528; TokenType[TokenType["_catch"] = _catch] = "_catch"; // catch keyword - const _continue = 65552; TokenType[TokenType["_continue"] = _continue] = "_continue"; // continue keyword - const _debugger = 66576; TokenType[TokenType["_debugger"] = _debugger] = "_debugger"; // debugger keyword - const _default = 67600; TokenType[TokenType["_default"] = _default] = "_default"; // default keyword - const _do = 68624; TokenType[TokenType["_do"] = _do] = "_do"; // do keyword - const _else = 69648; TokenType[TokenType["_else"] = _else] = "_else"; // else keyword - const _finally = 70672; TokenType[TokenType["_finally"] = _finally] = "_finally"; // finally keyword - const _for = 71696; TokenType[TokenType["_for"] = _for] = "_for"; // for keyword - const _function = 73232; TokenType[TokenType["_function"] = _function] = "_function"; // function keyword startsExpr - const _if = 73744; TokenType[TokenType["_if"] = _if] = "_if"; // if keyword - const _return = 74768; TokenType[TokenType["_return"] = _return] = "_return"; // return keyword - const _switch = 75792; TokenType[TokenType["_switch"] = _switch] = "_switch"; // switch keyword - const _throw = 77456; TokenType[TokenType["_throw"] = _throw] = "_throw"; // throw keyword prefix startsExpr - const _try = 77840; TokenType[TokenType["_try"] = _try] = "_try"; // try keyword - const _var = 78864; TokenType[TokenType["_var"] = _var] = "_var"; // var keyword - const _let = 79888; TokenType[TokenType["_let"] = _let] = "_let"; // let keyword - const _const = 80912; TokenType[TokenType["_const"] = _const] = "_const"; // const keyword - const _while = 81936; TokenType[TokenType["_while"] = _while] = "_while"; // while keyword - const _with = 82960; TokenType[TokenType["_with"] = _with] = "_with"; // with keyword - const _new = 84496; TokenType[TokenType["_new"] = _new] = "_new"; // new keyword startsExpr - const _this = 85520; TokenType[TokenType["_this"] = _this] = "_this"; // this keyword startsExpr - const _super = 86544; TokenType[TokenType["_super"] = _super] = "_super"; // super keyword startsExpr - const _class = 87568; TokenType[TokenType["_class"] = _class] = "_class"; // class keyword startsExpr - const _extends = 88080; TokenType[TokenType["_extends"] = _extends] = "_extends"; // extends keyword - const _export = 89104; TokenType[TokenType["_export"] = _export] = "_export"; // export keyword - const _import = 90640; TokenType[TokenType["_import"] = _import] = "_import"; // import keyword startsExpr - const _yield = 91664; TokenType[TokenType["_yield"] = _yield] = "_yield"; // yield keyword startsExpr - const _null = 92688; TokenType[TokenType["_null"] = _null] = "_null"; // null keyword startsExpr - const _true = 93712; TokenType[TokenType["_true"] = _true] = "_true"; // true keyword startsExpr - const _false = 94736; TokenType[TokenType["_false"] = _false] = "_false"; // false keyword startsExpr - const _in = 95256; TokenType[TokenType["_in"] = _in] = "_in"; // in prec:8 keyword - const _instanceof = 96280; TokenType[TokenType["_instanceof"] = _instanceof] = "_instanceof"; // instanceof prec:8 keyword - const _typeof = 97936; TokenType[TokenType["_typeof"] = _typeof] = "_typeof"; // typeof keyword prefix startsExpr - const _void = 98960; TokenType[TokenType["_void"] = _void] = "_void"; // void keyword prefix startsExpr - const _delete = 99984; TokenType[TokenType["_delete"] = _delete] = "_delete"; // delete keyword prefix startsExpr - const _async = 100880; TokenType[TokenType["_async"] = _async] = "_async"; // async keyword startsExpr - const _get = 101904; TokenType[TokenType["_get"] = _get] = "_get"; // get keyword startsExpr - const _set = 102928; TokenType[TokenType["_set"] = _set] = "_set"; // set keyword startsExpr - const _declare = 103952; TokenType[TokenType["_declare"] = _declare] = "_declare"; // declare keyword startsExpr - const _readonly = 104976; TokenType[TokenType["_readonly"] = _readonly] = "_readonly"; // readonly keyword startsExpr - const _abstract = 106000; TokenType[TokenType["_abstract"] = _abstract] = "_abstract"; // abstract keyword startsExpr - const _static = 107024; TokenType[TokenType["_static"] = _static] = "_static"; // static keyword startsExpr - const _public = 107536; TokenType[TokenType["_public"] = _public] = "_public"; // public keyword - const _private = 108560; TokenType[TokenType["_private"] = _private] = "_private"; // private keyword - const _protected = 109584; TokenType[TokenType["_protected"] = _protected] = "_protected"; // protected keyword - const _override = 110608; TokenType[TokenType["_override"] = _override] = "_override"; // override keyword - const _as = 112144; TokenType[TokenType["_as"] = _as] = "_as"; // as keyword startsExpr - const _enum = 113168; TokenType[TokenType["_enum"] = _enum] = "_enum"; // enum keyword startsExpr - const _type = 114192; TokenType[TokenType["_type"] = _type] = "_type"; // type keyword startsExpr - const _implements = 115216; TokenType[TokenType["_implements"] = _implements] = "_implements"; // implements keyword startsExpr -})(TokenType || (TokenType = {})); -export function formatTokenType(tokenType) { - switch (tokenType) { - case TokenType.num: - return "num"; - case TokenType.bigint: - return "bigint"; - case TokenType.decimal: - return "decimal"; - case TokenType.regexp: - return "regexp"; - case TokenType.string: - return "string"; - case TokenType.name: - return "name"; - case TokenType.eof: - return "eof"; - case TokenType.bracketL: - return "["; - case TokenType.bracketR: - return "]"; - case TokenType.braceL: - return "{"; - case TokenType.braceBarL: - return "{|"; - case TokenType.braceR: - return "}"; - case TokenType.braceBarR: - return "|}"; - case TokenType.parenL: - return "("; - case TokenType.parenR: - return ")"; - case TokenType.comma: - return ","; - case TokenType.semi: - return ";"; - case TokenType.colon: - return ":"; - case TokenType.doubleColon: - return "::"; - case TokenType.dot: - return "."; - case TokenType.question: - return "?"; - case TokenType.questionDot: - return "?."; - case TokenType.arrow: - return "=>"; - case TokenType.template: - return "template"; - case TokenType.ellipsis: - return "..."; - case TokenType.backQuote: - return "`"; - case TokenType.dollarBraceL: - return "${"; - case TokenType.at: - return "@"; - case TokenType.hash: - return "#"; - case TokenType.eq: - return "="; - case TokenType.assign: - return "_="; - case TokenType.preIncDec: - return "++/--"; - case TokenType.postIncDec: - return "++/--"; - case TokenType.bang: - return "!"; - case TokenType.tilde: - return "~"; - case TokenType.pipeline: - return "|>"; - case TokenType.nullishCoalescing: - return "??"; - case TokenType.logicalOR: - return "||"; - case TokenType.logicalAND: - return "&&"; - case TokenType.bitwiseOR: - return "|"; - case TokenType.bitwiseXOR: - return "^"; - case TokenType.bitwiseAND: - return "&"; - case TokenType.equality: - return "==/!="; - case TokenType.lessThan: - return "<"; - case TokenType.greaterThan: - return ">"; - case TokenType.relationalOrEqual: - return "<=/>="; - case TokenType.bitShiftL: - return "<<"; - case TokenType.bitShiftR: - return ">>/>>>"; - case TokenType.plus: - return "+"; - case TokenType.minus: - return "-"; - case TokenType.modulo: - return "%"; - case TokenType.star: - return "*"; - case TokenType.slash: - return "/"; - case TokenType.exponent: - return "**"; - case TokenType.jsxName: - return "jsxName"; - case TokenType.jsxText: - return "jsxText"; - case TokenType.jsxEmptyText: - return "jsxEmptyText"; - case TokenType.jsxTagStart: - return "jsxTagStart"; - case TokenType.jsxTagEnd: - return "jsxTagEnd"; - case TokenType.typeParameterStart: - return "typeParameterStart"; - case TokenType.nonNullAssertion: - return "nonNullAssertion"; - case TokenType._break: - return "break"; - case TokenType._case: - return "case"; - case TokenType._catch: - return "catch"; - case TokenType._continue: - return "continue"; - case TokenType._debugger: - return "debugger"; - case TokenType._default: - return "default"; - case TokenType._do: - return "do"; - case TokenType._else: - return "else"; - case TokenType._finally: - return "finally"; - case TokenType._for: - return "for"; - case TokenType._function: - return "function"; - case TokenType._if: - return "if"; - case TokenType._return: - return "return"; - case TokenType._switch: - return "switch"; - case TokenType._throw: - return "throw"; - case TokenType._try: - return "try"; - case TokenType._var: - return "var"; - case TokenType._let: - return "let"; - case TokenType._const: - return "const"; - case TokenType._while: - return "while"; - case TokenType._with: - return "with"; - case TokenType._new: - return "new"; - case TokenType._this: - return "this"; - case TokenType._super: - return "super"; - case TokenType._class: - return "class"; - case TokenType._extends: - return "extends"; - case TokenType._export: - return "export"; - case TokenType._import: - return "import"; - case TokenType._yield: - return "yield"; - case TokenType._null: - return "null"; - case TokenType._true: - return "true"; - case TokenType._false: - return "false"; - case TokenType._in: - return "in"; - case TokenType._instanceof: - return "instanceof"; - case TokenType._typeof: - return "typeof"; - case TokenType._void: - return "void"; - case TokenType._delete: - return "delete"; - case TokenType._async: - return "async"; - case TokenType._get: - return "get"; - case TokenType._set: - return "set"; - case TokenType._declare: - return "declare"; - case TokenType._readonly: - return "readonly"; - case TokenType._abstract: - return "abstract"; - case TokenType._static: - return "static"; - case TokenType._public: - return "public"; - case TokenType._private: - return "private"; - case TokenType._protected: - return "protected"; - case TokenType._override: - return "override"; - case TokenType._as: - return "as"; - case TokenType._enum: - return "enum"; - case TokenType._type: - return "type"; - case TokenType._implements: - return "implements"; - default: - return ""; - } -} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/base.js b/node_modules/sucrase/dist/esm/parser/traverser/base.js deleted file mode 100644 index df24ff7..0000000 --- a/node_modules/sucrase/dist/esm/parser/traverser/base.js +++ /dev/null @@ -1,60 +0,0 @@ -import State from "../tokenizer/state"; -import {charCodes} from "../util/charcodes"; - -export let isJSXEnabled; -export let isTypeScriptEnabled; -export let isFlowEnabled; -export let state; -export let input; -export let nextContextId; - -export function getNextContextId() { - return nextContextId++; -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export function augmentError(error) { - if ("pos" in error) { - const loc = locationForIndex(error.pos); - error.message += ` (${loc.line}:${loc.column})`; - error.loc = loc; - } - return error; -} - -export class Loc { - - - constructor(line, column) { - this.line = line; - this.column = column; - } -} - -export function locationForIndex(pos) { - let line = 1; - let column = 1; - for (let i = 0; i < pos; i++) { - if (input.charCodeAt(i) === charCodes.lineFeed) { - line++; - column = 1; - } else { - column++; - } - } - return new Loc(line, column); -} - -export function initParser( - inputCode, - isJSXEnabledArg, - isTypeScriptEnabledArg, - isFlowEnabledArg, -) { - input = inputCode; - state = new State(); - nextContextId = 1; - isJSXEnabled = isJSXEnabledArg; - isTypeScriptEnabled = isTypeScriptEnabledArg; - isFlowEnabled = isFlowEnabledArg; -} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/expression.js b/node_modules/sucrase/dist/esm/parser/traverser/expression.js deleted file mode 100644 index aa6717f..0000000 --- a/node_modules/sucrase/dist/esm/parser/traverser/expression.js +++ /dev/null @@ -1,1022 +0,0 @@ -/* eslint max-len: 0 */ - -// A recursive descent parser operates by defining functions for all -// syntactic elements, and recursively calling those, each function -// advancing the input stream and returning an AST node. Precedence -// of constructs (for example, the fact that `!x[1]` means `!(x[1])` -// instead of `(!x)[1]` is handled by the fact that the parser -// function that parses unary prefix operators is called first, and -// in turn calls the function that parses `[]` subscripts — that -// way, it'll receive the node for `x[1]` already parsed, and wraps -// *that* in the unary operator node. -// -// Acorn uses an [operator precedence parser][opp] to handle binary -// operator precedence, because it is much more compact than using -// the technique outlined above, which uses different, nesting -// functions to specify precedence, for all of the ten binary -// precedence levels that JavaScript defines. -// -// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser - -import { - flowParseArrow, - flowParseFunctionBodyAndFinish, - flowParseMaybeAssign, - flowParseSubscript, - flowParseSubscripts, - flowParseVariance, - flowStartParseAsyncArrowFromCallExpression, - flowStartParseNewArguments, - flowStartParseObjPropValue, -} from "../plugins/flow"; -import {jsxParseElement} from "../plugins/jsx/index"; -import {typedParseConditional, typedParseParenItem} from "../plugins/types"; -import { - tsParseArrow, - tsParseFunctionBodyAndFinish, - tsParseMaybeAssign, - tsParseSubscript, - tsParseType, - tsParseTypeAssertion, - tsStartParseAsyncArrowFromCallExpression, - tsStartParseObjPropValue, -} from "../plugins/typescript"; -import { - eat, - IdentifierRole, - lookaheadCharCode, - lookaheadType, - match, - next, - nextTemplateToken, - popTypeContext, - pushTypeContext, - rescan_gt, - retokenizeSlashAsRegex, -} from "../tokenizer/index"; -import {ContextualKeyword} from "../tokenizer/keywords"; -import {Scope} from "../tokenizer/state"; -import {TokenType, TokenType as tt} from "../tokenizer/types"; -import {charCodes} from "../util/charcodes"; -import {IS_IDENTIFIER_START} from "../util/identifier"; -import {getNextContextId, isFlowEnabled, isJSXEnabled, isTypeScriptEnabled, state} from "./base"; -import { - markPriorBindingIdentifier, - parseBindingIdentifier, - parseMaybeDefault, - parseRest, - parseSpread, -} from "./lval"; -import { - parseBlock, - parseBlockBody, - parseClass, - parseDecorators, - parseFunction, - parseFunctionParams, -} from "./statement"; -import { - canInsertSemicolon, - eatContextual, - expect, - expectContextual, - hasFollowingLineBreak, - hasPrecedingLineBreak, - isContextual, - unexpected, -} from "./util"; - -export class StopState { - - constructor(stop) { - this.stop = stop; - } -} - -// ### Expression parsing - -// These nest, from the most general expression type at the top to -// 'atomic', nondivisible expression types at the bottom. Most of -// the functions will simply let the function (s) below them parse, -// and, *if* the syntactic construct they handle is present, wrap -// the AST node that the inner parser gave them in another node. -export function parseExpression(noIn = false) { - parseMaybeAssign(noIn); - if (match(tt.comma)) { - while (eat(tt.comma)) { - parseMaybeAssign(noIn); - } - } -} - -/** - * noIn is used when parsing a for loop so that we don't interpret a following "in" as the binary - * operatior. - * isWithinParens is used to indicate that we're parsing something that might be a comma expression - * or might be an arrow function or might be a Flow type assertion (which requires explicit parens). - * In these cases, we should allow : and ?: after the initial "left" part. - */ -export function parseMaybeAssign(noIn = false, isWithinParens = false) { - if (isTypeScriptEnabled) { - return tsParseMaybeAssign(noIn, isWithinParens); - } else if (isFlowEnabled) { - return flowParseMaybeAssign(noIn, isWithinParens); - } else { - return baseParseMaybeAssign(noIn, isWithinParens); - } -} - -// Parse an assignment expression. This includes applications of -// operators like `+=`. -// Returns true if the expression was an arrow function. -export function baseParseMaybeAssign(noIn, isWithinParens) { - if (match(tt._yield)) { - parseYield(); - return false; - } - - if (match(tt.parenL) || match(tt.name) || match(tt._yield)) { - state.potentialArrowAt = state.start; - } - - const wasArrow = parseMaybeConditional(noIn); - if (isWithinParens) { - parseParenItem(); - } - if (state.type & TokenType.IS_ASSIGN) { - next(); - parseMaybeAssign(noIn); - return false; - } - return wasArrow; -} - -// Parse a ternary conditional (`?:`) operator. -// Returns true if the expression was an arrow function. -function parseMaybeConditional(noIn) { - const wasArrow = parseExprOps(noIn); - if (wasArrow) { - return true; - } - parseConditional(noIn); - return false; -} - -function parseConditional(noIn) { - if (isTypeScriptEnabled || isFlowEnabled) { - typedParseConditional(noIn); - } else { - baseParseConditional(noIn); - } -} - -export function baseParseConditional(noIn) { - if (eat(tt.question)) { - parseMaybeAssign(); - expect(tt.colon); - parseMaybeAssign(noIn); - } -} - -// Start the precedence parser. -// Returns true if this was an arrow function -function parseExprOps(noIn) { - const startTokenIndex = state.tokens.length; - const wasArrow = parseMaybeUnary(); - if (wasArrow) { - return true; - } - parseExprOp(startTokenIndex, -1, noIn); - return false; -} - -// Parse binary operators with the operator precedence parsing -// algorithm. `left` is the left-hand side of the operator. -// `minPrec` provides context that allows the function to stop and -// defer further parser to one of its callers when it encounters an -// operator that has a lower precedence than the set it is parsing. -function parseExprOp(startTokenIndex, minPrec, noIn) { - if ( - isTypeScriptEnabled && - (tt._in & TokenType.PRECEDENCE_MASK) > minPrec && - !hasPrecedingLineBreak() && - (eatContextual(ContextualKeyword._as) || eatContextual(ContextualKeyword._satisfies)) - ) { - const oldIsType = pushTypeContext(1); - tsParseType(); - popTypeContext(oldIsType); - rescan_gt(); - parseExprOp(startTokenIndex, minPrec, noIn); - return; - } - - const prec = state.type & TokenType.PRECEDENCE_MASK; - if (prec > 0 && (!noIn || !match(tt._in))) { - if (prec > minPrec) { - const op = state.type; - next(); - if (op === tt.nullishCoalescing) { - state.tokens[state.tokens.length - 1].nullishStartIndex = startTokenIndex; - } - - const rhsStartTokenIndex = state.tokens.length; - parseMaybeUnary(); - // Extend the right operand of this operator if possible. - parseExprOp(rhsStartTokenIndex, op & TokenType.IS_RIGHT_ASSOCIATIVE ? prec - 1 : prec, noIn); - if (op === tt.nullishCoalescing) { - state.tokens[startTokenIndex].numNullishCoalesceStarts++; - state.tokens[state.tokens.length - 1].numNullishCoalesceEnds++; - } - // Continue with any future operator holding this expression as the left operand. - parseExprOp(startTokenIndex, minPrec, noIn); - } - } -} - -// Parse unary operators, both prefix and postfix. -// Returns true if this was an arrow function. -export function parseMaybeUnary() { - if (isTypeScriptEnabled && !isJSXEnabled && eat(tt.lessThan)) { - tsParseTypeAssertion(); - return false; - } - if ( - isContextual(ContextualKeyword._module) && - lookaheadCharCode() === charCodes.leftCurlyBrace && - !hasFollowingLineBreak() - ) { - parseModuleExpression(); - return false; - } - if (state.type & TokenType.IS_PREFIX) { - next(); - parseMaybeUnary(); - return false; - } - - const wasArrow = parseExprSubscripts(); - if (wasArrow) { - return true; - } - while (state.type & TokenType.IS_POSTFIX && !canInsertSemicolon()) { - // The tokenizer calls everything a preincrement, so make it a postincrement when - // we see it in that context. - if (state.type === tt.preIncDec) { - state.type = tt.postIncDec; - } - next(); - } - return false; -} - -// Parse call, dot, and `[]`-subscript expressions. -// Returns true if this was an arrow function. -export function parseExprSubscripts() { - const startTokenIndex = state.tokens.length; - const wasArrow = parseExprAtom(); - if (wasArrow) { - return true; - } - parseSubscripts(startTokenIndex); - // If there was any optional chain operation, the start token would be marked - // as such, so also mark the end now. - if (state.tokens.length > startTokenIndex && state.tokens[startTokenIndex].isOptionalChainStart) { - state.tokens[state.tokens.length - 1].isOptionalChainEnd = true; - } - return false; -} - -function parseSubscripts(startTokenIndex, noCalls = false) { - if (isFlowEnabled) { - flowParseSubscripts(startTokenIndex, noCalls); - } else { - baseParseSubscripts(startTokenIndex, noCalls); - } -} - -export function baseParseSubscripts(startTokenIndex, noCalls = false) { - const stopState = new StopState(false); - do { - parseSubscript(startTokenIndex, noCalls, stopState); - } while (!stopState.stop && !state.error); -} - -function parseSubscript(startTokenIndex, noCalls, stopState) { - if (isTypeScriptEnabled) { - tsParseSubscript(startTokenIndex, noCalls, stopState); - } else if (isFlowEnabled) { - flowParseSubscript(startTokenIndex, noCalls, stopState); - } else { - baseParseSubscript(startTokenIndex, noCalls, stopState); - } -} - -/** Set 'state.stop = true' to indicate that we should stop parsing subscripts. */ -export function baseParseSubscript( - startTokenIndex, - noCalls, - stopState, -) { - if (!noCalls && eat(tt.doubleColon)) { - parseNoCallExpr(); - stopState.stop = true; - // Propagate startTokenIndex so that `a::b?.()` will keep `a` as the first token. We may want - // to revisit this in the future when fully supporting bind syntax. - parseSubscripts(startTokenIndex, noCalls); - } else if (match(tt.questionDot)) { - state.tokens[startTokenIndex].isOptionalChainStart = true; - if (noCalls && lookaheadType() === tt.parenL) { - stopState.stop = true; - return; - } - next(); - state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - - if (eat(tt.bracketL)) { - parseExpression(); - expect(tt.bracketR); - } else if (eat(tt.parenL)) { - parseCallExpressionArguments(); - } else { - parseMaybePrivateName(); - } - } else if (eat(tt.dot)) { - state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - parseMaybePrivateName(); - } else if (eat(tt.bracketL)) { - state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - parseExpression(); - expect(tt.bracketR); - } else if (!noCalls && match(tt.parenL)) { - if (atPossibleAsync()) { - // We see "async", but it's possible it's a usage of the name "async". Parse as if it's a - // function call, and if we see an arrow later, backtrack and re-parse as a parameter list. - const snapshot = state.snapshot(); - const asyncStartTokenIndex = state.tokens.length; - next(); - state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - - const callContextId = getNextContextId(); - - state.tokens[state.tokens.length - 1].contextId = callContextId; - parseCallExpressionArguments(); - state.tokens[state.tokens.length - 1].contextId = callContextId; - - if (shouldParseAsyncArrow()) { - // We hit an arrow, so backtrack and start again parsing function parameters. - state.restoreFromSnapshot(snapshot); - stopState.stop = true; - state.scopeDepth++; - - parseFunctionParams(); - parseAsyncArrowFromCallExpression(asyncStartTokenIndex); - } - } else { - next(); - state.tokens[state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - const callContextId = getNextContextId(); - state.tokens[state.tokens.length - 1].contextId = callContextId; - parseCallExpressionArguments(); - state.tokens[state.tokens.length - 1].contextId = callContextId; - } - } else if (match(tt.backQuote)) { - // Tagged template expression. - parseTemplate(); - } else { - stopState.stop = true; - } -} - -export function atPossibleAsync() { - // This was made less strict than the original version to avoid passing around nodes, but it - // should be safe to have rare false positives here. - return ( - state.tokens[state.tokens.length - 1].contextualKeyword === ContextualKeyword._async && - !canInsertSemicolon() - ); -} - -export function parseCallExpressionArguments() { - let first = true; - while (!eat(tt.parenR) && !state.error) { - if (first) { - first = false; - } else { - expect(tt.comma); - if (eat(tt.parenR)) { - break; - } - } - - parseExprListItem(false); - } -} - -function shouldParseAsyncArrow() { - return match(tt.colon) || match(tt.arrow); -} - -function parseAsyncArrowFromCallExpression(startTokenIndex) { - if (isTypeScriptEnabled) { - tsStartParseAsyncArrowFromCallExpression(); - } else if (isFlowEnabled) { - flowStartParseAsyncArrowFromCallExpression(); - } - expect(tt.arrow); - parseArrowExpression(startTokenIndex); -} - -// Parse a no-call expression (like argument of `new` or `::` operators). - -function parseNoCallExpr() { - const startTokenIndex = state.tokens.length; - parseExprAtom(); - parseSubscripts(startTokenIndex, true); -} - -// Parse an atomic expression — either a single token that is an -// expression, an expression started by a keyword like `function` or -// `new`, or an expression wrapped in punctuation like `()`, `[]`, -// or `{}`. -// Returns true if the parsed expression was an arrow function. -export function parseExprAtom() { - if (eat(tt.modulo)) { - // V8 intrinsic expression. Just parse the identifier, and the function invocation is parsed - // naturally. - parseIdentifier(); - return false; - } - - if (match(tt.jsxText) || match(tt.jsxEmptyText)) { - parseLiteral(); - return false; - } else if (match(tt.lessThan) && isJSXEnabled) { - state.type = tt.jsxTagStart; - jsxParseElement(); - next(); - return false; - } - - const canBeArrow = state.potentialArrowAt === state.start; - switch (state.type) { - case tt.slash: - case tt.assign: - retokenizeSlashAsRegex(); - // Fall through. - - case tt._super: - case tt._this: - case tt.regexp: - case tt.num: - case tt.bigint: - case tt.decimal: - case tt.string: - case tt._null: - case tt._true: - case tt._false: - next(); - return false; - - case tt._import: - next(); - if (match(tt.dot)) { - // import.meta - state.tokens[state.tokens.length - 1].type = tt.name; - next(); - parseIdentifier(); - } - return false; - - case tt.name: { - const startTokenIndex = state.tokens.length; - const functionStart = state.start; - const contextualKeyword = state.contextualKeyword; - parseIdentifier(); - if (contextualKeyword === ContextualKeyword._await) { - parseAwait(); - return false; - } else if ( - contextualKeyword === ContextualKeyword._async && - match(tt._function) && - !canInsertSemicolon() - ) { - next(); - parseFunction(functionStart, false); - return false; - } else if ( - canBeArrow && - contextualKeyword === ContextualKeyword._async && - !canInsertSemicolon() && - match(tt.name) - ) { - state.scopeDepth++; - parseBindingIdentifier(false); - expect(tt.arrow); - // let foo = async bar => {}; - parseArrowExpression(startTokenIndex); - return true; - } else if (match(tt._do) && !canInsertSemicolon()) { - next(); - parseBlock(); - return false; - } - - if (canBeArrow && !canInsertSemicolon() && match(tt.arrow)) { - state.scopeDepth++; - markPriorBindingIdentifier(false); - expect(tt.arrow); - parseArrowExpression(startTokenIndex); - return true; - } - - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.Access; - return false; - } - - case tt._do: { - next(); - parseBlock(); - return false; - } - - case tt.parenL: { - const wasArrow = parseParenAndDistinguishExpression(canBeArrow); - return wasArrow; - } - - case tt.bracketL: - next(); - parseExprList(tt.bracketR, true); - return false; - - case tt.braceL: - parseObj(false, false); - return false; - - case tt._function: - parseFunctionExpression(); - return false; - - case tt.at: - parseDecorators(); - // Fall through. - - case tt._class: - parseClass(false); - return false; - - case tt._new: - parseNew(); - return false; - - case tt.backQuote: - parseTemplate(); - return false; - - case tt.doubleColon: { - next(); - parseNoCallExpr(); - return false; - } - - case tt.hash: { - const code = lookaheadCharCode(); - if (IS_IDENTIFIER_START[code] || code === charCodes.backslash) { - parseMaybePrivateName(); - } else { - next(); - } - // Smart pipeline topic reference. - return false; - } - - default: - unexpected(); - return false; - } -} - -function parseMaybePrivateName() { - eat(tt.hash); - parseIdentifier(); -} - -function parseFunctionExpression() { - const functionStart = state.start; - parseIdentifier(); - if (eat(tt.dot)) { - // function.sent - parseIdentifier(); - } - parseFunction(functionStart, false); -} - -export function parseLiteral() { - next(); -} - -export function parseParenExpression() { - expect(tt.parenL); - parseExpression(); - expect(tt.parenR); -} - -// Returns true if this was an arrow expression. -function parseParenAndDistinguishExpression(canBeArrow) { - // Assume this is a normal parenthesized expression, but if we see an arrow, we'll bail and - // start over as a parameter list. - const snapshot = state.snapshot(); - - const startTokenIndex = state.tokens.length; - expect(tt.parenL); - - let first = true; - - while (!match(tt.parenR) && !state.error) { - if (first) { - first = false; - } else { - expect(tt.comma); - if (match(tt.parenR)) { - break; - } - } - - if (match(tt.ellipsis)) { - parseRest(false /* isBlockScope */); - parseParenItem(); - break; - } else { - parseMaybeAssign(false, true); - } - } - - expect(tt.parenR); - - if (canBeArrow && shouldParseArrow()) { - const wasArrow = parseArrow(); - if (wasArrow) { - // It was an arrow function this whole time, so start over and parse it as params so that we - // get proper token annotations. - state.restoreFromSnapshot(snapshot); - state.scopeDepth++; - // Don't specify a context ID because arrow functions don't need a context ID. - parseFunctionParams(); - parseArrow(); - parseArrowExpression(startTokenIndex); - if (state.error) { - // Nevermind! This must have been something that looks very much like an - // arrow function but where its "parameter list" isn't actually a valid - // parameter list. Force non-arrow parsing. - // See https://github.com/alangpierce/sucrase/issues/666 for an example. - state.restoreFromSnapshot(snapshot); - parseParenAndDistinguishExpression(false); - return false; - } - return true; - } - } - - return false; -} - -function shouldParseArrow() { - return match(tt.colon) || !canInsertSemicolon(); -} - -// Returns whether there was an arrow token. -export function parseArrow() { - if (isTypeScriptEnabled) { - return tsParseArrow(); - } else if (isFlowEnabled) { - return flowParseArrow(); - } else { - return eat(tt.arrow); - } -} - -function parseParenItem() { - if (isTypeScriptEnabled || isFlowEnabled) { - typedParseParenItem(); - } -} - -// New's precedence is slightly tricky. It must allow its argument to -// be a `[]` or dot subscript expression, but not a call — at least, -// not without wrapping it in parentheses. Thus, it uses the noCalls -// argument to parseSubscripts to prevent it from consuming the -// argument list. -function parseNew() { - expect(tt._new); - if (eat(tt.dot)) { - // new.target - parseIdentifier(); - return; - } - parseNewCallee(); - if (isFlowEnabled) { - flowStartParseNewArguments(); - } - if (eat(tt.parenL)) { - parseExprList(tt.parenR); - } -} - -function parseNewCallee() { - parseNoCallExpr(); - eat(tt.questionDot); -} - -export function parseTemplate() { - // Finish `, read quasi - nextTemplateToken(); - // Finish quasi, read ${ - nextTemplateToken(); - while (!match(tt.backQuote) && !state.error) { - expect(tt.dollarBraceL); - parseExpression(); - // Finish }, read quasi - nextTemplateToken(); - // Finish quasi, read either ${ or ` - nextTemplateToken(); - } - next(); -} - -// Parse an object literal or binding pattern. -export function parseObj(isPattern, isBlockScope) { - // Attach a context ID to the object open and close brace and each object key. - const contextId = getNextContextId(); - let first = true; - - next(); - state.tokens[state.tokens.length - 1].contextId = contextId; - - while (!eat(tt.braceR) && !state.error) { - if (first) { - first = false; - } else { - expect(tt.comma); - if (eat(tt.braceR)) { - break; - } - } - - let isGenerator = false; - if (match(tt.ellipsis)) { - const previousIndex = state.tokens.length; - parseSpread(); - if (isPattern) { - // Mark role when the only thing being spread over is an identifier. - if (state.tokens.length === previousIndex + 2) { - markPriorBindingIdentifier(isBlockScope); - } - if (eat(tt.braceR)) { - break; - } - } - continue; - } - - if (!isPattern) { - isGenerator = eat(tt.star); - } - - if (!isPattern && isContextual(ContextualKeyword._async)) { - if (isGenerator) unexpected(); - - parseIdentifier(); - if ( - match(tt.colon) || - match(tt.parenL) || - match(tt.braceR) || - match(tt.eq) || - match(tt.comma) - ) { - // This is a key called "async" rather than an async function. - } else { - if (match(tt.star)) { - next(); - isGenerator = true; - } - parsePropertyName(contextId); - } - } else { - parsePropertyName(contextId); - } - - parseObjPropValue(isPattern, isBlockScope, contextId); - } - - state.tokens[state.tokens.length - 1].contextId = contextId; -} - -function isGetterOrSetterMethod(isPattern) { - // We go off of the next and don't bother checking if the node key is actually "get" or "set". - // This lets us avoid generating a node, and should only make the validation worse. - return ( - !isPattern && - (match(tt.string) || // get "string"() {} - match(tt.num) || // get 1() {} - match(tt.bracketL) || // get ["string"]() {} - match(tt.name) || // get foo() {} - !!(state.type & TokenType.IS_KEYWORD)) // get debugger() {} - ); -} - -// Returns true if this was a method. -function parseObjectMethod(isPattern, objectContextId) { - // We don't need to worry about modifiers because object methods can't have optional bodies, so - // the start will never be used. - const functionStart = state.start; - if (match(tt.parenL)) { - if (isPattern) unexpected(); - parseMethod(functionStart, /* isConstructor */ false); - return true; - } - - if (isGetterOrSetterMethod(isPattern)) { - parsePropertyName(objectContextId); - parseMethod(functionStart, /* isConstructor */ false); - return true; - } - return false; -} - -function parseObjectProperty(isPattern, isBlockScope) { - if (eat(tt.colon)) { - if (isPattern) { - parseMaybeDefault(isBlockScope); - } else { - parseMaybeAssign(false); - } - return; - } - - // Since there's no colon, we assume this is an object shorthand. - - // If we're in a destructuring, we've now discovered that the key was actually an assignee, so - // we need to tag it as a declaration with the appropriate scope. Otherwise, we might need to - // transform it on access, so mark it as a normal object shorthand. - let identifierRole; - if (isPattern) { - if (state.scopeDepth === 0) { - identifierRole = IdentifierRole.ObjectShorthandTopLevelDeclaration; - } else if (isBlockScope) { - identifierRole = IdentifierRole.ObjectShorthandBlockScopedDeclaration; - } else { - identifierRole = IdentifierRole.ObjectShorthandFunctionScopedDeclaration; - } - } else { - identifierRole = IdentifierRole.ObjectShorthand; - } - state.tokens[state.tokens.length - 1].identifierRole = identifierRole; - - // Regardless of whether we know this to be a pattern or if we're in an ambiguous context, allow - // parsing as if there's a default value. - parseMaybeDefault(isBlockScope, true); -} - -function parseObjPropValue( - isPattern, - isBlockScope, - objectContextId, -) { - if (isTypeScriptEnabled) { - tsStartParseObjPropValue(); - } else if (isFlowEnabled) { - flowStartParseObjPropValue(); - } - const wasMethod = parseObjectMethod(isPattern, objectContextId); - if (!wasMethod) { - parseObjectProperty(isPattern, isBlockScope); - } -} - -export function parsePropertyName(objectContextId) { - if (isFlowEnabled) { - flowParseVariance(); - } - if (eat(tt.bracketL)) { - state.tokens[state.tokens.length - 1].contextId = objectContextId; - parseMaybeAssign(); - expect(tt.bracketR); - state.tokens[state.tokens.length - 1].contextId = objectContextId; - } else { - if (match(tt.num) || match(tt.string) || match(tt.bigint) || match(tt.decimal)) { - parseExprAtom(); - } else { - parseMaybePrivateName(); - } - - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ObjectKey; - state.tokens[state.tokens.length - 1].contextId = objectContextId; - } -} - -// Parse object or class method. -export function parseMethod(functionStart, isConstructor) { - const funcContextId = getNextContextId(); - - state.scopeDepth++; - const startTokenIndex = state.tokens.length; - const allowModifiers = isConstructor; // For TypeScript parameter properties - parseFunctionParams(allowModifiers, funcContextId); - parseFunctionBodyAndFinish(functionStart, funcContextId); - const endTokenIndex = state.tokens.length; - state.scopes.push(new Scope(startTokenIndex, endTokenIndex, true)); - state.scopeDepth--; -} - -// Parse arrow function expression. -// If the parameters are provided, they will be converted to an -// assignable list. -export function parseArrowExpression(startTokenIndex) { - parseFunctionBody(true); - const endTokenIndex = state.tokens.length; - state.scopes.push(new Scope(startTokenIndex, endTokenIndex, true)); - state.scopeDepth--; -} - -export function parseFunctionBodyAndFinish(functionStart, funcContextId = 0) { - if (isTypeScriptEnabled) { - tsParseFunctionBodyAndFinish(functionStart, funcContextId); - } else if (isFlowEnabled) { - flowParseFunctionBodyAndFinish(funcContextId); - } else { - parseFunctionBody(false, funcContextId); - } -} - -export function parseFunctionBody(allowExpression, funcContextId = 0) { - const isExpression = allowExpression && !match(tt.braceL); - - if (isExpression) { - parseMaybeAssign(); - } else { - parseBlock(true /* isFunctionScope */, funcContextId); - } -} - -// Parses a comma-separated list of expressions, and returns them as -// an array. `close` is the token type that ends the list, and -// `allowEmpty` can be turned on to allow subsequent commas with -// nothing in between them to be parsed as `null` (which is needed -// for array literals). - -function parseExprList(close, allowEmpty = false) { - let first = true; - while (!eat(close) && !state.error) { - if (first) { - first = false; - } else { - expect(tt.comma); - if (eat(close)) break; - } - parseExprListItem(allowEmpty); - } -} - -function parseExprListItem(allowEmpty) { - if (allowEmpty && match(tt.comma)) { - // Empty item; nothing more to parse for this item. - } else if (match(tt.ellipsis)) { - parseSpread(); - parseParenItem(); - } else if (match(tt.question)) { - // Partial function application proposal. - next(); - } else { - parseMaybeAssign(false, true); - } -} - -// Parse the next token as an identifier. -export function parseIdentifier() { - next(); - state.tokens[state.tokens.length - 1].type = tt.name; -} - -// Parses await expression inside async function. -function parseAwait() { - parseMaybeUnary(); -} - -// Parses yield expression inside generator. -function parseYield() { - next(); - if (!match(tt.semi) && !canInsertSemicolon()) { - eat(tt.star); - parseMaybeAssign(); - } -} - -// https://github.com/tc39/proposal-js-module-blocks -function parseModuleExpression() { - expectContextual(ContextualKeyword._module); - expect(tt.braceL); - // For now, just call parseBlockBody to parse the block. In the future when we - // implement full support, we'll want to emit scopes and possibly other - // information. - parseBlockBody(tt.braceR); -} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/index.js b/node_modules/sucrase/dist/esm/parser/traverser/index.js deleted file mode 100644 index eb8c990..0000000 --- a/node_modules/sucrase/dist/esm/parser/traverser/index.js +++ /dev/null @@ -1,18 +0,0 @@ - -import {nextToken, skipLineComment} from "../tokenizer/index"; -import {charCodes} from "../util/charcodes"; -import {input, state} from "./base"; -import {parseTopLevel} from "./statement"; - -export function parseFile() { - // If enabled, skip leading hashbang line. - if ( - state.pos === 0 && - input.charCodeAt(0) === charCodes.numberSign && - input.charCodeAt(1) === charCodes.exclamationMark - ) { - skipLineComment(2); - } - nextToken(); - return parseTopLevel(); -} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/lval.js b/node_modules/sucrase/dist/esm/parser/traverser/lval.js deleted file mode 100644 index f5c4855..0000000 --- a/node_modules/sucrase/dist/esm/parser/traverser/lval.js +++ /dev/null @@ -1,159 +0,0 @@ -import {flowParseAssignableListItemTypes} from "../plugins/flow"; -import {tsParseAssignableListItemTypes, tsParseModifiers} from "../plugins/typescript"; -import { - eat, - IdentifierRole, - match, - next, - popTypeContext, - pushTypeContext, -} from "../tokenizer/index"; -import {ContextualKeyword} from "../tokenizer/keywords"; -import {TokenType, TokenType as tt} from "../tokenizer/types"; -import {isFlowEnabled, isTypeScriptEnabled, state} from "./base"; -import {parseIdentifier, parseMaybeAssign, parseObj} from "./expression"; -import {expect, unexpected} from "./util"; - -export function parseSpread() { - next(); - parseMaybeAssign(false); -} - -export function parseRest(isBlockScope) { - next(); - parseBindingAtom(isBlockScope); -} - -export function parseBindingIdentifier(isBlockScope) { - parseIdentifier(); - markPriorBindingIdentifier(isBlockScope); -} - -export function parseImportedIdentifier() { - parseIdentifier(); - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportDeclaration; -} - -export function markPriorBindingIdentifier(isBlockScope) { - let identifierRole; - if (state.scopeDepth === 0) { - identifierRole = IdentifierRole.TopLevelDeclaration; - } else if (isBlockScope) { - identifierRole = IdentifierRole.BlockScopedDeclaration; - } else { - identifierRole = IdentifierRole.FunctionScopedDeclaration; - } - state.tokens[state.tokens.length - 1].identifierRole = identifierRole; -} - -// Parses lvalue (assignable) atom. -export function parseBindingAtom(isBlockScope) { - switch (state.type) { - case tt._this: { - // In TypeScript, "this" may be the name of a parameter, so allow it. - const oldIsType = pushTypeContext(0); - next(); - popTypeContext(oldIsType); - return; - } - - case tt._yield: - case tt.name: { - state.type = tt.name; - parseBindingIdentifier(isBlockScope); - return; - } - - case tt.bracketL: { - next(); - parseBindingList(tt.bracketR, isBlockScope, true /* allowEmpty */); - return; - } - - case tt.braceL: - parseObj(true, isBlockScope); - return; - - default: - unexpected(); - } -} - -export function parseBindingList( - close, - isBlockScope, - allowEmpty = false, - allowModifiers = false, - contextId = 0, -) { - let first = true; - - let hasRemovedComma = false; - const firstItemTokenIndex = state.tokens.length; - - while (!eat(close) && !state.error) { - if (first) { - first = false; - } else { - expect(tt.comma); - state.tokens[state.tokens.length - 1].contextId = contextId; - // After a "this" type in TypeScript, we need to set the following comma (if any) to also be - // a type token so that it will be removed. - if (!hasRemovedComma && state.tokens[firstItemTokenIndex].isType) { - state.tokens[state.tokens.length - 1].isType = true; - hasRemovedComma = true; - } - } - if (allowEmpty && match(tt.comma)) { - // Empty item; nothing further to parse for this item. - } else if (eat(close)) { - break; - } else if (match(tt.ellipsis)) { - parseRest(isBlockScope); - parseAssignableListItemTypes(); - // Support rest element trailing commas allowed by TypeScript <2.9. - eat(TokenType.comma); - expect(close); - break; - } else { - parseAssignableListItem(allowModifiers, isBlockScope); - } - } -} - -function parseAssignableListItem(allowModifiers, isBlockScope) { - if (allowModifiers) { - tsParseModifiers([ - ContextualKeyword._public, - ContextualKeyword._protected, - ContextualKeyword._private, - ContextualKeyword._readonly, - ContextualKeyword._override, - ]); - } - - parseMaybeDefault(isBlockScope); - parseAssignableListItemTypes(); - parseMaybeDefault(isBlockScope, true /* leftAlreadyParsed */); -} - -function parseAssignableListItemTypes() { - if (isFlowEnabled) { - flowParseAssignableListItemTypes(); - } else if (isTypeScriptEnabled) { - tsParseAssignableListItemTypes(); - } -} - -// Parses assignment pattern around given atom if possible. -export function parseMaybeDefault(isBlockScope, leftAlreadyParsed = false) { - if (!leftAlreadyParsed) { - parseBindingAtom(isBlockScope); - } - if (!eat(tt.eq)) { - return; - } - const eqIndex = state.tokens.length - 1; - parseMaybeAssign(); - state.tokens[eqIndex].rhsEndIndex = state.tokens.length; -} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/statement.js b/node_modules/sucrase/dist/esm/parser/traverser/statement.js deleted file mode 100644 index 34a6511..0000000 --- a/node_modules/sucrase/dist/esm/parser/traverser/statement.js +++ /dev/null @@ -1,1332 +0,0 @@ -/* eslint max-len: 0 */ - -import {File} from "../index"; -import { - flowAfterParseClassSuper, - flowAfterParseVarHead, - flowParseExportDeclaration, - flowParseExportStar, - flowParseIdentifierStatement, - flowParseImportSpecifier, - flowParseTypeAnnotation, - flowParseTypeParameterDeclaration, - flowShouldDisallowExportDefaultSpecifier, - flowShouldParseExportDeclaration, - flowShouldParseExportStar, - flowStartParseFunctionParams, - flowStartParseImportSpecifiers, - flowTryParseExportDefaultExpression, - flowTryParseStatement, -} from "../plugins/flow"; -import { - tsAfterParseClassSuper, - tsAfterParseVarHead, - tsIsDeclarationStart, - tsParseExportDeclaration, - tsParseExportSpecifier, - tsParseIdentifierStatement, - tsParseImportEqualsDeclaration, - tsParseImportSpecifier, - tsParseMaybeDecoratorArguments, - tsParseModifiers, - tsStartParseFunctionParams, - tsTryParseClassMemberWithIsStatic, - tsTryParseExport, - tsTryParseExportDefaultExpression, - tsTryParseStatementContent, - tsTryParseTypeAnnotation, - tsTryParseTypeParameters, -} from "../plugins/typescript"; -import { - eat, - eatTypeToken, - IdentifierRole, - lookaheadType, - lookaheadTypeAndKeyword, - match, - next, - nextTokenStart, - nextTokenStartSince, - popTypeContext, - pushTypeContext, -} from "../tokenizer"; -import {ContextualKeyword} from "../tokenizer/keywords"; -import {Scope} from "../tokenizer/state"; -import { TokenType as tt} from "../tokenizer/types"; -import {charCodes} from "../util/charcodes"; -import {getNextContextId, input, isFlowEnabled, isTypeScriptEnabled, state} from "./base"; -import { - parseCallExpressionArguments, - parseExprAtom, - parseExpression, - parseExprSubscripts, - parseFunctionBodyAndFinish, - parseIdentifier, - parseMaybeAssign, - parseMethod, - parseObj, - parseParenExpression, - parsePropertyName, -} from "./expression"; -import { - parseBindingAtom, - parseBindingIdentifier, - parseBindingList, - parseImportedIdentifier, -} from "./lval"; -import { - canInsertSemicolon, - eatContextual, - expect, - expectContextual, - hasFollowingLineBreak, - hasPrecedingLineBreak, - isContextual, - isLineTerminator, - isLookaheadContextual, - semicolon, - unexpected, -} from "./util"; - -export function parseTopLevel() { - parseBlockBody(tt.eof); - state.scopes.push(new Scope(0, state.tokens.length, true)); - if (state.scopeDepth !== 0) { - throw new Error(`Invalid scope depth at end of file: ${state.scopeDepth}`); - } - return new File(state.tokens, state.scopes); -} - -// Parse a single statement. -// -// If expecting a statement and finding a slash operator, parse a -// regular expression literal. This is to handle cases like -// `if (foo) /blah/.exec(foo)`, where looking at the previous token -// does not help. - -export function parseStatement(declaration) { - if (isFlowEnabled) { - if (flowTryParseStatement()) { - return; - } - } - if (match(tt.at)) { - parseDecorators(); - } - parseStatementContent(declaration); -} - -function parseStatementContent(declaration) { - if (isTypeScriptEnabled) { - if (tsTryParseStatementContent()) { - return; - } - } - - const starttype = state.type; - - // Most types of statements are recognized by the keyword they - // start with. Many are trivial to parse, some require a bit of - // complexity. - - switch (starttype) { - case tt._break: - case tt._continue: - parseBreakContinueStatement(); - return; - case tt._debugger: - parseDebuggerStatement(); - return; - case tt._do: - parseDoStatement(); - return; - case tt._for: - parseForStatement(); - return; - case tt._function: - if (lookaheadType() === tt.dot) break; - if (!declaration) unexpected(); - parseFunctionStatement(); - return; - - case tt._class: - if (!declaration) unexpected(); - parseClass(true); - return; - - case tt._if: - parseIfStatement(); - return; - case tt._return: - parseReturnStatement(); - return; - case tt._switch: - parseSwitchStatement(); - return; - case tt._throw: - parseThrowStatement(); - return; - case tt._try: - parseTryStatement(); - return; - - case tt._let: - case tt._const: - if (!declaration) unexpected(); // NOTE: falls through to _var - - case tt._var: - parseVarStatement(starttype !== tt._var); - return; - - case tt._while: - parseWhileStatement(); - return; - case tt.braceL: - parseBlock(); - return; - case tt.semi: - parseEmptyStatement(); - return; - case tt._export: - case tt._import: { - const nextType = lookaheadType(); - if (nextType === tt.parenL || nextType === tt.dot) { - break; - } - next(); - if (starttype === tt._import) { - parseImport(); - } else { - parseExport(); - } - return; - } - case tt.name: - if (state.contextualKeyword === ContextualKeyword._async) { - const functionStart = state.start; - // peek ahead and see if next token is a function - const snapshot = state.snapshot(); - next(); - if (match(tt._function) && !canInsertSemicolon()) { - expect(tt._function); - parseFunction(functionStart, true); - return; - } else { - state.restoreFromSnapshot(snapshot); - } - } else if ( - state.contextualKeyword === ContextualKeyword._using && - !hasFollowingLineBreak() && - // Statements like `using[0]` and `using in foo` aren't actual using - // declarations. - lookaheadType() === tt.name - ) { - parseVarStatement(true); - return; - } else if (startsAwaitUsing()) { - expectContextual(ContextualKeyword._await); - parseVarStatement(true); - return; - } - default: - // Do nothing. - break; - } - - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - const initialTokensLength = state.tokens.length; - parseExpression(); - let simpleName = null; - if (state.tokens.length === initialTokensLength + 1) { - const token = state.tokens[state.tokens.length - 1]; - if (token.type === tt.name) { - simpleName = token.contextualKeyword; - } - } - if (simpleName == null) { - semicolon(); - return; - } - if (eat(tt.colon)) { - parseLabeledStatement(); - } else { - // This was an identifier, so we might want to handle flow/typescript-specific cases. - parseIdentifierStatement(simpleName); - } -} - -/** - * Determine if we're positioned at an `await using` declaration. - * - * Note that this can happen either in place of a regular variable declaration - * or in a loop body, and in both places, there are similar-looking cases where - * we need to return false. - * - * Examples returning true: - * await using foo = bar(); - * for (await using a of b) {} - * - * Examples returning false: - * await using - * await using + 1 - * await using instanceof T - * for (await using;;) {} - * - * For now, we early return if we don't see `await`, then do a simple - * backtracking-based lookahead for the `using` and identifier tokens. In the - * future, this could be optimized with a character-based approach. - */ -function startsAwaitUsing() { - if (!isContextual(ContextualKeyword._await)) { - return false; - } - const snapshot = state.snapshot(); - // await - next(); - if (!isContextual(ContextualKeyword._using) || hasPrecedingLineBreak()) { - state.restoreFromSnapshot(snapshot); - return false; - } - // using - next(); - if (!match(tt.name) || hasPrecedingLineBreak()) { - state.restoreFromSnapshot(snapshot); - return false; - } - state.restoreFromSnapshot(snapshot); - return true; -} - -export function parseDecorators() { - while (match(tt.at)) { - parseDecorator(); - } -} - -function parseDecorator() { - next(); - if (eat(tt.parenL)) { - parseExpression(); - expect(tt.parenR); - } else { - parseIdentifier(); - while (eat(tt.dot)) { - parseIdentifier(); - } - parseMaybeDecoratorArguments(); - } -} - -function parseMaybeDecoratorArguments() { - if (isTypeScriptEnabled) { - tsParseMaybeDecoratorArguments(); - } else { - baseParseMaybeDecoratorArguments(); - } -} - -export function baseParseMaybeDecoratorArguments() { - if (eat(tt.parenL)) { - parseCallExpressionArguments(); - } -} - -function parseBreakContinueStatement() { - next(); - if (!isLineTerminator()) { - parseIdentifier(); - semicolon(); - } -} - -function parseDebuggerStatement() { - next(); - semicolon(); -} - -function parseDoStatement() { - next(); - parseStatement(false); - expect(tt._while); - parseParenExpression(); - eat(tt.semi); -} - -function parseForStatement() { - state.scopeDepth++; - const startTokenIndex = state.tokens.length; - parseAmbiguousForStatement(); - const endTokenIndex = state.tokens.length; - state.scopes.push(new Scope(startTokenIndex, endTokenIndex, false)); - state.scopeDepth--; -} - -/** - * Determine if this token is a `using` declaration (explicit resource - * management) as part of a loop. - * https://github.com/tc39/proposal-explicit-resource-management - */ -function isUsingInLoop() { - if (!isContextual(ContextualKeyword._using)) { - return false; - } - // This must be `for (using of`, where `using` is the name of the loop - // variable. - if (isLookaheadContextual(ContextualKeyword._of)) { - return false; - } - return true; -} - -// Disambiguating between a `for` and a `for`/`in` or `for`/`of` -// loop is non-trivial. Basically, we have to parse the init `var` -// statement or expression, disallowing the `in` operator (see -// the second parameter to `parseExpression`), and then check -// whether the next token is `in` or `of`. When there is no init -// part (semicolon immediately after the opening parenthesis), it -// is a regular `for` loop. -function parseAmbiguousForStatement() { - next(); - - let forAwait = false; - if (isContextual(ContextualKeyword._await)) { - forAwait = true; - next(); - } - expect(tt.parenL); - - if (match(tt.semi)) { - if (forAwait) { - unexpected(); - } - parseFor(); - return; - } - - const isAwaitUsing = startsAwaitUsing(); - if (isAwaitUsing || match(tt._var) || match(tt._let) || match(tt._const) || isUsingInLoop()) { - if (isAwaitUsing) { - expectContextual(ContextualKeyword._await); - } - next(); - parseVar(true, state.type !== tt._var); - if (match(tt._in) || isContextual(ContextualKeyword._of)) { - parseForIn(forAwait); - return; - } - parseFor(); - return; - } - - parseExpression(true); - if (match(tt._in) || isContextual(ContextualKeyword._of)) { - parseForIn(forAwait); - return; - } - if (forAwait) { - unexpected(); - } - parseFor(); -} - -function parseFunctionStatement() { - const functionStart = state.start; - next(); - parseFunction(functionStart, true); -} - -function parseIfStatement() { - next(); - parseParenExpression(); - parseStatement(false); - if (eat(tt._else)) { - parseStatement(false); - } -} - -function parseReturnStatement() { - next(); - - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. - - if (!isLineTerminator()) { - parseExpression(); - semicolon(); - } -} - -function parseSwitchStatement() { - next(); - parseParenExpression(); - state.scopeDepth++; - const startTokenIndex = state.tokens.length; - expect(tt.braceL); - - // Don't bother validation; just go through any sequence of cases, defaults, and statements. - while (!match(tt.braceR) && !state.error) { - if (match(tt._case) || match(tt._default)) { - const isCase = match(tt._case); - next(); - if (isCase) { - parseExpression(); - } - expect(tt.colon); - } else { - parseStatement(true); - } - } - next(); // Closing brace - const endTokenIndex = state.tokens.length; - state.scopes.push(new Scope(startTokenIndex, endTokenIndex, false)); - state.scopeDepth--; -} - -function parseThrowStatement() { - next(); - parseExpression(); - semicolon(); -} - -function parseCatchClauseParam() { - parseBindingAtom(true /* isBlockScope */); - - if (isTypeScriptEnabled) { - tsTryParseTypeAnnotation(); - } -} - -function parseTryStatement() { - next(); - - parseBlock(); - - if (match(tt._catch)) { - next(); - let catchBindingStartTokenIndex = null; - if (match(tt.parenL)) { - state.scopeDepth++; - catchBindingStartTokenIndex = state.tokens.length; - expect(tt.parenL); - parseCatchClauseParam(); - expect(tt.parenR); - } - parseBlock(); - if (catchBindingStartTokenIndex != null) { - // We need a special scope for the catch binding which includes the binding itself and the - // catch block. - const endTokenIndex = state.tokens.length; - state.scopes.push(new Scope(catchBindingStartTokenIndex, endTokenIndex, false)); - state.scopeDepth--; - } - } - if (eat(tt._finally)) { - parseBlock(); - } -} - -export function parseVarStatement(isBlockScope) { - next(); - parseVar(false, isBlockScope); - semicolon(); -} - -function parseWhileStatement() { - next(); - parseParenExpression(); - parseStatement(false); -} - -function parseEmptyStatement() { - next(); -} - -function parseLabeledStatement() { - parseStatement(true); -} - -/** - * Parse a statement starting with an identifier of the given name. Subclasses match on the name - * to handle statements like "declare". - */ -function parseIdentifierStatement(contextualKeyword) { - if (isTypeScriptEnabled) { - tsParseIdentifierStatement(contextualKeyword); - } else if (isFlowEnabled) { - flowParseIdentifierStatement(contextualKeyword); - } else { - semicolon(); - } -} - -// Parse a semicolon-enclosed block of statements. -export function parseBlock(isFunctionScope = false, contextId = 0) { - const startTokenIndex = state.tokens.length; - state.scopeDepth++; - expect(tt.braceL); - if (contextId) { - state.tokens[state.tokens.length - 1].contextId = contextId; - } - parseBlockBody(tt.braceR); - if (contextId) { - state.tokens[state.tokens.length - 1].contextId = contextId; - } - const endTokenIndex = state.tokens.length; - state.scopes.push(new Scope(startTokenIndex, endTokenIndex, isFunctionScope)); - state.scopeDepth--; -} - -export function parseBlockBody(end) { - while (!eat(end) && !state.error) { - parseStatement(true); - } -} - -// Parse a regular `for` loop. The disambiguation code in -// `parseStatement` will already have parsed the init statement or -// expression. - -function parseFor() { - expect(tt.semi); - if (!match(tt.semi)) { - parseExpression(); - } - expect(tt.semi); - if (!match(tt.parenR)) { - parseExpression(); - } - expect(tt.parenR); - parseStatement(false); -} - -// Parse a `for`/`in` and `for`/`of` loop, which are almost -// same from parser's perspective. - -function parseForIn(forAwait) { - if (forAwait) { - eatContextual(ContextualKeyword._of); - } else { - next(); - } - parseExpression(); - expect(tt.parenR); - parseStatement(false); -} - -// Parse a list of variable declarations. - -function parseVar(isFor, isBlockScope) { - while (true) { - parseVarHead(isBlockScope); - if (eat(tt.eq)) { - const eqIndex = state.tokens.length - 1; - parseMaybeAssign(isFor); - state.tokens[eqIndex].rhsEndIndex = state.tokens.length; - } - if (!eat(tt.comma)) { - break; - } - } -} - -function parseVarHead(isBlockScope) { - parseBindingAtom(isBlockScope); - if (isTypeScriptEnabled) { - tsAfterParseVarHead(); - } else if (isFlowEnabled) { - flowAfterParseVarHead(); - } -} - -// Parse a function declaration or literal (depending on the -// `isStatement` parameter). - -export function parseFunction( - functionStart, - isStatement, - optionalId = false, -) { - if (match(tt.star)) { - next(); - } - - if (isStatement && !optionalId && !match(tt.name) && !match(tt._yield)) { - unexpected(); - } - - let nameScopeStartTokenIndex = null; - - if (match(tt.name)) { - // Expression-style functions should limit their name's scope to the function body, so we make - // a new function scope to enforce that. - if (!isStatement) { - nameScopeStartTokenIndex = state.tokens.length; - state.scopeDepth++; - } - parseBindingIdentifier(false); - } - - const startTokenIndex = state.tokens.length; - state.scopeDepth++; - parseFunctionParams(); - parseFunctionBodyAndFinish(functionStart); - const endTokenIndex = state.tokens.length; - // In addition to the block scope of the function body, we need a separate function-style scope - // that includes the params. - state.scopes.push(new Scope(startTokenIndex, endTokenIndex, true)); - state.scopeDepth--; - if (nameScopeStartTokenIndex !== null) { - state.scopes.push(new Scope(nameScopeStartTokenIndex, endTokenIndex, true)); - state.scopeDepth--; - } -} - -export function parseFunctionParams( - allowModifiers = false, - funcContextId = 0, -) { - if (isTypeScriptEnabled) { - tsStartParseFunctionParams(); - } else if (isFlowEnabled) { - flowStartParseFunctionParams(); - } - - expect(tt.parenL); - if (funcContextId) { - state.tokens[state.tokens.length - 1].contextId = funcContextId; - } - parseBindingList( - tt.parenR, - false /* isBlockScope */, - false /* allowEmpty */, - allowModifiers, - funcContextId, - ); - if (funcContextId) { - state.tokens[state.tokens.length - 1].contextId = funcContextId; - } -} - -// Parse a class declaration or literal (depending on the -// `isStatement` parameter). - -export function parseClass(isStatement, optionalId = false) { - // Put a context ID on the class keyword, the open-brace, and the close-brace, so that later - // code can easily navigate to meaningful points on the class. - const contextId = getNextContextId(); - - next(); - state.tokens[state.tokens.length - 1].contextId = contextId; - state.tokens[state.tokens.length - 1].isExpression = !isStatement; - // Like with functions, we declare a special "name scope" from the start of the name to the end - // of the class, but only with expression-style classes, to represent the fact that the name is - // available to the body of the class but not an outer declaration. - let nameScopeStartTokenIndex = null; - if (!isStatement) { - nameScopeStartTokenIndex = state.tokens.length; - state.scopeDepth++; - } - parseClassId(isStatement, optionalId); - parseClassSuper(); - const openBraceIndex = state.tokens.length; - parseClassBody(contextId); - if (state.error) { - return; - } - state.tokens[openBraceIndex].contextId = contextId; - state.tokens[state.tokens.length - 1].contextId = contextId; - if (nameScopeStartTokenIndex !== null) { - const endTokenIndex = state.tokens.length; - state.scopes.push(new Scope(nameScopeStartTokenIndex, endTokenIndex, false)); - state.scopeDepth--; - } -} - -function isClassProperty() { - return match(tt.eq) || match(tt.semi) || match(tt.braceR) || match(tt.bang) || match(tt.colon); -} - -function isClassMethod() { - return match(tt.parenL) || match(tt.lessThan); -} - -function parseClassBody(classContextId) { - expect(tt.braceL); - - while (!eat(tt.braceR) && !state.error) { - if (eat(tt.semi)) { - continue; - } - - if (match(tt.at)) { - parseDecorator(); - continue; - } - const memberStart = state.start; - parseClassMember(memberStart, classContextId); - } -} - -function parseClassMember(memberStart, classContextId) { - if (isTypeScriptEnabled) { - tsParseModifiers([ - ContextualKeyword._declare, - ContextualKeyword._public, - ContextualKeyword._protected, - ContextualKeyword._private, - ContextualKeyword._override, - ]); - } - let isStatic = false; - if (match(tt.name) && state.contextualKeyword === ContextualKeyword._static) { - parseIdentifier(); // eats 'static' - if (isClassMethod()) { - parseClassMethod(memberStart, /* isConstructor */ false); - return; - } else if (isClassProperty()) { - parseClassProperty(); - return; - } - // otherwise something static - state.tokens[state.tokens.length - 1].type = tt._static; - isStatic = true; - - if (match(tt.braceL)) { - // This is a static block. Mark the word "static" with the class context ID for class element - // detection and parse as a regular block. - state.tokens[state.tokens.length - 1].contextId = classContextId; - parseBlock(); - return; - } - } - - parseClassMemberWithIsStatic(memberStart, isStatic, classContextId); -} - -function parseClassMemberWithIsStatic( - memberStart, - isStatic, - classContextId, -) { - if (isTypeScriptEnabled) { - if (tsTryParseClassMemberWithIsStatic(isStatic)) { - return; - } - } - if (eat(tt.star)) { - // a generator - parseClassPropertyName(classContextId); - parseClassMethod(memberStart, /* isConstructor */ false); - return; - } - - // Get the identifier name so we can tell if it's actually a keyword like "async", "get", or - // "set". - parseClassPropertyName(classContextId); - let isConstructor = false; - const token = state.tokens[state.tokens.length - 1]; - // We allow "constructor" as either an identifier or a string. - if (token.contextualKeyword === ContextualKeyword._constructor) { - isConstructor = true; - } - parsePostMemberNameModifiers(); - - if (isClassMethod()) { - parseClassMethod(memberStart, isConstructor); - } else if (isClassProperty()) { - parseClassProperty(); - } else if (token.contextualKeyword === ContextualKeyword._async && !isLineTerminator()) { - state.tokens[state.tokens.length - 1].type = tt._async; - // an async method - const isGenerator = match(tt.star); - if (isGenerator) { - next(); - } - - // The so-called parsed name would have been "async": get the real name. - parseClassPropertyName(classContextId); - parsePostMemberNameModifiers(); - parseClassMethod(memberStart, false /* isConstructor */); - } else if ( - (token.contextualKeyword === ContextualKeyword._get || - token.contextualKeyword === ContextualKeyword._set) && - !(isLineTerminator() && match(tt.star)) - ) { - if (token.contextualKeyword === ContextualKeyword._get) { - state.tokens[state.tokens.length - 1].type = tt._get; - } else { - state.tokens[state.tokens.length - 1].type = tt._set; - } - // `get\n*` is an uninitialized property named 'get' followed by a generator. - // a getter or setter - // The so-called parsed name would have been "get/set": get the real name. - parseClassPropertyName(classContextId); - parseClassMethod(memberStart, /* isConstructor */ false); - } else if (token.contextualKeyword === ContextualKeyword._accessor && !isLineTerminator()) { - parseClassPropertyName(classContextId); - parseClassProperty(); - } else if (isLineTerminator()) { - // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token) - parseClassProperty(); - } else { - unexpected(); - } -} - -function parseClassMethod(functionStart, isConstructor) { - if (isTypeScriptEnabled) { - tsTryParseTypeParameters(); - } else if (isFlowEnabled) { - if (match(tt.lessThan)) { - flowParseTypeParameterDeclaration(); - } - } - parseMethod(functionStart, isConstructor); -} - -// Return the name of the class property, if it is a simple identifier. -export function parseClassPropertyName(classContextId) { - parsePropertyName(classContextId); -} - -export function parsePostMemberNameModifiers() { - if (isTypeScriptEnabled) { - const oldIsType = pushTypeContext(0); - eat(tt.question); - popTypeContext(oldIsType); - } -} - -export function parseClassProperty() { - if (isTypeScriptEnabled) { - eatTypeToken(tt.bang); - tsTryParseTypeAnnotation(); - } else if (isFlowEnabled) { - if (match(tt.colon)) { - flowParseTypeAnnotation(); - } - } - - if (match(tt.eq)) { - const equalsTokenIndex = state.tokens.length; - next(); - parseMaybeAssign(); - state.tokens[equalsTokenIndex].rhsEndIndex = state.tokens.length; - } - semicolon(); -} - -function parseClassId(isStatement, optionalId = false) { - if ( - isTypeScriptEnabled && - (!isStatement || optionalId) && - isContextual(ContextualKeyword._implements) - ) { - return; - } - - if (match(tt.name)) { - parseBindingIdentifier(true); - } - - if (isTypeScriptEnabled) { - tsTryParseTypeParameters(); - } else if (isFlowEnabled) { - if (match(tt.lessThan)) { - flowParseTypeParameterDeclaration(); - } - } -} - -// Returns true if there was a superclass. -function parseClassSuper() { - let hasSuper = false; - if (eat(tt._extends)) { - parseExprSubscripts(); - hasSuper = true; - } else { - hasSuper = false; - } - if (isTypeScriptEnabled) { - tsAfterParseClassSuper(hasSuper); - } else if (isFlowEnabled) { - flowAfterParseClassSuper(hasSuper); - } -} - -// Parses module export declaration. - -export function parseExport() { - const exportIndex = state.tokens.length - 1; - if (isTypeScriptEnabled) { - if (tsTryParseExport()) { - return; - } - } - // export * from '...' - if (shouldParseExportStar()) { - parseExportStar(); - } else if (isExportDefaultSpecifier()) { - // export default from - parseIdentifier(); - if (match(tt.comma) && lookaheadType() === tt.star) { - expect(tt.comma); - expect(tt.star); - expectContextual(ContextualKeyword._as); - parseIdentifier(); - } else { - parseExportSpecifiersMaybe(); - } - parseExportFrom(); - } else if (eat(tt._default)) { - // export default ... - parseExportDefaultExpression(); - } else if (shouldParseExportDeclaration()) { - parseExportDeclaration(); - } else { - // export { x, y as z } [from '...'] - parseExportSpecifiers(); - parseExportFrom(); - } - state.tokens[exportIndex].rhsEndIndex = state.tokens.length; -} - -function parseExportDefaultExpression() { - if (isTypeScriptEnabled) { - if (tsTryParseExportDefaultExpression()) { - return; - } - } - if (isFlowEnabled) { - if (flowTryParseExportDefaultExpression()) { - return; - } - } - const functionStart = state.start; - if (eat(tt._function)) { - parseFunction(functionStart, true, true); - } else if (isContextual(ContextualKeyword._async) && lookaheadType() === tt._function) { - // async function declaration - eatContextual(ContextualKeyword._async); - eat(tt._function); - parseFunction(functionStart, true, true); - } else if (match(tt._class)) { - parseClass(true, true); - } else if (match(tt.at)) { - parseDecorators(); - parseClass(true, true); - } else { - parseMaybeAssign(); - semicolon(); - } -} - -function parseExportDeclaration() { - if (isTypeScriptEnabled) { - tsParseExportDeclaration(); - } else if (isFlowEnabled) { - flowParseExportDeclaration(); - } else { - parseStatement(true); - } -} - -function isExportDefaultSpecifier() { - if (isTypeScriptEnabled && tsIsDeclarationStart()) { - return false; - } else if (isFlowEnabled && flowShouldDisallowExportDefaultSpecifier()) { - return false; - } - if (match(tt.name)) { - return state.contextualKeyword !== ContextualKeyword._async; - } - - if (!match(tt._default)) { - return false; - } - - const _next = nextTokenStart(); - const lookahead = lookaheadTypeAndKeyword(); - const hasFrom = - lookahead.type === tt.name && lookahead.contextualKeyword === ContextualKeyword._from; - if (lookahead.type === tt.comma) { - return true; - } - // lookahead again when `export default from` is seen - if (hasFrom) { - const nextAfterFrom = input.charCodeAt(nextTokenStartSince(_next + 4)); - return nextAfterFrom === charCodes.quotationMark || nextAfterFrom === charCodes.apostrophe; - } - return false; -} - -function parseExportSpecifiersMaybe() { - if (eat(tt.comma)) { - parseExportSpecifiers(); - } -} - -export function parseExportFrom() { - if (eatContextual(ContextualKeyword._from)) { - parseExprAtom(); - maybeParseImportAttributes(); - } - semicolon(); -} - -function shouldParseExportStar() { - if (isFlowEnabled) { - return flowShouldParseExportStar(); - } else { - return match(tt.star); - } -} - -function parseExportStar() { - if (isFlowEnabled) { - flowParseExportStar(); - } else { - baseParseExportStar(); - } -} - -export function baseParseExportStar() { - expect(tt.star); - - if (isContextual(ContextualKeyword._as)) { - parseExportNamespace(); - } else { - parseExportFrom(); - } -} - -function parseExportNamespace() { - next(); - state.tokens[state.tokens.length - 1].type = tt._as; - parseIdentifier(); - parseExportSpecifiersMaybe(); - parseExportFrom(); -} - -function shouldParseExportDeclaration() { - return ( - (isTypeScriptEnabled && tsIsDeclarationStart()) || - (isFlowEnabled && flowShouldParseExportDeclaration()) || - state.type === tt._var || - state.type === tt._const || - state.type === tt._let || - state.type === tt._function || - state.type === tt._class || - isContextual(ContextualKeyword._async) || - match(tt.at) - ); -} - -// Parses a comma-separated list of module exports. -export function parseExportSpecifiers() { - let first = true; - - // export { x, y as z } [from '...'] - expect(tt.braceL); - - while (!eat(tt.braceR) && !state.error) { - if (first) { - first = false; - } else { - expect(tt.comma); - if (eat(tt.braceR)) { - break; - } - } - parseExportSpecifier(); - } -} - -function parseExportSpecifier() { - if (isTypeScriptEnabled) { - tsParseExportSpecifier(); - return; - } - parseIdentifier(); - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ExportAccess; - if (eatContextual(ContextualKeyword._as)) { - parseIdentifier(); - } -} - -/** - * Starting at the `module` token in an import, determine if it was truly an - * import reflection token or just looks like one. - * - * Returns true for: - * import module foo from "foo"; - * import module from from "foo"; - * - * Returns false for: - * import module from "foo"; - * import module, {bar} from "foo"; - */ -function isImportReflection() { - const snapshot = state.snapshot(); - expectContextual(ContextualKeyword._module); - if (eatContextual(ContextualKeyword._from)) { - if (isContextual(ContextualKeyword._from)) { - state.restoreFromSnapshot(snapshot); - return true; - } else { - state.restoreFromSnapshot(snapshot); - return false; - } - } else if (match(tt.comma)) { - state.restoreFromSnapshot(snapshot); - return false; - } else { - state.restoreFromSnapshot(snapshot); - return true; - } -} - -/** - * Eat the "module" token from the import reflection proposal. - * https://github.com/tc39/proposal-import-reflection - */ -function parseMaybeImportReflection() { - // isImportReflection does snapshot/restore, so only run it if we see the word - // "module". - if (isContextual(ContextualKeyword._module) && isImportReflection()) { - next(); - } -} - -// Parses import declaration. - -export function parseImport() { - if (isTypeScriptEnabled && match(tt.name) && lookaheadType() === tt.eq) { - tsParseImportEqualsDeclaration(); - return; - } - if (isTypeScriptEnabled && isContextual(ContextualKeyword._type)) { - const lookahead = lookaheadTypeAndKeyword(); - if (lookahead.type === tt.name && lookahead.contextualKeyword !== ContextualKeyword._from) { - // One of these `import type` cases: - // import type T = require('T'); - // import type A from 'A'; - expectContextual(ContextualKeyword._type); - if (lookaheadType() === tt.eq) { - tsParseImportEqualsDeclaration(); - return; - } - // If this is an `import type...from` statement, then we already ate the - // type token, so proceed to the regular import parser. - } else if (lookahead.type === tt.star || lookahead.type === tt.braceL) { - // One of these `import type` cases, in which case we can eat the type token - // and proceed as normal: - // import type * as A from 'A'; - // import type {a} from 'A'; - expectContextual(ContextualKeyword._type); - } - // Otherwise, we are importing the name "type". - } - - // import '...' - if (match(tt.string)) { - parseExprAtom(); - } else { - parseMaybeImportReflection(); - parseImportSpecifiers(); - expectContextual(ContextualKeyword._from); - parseExprAtom(); - } - maybeParseImportAttributes(); - semicolon(); -} - -// eslint-disable-next-line no-unused-vars -function shouldParseDefaultImport() { - return match(tt.name); -} - -function parseImportSpecifierLocal() { - parseImportedIdentifier(); -} - -// Parses a comma-separated list of module imports. -function parseImportSpecifiers() { - if (isFlowEnabled) { - flowStartParseImportSpecifiers(); - } - - let first = true; - if (shouldParseDefaultImport()) { - // import defaultObj, { x, y as z } from '...' - parseImportSpecifierLocal(); - - if (!eat(tt.comma)) return; - } - - if (match(tt.star)) { - next(); - expectContextual(ContextualKeyword._as); - - parseImportSpecifierLocal(); - - return; - } - - expect(tt.braceL); - while (!eat(tt.braceR) && !state.error) { - if (first) { - first = false; - } else { - // Detect an attempt to deep destructure - if (eat(tt.colon)) { - unexpected( - "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", - ); - } - - expect(tt.comma); - if (eat(tt.braceR)) { - break; - } - } - - parseImportSpecifier(); - } -} - -function parseImportSpecifier() { - if (isTypeScriptEnabled) { - tsParseImportSpecifier(); - return; - } - if (isFlowEnabled) { - flowParseImportSpecifier(); - return; - } - parseImportedIdentifier(); - if (isContextual(ContextualKeyword._as)) { - state.tokens[state.tokens.length - 1].identifierRole = IdentifierRole.ImportAccess; - next(); - parseImportedIdentifier(); - } -} - -/** - * Parse import attributes like `with {type: "json"}`, or the legacy form - * `assert {type: "json"}`. - * - * Import attributes technically have their own syntax, but are always parseable - * as a plain JS object, so just do that for simplicity. - */ -function maybeParseImportAttributes() { - if (match(tt._with) || (isContextual(ContextualKeyword._assert) && !hasPrecedingLineBreak())) { - next(); - parseObj(false, false); - } -} diff --git a/node_modules/sucrase/dist/esm/parser/traverser/util.js b/node_modules/sucrase/dist/esm/parser/traverser/util.js deleted file mode 100644 index 6a2b2d9..0000000 --- a/node_modules/sucrase/dist/esm/parser/traverser/util.js +++ /dev/null @@ -1,104 +0,0 @@ -import {eat, finishToken, lookaheadTypeAndKeyword, match, nextTokenStart} from "../tokenizer/index"; - -import {formatTokenType, TokenType as tt} from "../tokenizer/types"; -import {charCodes} from "../util/charcodes"; -import {input, state} from "./base"; - -// ## Parser utilities - -// Tests whether parsed token is a contextual keyword. -export function isContextual(contextualKeyword) { - return state.contextualKeyword === contextualKeyword; -} - -export function isLookaheadContextual(contextualKeyword) { - const l = lookaheadTypeAndKeyword(); - return l.type === tt.name && l.contextualKeyword === contextualKeyword; -} - -// Consumes contextual keyword if possible. -export function eatContextual(contextualKeyword) { - return state.contextualKeyword === contextualKeyword && eat(tt.name); -} - -// Asserts that following token is given contextual keyword. -export function expectContextual(contextualKeyword) { - if (!eatContextual(contextualKeyword)) { - unexpected(); - } -} - -// Test whether a semicolon can be inserted at the current position. -export function canInsertSemicolon() { - return match(tt.eof) || match(tt.braceR) || hasPrecedingLineBreak(); -} - -export function hasPrecedingLineBreak() { - const prevToken = state.tokens[state.tokens.length - 1]; - const lastTokEnd = prevToken ? prevToken.end : 0; - for (let i = lastTokEnd; i < state.start; i++) { - const code = input.charCodeAt(i); - if ( - code === charCodes.lineFeed || - code === charCodes.carriageReturn || - code === 0x2028 || - code === 0x2029 - ) { - return true; - } - } - return false; -} - -export function hasFollowingLineBreak() { - const nextStart = nextTokenStart(); - for (let i = state.end; i < nextStart; i++) { - const code = input.charCodeAt(i); - if ( - code === charCodes.lineFeed || - code === charCodes.carriageReturn || - code === 0x2028 || - code === 0x2029 - ) { - return true; - } - } - return false; -} - -export function isLineTerminator() { - return eat(tt.semi) || canInsertSemicolon(); -} - -// Consume a semicolon, or, failing that, see if we are allowed to -// pretend that there is a semicolon at this position. -export function semicolon() { - if (!isLineTerminator()) { - unexpected('Unexpected token, expected ";"'); - } -} - -// Expect a token of a given type. If found, consume it, otherwise, -// raise an unexpected token error at given pos. -export function expect(type) { - const matched = eat(type); - if (!matched) { - unexpected(`Unexpected token, expected "${formatTokenType(type)}"`); - } -} - -/** - * Transition the parser to an error state. All code needs to be written to naturally unwind in this - * state, which allows us to backtrack without exceptions and without error plumbing everywhere. - */ -export function unexpected(message = "Unexpected token", pos = state.start) { - if (state.error) { - return; - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const err = new SyntaxError(message); - err.pos = pos; - state.error = err; - state.pos = input.length; - finishToken(tt.eof); -} diff --git a/node_modules/sucrase/dist/esm/parser/util/charcodes.js b/node_modules/sucrase/dist/esm/parser/util/charcodes.js deleted file mode 100644 index 36ea667..0000000 --- a/node_modules/sucrase/dist/esm/parser/util/charcodes.js +++ /dev/null @@ -1,115 +0,0 @@ -export var charCodes; (function (charCodes) { - const backSpace = 8; charCodes[charCodes["backSpace"] = backSpace] = "backSpace"; - const lineFeed = 10; charCodes[charCodes["lineFeed"] = lineFeed] = "lineFeed"; // '\n' - const tab = 9; charCodes[charCodes["tab"] = tab] = "tab"; // '\t' - const carriageReturn = 13; charCodes[charCodes["carriageReturn"] = carriageReturn] = "carriageReturn"; // '\r' - const shiftOut = 14; charCodes[charCodes["shiftOut"] = shiftOut] = "shiftOut"; - const space = 32; charCodes[charCodes["space"] = space] = "space"; - const exclamationMark = 33; charCodes[charCodes["exclamationMark"] = exclamationMark] = "exclamationMark"; // '!' - const quotationMark = 34; charCodes[charCodes["quotationMark"] = quotationMark] = "quotationMark"; // '"' - const numberSign = 35; charCodes[charCodes["numberSign"] = numberSign] = "numberSign"; // '#' - const dollarSign = 36; charCodes[charCodes["dollarSign"] = dollarSign] = "dollarSign"; // '$' - const percentSign = 37; charCodes[charCodes["percentSign"] = percentSign] = "percentSign"; // '%' - const ampersand = 38; charCodes[charCodes["ampersand"] = ampersand] = "ampersand"; // '&' - const apostrophe = 39; charCodes[charCodes["apostrophe"] = apostrophe] = "apostrophe"; // ''' - const leftParenthesis = 40; charCodes[charCodes["leftParenthesis"] = leftParenthesis] = "leftParenthesis"; // '(' - const rightParenthesis = 41; charCodes[charCodes["rightParenthesis"] = rightParenthesis] = "rightParenthesis"; // ')' - const asterisk = 42; charCodes[charCodes["asterisk"] = asterisk] = "asterisk"; // '*' - const plusSign = 43; charCodes[charCodes["plusSign"] = plusSign] = "plusSign"; // '+' - const comma = 44; charCodes[charCodes["comma"] = comma] = "comma"; // ',' - const dash = 45; charCodes[charCodes["dash"] = dash] = "dash"; // '-' - const dot = 46; charCodes[charCodes["dot"] = dot] = "dot"; // '.' - const slash = 47; charCodes[charCodes["slash"] = slash] = "slash"; // '/' - const digit0 = 48; charCodes[charCodes["digit0"] = digit0] = "digit0"; // '0' - const digit1 = 49; charCodes[charCodes["digit1"] = digit1] = "digit1"; // '1' - const digit2 = 50; charCodes[charCodes["digit2"] = digit2] = "digit2"; // '2' - const digit3 = 51; charCodes[charCodes["digit3"] = digit3] = "digit3"; // '3' - const digit4 = 52; charCodes[charCodes["digit4"] = digit4] = "digit4"; // '4' - const digit5 = 53; charCodes[charCodes["digit5"] = digit5] = "digit5"; // '5' - const digit6 = 54; charCodes[charCodes["digit6"] = digit6] = "digit6"; // '6' - const digit7 = 55; charCodes[charCodes["digit7"] = digit7] = "digit7"; // '7' - const digit8 = 56; charCodes[charCodes["digit8"] = digit8] = "digit8"; // '8' - const digit9 = 57; charCodes[charCodes["digit9"] = digit9] = "digit9"; // '9' - const colon = 58; charCodes[charCodes["colon"] = colon] = "colon"; // ':' - const semicolon = 59; charCodes[charCodes["semicolon"] = semicolon] = "semicolon"; // ';' - const lessThan = 60; charCodes[charCodes["lessThan"] = lessThan] = "lessThan"; // '<' - const equalsTo = 61; charCodes[charCodes["equalsTo"] = equalsTo] = "equalsTo"; // '=' - const greaterThan = 62; charCodes[charCodes["greaterThan"] = greaterThan] = "greaterThan"; // '>' - const questionMark = 63; charCodes[charCodes["questionMark"] = questionMark] = "questionMark"; // '?' - const atSign = 64; charCodes[charCodes["atSign"] = atSign] = "atSign"; // '@' - const uppercaseA = 65; charCodes[charCodes["uppercaseA"] = uppercaseA] = "uppercaseA"; // 'A' - const uppercaseB = 66; charCodes[charCodes["uppercaseB"] = uppercaseB] = "uppercaseB"; // 'B' - const uppercaseC = 67; charCodes[charCodes["uppercaseC"] = uppercaseC] = "uppercaseC"; // 'C' - const uppercaseD = 68; charCodes[charCodes["uppercaseD"] = uppercaseD] = "uppercaseD"; // 'D' - const uppercaseE = 69; charCodes[charCodes["uppercaseE"] = uppercaseE] = "uppercaseE"; // 'E' - const uppercaseF = 70; charCodes[charCodes["uppercaseF"] = uppercaseF] = "uppercaseF"; // 'F' - const uppercaseG = 71; charCodes[charCodes["uppercaseG"] = uppercaseG] = "uppercaseG"; // 'G' - const uppercaseH = 72; charCodes[charCodes["uppercaseH"] = uppercaseH] = "uppercaseH"; // 'H' - const uppercaseI = 73; charCodes[charCodes["uppercaseI"] = uppercaseI] = "uppercaseI"; // 'I' - const uppercaseJ = 74; charCodes[charCodes["uppercaseJ"] = uppercaseJ] = "uppercaseJ"; // 'J' - const uppercaseK = 75; charCodes[charCodes["uppercaseK"] = uppercaseK] = "uppercaseK"; // 'K' - const uppercaseL = 76; charCodes[charCodes["uppercaseL"] = uppercaseL] = "uppercaseL"; // 'L' - const uppercaseM = 77; charCodes[charCodes["uppercaseM"] = uppercaseM] = "uppercaseM"; // 'M' - const uppercaseN = 78; charCodes[charCodes["uppercaseN"] = uppercaseN] = "uppercaseN"; // 'N' - const uppercaseO = 79; charCodes[charCodes["uppercaseO"] = uppercaseO] = "uppercaseO"; // 'O' - const uppercaseP = 80; charCodes[charCodes["uppercaseP"] = uppercaseP] = "uppercaseP"; // 'P' - const uppercaseQ = 81; charCodes[charCodes["uppercaseQ"] = uppercaseQ] = "uppercaseQ"; // 'Q' - const uppercaseR = 82; charCodes[charCodes["uppercaseR"] = uppercaseR] = "uppercaseR"; // 'R' - const uppercaseS = 83; charCodes[charCodes["uppercaseS"] = uppercaseS] = "uppercaseS"; // 'S' - const uppercaseT = 84; charCodes[charCodes["uppercaseT"] = uppercaseT] = "uppercaseT"; // 'T' - const uppercaseU = 85; charCodes[charCodes["uppercaseU"] = uppercaseU] = "uppercaseU"; // 'U' - const uppercaseV = 86; charCodes[charCodes["uppercaseV"] = uppercaseV] = "uppercaseV"; // 'V' - const uppercaseW = 87; charCodes[charCodes["uppercaseW"] = uppercaseW] = "uppercaseW"; // 'W' - const uppercaseX = 88; charCodes[charCodes["uppercaseX"] = uppercaseX] = "uppercaseX"; // 'X' - const uppercaseY = 89; charCodes[charCodes["uppercaseY"] = uppercaseY] = "uppercaseY"; // 'Y' - const uppercaseZ = 90; charCodes[charCodes["uppercaseZ"] = uppercaseZ] = "uppercaseZ"; // 'Z' - const leftSquareBracket = 91; charCodes[charCodes["leftSquareBracket"] = leftSquareBracket] = "leftSquareBracket"; // '[' - const backslash = 92; charCodes[charCodes["backslash"] = backslash] = "backslash"; // '\ ' - const rightSquareBracket = 93; charCodes[charCodes["rightSquareBracket"] = rightSquareBracket] = "rightSquareBracket"; // ']' - const caret = 94; charCodes[charCodes["caret"] = caret] = "caret"; // '^' - const underscore = 95; charCodes[charCodes["underscore"] = underscore] = "underscore"; // '_' - const graveAccent = 96; charCodes[charCodes["graveAccent"] = graveAccent] = "graveAccent"; // '`' - const lowercaseA = 97; charCodes[charCodes["lowercaseA"] = lowercaseA] = "lowercaseA"; // 'a' - const lowercaseB = 98; charCodes[charCodes["lowercaseB"] = lowercaseB] = "lowercaseB"; // 'b' - const lowercaseC = 99; charCodes[charCodes["lowercaseC"] = lowercaseC] = "lowercaseC"; // 'c' - const lowercaseD = 100; charCodes[charCodes["lowercaseD"] = lowercaseD] = "lowercaseD"; // 'd' - const lowercaseE = 101; charCodes[charCodes["lowercaseE"] = lowercaseE] = "lowercaseE"; // 'e' - const lowercaseF = 102; charCodes[charCodes["lowercaseF"] = lowercaseF] = "lowercaseF"; // 'f' - const lowercaseG = 103; charCodes[charCodes["lowercaseG"] = lowercaseG] = "lowercaseG"; // 'g' - const lowercaseH = 104; charCodes[charCodes["lowercaseH"] = lowercaseH] = "lowercaseH"; // 'h' - const lowercaseI = 105; charCodes[charCodes["lowercaseI"] = lowercaseI] = "lowercaseI"; // 'i' - const lowercaseJ = 106; charCodes[charCodes["lowercaseJ"] = lowercaseJ] = "lowercaseJ"; // 'j' - const lowercaseK = 107; charCodes[charCodes["lowercaseK"] = lowercaseK] = "lowercaseK"; // 'k' - const lowercaseL = 108; charCodes[charCodes["lowercaseL"] = lowercaseL] = "lowercaseL"; // 'l' - const lowercaseM = 109; charCodes[charCodes["lowercaseM"] = lowercaseM] = "lowercaseM"; // 'm' - const lowercaseN = 110; charCodes[charCodes["lowercaseN"] = lowercaseN] = "lowercaseN"; // 'n' - const lowercaseO = 111; charCodes[charCodes["lowercaseO"] = lowercaseO] = "lowercaseO"; // 'o' - const lowercaseP = 112; charCodes[charCodes["lowercaseP"] = lowercaseP] = "lowercaseP"; // 'p' - const lowercaseQ = 113; charCodes[charCodes["lowercaseQ"] = lowercaseQ] = "lowercaseQ"; // 'q' - const lowercaseR = 114; charCodes[charCodes["lowercaseR"] = lowercaseR] = "lowercaseR"; // 'r' - const lowercaseS = 115; charCodes[charCodes["lowercaseS"] = lowercaseS] = "lowercaseS"; // 's' - const lowercaseT = 116; charCodes[charCodes["lowercaseT"] = lowercaseT] = "lowercaseT"; // 't' - const lowercaseU = 117; charCodes[charCodes["lowercaseU"] = lowercaseU] = "lowercaseU"; // 'u' - const lowercaseV = 118; charCodes[charCodes["lowercaseV"] = lowercaseV] = "lowercaseV"; // 'v' - const lowercaseW = 119; charCodes[charCodes["lowercaseW"] = lowercaseW] = "lowercaseW"; // 'w' - const lowercaseX = 120; charCodes[charCodes["lowercaseX"] = lowercaseX] = "lowercaseX"; // 'x' - const lowercaseY = 121; charCodes[charCodes["lowercaseY"] = lowercaseY] = "lowercaseY"; // 'y' - const lowercaseZ = 122; charCodes[charCodes["lowercaseZ"] = lowercaseZ] = "lowercaseZ"; // 'z' - const leftCurlyBrace = 123; charCodes[charCodes["leftCurlyBrace"] = leftCurlyBrace] = "leftCurlyBrace"; // '{' - const verticalBar = 124; charCodes[charCodes["verticalBar"] = verticalBar] = "verticalBar"; // '|' - const rightCurlyBrace = 125; charCodes[charCodes["rightCurlyBrace"] = rightCurlyBrace] = "rightCurlyBrace"; // '}' - const tilde = 126; charCodes[charCodes["tilde"] = tilde] = "tilde"; // '~' - const nonBreakingSpace = 160; charCodes[charCodes["nonBreakingSpace"] = nonBreakingSpace] = "nonBreakingSpace"; - // eslint-disable-next-line no-irregular-whitespace - const oghamSpaceMark = 5760; charCodes[charCodes["oghamSpaceMark"] = oghamSpaceMark] = "oghamSpaceMark"; // ' ' - const lineSeparator = 8232; charCodes[charCodes["lineSeparator"] = lineSeparator] = "lineSeparator"; - const paragraphSeparator = 8233; charCodes[charCodes["paragraphSeparator"] = paragraphSeparator] = "paragraphSeparator"; -})(charCodes || (charCodes = {})); - -export function isDigit(code) { - return ( - (code >= charCodes.digit0 && code <= charCodes.digit9) || - (code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) || - (code >= charCodes.uppercaseA && code <= charCodes.uppercaseF) - ); -} diff --git a/node_modules/sucrase/dist/esm/parser/util/identifier.js b/node_modules/sucrase/dist/esm/parser/util/identifier.js deleted file mode 100644 index 33a6bb1..0000000 --- a/node_modules/sucrase/dist/esm/parser/util/identifier.js +++ /dev/null @@ -1,34 +0,0 @@ -import {charCodes} from "./charcodes"; -import {WHITESPACE_CHARS} from "./whitespace"; - -function computeIsIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code < 91) return true; - if (code < 97) return code === 95; - if (code < 123) return true; - if (code < 128) return false; - throw new Error("Should not be called with non-ASCII char code."); -} - -export const IS_IDENTIFIER_CHAR = new Uint8Array(65536); -for (let i = 0; i < 128; i++) { - IS_IDENTIFIER_CHAR[i] = computeIsIdentifierChar(i) ? 1 : 0; -} -for (let i = 128; i < 65536; i++) { - IS_IDENTIFIER_CHAR[i] = 1; -} -// Aside from whitespace and newlines, all characters outside the ASCII space are either -// identifier characters or invalid. Since we're not performing code validation, we can just -// treat all invalid characters as identifier characters. -for (const whitespaceChar of WHITESPACE_CHARS) { - IS_IDENTIFIER_CHAR[whitespaceChar] = 0; -} -IS_IDENTIFIER_CHAR[0x2028] = 0; -IS_IDENTIFIER_CHAR[0x2029] = 0; - -export const IS_IDENTIFIER_START = IS_IDENTIFIER_CHAR.slice(); -for (let numChar = charCodes.digit0; numChar <= charCodes.digit9; numChar++) { - IS_IDENTIFIER_START[numChar] = 0; -} diff --git a/node_modules/sucrase/dist/esm/parser/util/whitespace.js b/node_modules/sucrase/dist/esm/parser/util/whitespace.js deleted file mode 100644 index 303b8a6..0000000 --- a/node_modules/sucrase/dist/esm/parser/util/whitespace.js +++ /dev/null @@ -1,33 +0,0 @@ -import {charCodes} from "./charcodes"; - -// https://tc39.github.io/ecma262/#sec-white-space -export const WHITESPACE_CHARS = [ - 0x0009, - 0x000b, - 0x000c, - charCodes.space, - charCodes.nonBreakingSpace, - charCodes.oghamSpaceMark, - 0x2000, // EN QUAD - 0x2001, // EM QUAD - 0x2002, // EN SPACE - 0x2003, // EM SPACE - 0x2004, // THREE-PER-EM SPACE - 0x2005, // FOUR-PER-EM SPACE - 0x2006, // SIX-PER-EM SPACE - 0x2007, // FIGURE SPACE - 0x2008, // PUNCTUATION SPACE - 0x2009, // THIN SPACE - 0x200a, // HAIR SPACE - 0x202f, // NARROW NO-BREAK SPACE - 0x205f, // MEDIUM MATHEMATICAL SPACE - 0x3000, // IDEOGRAPHIC SPACE - 0xfeff, // ZERO WIDTH NO-BREAK SPACE -]; - -export const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; - -export const IS_WHITESPACE = new Uint8Array(65536); -for (const char of WHITESPACE_CHARS) { - IS_WHITESPACE[char] = 1; -} diff --git a/node_modules/sucrase/dist/esm/register.js b/node_modules/sucrase/dist/esm/register.js deleted file mode 100644 index ca30cab..0000000 --- a/node_modules/sucrase/dist/esm/register.js +++ /dev/null @@ -1,88 +0,0 @@ -import * as pirates from "pirates"; - -import { transform} from "./index"; - - - - - - - - -export function addHook( - extension, - sucraseOptions, - hookOptions, -) { - let mergedSucraseOptions = sucraseOptions; - const sucraseOptionsEnvJSON = process.env.SUCRASE_OPTIONS; - if (sucraseOptionsEnvJSON) { - mergedSucraseOptions = {...mergedSucraseOptions, ...JSON.parse(sucraseOptionsEnvJSON)}; - } - return pirates.addHook( - (code, filePath) => { - const {code: transformedCode, sourceMap} = transform(code, { - ...mergedSucraseOptions, - sourceMapOptions: {compiledFilename: filePath}, - filePath, - }); - const mapBase64 = Buffer.from(JSON.stringify(sourceMap)).toString("base64"); - const suffix = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${mapBase64}`; - return `${transformedCode}\n${suffix}`; - }, - {...hookOptions, exts: [extension]}, - ); -} - -export function registerJS(hookOptions) { - return addHook(".js", {transforms: ["imports", "flow", "jsx"]}, hookOptions); -} - -export function registerJSX(hookOptions) { - return addHook(".jsx", {transforms: ["imports", "flow", "jsx"]}, hookOptions); -} - -export function registerTS(hookOptions) { - return addHook(".ts", {transforms: ["imports", "typescript"]}, hookOptions); -} - -export function registerTSX(hookOptions) { - return addHook(".tsx", {transforms: ["imports", "typescript", "jsx"]}, hookOptions); -} - -export function registerTSLegacyModuleInterop(hookOptions) { - return addHook( - ".ts", - { - transforms: ["imports", "typescript"], - enableLegacyTypeScriptModuleInterop: true, - }, - hookOptions, - ); -} - -export function registerTSXLegacyModuleInterop(hookOptions) { - return addHook( - ".tsx", - { - transforms: ["imports", "typescript", "jsx"], - enableLegacyTypeScriptModuleInterop: true, - }, - hookOptions, - ); -} - -export function registerAll(hookOptions) { - const reverts = [ - registerJS(hookOptions), - registerJSX(hookOptions), - registerTS(hookOptions), - registerTSX(hookOptions), - ]; - - return () => { - for (const fn of reverts) { - fn(); - } - }; -} diff --git a/node_modules/sucrase/dist/esm/transformers/CJSImportTransformer.js b/node_modules/sucrase/dist/esm/transformers/CJSImportTransformer.js deleted file mode 100644 index 78cf896..0000000 --- a/node_modules/sucrase/dist/esm/transformers/CJSImportTransformer.js +++ /dev/null @@ -1,916 +0,0 @@ - - - -import {IdentifierRole, isDeclaration, isObjectShorthandDeclaration} from "../parser/tokenizer"; -import {ContextualKeyword} from "../parser/tokenizer/keywords"; -import {TokenType as tt} from "../parser/tokenizer/types"; - -import elideImportEquals from "../util/elideImportEquals"; -import getDeclarationInfo, { - - EMPTY_DECLARATION_INFO, -} from "../util/getDeclarationInfo"; -import getImportExportSpecifierInfo from "../util/getImportExportSpecifierInfo"; -import isExportFrom from "../util/isExportFrom"; -import {removeMaybeImportAttributes} from "../util/removeMaybeImportAttributes"; -import shouldElideDefaultExport from "../util/shouldElideDefaultExport"; - - -import Transformer from "./Transformer"; - -/** - * Class for editing import statements when we are transforming to commonjs. - */ -export default class CJSImportTransformer extends Transformer { - __init() {this.hadExport = false} - __init2() {this.hadNamedExport = false} - __init3() {this.hadDefaultExport = false} - - - constructor( - rootTransformer, - tokens, - importProcessor, - nameManager, - helperManager, - reactHotLoaderTransformer, - enableLegacyBabel5ModuleInterop, - enableLegacyTypeScriptModuleInterop, - isTypeScriptTransformEnabled, - isFlowTransformEnabled, - preserveDynamicImport, - keepUnusedImports, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.nameManager = nameManager;this.helperManager = helperManager;this.reactHotLoaderTransformer = reactHotLoaderTransformer;this.enableLegacyBabel5ModuleInterop = enableLegacyBabel5ModuleInterop;this.enableLegacyTypeScriptModuleInterop = enableLegacyTypeScriptModuleInterop;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.isFlowTransformEnabled = isFlowTransformEnabled;this.preserveDynamicImport = preserveDynamicImport;this.keepUnusedImports = keepUnusedImports;CJSImportTransformer.prototype.__init.call(this);CJSImportTransformer.prototype.__init2.call(this);CJSImportTransformer.prototype.__init3.call(this);; - this.declarationInfo = isTypeScriptTransformEnabled - ? getDeclarationInfo(tokens) - : EMPTY_DECLARATION_INFO; - } - - getPrefixCode() { - let prefix = ""; - if (this.hadExport) { - prefix += 'Object.defineProperty(exports, "__esModule", {value: true});'; - } - return prefix; - } - - getSuffixCode() { - if (this.enableLegacyBabel5ModuleInterop && this.hadDefaultExport && !this.hadNamedExport) { - return "\nmodule.exports = exports.default;\n"; - } - return ""; - } - - process() { - // TypeScript `import foo = require('foo');` should always just be translated to plain require. - if (this.tokens.matches3(tt._import, tt.name, tt.eq)) { - return this.processImportEquals(); - } - if (this.tokens.matches1(tt._import)) { - this.processImport(); - return true; - } - if (this.tokens.matches2(tt._export, tt.eq)) { - this.tokens.replaceToken("module.exports"); - return true; - } - if (this.tokens.matches1(tt._export) && !this.tokens.currentToken().isType) { - this.hadExport = true; - return this.processExport(); - } - if (this.tokens.matches2(tt.name, tt.postIncDec)) { - // Fall through to normal identifier matching if this doesn't apply. - if (this.processPostIncDec()) { - return true; - } - } - if (this.tokens.matches1(tt.name) || this.tokens.matches1(tt.jsxName)) { - return this.processIdentifier(); - } - if (this.tokens.matches1(tt.eq)) { - return this.processAssignment(); - } - if (this.tokens.matches1(tt.assign)) { - return this.processComplexAssignment(); - } - if (this.tokens.matches1(tt.preIncDec)) { - return this.processPreIncDec(); - } - return false; - } - - processImportEquals() { - const importName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); - if (this.importProcessor.shouldAutomaticallyElideImportedName(importName)) { - // If this name is only used as a type, elide the whole import. - elideImportEquals(this.tokens); - } else { - // Otherwise, switch `import` to `const`. - this.tokens.replaceToken("const"); - } - return true; - } - - /** - * Transform this: - * import foo, {bar} from 'baz'; - * into - * var _baz = require('baz'); var _baz2 = _interopRequireDefault(_baz); - * - * The import code was already generated in the import preprocessing step, so - * we just need to look it up. - */ - processImport() { - if (this.tokens.matches2(tt._import, tt.parenL)) { - if (this.preserveDynamicImport) { - // Bail out, only making progress for this one token. - this.tokens.copyToken(); - return; - } - const requireWrapper = this.enableLegacyTypeScriptModuleInterop - ? "" - : `${this.helperManager.getHelperName("interopRequireWildcard")}(`; - this.tokens.replaceToken(`Promise.resolve().then(() => ${requireWrapper}require`); - const contextId = this.tokens.currentToken().contextId; - if (contextId == null) { - throw new Error("Expected context ID on dynamic import invocation."); - } - this.tokens.copyToken(); - while (!this.tokens.matchesContextIdAndLabel(tt.parenR, contextId)) { - this.rootTransformer.processToken(); - } - this.tokens.replaceToken(requireWrapper ? ")))" : "))"); - return; - } - - const shouldElideImport = this.removeImportAndDetectIfShouldElide(); - if (shouldElideImport) { - this.tokens.removeToken(); - } else { - const path = this.tokens.stringValue(); - this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); - this.tokens.appendCode(this.importProcessor.claimImportCode(path)); - } - removeMaybeImportAttributes(this.tokens); - if (this.tokens.matches1(tt.semi)) { - this.tokens.removeToken(); - } - } - - /** - * Erase this import (since any CJS output would be completely different), and - * return true if this import is should be elided due to being a type-only - * import. Such imports will not be emitted at all to avoid side effects. - * - * Import elision only happens with the TypeScript or Flow transforms enabled. - * - * TODO: This function has some awkward overlap with - * CJSImportProcessor.pruneTypeOnlyImports , and the two should be unified. - * That function handles TypeScript implicit import name elision, and removes - * an import if all typical imported names (without `type`) are removed due - * to being type-only imports. This function handles Flow import removal and - * properly distinguishes `import 'foo'` from `import {} from 'foo'` for TS - * purposes. - * - * The position should end at the import string. - */ - removeImportAndDetectIfShouldElide() { - this.tokens.removeInitialToken(); - if ( - this.tokens.matchesContextual(ContextualKeyword._type) && - !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, tt.comma) && - !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._from) - ) { - // This is an "import type" statement, so exit early. - this.removeRemainingImport(); - return true; - } - - if (this.tokens.matches1(tt.name) || this.tokens.matches1(tt.star)) { - // We have a default import or namespace import, so there must be some - // non-type import. - this.removeRemainingImport(); - return false; - } - - if (this.tokens.matches1(tt.string)) { - // This is a bare import, so we should proceed with the import. - return false; - } - - let foundNonTypeImport = false; - let foundAnyNamedImport = false; - while (!this.tokens.matches1(tt.string)) { - // Check if any named imports are of the form "foo" or "foo as bar", with - // no leading "type". - if ( - (!foundNonTypeImport && this.tokens.matches1(tt.braceL)) || - this.tokens.matches1(tt.comma) - ) { - this.tokens.removeToken(); - if (!this.tokens.matches1(tt.braceR)) { - foundAnyNamedImport = true; - } - if ( - this.tokens.matches2(tt.name, tt.comma) || - this.tokens.matches2(tt.name, tt.braceR) || - this.tokens.matches4(tt.name, tt.name, tt.name, tt.comma) || - this.tokens.matches4(tt.name, tt.name, tt.name, tt.braceR) - ) { - foundNonTypeImport = true; - } - } - this.tokens.removeToken(); - } - if (this.keepUnusedImports) { - return false; - } - if (this.isTypeScriptTransformEnabled) { - return !foundNonTypeImport; - } else if (this.isFlowTransformEnabled) { - // In Flow, unlike TS, `import {} from 'foo';` preserves the import. - return foundAnyNamedImport && !foundNonTypeImport; - } else { - return false; - } - } - - removeRemainingImport() { - while (!this.tokens.matches1(tt.string)) { - this.tokens.removeToken(); - } - } - - processIdentifier() { - const token = this.tokens.currentToken(); - if (token.shadowsGlobal) { - return false; - } - - if (token.identifierRole === IdentifierRole.ObjectShorthand) { - return this.processObjectShorthand(); - } - - if (token.identifierRole !== IdentifierRole.Access) { - return false; - } - const replacement = this.importProcessor.getIdentifierReplacement( - this.tokens.identifierNameForToken(token), - ); - if (!replacement) { - return false; - } - // Tolerate any number of closing parens while looking for an opening paren - // that indicates a function call. - let possibleOpenParenIndex = this.tokens.currentIndex() + 1; - while ( - possibleOpenParenIndex < this.tokens.tokens.length && - this.tokens.tokens[possibleOpenParenIndex].type === tt.parenR - ) { - possibleOpenParenIndex++; - } - // Avoid treating imported functions as methods of their `exports` object - // by using `(0, f)` when the identifier is in a paren expression. Else - // use `Function.prototype.call` when the identifier is a guaranteed - // function call. When using `call`, pass undefined as the context. - if (this.tokens.tokens[possibleOpenParenIndex].type === tt.parenL) { - if ( - this.tokens.tokenAtRelativeIndex(1).type === tt.parenL && - this.tokens.tokenAtRelativeIndex(-1).type !== tt._new - ) { - this.tokens.replaceToken(`${replacement}.call(void 0, `); - // Remove the old paren. - this.tokens.removeToken(); - // Balance out the new paren. - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(tt.parenR); - } else { - // See here: http://2ality.com/2015/12/references.html - this.tokens.replaceToken(`(0, ${replacement})`); - } - } else { - this.tokens.replaceToken(replacement); - } - return true; - } - - processObjectShorthand() { - const identifier = this.tokens.identifierName(); - const replacement = this.importProcessor.getIdentifierReplacement(identifier); - if (!replacement) { - return false; - } - this.tokens.replaceToken(`${identifier}: ${replacement}`); - return true; - } - - processExport() { - if ( - this.tokens.matches2(tt._export, tt._enum) || - this.tokens.matches3(tt._export, tt._const, tt._enum) - ) { - this.hadNamedExport = true; - // Let the TypeScript transform handle it. - return false; - } - if (this.tokens.matches2(tt._export, tt._default)) { - if (this.tokens.matches3(tt._export, tt._default, tt._enum)) { - this.hadDefaultExport = true; - // Flow export default enums need some special handling, so handle them - // in that tranform rather than this one. - return false; - } - this.processExportDefault(); - return true; - } else if (this.tokens.matches2(tt._export, tt.braceL)) { - this.processExportBindings(); - return true; - } else if ( - this.tokens.matches2(tt._export, tt.name) && - this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._type) - ) { - // export type {a}; - // export type {a as b}; - // export type {a} from './b'; - // export type * from './b'; - // export type * as ns from './b'; - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - if (this.tokens.matches1(tt.braceL)) { - while (!this.tokens.matches1(tt.braceR)) { - this.tokens.removeToken(); - } - this.tokens.removeToken(); - } else { - // * - this.tokens.removeToken(); - if (this.tokens.matches1(tt._as)) { - // as - this.tokens.removeToken(); - // ns - this.tokens.removeToken(); - } - } - // Remove type re-export `... } from './T'` - if ( - this.tokens.matchesContextual(ContextualKeyword._from) && - this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, tt.string) - ) { - this.tokens.removeToken(); - this.tokens.removeToken(); - removeMaybeImportAttributes(this.tokens); - } - return true; - } - this.hadNamedExport = true; - if ( - this.tokens.matches2(tt._export, tt._var) || - this.tokens.matches2(tt._export, tt._let) || - this.tokens.matches2(tt._export, tt._const) - ) { - this.processExportVar(); - return true; - } else if ( - this.tokens.matches2(tt._export, tt._function) || - // export async function - this.tokens.matches3(tt._export, tt.name, tt._function) - ) { - this.processExportFunction(); - return true; - } else if ( - this.tokens.matches2(tt._export, tt._class) || - this.tokens.matches3(tt._export, tt._abstract, tt._class) || - this.tokens.matches2(tt._export, tt.at) - ) { - this.processExportClass(); - return true; - } else if (this.tokens.matches2(tt._export, tt.star)) { - this.processExportStar(); - return true; - } else { - throw new Error("Unrecognized export syntax."); - } - } - - processAssignment() { - const index = this.tokens.currentIndex(); - const identifierToken = this.tokens.tokens[index - 1]; - // If the LHS is a type identifier, this must be a declaration like `let a: b = c;`, - // with `b` as the identifier, so nothing needs to be done in that case. - if (identifierToken.isType || identifierToken.type !== tt.name) { - return false; - } - if (identifierToken.shadowsGlobal) { - return false; - } - if (index >= 2 && this.tokens.matches1AtIndex(index - 2, tt.dot)) { - return false; - } - if (index >= 2 && [tt._var, tt._let, tt._const].includes(this.tokens.tokens[index - 2].type)) { - // Declarations don't need an extra assignment. This doesn't avoid the - // assignment for comma-separated declarations, but it's still correct - // since the assignment is just redundant. - return false; - } - const assignmentSnippet = this.importProcessor.resolveExportBinding( - this.tokens.identifierNameForToken(identifierToken), - ); - if (!assignmentSnippet) { - return false; - } - this.tokens.copyToken(); - this.tokens.appendCode(` ${assignmentSnippet} =`); - return true; - } - - /** - * Process something like `a += 3`, where `a` might be an exported value. - */ - processComplexAssignment() { - const index = this.tokens.currentIndex(); - const identifierToken = this.tokens.tokens[index - 1]; - if (identifierToken.type !== tt.name) { - return false; - } - if (identifierToken.shadowsGlobal) { - return false; - } - if (index >= 2 && this.tokens.matches1AtIndex(index - 2, tt.dot)) { - return false; - } - const assignmentSnippet = this.importProcessor.resolveExportBinding( - this.tokens.identifierNameForToken(identifierToken), - ); - if (!assignmentSnippet) { - return false; - } - this.tokens.appendCode(` = ${assignmentSnippet}`); - this.tokens.copyToken(); - return true; - } - - /** - * Process something like `++a`, where `a` might be an exported value. - */ - processPreIncDec() { - const index = this.tokens.currentIndex(); - const identifierToken = this.tokens.tokens[index + 1]; - if (identifierToken.type !== tt.name) { - return false; - } - if (identifierToken.shadowsGlobal) { - return false; - } - // Ignore things like ++a.b and ++a[b] and ++a().b. - if ( - index + 2 < this.tokens.tokens.length && - (this.tokens.matches1AtIndex(index + 2, tt.dot) || - this.tokens.matches1AtIndex(index + 2, tt.bracketL) || - this.tokens.matches1AtIndex(index + 2, tt.parenL)) - ) { - return false; - } - const identifierName = this.tokens.identifierNameForToken(identifierToken); - const assignmentSnippet = this.importProcessor.resolveExportBinding(identifierName); - if (!assignmentSnippet) { - return false; - } - this.tokens.appendCode(`${assignmentSnippet} = `); - this.tokens.copyToken(); - return true; - } - - /** - * Process something like `a++`, where `a` might be an exported value. - * This starts at the `a`, not at the `++`. - */ - processPostIncDec() { - const index = this.tokens.currentIndex(); - const identifierToken = this.tokens.tokens[index]; - const operatorToken = this.tokens.tokens[index + 1]; - if (identifierToken.type !== tt.name) { - return false; - } - if (identifierToken.shadowsGlobal) { - return false; - } - if (index >= 1 && this.tokens.matches1AtIndex(index - 1, tt.dot)) { - return false; - } - const identifierName = this.tokens.identifierNameForToken(identifierToken); - const assignmentSnippet = this.importProcessor.resolveExportBinding(identifierName); - if (!assignmentSnippet) { - return false; - } - const operatorCode = this.tokens.rawCodeForToken(operatorToken); - // We might also replace the identifier with something like exports.x, so - // do that replacement here as well. - const base = this.importProcessor.getIdentifierReplacement(identifierName) || identifierName; - if (operatorCode === "++") { - this.tokens.replaceToken(`(${base} = ${assignmentSnippet} = ${base} + 1, ${base} - 1)`); - } else if (operatorCode === "--") { - this.tokens.replaceToken(`(${base} = ${assignmentSnippet} = ${base} - 1, ${base} + 1)`); - } else { - throw new Error(`Unexpected operator: ${operatorCode}`); - } - this.tokens.removeToken(); - return true; - } - - processExportDefault() { - let exportedRuntimeValue = true; - if ( - this.tokens.matches4(tt._export, tt._default, tt._function, tt.name) || - // export default async function - (this.tokens.matches5(tt._export, tt._default, tt.name, tt._function, tt.name) && - this.tokens.matchesContextualAtIndex( - this.tokens.currentIndex() + 2, - ContextualKeyword._async, - )) - ) { - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - // Named function export case: change it to a top-level function - // declaration followed by exports statement. - const name = this.processNamedFunction(); - this.tokens.appendCode(` exports.default = ${name};`); - } else if ( - this.tokens.matches4(tt._export, tt._default, tt._class, tt.name) || - this.tokens.matches5(tt._export, tt._default, tt._abstract, tt._class, tt.name) || - this.tokens.matches3(tt._export, tt._default, tt.at) - ) { - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - this.copyDecorators(); - if (this.tokens.matches1(tt._abstract)) { - this.tokens.removeToken(); - } - const name = this.rootTransformer.processNamedClass(); - this.tokens.appendCode(` exports.default = ${name};`); - // After this point, this is a plain "export default E" statement. - } else if ( - shouldElideDefaultExport( - this.isTypeScriptTransformEnabled, - this.keepUnusedImports, - this.tokens, - this.declarationInfo, - ) - ) { - // If the exported value is just an identifier and should be elided by TypeScript - // rules, then remove it entirely. It will always have the form `export default e`, - // where `e` is an identifier. - exportedRuntimeValue = false; - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - this.tokens.removeToken(); - } else if (this.reactHotLoaderTransformer) { - // We need to assign E to a variable. Change "export default E" to - // "let _default; exports.default = _default = E" - const defaultVarName = this.nameManager.claimFreeName("_default"); - this.tokens.replaceToken(`let ${defaultVarName}; exports.`); - this.tokens.copyToken(); - this.tokens.appendCode(` = ${defaultVarName} =`); - this.reactHotLoaderTransformer.setExtractedDefaultExportName(defaultVarName); - } else { - // Change "export default E" to "exports.default = E" - this.tokens.replaceToken("exports."); - this.tokens.copyToken(); - this.tokens.appendCode(" ="); - } - if (exportedRuntimeValue) { - this.hadDefaultExport = true; - } - } - - copyDecorators() { - while (this.tokens.matches1(tt.at)) { - this.tokens.copyToken(); - if (this.tokens.matches1(tt.parenL)) { - this.tokens.copyExpectedToken(tt.parenL); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(tt.parenR); - } else { - this.tokens.copyExpectedToken(tt.name); - while (this.tokens.matches1(tt.dot)) { - this.tokens.copyExpectedToken(tt.dot); - this.tokens.copyExpectedToken(tt.name); - } - if (this.tokens.matches1(tt.parenL)) { - this.tokens.copyExpectedToken(tt.parenL); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(tt.parenR); - } - } - } - } - - /** - * Transform a declaration like `export var`, `export let`, or `export const`. - */ - processExportVar() { - if (this.isSimpleExportVar()) { - this.processSimpleExportVar(); - } else { - this.processComplexExportVar(); - } - } - - /** - * Determine if the export is of the form: - * export var/let/const [varName] = [expr]; - * In other words, determine if function name inference might apply. - */ - isSimpleExportVar() { - let tokenIndex = this.tokens.currentIndex(); - // export - tokenIndex++; - // var/let/const - tokenIndex++; - if (!this.tokens.matches1AtIndex(tokenIndex, tt.name)) { - return false; - } - tokenIndex++; - while (tokenIndex < this.tokens.tokens.length && this.tokens.tokens[tokenIndex].isType) { - tokenIndex++; - } - if (!this.tokens.matches1AtIndex(tokenIndex, tt.eq)) { - return false; - } - return true; - } - - /** - * Transform an `export var` declaration initializing a single variable. - * - * For example, this: - * export const f = () => {}; - * becomes this: - * const f = () => {}; exports.f = f; - * - * The variable is unused (e.g. exports.f has the true value of the export). - * We need to produce an assignment of this form so that the function will - * have an inferred name of "f", which wouldn't happen in the more general - * case below. - */ - processSimpleExportVar() { - // export - this.tokens.removeInitialToken(); - // var/let/const - this.tokens.copyToken(); - const varName = this.tokens.identifierName(); - // x: number -> x - while (!this.tokens.matches1(tt.eq)) { - this.rootTransformer.processToken(); - } - const endIndex = this.tokens.currentToken().rhsEndIndex; - if (endIndex == null) { - throw new Error("Expected = token with an end index."); - } - while (this.tokens.currentIndex() < endIndex) { - this.rootTransformer.processToken(); - } - this.tokens.appendCode(`; exports.${varName} = ${varName}`); - } - - /** - * Transform normal declaration exports, including handling destructuring. - * For example, this: - * export const {x: [a = 2, b], c} = d; - * becomes this: - * ({x: [exports.a = 2, exports.b], c: exports.c} = d;) - */ - processComplexExportVar() { - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - const needsParens = this.tokens.matches1(tt.braceL); - if (needsParens) { - this.tokens.appendCode("("); - } - - let depth = 0; - while (true) { - if ( - this.tokens.matches1(tt.braceL) || - this.tokens.matches1(tt.dollarBraceL) || - this.tokens.matches1(tt.bracketL) - ) { - depth++; - this.tokens.copyToken(); - } else if (this.tokens.matches1(tt.braceR) || this.tokens.matches1(tt.bracketR)) { - depth--; - this.tokens.copyToken(); - } else if ( - depth === 0 && - !this.tokens.matches1(tt.name) && - !this.tokens.currentToken().isType - ) { - break; - } else if (this.tokens.matches1(tt.eq)) { - // Default values might have assignments in the RHS that we want to ignore, so skip past - // them. - const endIndex = this.tokens.currentToken().rhsEndIndex; - if (endIndex == null) { - throw new Error("Expected = token with an end index."); - } - while (this.tokens.currentIndex() < endIndex) { - this.rootTransformer.processToken(); - } - } else { - const token = this.tokens.currentToken(); - if (isDeclaration(token)) { - const name = this.tokens.identifierName(); - let replacement = this.importProcessor.getIdentifierReplacement(name); - if (replacement === null) { - throw new Error(`Expected a replacement for ${name} in \`export var\` syntax.`); - } - if (isObjectShorthandDeclaration(token)) { - replacement = `${name}: ${replacement}`; - } - this.tokens.replaceToken(replacement); - } else { - this.rootTransformer.processToken(); - } - } - } - - if (needsParens) { - // Seek to the end of the RHS. - const endIndex = this.tokens.currentToken().rhsEndIndex; - if (endIndex == null) { - throw new Error("Expected = token with an end index."); - } - while (this.tokens.currentIndex() < endIndex) { - this.rootTransformer.processToken(); - } - this.tokens.appendCode(")"); - } - } - - /** - * Transform this: - * export function foo() {} - * into this: - * function foo() {} exports.foo = foo; - */ - processExportFunction() { - this.tokens.replaceToken(""); - const name = this.processNamedFunction(); - this.tokens.appendCode(` exports.${name} = ${name};`); - } - - /** - * Skip past a function with a name and return that name. - */ - processNamedFunction() { - if (this.tokens.matches1(tt._function)) { - this.tokens.copyToken(); - } else if (this.tokens.matches2(tt.name, tt._function)) { - if (!this.tokens.matchesContextual(ContextualKeyword._async)) { - throw new Error("Expected async keyword in function export."); - } - this.tokens.copyToken(); - this.tokens.copyToken(); - } - if (this.tokens.matches1(tt.star)) { - this.tokens.copyToken(); - } - if (!this.tokens.matches1(tt.name)) { - throw new Error("Expected identifier for exported function name."); - } - const name = this.tokens.identifierName(); - this.tokens.copyToken(); - if (this.tokens.currentToken().isType) { - this.tokens.removeInitialToken(); - while (this.tokens.currentToken().isType) { - this.tokens.removeToken(); - } - } - this.tokens.copyExpectedToken(tt.parenL); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(tt.parenR); - this.rootTransformer.processPossibleTypeRange(); - this.tokens.copyExpectedToken(tt.braceL); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(tt.braceR); - return name; - } - - /** - * Transform this: - * export class A {} - * into this: - * class A {} exports.A = A; - */ - processExportClass() { - this.tokens.removeInitialToken(); - this.copyDecorators(); - if (this.tokens.matches1(tt._abstract)) { - this.tokens.removeToken(); - } - const name = this.rootTransformer.processNamedClass(); - this.tokens.appendCode(` exports.${name} = ${name};`); - } - - /** - * Transform this: - * export {a, b as c}; - * into this: - * exports.a = a; exports.c = b; - * - * OR - * - * Transform this: - * export {a, b as c} from './foo'; - * into the pre-generated Object.defineProperty code from the ImportProcessor. - * - * For the first case, if the TypeScript transform is enabled, we need to skip - * exports that are only defined as types. - */ - processExportBindings() { - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - - const isReExport = isExportFrom(this.tokens); - - const exportStatements = []; - while (true) { - if (this.tokens.matches1(tt.braceR)) { - this.tokens.removeToken(); - break; - } - - const specifierInfo = getImportExportSpecifierInfo(this.tokens); - - while (this.tokens.currentIndex() < specifierInfo.endIndex) { - this.tokens.removeToken(); - } - - const shouldRemoveExport = - specifierInfo.isType || - (!isReExport && this.shouldElideExportedIdentifier(specifierInfo.leftName)); - if (!shouldRemoveExport) { - const exportedName = specifierInfo.rightName; - if (exportedName === "default") { - this.hadDefaultExport = true; - } else { - this.hadNamedExport = true; - } - const localName = specifierInfo.leftName; - const newLocalName = this.importProcessor.getIdentifierReplacement(localName); - exportStatements.push(`exports.${exportedName} = ${newLocalName || localName};`); - } - - if (this.tokens.matches1(tt.braceR)) { - this.tokens.removeToken(); - break; - } - if (this.tokens.matches2(tt.comma, tt.braceR)) { - this.tokens.removeToken(); - this.tokens.removeToken(); - break; - } else if (this.tokens.matches1(tt.comma)) { - this.tokens.removeToken(); - } else { - throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.currentToken())}`); - } - } - - if (this.tokens.matchesContextual(ContextualKeyword._from)) { - // This is an export...from, so throw away the normal named export code - // and use the Object.defineProperty code from ImportProcessor. - this.tokens.removeToken(); - const path = this.tokens.stringValue(); - this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); - removeMaybeImportAttributes(this.tokens); - } else { - // This is a normal named export, so use that. - this.tokens.appendCode(exportStatements.join(" ")); - } - - if (this.tokens.matches1(tt.semi)) { - this.tokens.removeToken(); - } - } - - processExportStar() { - this.tokens.removeInitialToken(); - while (!this.tokens.matches1(tt.string)) { - this.tokens.removeToken(); - } - const path = this.tokens.stringValue(); - this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); - removeMaybeImportAttributes(this.tokens); - if (this.tokens.matches1(tt.semi)) { - this.tokens.removeToken(); - } - } - - shouldElideExportedIdentifier(name) { - return ( - this.isTypeScriptTransformEnabled && - !this.keepUnusedImports && - !this.declarationInfo.valueDeclarations.has(name) - ); - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/ESMImportTransformer.js b/node_modules/sucrase/dist/esm/transformers/ESMImportTransformer.js deleted file mode 100644 index b45cd3e..0000000 --- a/node_modules/sucrase/dist/esm/transformers/ESMImportTransformer.js +++ /dev/null @@ -1,415 +0,0 @@ - - - -import {ContextualKeyword} from "../parser/tokenizer/keywords"; -import {TokenType as tt} from "../parser/tokenizer/types"; - -import elideImportEquals from "../util/elideImportEquals"; -import getDeclarationInfo, { - - EMPTY_DECLARATION_INFO, -} from "../util/getDeclarationInfo"; -import getImportExportSpecifierInfo from "../util/getImportExportSpecifierInfo"; -import {getNonTypeIdentifiers} from "../util/getNonTypeIdentifiers"; -import isExportFrom from "../util/isExportFrom"; -import {removeMaybeImportAttributes} from "../util/removeMaybeImportAttributes"; -import shouldElideDefaultExport from "../util/shouldElideDefaultExport"; - -import Transformer from "./Transformer"; - -/** - * Class for editing import statements when we are keeping the code as ESM. We still need to remove - * type-only imports in TypeScript and Flow. - */ -export default class ESMImportTransformer extends Transformer { - - - - - constructor( - tokens, - nameManager, - helperManager, - reactHotLoaderTransformer, - isTypeScriptTransformEnabled, - isFlowTransformEnabled, - keepUnusedImports, - options, - ) { - super();this.tokens = tokens;this.nameManager = nameManager;this.helperManager = helperManager;this.reactHotLoaderTransformer = reactHotLoaderTransformer;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.isFlowTransformEnabled = isFlowTransformEnabled;this.keepUnusedImports = keepUnusedImports;; - this.nonTypeIdentifiers = - isTypeScriptTransformEnabled && !keepUnusedImports - ? getNonTypeIdentifiers(tokens, options) - : new Set(); - this.declarationInfo = - isTypeScriptTransformEnabled && !keepUnusedImports - ? getDeclarationInfo(tokens) - : EMPTY_DECLARATION_INFO; - this.injectCreateRequireForImportRequire = Boolean(options.injectCreateRequireForImportRequire); - } - - process() { - // TypeScript `import foo = require('foo');` should always just be translated to plain require. - if (this.tokens.matches3(tt._import, tt.name, tt.eq)) { - return this.processImportEquals(); - } - if ( - this.tokens.matches4(tt._import, tt.name, tt.name, tt.eq) && - this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._type) - ) { - // import type T = require('T') - this.tokens.removeInitialToken(); - // This construct is always exactly 8 tokens long, so remove the 7 remaining tokens. - for (let i = 0; i < 7; i++) { - this.tokens.removeToken(); - } - return true; - } - if (this.tokens.matches2(tt._export, tt.eq)) { - this.tokens.replaceToken("module.exports"); - return true; - } - if ( - this.tokens.matches5(tt._export, tt._import, tt.name, tt.name, tt.eq) && - this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, ContextualKeyword._type) - ) { - // export import type T = require('T') - this.tokens.removeInitialToken(); - // This construct is always exactly 9 tokens long, so remove the 8 remaining tokens. - for (let i = 0; i < 8; i++) { - this.tokens.removeToken(); - } - return true; - } - if (this.tokens.matches1(tt._import)) { - return this.processImport(); - } - if (this.tokens.matches2(tt._export, tt._default)) { - return this.processExportDefault(); - } - if (this.tokens.matches2(tt._export, tt.braceL)) { - return this.processNamedExports(); - } - if ( - this.tokens.matches2(tt._export, tt.name) && - this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._type) - ) { - // export type {a}; - // export type {a as b}; - // export type {a} from './b'; - // export type * from './b'; - // export type * as ns from './b'; - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - if (this.tokens.matches1(tt.braceL)) { - while (!this.tokens.matches1(tt.braceR)) { - this.tokens.removeToken(); - } - this.tokens.removeToken(); - } else { - // * - this.tokens.removeToken(); - if (this.tokens.matches1(tt._as)) { - // as - this.tokens.removeToken(); - // ns - this.tokens.removeToken(); - } - } - // Remove type re-export `... } from './T'` - if ( - this.tokens.matchesContextual(ContextualKeyword._from) && - this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, tt.string) - ) { - this.tokens.removeToken(); - this.tokens.removeToken(); - removeMaybeImportAttributes(this.tokens); - } - return true; - } - return false; - } - - processImportEquals() { - const importName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); - if (this.shouldAutomaticallyElideImportedName(importName)) { - // If this name is only used as a type, elide the whole import. - elideImportEquals(this.tokens); - } else if (this.injectCreateRequireForImportRequire) { - // We're using require in an environment (Node ESM) that doesn't provide - // it as a global, so generate a helper to import it. - // import -> const - this.tokens.replaceToken("const"); - // Foo - this.tokens.copyToken(); - // = - this.tokens.copyToken(); - // require - this.tokens.replaceToken(this.helperManager.getHelperName("require")); - } else { - // Otherwise, just switch `import` to `const`. - this.tokens.replaceToken("const"); - } - return true; - } - - processImport() { - if (this.tokens.matches2(tt._import, tt.parenL)) { - // Dynamic imports don't need to be transformed. - return false; - } - - const snapshot = this.tokens.snapshot(); - const allImportsRemoved = this.removeImportTypeBindings(); - if (allImportsRemoved) { - this.tokens.restoreToSnapshot(snapshot); - while (!this.tokens.matches1(tt.string)) { - this.tokens.removeToken(); - } - this.tokens.removeToken(); - removeMaybeImportAttributes(this.tokens); - if (this.tokens.matches1(tt.semi)) { - this.tokens.removeToken(); - } - } - return true; - } - - /** - * Remove type bindings from this import, leaving the rest of the import intact. - * - * Return true if this import was ONLY types, and thus is eligible for removal. This will bail out - * of the replacement operation, so we can return early here. - */ - removeImportTypeBindings() { - this.tokens.copyExpectedToken(tt._import); - if ( - this.tokens.matchesContextual(ContextualKeyword._type) && - !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, tt.comma) && - !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, ContextualKeyword._from) - ) { - // This is an "import type" statement, so exit early. - return true; - } - - if (this.tokens.matches1(tt.string)) { - // This is a bare import, so we should proceed with the import. - this.tokens.copyToken(); - return false; - } - - // Skip the "module" token in import reflection. - if ( - this.tokens.matchesContextual(ContextualKeyword._module) && - this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, ContextualKeyword._from) - ) { - this.tokens.copyToken(); - } - - let foundNonTypeImport = false; - let foundAnyNamedImport = false; - let needsComma = false; - - // Handle default import. - if (this.tokens.matches1(tt.name)) { - if (this.shouldAutomaticallyElideImportedName(this.tokens.identifierName())) { - this.tokens.removeToken(); - if (this.tokens.matches1(tt.comma)) { - this.tokens.removeToken(); - } - } else { - foundNonTypeImport = true; - this.tokens.copyToken(); - if (this.tokens.matches1(tt.comma)) { - // We're in a statement like: - // import A, * as B from './A'; - // or - // import A, {foo} from './A'; - // where the `A` is being kept. The comma should be removed if an only - // if the next part of the import statement is elided, but that's hard - // to determine at this point in the code. Instead, always remove it - // and set a flag to add it back if necessary. - needsComma = true; - this.tokens.removeToken(); - } - } - } - - if (this.tokens.matches1(tt.star)) { - if (this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2))) { - this.tokens.removeToken(); - this.tokens.removeToken(); - this.tokens.removeToken(); - } else { - if (needsComma) { - this.tokens.appendCode(","); - } - foundNonTypeImport = true; - this.tokens.copyExpectedToken(tt.star); - this.tokens.copyExpectedToken(tt.name); - this.tokens.copyExpectedToken(tt.name); - } - } else if (this.tokens.matches1(tt.braceL)) { - if (needsComma) { - this.tokens.appendCode(","); - } - this.tokens.copyToken(); - while (!this.tokens.matches1(tt.braceR)) { - foundAnyNamedImport = true; - const specifierInfo = getImportExportSpecifierInfo(this.tokens); - if ( - specifierInfo.isType || - this.shouldAutomaticallyElideImportedName(specifierInfo.rightName) - ) { - while (this.tokens.currentIndex() < specifierInfo.endIndex) { - this.tokens.removeToken(); - } - if (this.tokens.matches1(tt.comma)) { - this.tokens.removeToken(); - } - } else { - foundNonTypeImport = true; - while (this.tokens.currentIndex() < specifierInfo.endIndex) { - this.tokens.copyToken(); - } - if (this.tokens.matches1(tt.comma)) { - this.tokens.copyToken(); - } - } - } - this.tokens.copyExpectedToken(tt.braceR); - } - - if (this.keepUnusedImports) { - return false; - } - if (this.isTypeScriptTransformEnabled) { - return !foundNonTypeImport; - } else if (this.isFlowTransformEnabled) { - // In Flow, unlike TS, `import {} from 'foo';` preserves the import. - return foundAnyNamedImport && !foundNonTypeImport; - } else { - return false; - } - } - - shouldAutomaticallyElideImportedName(name) { - return ( - this.isTypeScriptTransformEnabled && - !this.keepUnusedImports && - !this.nonTypeIdentifiers.has(name) - ); - } - - processExportDefault() { - if ( - shouldElideDefaultExport( - this.isTypeScriptTransformEnabled, - this.keepUnusedImports, - this.tokens, - this.declarationInfo, - ) - ) { - // If the exported value is just an identifier and should be elided by TypeScript - // rules, then remove it entirely. It will always have the form `export default e`, - // where `e` is an identifier. - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - this.tokens.removeToken(); - return true; - } - - const alreadyHasName = - this.tokens.matches4(tt._export, tt._default, tt._function, tt.name) || - // export default async function - (this.tokens.matches5(tt._export, tt._default, tt.name, tt._function, tt.name) && - this.tokens.matchesContextualAtIndex( - this.tokens.currentIndex() + 2, - ContextualKeyword._async, - )) || - this.tokens.matches4(tt._export, tt._default, tt._class, tt.name) || - this.tokens.matches5(tt._export, tt._default, tt._abstract, tt._class, tt.name); - - if (!alreadyHasName && this.reactHotLoaderTransformer) { - // This is a plain "export default E" statement and we need to assign E to a variable. - // Change "export default E" to "let _default; export default _default = E" - const defaultVarName = this.nameManager.claimFreeName("_default"); - this.tokens.replaceToken(`let ${defaultVarName}; export`); - this.tokens.copyToken(); - this.tokens.appendCode(` ${defaultVarName} =`); - this.reactHotLoaderTransformer.setExtractedDefaultExportName(defaultVarName); - return true; - } - return false; - } - - /** - * Handle a statement with one of these forms: - * export {a, type b}; - * export {c, type d} from 'foo'; - * - * In both cases, any explicit type exports should be removed. In the first - * case, we also need to handle implicit export elision for names declared as - * types. In the second case, we must NOT do implicit named export elision, - * but we must remove the runtime import if all exports are type exports. - */ - processNamedExports() { - if (!this.isTypeScriptTransformEnabled) { - return false; - } - this.tokens.copyExpectedToken(tt._export); - this.tokens.copyExpectedToken(tt.braceL); - - const isReExport = isExportFrom(this.tokens); - let foundNonTypeExport = false; - while (!this.tokens.matches1(tt.braceR)) { - const specifierInfo = getImportExportSpecifierInfo(this.tokens); - if ( - specifierInfo.isType || - (!isReExport && this.shouldElideExportedName(specifierInfo.leftName)) - ) { - // Type export, so remove all tokens, including any comma. - while (this.tokens.currentIndex() < specifierInfo.endIndex) { - this.tokens.removeToken(); - } - if (this.tokens.matches1(tt.comma)) { - this.tokens.removeToken(); - } - } else { - // Non-type export, so copy all tokens, including any comma. - foundNonTypeExport = true; - while (this.tokens.currentIndex() < specifierInfo.endIndex) { - this.tokens.copyToken(); - } - if (this.tokens.matches1(tt.comma)) { - this.tokens.copyToken(); - } - } - } - this.tokens.copyExpectedToken(tt.braceR); - - if (!this.keepUnusedImports && isReExport && !foundNonTypeExport) { - // This is a type-only re-export, so skip evaluating the other module. Technically this - // leaves the statement as `export {}`, but that's ok since that's a no-op. - this.tokens.removeToken(); - this.tokens.removeToken(); - removeMaybeImportAttributes(this.tokens); - } - - return true; - } - - /** - * ESM elides all imports with the rule that we only elide if we see that it's - * a type and never see it as a value. This is in contrast to CJS, which - * elides imports that are completely unknown. - */ - shouldElideExportedName(name) { - return ( - this.isTypeScriptTransformEnabled && - !this.keepUnusedImports && - this.declarationInfo.typeDeclarations.has(name) && - !this.declarationInfo.valueDeclarations.has(name) - ); - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/FlowTransformer.js b/node_modules/sucrase/dist/esm/transformers/FlowTransformer.js deleted file mode 100644 index 7df0aca..0000000 --- a/node_modules/sucrase/dist/esm/transformers/FlowTransformer.js +++ /dev/null @@ -1,182 +0,0 @@ -import {ContextualKeyword} from "../parser/tokenizer/keywords"; -import {TokenType as tt} from "../parser/tokenizer/types"; - - -import Transformer from "./Transformer"; - -export default class FlowTransformer extends Transformer { - constructor( - rootTransformer, - tokens, - isImportsTransformEnabled, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.isImportsTransformEnabled = isImportsTransformEnabled;; - } - - process() { - if ( - this.rootTransformer.processPossibleArrowParamEnd() || - this.rootTransformer.processPossibleAsyncArrowWithTypeParams() || - this.rootTransformer.processPossibleTypeRange() - ) { - return true; - } - if (this.tokens.matches1(tt._enum)) { - this.processEnum(); - return true; - } - if (this.tokens.matches2(tt._export, tt._enum)) { - this.processNamedExportEnum(); - return true; - } - if (this.tokens.matches3(tt._export, tt._default, tt._enum)) { - this.processDefaultExportEnum(); - return true; - } - return false; - } - - /** - * Handle a declaration like: - * export enum E ... - * - * With this imports transform, this becomes: - * const E = [[enum]]; exports.E = E; - * - * otherwise, it becomes: - * export const E = [[enum]]; - */ - processNamedExportEnum() { - if (this.isImportsTransformEnabled) { - // export - this.tokens.removeInitialToken(); - const enumName = this.tokens.identifierNameAtRelativeIndex(1); - this.processEnum(); - this.tokens.appendCode(` exports.${enumName} = ${enumName};`); - } else { - this.tokens.copyToken(); - this.processEnum(); - } - } - - /** - * Handle a declaration like: - * export default enum E - * - * With the imports transform, this becomes: - * const E = [[enum]]; exports.default = E; - * - * otherwise, it becomes: - * const E = [[enum]]; export default E; - */ - processDefaultExportEnum() { - // export - this.tokens.removeInitialToken(); - // default - this.tokens.removeToken(); - const enumName = this.tokens.identifierNameAtRelativeIndex(1); - this.processEnum(); - if (this.isImportsTransformEnabled) { - this.tokens.appendCode(` exports.default = ${enumName};`); - } else { - this.tokens.appendCode(` export default ${enumName};`); - } - } - - /** - * Transpile flow enums to invoke the "flow-enums-runtime" library. - * - * Currently, the transpiled code always uses `require("flow-enums-runtime")`, - * but if future flexibility is needed, we could expose a config option for - * this string (similar to configurable JSX). Even when targeting ESM, the - * default behavior of babel-plugin-transform-flow-enums is to use require - * rather than injecting an import. - * - * Flow enums are quite a bit simpler than TS enums and have some convenient - * constraints: - * - Element initializers must be either always present or always absent. That - * means that we can use fixed lookahead on the first element (if any) and - * assume that all elements are like that. - * - The right-hand side of an element initializer must be a literal value, - * not a complex expression and not referencing other elements. That means - * we can simply copy a single token. - * - * Enums can be broken up into three basic cases: - * - * Mirrored enums: - * enum E {A, B} - * -> - * const E = require("flow-enums-runtime").Mirrored(["A", "B"]); - * - * Initializer enums: - * enum E {A = 1, B = 2} - * -> - * const E = require("flow-enums-runtime")({A: 1, B: 2}); - * - * Symbol enums: - * enum E of symbol {A, B} - * -> - * const E = require("flow-enums-runtime")({A: Symbol("A"), B: Symbol("B")}); - * - * We can statically detect which of the three cases this is by looking at the - * "of" declaration (if any) and seeing if the first element has an initializer. - * Since the other transform details are so similar between the three cases, we - * use a single implementation and vary the transform within processEnumElement - * based on case. - */ - processEnum() { - // enum E -> const E - this.tokens.replaceToken("const"); - this.tokens.copyExpectedToken(tt.name); - - let isSymbolEnum = false; - if (this.tokens.matchesContextual(ContextualKeyword._of)) { - this.tokens.removeToken(); - isSymbolEnum = this.tokens.matchesContextual(ContextualKeyword._symbol); - this.tokens.removeToken(); - } - const hasInitializers = this.tokens.matches3(tt.braceL, tt.name, tt.eq); - this.tokens.appendCode(' = require("flow-enums-runtime")'); - - const isMirrored = !isSymbolEnum && !hasInitializers; - this.tokens.replaceTokenTrimmingLeftWhitespace(isMirrored ? ".Mirrored([" : "({"); - - while (!this.tokens.matches1(tt.braceR)) { - // ... is allowed at the end and has no runtime behavior. - if (this.tokens.matches1(tt.ellipsis)) { - this.tokens.removeToken(); - break; - } - this.processEnumElement(isSymbolEnum, hasInitializers); - if (this.tokens.matches1(tt.comma)) { - this.tokens.copyToken(); - } - } - - this.tokens.replaceToken(isMirrored ? "]);" : "});"); - } - - /** - * Process an individual enum element, producing either an array element or an - * object element based on what type of enum this is. - */ - processEnumElement(isSymbolEnum, hasInitializers) { - if (isSymbolEnum) { - // Symbol enums never have initializers and are expanded to object elements. - // A, -> A: Symbol("A"), - const elementName = this.tokens.identifierName(); - this.tokens.copyToken(); - this.tokens.appendCode(`: Symbol("${elementName}")`); - } else if (hasInitializers) { - // Initializers are expanded to object elements. - // A = 1, -> A: 1, - this.tokens.copyToken(); - this.tokens.replaceTokenTrimmingLeftWhitespace(":"); - this.tokens.copyToken(); - } else { - // Enum elements without initializers become string literal array elements. - // A, -> "A", - this.tokens.replaceToken(`"${this.tokens.identifierName()}"`); - } - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/JSXTransformer.js b/node_modules/sucrase/dist/esm/transformers/JSXTransformer.js deleted file mode 100644 index e5f5ae5..0000000 --- a/node_modules/sucrase/dist/esm/transformers/JSXTransformer.js +++ /dev/null @@ -1,733 +0,0 @@ - - - -import XHTMLEntities from "../parser/plugins/jsx/xhtml"; -import {JSXRole} from "../parser/tokenizer"; -import {TokenType as tt} from "../parser/tokenizer/types"; -import {charCodes} from "../parser/util/charcodes"; - -import getJSXPragmaInfo, {} from "../util/getJSXPragmaInfo"; - -import Transformer from "./Transformer"; - -export default class JSXTransformer extends Transformer { - - - - - // State for calculating the line number of each JSX tag in development. - __init() {this.lastLineNumber = 1} - __init2() {this.lastIndex = 0} - - // In development, variable name holding the name of the current file. - __init3() {this.filenameVarName = null} - // Mapping of claimed names for imports in the automatic transform, e,g. - // {jsx: "_jsx"}. This determines which imports to generate in the prefix. - __init4() {this.esmAutomaticImportNameResolutions = {}} - // When automatically adding imports in CJS mode, we store the variable name - // holding the imported CJS module so we can require it in the prefix. - __init5() {this.cjsAutomaticModuleNameResolutions = {}} - - constructor( - rootTransformer, - tokens, - importProcessor, - nameManager, - options, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.nameManager = nameManager;this.options = options;JSXTransformer.prototype.__init.call(this);JSXTransformer.prototype.__init2.call(this);JSXTransformer.prototype.__init3.call(this);JSXTransformer.prototype.__init4.call(this);JSXTransformer.prototype.__init5.call(this);; - this.jsxPragmaInfo = getJSXPragmaInfo(options); - this.isAutomaticRuntime = options.jsxRuntime === "automatic"; - this.jsxImportSource = options.jsxImportSource || "react"; - } - - process() { - if (this.tokens.matches1(tt.jsxTagStart)) { - this.processJSXTag(); - return true; - } - return false; - } - - getPrefixCode() { - let prefix = ""; - if (this.filenameVarName) { - prefix += `const ${this.filenameVarName} = ${JSON.stringify(this.options.filePath || "")};`; - } - if (this.isAutomaticRuntime) { - if (this.importProcessor) { - // CJS mode: emit require statements for all modules that were referenced. - for (const [path, resolvedName] of Object.entries(this.cjsAutomaticModuleNameResolutions)) { - prefix += `var ${resolvedName} = require("${path}");`; - } - } else { - // ESM mode: consolidate and emit import statements for referenced names. - const {createElement: createElementResolution, ...otherResolutions} = - this.esmAutomaticImportNameResolutions; - if (createElementResolution) { - prefix += `import {createElement as ${createElementResolution}} from "${this.jsxImportSource}";`; - } - const importSpecifiers = Object.entries(otherResolutions) - .map(([name, resolvedName]) => `${name} as ${resolvedName}`) - .join(", "); - if (importSpecifiers) { - const importPath = - this.jsxImportSource + (this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime"); - prefix += `import {${importSpecifiers}} from "${importPath}";`; - } - } - } - return prefix; - } - - processJSXTag() { - const {jsxRole, start} = this.tokens.currentToken(); - // Calculate line number information at the very start (if in development - // mode) so that the information is guaranteed to be queried in token order. - const elementLocationCode = this.options.production ? null : this.getElementLocationCode(start); - if (this.isAutomaticRuntime && jsxRole !== JSXRole.KeyAfterPropSpread) { - this.transformTagToJSXFunc(elementLocationCode, jsxRole); - } else { - this.transformTagToCreateElement(elementLocationCode); - } - } - - getElementLocationCode(firstTokenStart) { - const lineNumber = this.getLineNumberForIndex(firstTokenStart); - return `lineNumber: ${lineNumber}`; - } - - /** - * Get the line number for this source position. This is calculated lazily and - * must be called in increasing order by index. - */ - getLineNumberForIndex(index) { - const code = this.tokens.code; - while (this.lastIndex < index && this.lastIndex < code.length) { - if (code[this.lastIndex] === "\n") { - this.lastLineNumber++; - } - this.lastIndex++; - } - return this.lastLineNumber; - } - - /** - * Convert the current JSX element to a call to jsx, jsxs, or jsxDEV. This is - * the primary transformation for the automatic transform. - * - * Example: - *
Hello{x}
- * becomes - * jsxs('div', {a: 1, children: ["Hello", x]}, 2) - */ - transformTagToJSXFunc(elementLocationCode, jsxRole) { - const isStatic = jsxRole === JSXRole.StaticChildren; - // First tag is always jsxTagStart. - this.tokens.replaceToken(this.getJSXFuncInvocationCode(isStatic)); - - let keyCode = null; - if (this.tokens.matches1(tt.jsxTagEnd)) { - // Fragment syntax. - this.tokens.replaceToken(`${this.getFragmentCode()}, {`); - this.processAutomaticChildrenAndEndProps(jsxRole); - } else { - // Normal open tag or self-closing tag. - this.processTagIntro(); - this.tokens.appendCode(", {"); - keyCode = this.processProps(true); - - if (this.tokens.matches2(tt.slash, tt.jsxTagEnd)) { - // Self-closing tag, no children to add, so close the props. - this.tokens.appendCode("}"); - } else if (this.tokens.matches1(tt.jsxTagEnd)) { - // Tag with children. - this.tokens.removeToken(); - this.processAutomaticChildrenAndEndProps(jsxRole); - } else { - throw new Error("Expected either /> or > at the end of the tag."); - } - // If a key was present, move it to its own arg. Note that moving code - // like this will cause line numbers to get out of sync within the JSX - // element if the key expression has a newline in it. This is unfortunate, - // but hopefully should be rare. - if (keyCode) { - this.tokens.appendCode(`, ${keyCode}`); - } - } - if (!this.options.production) { - // If the key wasn't already added, add it now so we can correctly set - // positional args for jsxDEV. - if (keyCode === null) { - this.tokens.appendCode(", void 0"); - } - this.tokens.appendCode(`, ${isStatic}, ${this.getDevSource(elementLocationCode)}, this`); - } - // We're at the close-tag or the end of a self-closing tag, so remove - // everything else and close the function call. - this.tokens.removeInitialToken(); - while (!this.tokens.matches1(tt.jsxTagEnd)) { - this.tokens.removeToken(); - } - this.tokens.replaceToken(")"); - } - - /** - * Convert the current JSX element to a createElement call. In the classic - * runtime, this is the only case. In the automatic runtime, this is called - * as a fallback in some situations. - * - * Example: - *
Hello{x}
- * becomes - * React.createElement('div', {a: 1, key: 2}, "Hello", x) - */ - transformTagToCreateElement(elementLocationCode) { - // First tag is always jsxTagStart. - this.tokens.replaceToken(this.getCreateElementInvocationCode()); - - if (this.tokens.matches1(tt.jsxTagEnd)) { - // Fragment syntax. - this.tokens.replaceToken(`${this.getFragmentCode()}, null`); - this.processChildren(true); - } else { - // Normal open tag or self-closing tag. - this.processTagIntro(); - this.processPropsObjectWithDevInfo(elementLocationCode); - - if (this.tokens.matches2(tt.slash, tt.jsxTagEnd)) { - // Self-closing tag; no children to process. - } else if (this.tokens.matches1(tt.jsxTagEnd)) { - // Tag with children and a close-tag; process the children as args. - this.tokens.removeToken(); - this.processChildren(true); - } else { - throw new Error("Expected either /> or > at the end of the tag."); - } - } - // We're at the close-tag or the end of a self-closing tag, so remove - // everything else and close the function call. - this.tokens.removeInitialToken(); - while (!this.tokens.matches1(tt.jsxTagEnd)) { - this.tokens.removeToken(); - } - this.tokens.replaceToken(")"); - } - - /** - * Get the code for the relevant function for this context: jsx, jsxs, - * or jsxDEV. The following open-paren is included as well. - * - * These functions are only used for the automatic runtime, so they are always - * auto-imported, but the auto-import will be either CJS or ESM based on the - * target module format. - */ - getJSXFuncInvocationCode(isStatic) { - if (this.options.production) { - if (isStatic) { - return this.claimAutoImportedFuncInvocation("jsxs", "/jsx-runtime"); - } else { - return this.claimAutoImportedFuncInvocation("jsx", "/jsx-runtime"); - } - } else { - return this.claimAutoImportedFuncInvocation("jsxDEV", "/jsx-dev-runtime"); - } - } - - /** - * Return the code to use for the createElement function, e.g. - * `React.createElement`, including the following open-paren. - * - * This is the main function to use for the classic runtime. For the - * automatic runtime, this function is used as a fallback function to - * preserve behavior when there is a prop spread followed by an explicit - * key. In that automatic runtime case, the function should be automatically - * imported. - */ - getCreateElementInvocationCode() { - if (this.isAutomaticRuntime) { - return this.claimAutoImportedFuncInvocation("createElement", ""); - } else { - const {jsxPragmaInfo} = this; - const resolvedPragmaBaseName = this.importProcessor - ? this.importProcessor.getIdentifierReplacement(jsxPragmaInfo.base) || jsxPragmaInfo.base - : jsxPragmaInfo.base; - return `${resolvedPragmaBaseName}${jsxPragmaInfo.suffix}(`; - } - } - - /** - * Return the code to use as the component when compiling a shorthand - * fragment, e.g. `React.Fragment`. - * - * This may be called from either the classic or automatic runtime, and - * the value should be auto-imported for the automatic runtime. - */ - getFragmentCode() { - if (this.isAutomaticRuntime) { - return this.claimAutoImportedName( - "Fragment", - this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime", - ); - } else { - const {jsxPragmaInfo} = this; - const resolvedFragmentPragmaBaseName = this.importProcessor - ? this.importProcessor.getIdentifierReplacement(jsxPragmaInfo.fragmentBase) || - jsxPragmaInfo.fragmentBase - : jsxPragmaInfo.fragmentBase; - return resolvedFragmentPragmaBaseName + jsxPragmaInfo.fragmentSuffix; - } - } - - /** - * Return code that invokes the given function. - * - * When the imports transform is enabled, use the CJSImportTransformer - * strategy of using `.call(void 0, ...` to avoid passing a `this` value in a - * situation that would otherwise look like a method call. - */ - claimAutoImportedFuncInvocation(funcName, importPathSuffix) { - const funcCode = this.claimAutoImportedName(funcName, importPathSuffix); - if (this.importProcessor) { - return `${funcCode}.call(void 0, `; - } else { - return `${funcCode}(`; - } - } - - claimAutoImportedName(funcName, importPathSuffix) { - if (this.importProcessor) { - // CJS mode: claim a name for the module and mark it for import. - const path = this.jsxImportSource + importPathSuffix; - if (!this.cjsAutomaticModuleNameResolutions[path]) { - this.cjsAutomaticModuleNameResolutions[path] = - this.importProcessor.getFreeIdentifierForPath(path); - } - return `${this.cjsAutomaticModuleNameResolutions[path]}.${funcName}`; - } else { - // ESM mode: claim a name for this function and add it to the names that - // should be auto-imported when the prefix is generated. - if (!this.esmAutomaticImportNameResolutions[funcName]) { - this.esmAutomaticImportNameResolutions[funcName] = this.nameManager.claimFreeName( - `_${funcName}`, - ); - } - return this.esmAutomaticImportNameResolutions[funcName]; - } - } - - /** - * Process the first part of a tag, before any props. - */ - processTagIntro() { - // Walk forward until we see one of these patterns: - // jsxName to start the first prop, preceded by another jsxName to end the tag name. - // jsxName to start the first prop, preceded by greaterThan to end the type argument. - // [open brace] to start the first prop. - // [jsxTagEnd] to end the open-tag. - // [slash, jsxTagEnd] to end the self-closing tag. - let introEnd = this.tokens.currentIndex() + 1; - while ( - this.tokens.tokens[introEnd].isType || - (!this.tokens.matches2AtIndex(introEnd - 1, tt.jsxName, tt.jsxName) && - !this.tokens.matches2AtIndex(introEnd - 1, tt.greaterThan, tt.jsxName) && - !this.tokens.matches1AtIndex(introEnd, tt.braceL) && - !this.tokens.matches1AtIndex(introEnd, tt.jsxTagEnd) && - !this.tokens.matches2AtIndex(introEnd, tt.slash, tt.jsxTagEnd)) - ) { - introEnd++; - } - if (introEnd === this.tokens.currentIndex() + 1) { - const tagName = this.tokens.identifierName(); - if (startsWithLowerCase(tagName)) { - this.tokens.replaceToken(`'${tagName}'`); - } - } - while (this.tokens.currentIndex() < introEnd) { - this.rootTransformer.processToken(); - } - } - - /** - * Starting at the beginning of the props, add the props argument to - * React.createElement, including the comma before it. - */ - processPropsObjectWithDevInfo(elementLocationCode) { - const devProps = this.options.production - ? "" - : `__self: this, __source: ${this.getDevSource(elementLocationCode)}`; - if (!this.tokens.matches1(tt.jsxName) && !this.tokens.matches1(tt.braceL)) { - if (devProps) { - this.tokens.appendCode(`, {${devProps}}`); - } else { - this.tokens.appendCode(`, null`); - } - return; - } - this.tokens.appendCode(`, {`); - this.processProps(false); - if (devProps) { - this.tokens.appendCode(` ${devProps}}`); - } else { - this.tokens.appendCode("}"); - } - } - - /** - * Transform the core part of the props, assuming that a { has already been - * inserted before us and that a } will be inserted after us. - * - * If extractKeyCode is true (i.e. when using any jsx... function), any prop - * named "key" has its code captured and returned rather than being emitted to - * the output code. This shifts line numbers, and emitting the code later will - * correct line numbers again. If no key is found or if extractKeyCode is - * false, this function returns null. - */ - processProps(extractKeyCode) { - let keyCode = null; - while (true) { - if (this.tokens.matches2(tt.jsxName, tt.eq)) { - // This is a regular key={value} or key="value" prop. - const propName = this.tokens.identifierName(); - if (extractKeyCode && propName === "key") { - if (keyCode !== null) { - // The props list has multiple keys. Different implementations are - // inconsistent about what to do here: as of this writing, Babel and - // swc keep the *last* key and completely remove the rest, while - // TypeScript uses the *first* key and leaves the others as regular - // props. The React team collaborated with Babel on the - // implementation of this behavior, so presumably the Babel behavior - // is the one to use. - // Since we won't ever be emitting the previous key code, we need to - // at least emit its newlines here so that the line numbers match up - // in the long run. - this.tokens.appendCode(keyCode.replace(/[^\n]/g, "")); - } - // key - this.tokens.removeToken(); - // = - this.tokens.removeToken(); - const snapshot = this.tokens.snapshot(); - this.processPropValue(); - keyCode = this.tokens.dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot); - // Don't add a comma - continue; - } else { - this.processPropName(propName); - this.tokens.replaceToken(": "); - this.processPropValue(); - } - } else if (this.tokens.matches1(tt.jsxName)) { - // This is a shorthand prop like . - const propName = this.tokens.identifierName(); - this.processPropName(propName); - this.tokens.appendCode(": true"); - } else if (this.tokens.matches1(tt.braceL)) { - // This is prop spread, like
, which we can pass - // through fairly directly as an object spread. - this.tokens.replaceToken(""); - this.rootTransformer.processBalancedCode(); - this.tokens.replaceToken(""); - } else { - break; - } - this.tokens.appendCode(","); - } - return keyCode; - } - - processPropName(propName) { - if (propName.includes("-")) { - this.tokens.replaceToken(`'${propName}'`); - } else { - this.tokens.copyToken(); - } - } - - processPropValue() { - if (this.tokens.matches1(tt.braceL)) { - this.tokens.replaceToken(""); - this.rootTransformer.processBalancedCode(); - this.tokens.replaceToken(""); - } else if (this.tokens.matches1(tt.jsxTagStart)) { - this.processJSXTag(); - } else { - this.processStringPropValue(); - } - } - - processStringPropValue() { - const token = this.tokens.currentToken(); - const valueCode = this.tokens.code.slice(token.start + 1, token.end - 1); - const replacementCode = formatJSXTextReplacement(valueCode); - const literalCode = formatJSXStringValueLiteral(valueCode); - this.tokens.replaceToken(literalCode + replacementCode); - } - - /** - * Starting in the middle of the props object literal, produce an additional - * prop for the children and close the object literal. - */ - processAutomaticChildrenAndEndProps(jsxRole) { - if (jsxRole === JSXRole.StaticChildren) { - this.tokens.appendCode(" children: ["); - this.processChildren(false); - this.tokens.appendCode("]}"); - } else { - // The parser information tells us whether we will see a real child or if - // all remaining children (if any) will resolve to empty. If there are no - // non-empty children, don't emit a children prop at all, but still - // process children so that we properly transform the code into nothing. - if (jsxRole === JSXRole.OneChild) { - this.tokens.appendCode(" children: "); - } - this.processChildren(false); - this.tokens.appendCode("}"); - } - } - - /** - * Transform children into a comma-separated list, which will be either - * arguments to createElement or array elements of a children prop. - */ - processChildren(needsInitialComma) { - let needsComma = needsInitialComma; - while (true) { - if (this.tokens.matches2(tt.jsxTagStart, tt.slash)) { - // Closing tag, so no more children. - return; - } - let didEmitElement = false; - if (this.tokens.matches1(tt.braceL)) { - if (this.tokens.matches2(tt.braceL, tt.braceR)) { - // Empty interpolations and comment-only interpolations are allowed - // and don't create an extra child arg. - this.tokens.replaceToken(""); - this.tokens.replaceToken(""); - } else { - // Interpolated expression. - this.tokens.replaceToken(needsComma ? ", " : ""); - this.rootTransformer.processBalancedCode(); - this.tokens.replaceToken(""); - didEmitElement = true; - } - } else if (this.tokens.matches1(tt.jsxTagStart)) { - // Child JSX element - this.tokens.appendCode(needsComma ? ", " : ""); - this.processJSXTag(); - didEmitElement = true; - } else if (this.tokens.matches1(tt.jsxText) || this.tokens.matches1(tt.jsxEmptyText)) { - didEmitElement = this.processChildTextElement(needsComma); - } else { - throw new Error("Unexpected token when processing JSX children."); - } - if (didEmitElement) { - needsComma = true; - } - } - } - - /** - * Turn a JSX text element into a string literal, or nothing at all if the JSX - * text resolves to the empty string. - * - * Returns true if a string literal is emitted, false otherwise. - */ - processChildTextElement(needsComma) { - const token = this.tokens.currentToken(); - const valueCode = this.tokens.code.slice(token.start, token.end); - const replacementCode = formatJSXTextReplacement(valueCode); - const literalCode = formatJSXTextLiteral(valueCode); - if (literalCode === '""') { - this.tokens.replaceToken(replacementCode); - return false; - } else { - this.tokens.replaceToken(`${needsComma ? ", " : ""}${literalCode}${replacementCode}`); - return true; - } - } - - getDevSource(elementLocationCode) { - return `{fileName: ${this.getFilenameVarName()}, ${elementLocationCode}}`; - } - - getFilenameVarName() { - if (!this.filenameVarName) { - this.filenameVarName = this.nameManager.claimFreeName("_jsxFileName"); - } - return this.filenameVarName; - } -} - -/** - * Spec for identifiers: https://tc39.github.io/ecma262/#prod-IdentifierStart. - * - * Really only treat anything starting with a-z as tag names. `_`, `$`, `é` - * should be treated as component names - */ -export function startsWithLowerCase(s) { - const firstChar = s.charCodeAt(0); - return firstChar >= charCodes.lowercaseA && firstChar <= charCodes.lowercaseZ; -} - -/** - * Turn the given jsxText string into a JS string literal. Leading and trailing - * whitespace on lines is removed, except immediately after the open-tag and - * before the close-tag. Empty lines are completely removed, and spaces are - * added between lines after that. - * - * We use JSON.stringify to introduce escape characters as necessary, and trim - * the start and end of each line and remove blank lines. - */ -function formatJSXTextLiteral(text) { - let result = ""; - let whitespace = ""; - - let isInInitialLineWhitespace = false; - let seenNonWhitespace = false; - for (let i = 0; i < text.length; i++) { - const c = text[i]; - if (c === " " || c === "\t" || c === "\r") { - if (!isInInitialLineWhitespace) { - whitespace += c; - } - } else if (c === "\n") { - whitespace = ""; - isInInitialLineWhitespace = true; - } else { - if (seenNonWhitespace && isInInitialLineWhitespace) { - result += " "; - } - result += whitespace; - whitespace = ""; - if (c === "&") { - const {entity, newI} = processEntity(text, i + 1); - i = newI - 1; - result += entity; - } else { - result += c; - } - seenNonWhitespace = true; - isInInitialLineWhitespace = false; - } - } - if (!isInInitialLineWhitespace) { - result += whitespace; - } - return JSON.stringify(result); -} - -/** - * Produce the code that should be printed after the JSX text string literal, - * with most content removed, but all newlines preserved and all spacing at the - * end preserved. - */ -function formatJSXTextReplacement(text) { - let numNewlines = 0; - let numSpaces = 0; - for (const c of text) { - if (c === "\n") { - numNewlines++; - numSpaces = 0; - } else if (c === " ") { - numSpaces++; - } - } - return "\n".repeat(numNewlines) + " ".repeat(numSpaces); -} - -/** - * Format a string in the value position of a JSX prop. - * - * Use the same implementation as convertAttribute from - * babel-helper-builder-react-jsx. - */ -function formatJSXStringValueLiteral(text) { - let result = ""; - for (let i = 0; i < text.length; i++) { - const c = text[i]; - if (c === "\n") { - if (/\s/.test(text[i + 1])) { - result += " "; - while (i < text.length && /\s/.test(text[i + 1])) { - i++; - } - } else { - result += "\n"; - } - } else if (c === "&") { - const {entity, newI} = processEntity(text, i + 1); - result += entity; - i = newI - 1; - } else { - result += c; - } - } - return JSON.stringify(result); -} - -/** - * Starting at a &, see if there's an HTML entity (specified by name, decimal - * char code, or hex char code) and return it if so. - * - * Modified from jsxReadString in babel-parser. - */ -function processEntity(text, indexAfterAmpersand) { - let str = ""; - let count = 0; - let entity; - let i = indexAfterAmpersand; - - if (text[i] === "#") { - let radix = 10; - i++; - let numStart; - if (text[i] === "x") { - radix = 16; - i++; - numStart = i; - while (i < text.length && isHexDigit(text.charCodeAt(i))) { - i++; - } - } else { - numStart = i; - while (i < text.length && isDecimalDigit(text.charCodeAt(i))) { - i++; - } - } - if (text[i] === ";") { - const numStr = text.slice(numStart, i); - if (numStr) { - i++; - entity = String.fromCodePoint(parseInt(numStr, radix)); - } - } - } else { - while (i < text.length && count++ < 10) { - const ch = text[i]; - i++; - if (ch === ";") { - entity = XHTMLEntities.get(str); - break; - } - str += ch; - } - } - - if (!entity) { - return {entity: "&", newI: indexAfterAmpersand}; - } - return {entity, newI: i}; -} - -function isDecimalDigit(code) { - return code >= charCodes.digit0 && code <= charCodes.digit9; -} - -function isHexDigit(code) { - return ( - (code >= charCodes.digit0 && code <= charCodes.digit9) || - (code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) || - (code >= charCodes.uppercaseA && code <= charCodes.uppercaseF) - ); -} diff --git a/node_modules/sucrase/dist/esm/transformers/JestHoistTransformer.js b/node_modules/sucrase/dist/esm/transformers/JestHoistTransformer.js deleted file mode 100644 index 8f45d06..0000000 --- a/node_modules/sucrase/dist/esm/transformers/JestHoistTransformer.js +++ /dev/null @@ -1,111 +0,0 @@ - function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } - -import {TokenType as tt} from "../parser/tokenizer/types"; - - -import Transformer from "./Transformer"; - -const JEST_GLOBAL_NAME = "jest"; -const HOISTED_METHODS = ["mock", "unmock", "enableAutomock", "disableAutomock"]; - -/** - * Implementation of babel-plugin-jest-hoist, which hoists up some jest method - * calls above the imports to allow them to override other imports. - * - * To preserve line numbers, rather than directly moving the jest.mock code, we - * wrap each invocation in a function statement and then call the function from - * the top of the file. - */ -export default class JestHoistTransformer extends Transformer { - __init() {this.hoistedFunctionNames = []} - - constructor( - rootTransformer, - tokens, - nameManager, - importProcessor, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.nameManager = nameManager;this.importProcessor = importProcessor;JestHoistTransformer.prototype.__init.call(this);; - } - - process() { - if ( - this.tokens.currentToken().scopeDepth === 0 && - this.tokens.matches4(tt.name, tt.dot, tt.name, tt.parenL) && - this.tokens.identifierName() === JEST_GLOBAL_NAME - ) { - // TODO: This only works if imports transform is active, which it will be for jest. - // But if jest adds module support and we no longer need the import transform, this needs fixing. - if (_optionalChain([this, 'access', _ => _.importProcessor, 'optionalAccess', _2 => _2.getGlobalNames, 'call', _3 => _3(), 'optionalAccess', _4 => _4.has, 'call', _5 => _5(JEST_GLOBAL_NAME)])) { - return false; - } - return this.extractHoistedCalls(); - } - - return false; - } - - getHoistedCode() { - if (this.hoistedFunctionNames.length > 0) { - // This will be placed before module interop code, but that's fine since - // imports aren't allowed in module mock factories. - return this.hoistedFunctionNames.map((name) => `${name}();`).join(""); - } - return ""; - } - - /** - * Extracts any methods calls on the jest-object that should be hoisted. - * - * According to the jest docs, https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options, - * mock, unmock, enableAutomock, disableAutomock, are the methods that should be hoisted. - * - * We do not apply the same checks of the arguments as babel-plugin-jest-hoist does. - */ - extractHoistedCalls() { - // We're handling a chain of calls where `jest` may or may not need to be inserted for each call - // in the chain, so remove the initial `jest` to make the loop implementation cleaner. - this.tokens.removeToken(); - // Track some state so that multiple non-hoisted chained calls in a row keep their chaining - // syntax. - let followsNonHoistedJestCall = false; - - // Iterate through all chained calls on the jest object. - while (this.tokens.matches3(tt.dot, tt.name, tt.parenL)) { - const methodName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); - const shouldHoist = HOISTED_METHODS.includes(methodName); - if (shouldHoist) { - // We've matched e.g. `.mock(...)` or similar call. - // Replace the initial `.` with `function __jestHoist(){jest.` - const hoistedFunctionName = this.nameManager.claimFreeName("__jestHoist"); - this.hoistedFunctionNames.push(hoistedFunctionName); - this.tokens.replaceToken(`function ${hoistedFunctionName}(){${JEST_GLOBAL_NAME}.`); - this.tokens.copyToken(); - this.tokens.copyToken(); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(tt.parenR); - this.tokens.appendCode(";}"); - followsNonHoistedJestCall = false; - } else { - // This is a non-hoisted method, so just transform the code as usual. - if (followsNonHoistedJestCall) { - // If we didn't hoist the previous call, we can leave the code as-is to chain off of the - // previous method call. It's important to preserve the code here because we don't know - // for sure that the method actually returned the jest object for chaining. - this.tokens.copyToken(); - } else { - // If we hoisted the previous call, we know it returns the jest object back, so we insert - // the identifier `jest` to continue the chain. - this.tokens.replaceToken(`${JEST_GLOBAL_NAME}.`); - } - this.tokens.copyToken(); - this.tokens.copyToken(); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(tt.parenR); - followsNonHoistedJestCall = true; - } - } - - return true; - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/NumericSeparatorTransformer.js b/node_modules/sucrase/dist/esm/transformers/NumericSeparatorTransformer.js deleted file mode 100644 index 0cb01a1..0000000 --- a/node_modules/sucrase/dist/esm/transformers/NumericSeparatorTransformer.js +++ /dev/null @@ -1,20 +0,0 @@ -import {TokenType as tt} from "../parser/tokenizer/types"; - -import Transformer from "./Transformer"; - -export default class NumericSeparatorTransformer extends Transformer { - constructor( tokens) { - super();this.tokens = tokens;; - } - - process() { - if (this.tokens.matches1(tt.num)) { - const code = this.tokens.currentTokenCode(); - if (code.includes("_")) { - this.tokens.replaceToken(code.replace(/_/g, "")); - return true; - } - } - return false; - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/OptionalCatchBindingTransformer.js b/node_modules/sucrase/dist/esm/transformers/OptionalCatchBindingTransformer.js deleted file mode 100644 index 547273b..0000000 --- a/node_modules/sucrase/dist/esm/transformers/OptionalCatchBindingTransformer.js +++ /dev/null @@ -1,19 +0,0 @@ - -import {TokenType as tt} from "../parser/tokenizer/types"; - -import Transformer from "./Transformer"; - -export default class OptionalCatchBindingTransformer extends Transformer { - constructor( tokens, nameManager) { - super();this.tokens = tokens;this.nameManager = nameManager;; - } - - process() { - if (this.tokens.matches2(tt._catch, tt.braceL)) { - this.tokens.copyToken(); - this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`); - return true; - } - return false; - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/OptionalChainingNullishTransformer.js b/node_modules/sucrase/dist/esm/transformers/OptionalChainingNullishTransformer.js deleted file mode 100644 index 571d97f..0000000 --- a/node_modules/sucrase/dist/esm/transformers/OptionalChainingNullishTransformer.js +++ /dev/null @@ -1,155 +0,0 @@ - -import {TokenType as tt} from "../parser/tokenizer/types"; - -import Transformer from "./Transformer"; - -/** - * Transformer supporting the optional chaining and nullish coalescing operators. - * - * Tech plan here: - * https://github.com/alangpierce/sucrase/wiki/Sucrase-Optional-Chaining-and-Nullish-Coalescing-Technical-Plan - * - * The prefix and suffix code snippets are handled by TokenProcessor, and this transformer handles - * the operators themselves. - */ -export default class OptionalChainingNullishTransformer extends Transformer { - constructor( tokens, nameManager) { - super();this.tokens = tokens;this.nameManager = nameManager;; - } - - process() { - if (this.tokens.matches1(tt.nullishCoalescing)) { - const token = this.tokens.currentToken(); - if (this.tokens.tokens[token.nullishStartIndex].isAsyncOperation) { - this.tokens.replaceTokenTrimmingLeftWhitespace(", async () => ("); - } else { - this.tokens.replaceTokenTrimmingLeftWhitespace(", () => ("); - } - return true; - } - if (this.tokens.matches1(tt._delete)) { - const nextToken = this.tokens.tokenAtRelativeIndex(1); - if (nextToken.isOptionalChainStart) { - this.tokens.removeInitialToken(); - return true; - } - } - const token = this.tokens.currentToken(); - const chainStart = token.subscriptStartIndex; - if ( - chainStart != null && - this.tokens.tokens[chainStart].isOptionalChainStart && - // Super subscripts can't be optional (since super is never null/undefined), and the syntax - // relies on the subscript being intact, so leave this token alone. - this.tokens.tokenAtRelativeIndex(-1).type !== tt._super - ) { - const param = this.nameManager.claimFreeName("_"); - let arrowStartSnippet; - if ( - chainStart > 0 && - this.tokens.matches1AtIndex(chainStart - 1, tt._delete) && - this.isLastSubscriptInChain() - ) { - // Delete operations are special: we already removed the delete keyword, and to still - // perform a delete, we need to insert a delete in the very last part of the chain, which - // in correct code will always be a property access. - arrowStartSnippet = `${param} => delete ${param}`; - } else { - arrowStartSnippet = `${param} => ${param}`; - } - if (this.tokens.tokens[chainStart].isAsyncOperation) { - arrowStartSnippet = `async ${arrowStartSnippet}`; - } - if ( - this.tokens.matches2(tt.questionDot, tt.parenL) || - this.tokens.matches2(tt.questionDot, tt.lessThan) - ) { - if (this.justSkippedSuper()) { - this.tokens.appendCode(".bind(this)"); - } - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${arrowStartSnippet}`); - } else if (this.tokens.matches2(tt.questionDot, tt.bracketL)) { - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${arrowStartSnippet}`); - } else if (this.tokens.matches1(tt.questionDot)) { - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${arrowStartSnippet}.`); - } else if (this.tokens.matches1(tt.dot)) { - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${arrowStartSnippet}.`); - } else if (this.tokens.matches1(tt.bracketL)) { - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${arrowStartSnippet}[`); - } else if (this.tokens.matches1(tt.parenL)) { - if (this.justSkippedSuper()) { - this.tokens.appendCode(".bind(this)"); - } - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${arrowStartSnippet}(`); - } else { - throw new Error("Unexpected subscript operator in optional chain."); - } - return true; - } - return false; - } - - /** - * Determine if the current token is the last of its chain, so that we know whether it's eligible - * to have a delete op inserted. - * - * We can do this by walking forward until we determine one way or another. Each - * isOptionalChainStart token must be paired with exactly one isOptionalChainEnd token after it in - * a nesting way, so we can track depth and walk to the end of the chain (the point where the - * depth goes negative) and see if any other subscript token is after us in the chain. - */ - isLastSubscriptInChain() { - let depth = 0; - for (let i = this.tokens.currentIndex() + 1; ; i++) { - if (i >= this.tokens.tokens.length) { - throw new Error("Reached the end of the code while finding the end of the access chain."); - } - if (this.tokens.tokens[i].isOptionalChainStart) { - depth++; - } else if (this.tokens.tokens[i].isOptionalChainEnd) { - depth--; - } - if (depth < 0) { - return true; - } - - // This subscript token is a later one in the same chain. - if (depth === 0 && this.tokens.tokens[i].subscriptStartIndex != null) { - return false; - } - } - } - - /** - * Determine if we are the open-paren in an expression like super.a()?.b. - * - * We can do this by walking backward to find the previous subscript. If that subscript was - * preceded by a super, then we must be the subscript after it, so if this is a call expression, - * we'll need to attach the right context. - */ - justSkippedSuper() { - let depth = 0; - let index = this.tokens.currentIndex() - 1; - while (true) { - if (index < 0) { - throw new Error( - "Reached the start of the code while finding the start of the access chain.", - ); - } - if (this.tokens.tokens[index].isOptionalChainStart) { - depth--; - } else if (this.tokens.tokens[index].isOptionalChainEnd) { - depth++; - } - if (depth < 0) { - return false; - } - - // This subscript token is a later one in the same chain. - if (depth === 0 && this.tokens.tokens[index].subscriptStartIndex != null) { - return this.tokens.tokens[index - 1].type === tt._super; - } - index--; - } - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/ReactDisplayNameTransformer.js b/node_modules/sucrase/dist/esm/transformers/ReactDisplayNameTransformer.js deleted file mode 100644 index 0c44c81..0000000 --- a/node_modules/sucrase/dist/esm/transformers/ReactDisplayNameTransformer.js +++ /dev/null @@ -1,160 +0,0 @@ - - -import {IdentifierRole} from "../parser/tokenizer"; -import {TokenType as tt} from "../parser/tokenizer/types"; - - -import Transformer from "./Transformer"; - -/** - * Implementation of babel-plugin-transform-react-display-name, which adds a - * display name to usages of React.createClass and createReactClass. - */ -export default class ReactDisplayNameTransformer extends Transformer { - constructor( - rootTransformer, - tokens, - importProcessor, - options, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.options = options;; - } - - process() { - const startIndex = this.tokens.currentIndex(); - if (this.tokens.identifierName() === "createReactClass") { - const newName = - this.importProcessor && this.importProcessor.getIdentifierReplacement("createReactClass"); - if (newName) { - this.tokens.replaceToken(`(0, ${newName})`); - } else { - this.tokens.copyToken(); - } - this.tryProcessCreateClassCall(startIndex); - return true; - } - if ( - this.tokens.matches3(tt.name, tt.dot, tt.name) && - this.tokens.identifierName() === "React" && - this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 2) === "createClass" - ) { - const newName = this.importProcessor - ? this.importProcessor.getIdentifierReplacement("React") || "React" - : "React"; - if (newName) { - this.tokens.replaceToken(newName); - this.tokens.copyToken(); - this.tokens.copyToken(); - } else { - this.tokens.copyToken(); - this.tokens.copyToken(); - this.tokens.copyToken(); - } - this.tryProcessCreateClassCall(startIndex); - return true; - } - return false; - } - - /** - * This is called with the token position at the open-paren. - */ - tryProcessCreateClassCall(startIndex) { - const displayName = this.findDisplayName(startIndex); - if (!displayName) { - return; - } - - if (this.classNeedsDisplayName()) { - this.tokens.copyExpectedToken(tt.parenL); - this.tokens.copyExpectedToken(tt.braceL); - this.tokens.appendCode(`displayName: '${displayName}',`); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(tt.braceR); - this.tokens.copyExpectedToken(tt.parenR); - } - } - - findDisplayName(startIndex) { - if (startIndex < 2) { - return null; - } - if (this.tokens.matches2AtIndex(startIndex - 2, tt.name, tt.eq)) { - // This is an assignment (or declaration) and the LHS is either an identifier or a member - // expression ending in an identifier, so use that identifier name. - return this.tokens.identifierNameAtIndex(startIndex - 2); - } - if ( - startIndex >= 2 && - this.tokens.tokens[startIndex - 2].identifierRole === IdentifierRole.ObjectKey - ) { - // This is an object literal value. - return this.tokens.identifierNameAtIndex(startIndex - 2); - } - if (this.tokens.matches2AtIndex(startIndex - 2, tt._export, tt._default)) { - return this.getDisplayNameFromFilename(); - } - return null; - } - - getDisplayNameFromFilename() { - const filePath = this.options.filePath || "unknown"; - const pathSegments = filePath.split("/"); - const filename = pathSegments[pathSegments.length - 1]; - const dotIndex = filename.lastIndexOf("."); - const baseFilename = dotIndex === -1 ? filename : filename.slice(0, dotIndex); - if (baseFilename === "index" && pathSegments[pathSegments.length - 2]) { - return pathSegments[pathSegments.length - 2]; - } else { - return baseFilename; - } - } - - /** - * We only want to add a display name when this is a function call containing - * one argument, which is an object literal without `displayName` as an - * existing key. - */ - classNeedsDisplayName() { - let index = this.tokens.currentIndex(); - if (!this.tokens.matches2(tt.parenL, tt.braceL)) { - return false; - } - // The block starts on the {, and we expect any displayName key to be in - // that context. We need to ignore other other contexts to avoid matching - // nested displayName keys. - const objectStartIndex = index + 1; - const objectContextId = this.tokens.tokens[objectStartIndex].contextId; - if (objectContextId == null) { - throw new Error("Expected non-null context ID on object open-brace."); - } - - for (; index < this.tokens.tokens.length; index++) { - const token = this.tokens.tokens[index]; - if (token.type === tt.braceR && token.contextId === objectContextId) { - index++; - break; - } - - if ( - this.tokens.identifierNameAtIndex(index) === "displayName" && - this.tokens.tokens[index].identifierRole === IdentifierRole.ObjectKey && - token.contextId === objectContextId - ) { - // We found a displayName key, so bail out. - return false; - } - } - - if (index === this.tokens.tokens.length) { - throw new Error("Unexpected end of input when processing React class."); - } - - // If we got this far, we know we have createClass with an object with no - // display name, so we want to proceed as long as that was the only argument. - return ( - this.tokens.matches1AtIndex(index, tt.parenR) || - this.tokens.matches2AtIndex(index, tt.comma, tt.parenR) - ); - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/ReactHotLoaderTransformer.js b/node_modules/sucrase/dist/esm/transformers/ReactHotLoaderTransformer.js deleted file mode 100644 index 873902e..0000000 --- a/node_modules/sucrase/dist/esm/transformers/ReactHotLoaderTransformer.js +++ /dev/null @@ -1,69 +0,0 @@ -import {IdentifierRole, isTopLevelDeclaration} from "../parser/tokenizer"; - -import Transformer from "./Transformer"; - -export default class ReactHotLoaderTransformer extends Transformer { - __init() {this.extractedDefaultExportName = null} - - constructor( tokens, filePath) { - super();this.tokens = tokens;this.filePath = filePath;ReactHotLoaderTransformer.prototype.__init.call(this);; - } - - setExtractedDefaultExportName(extractedDefaultExportName) { - this.extractedDefaultExportName = extractedDefaultExportName; - } - - getPrefixCode() { - return ` - (function () { - var enterModule = require('react-hot-loader').enterModule; - enterModule && enterModule(module); - })();` - .replace(/\s+/g, " ") - .trim(); - } - - getSuffixCode() { - const topLevelNames = new Set(); - for (const token of this.tokens.tokens) { - if ( - !token.isType && - isTopLevelDeclaration(token) && - token.identifierRole !== IdentifierRole.ImportDeclaration - ) { - topLevelNames.add(this.tokens.identifierNameForToken(token)); - } - } - const namesToRegister = Array.from(topLevelNames).map((name) => ({ - variableName: name, - uniqueLocalName: name, - })); - if (this.extractedDefaultExportName) { - namesToRegister.push({ - variableName: this.extractedDefaultExportName, - uniqueLocalName: "default", - }); - } - return ` -;(function () { - var reactHotLoader = require('react-hot-loader').default; - var leaveModule = require('react-hot-loader').leaveModule; - if (!reactHotLoader) { - return; - } -${namesToRegister - .map( - ({variableName, uniqueLocalName}) => - ` reactHotLoader.register(${variableName}, "${uniqueLocalName}", ${JSON.stringify( - this.filePath || "", - )});`, - ) - .join("\n")} - leaveModule(module); -})();`; - } - - process() { - return false; - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/RootTransformer.js b/node_modules/sucrase/dist/esm/transformers/RootTransformer.js deleted file mode 100644 index c7a83fe..0000000 --- a/node_modules/sucrase/dist/esm/transformers/RootTransformer.js +++ /dev/null @@ -1,462 +0,0 @@ - - - -import {ContextualKeyword} from "../parser/tokenizer/keywords"; -import {TokenType as tt} from "../parser/tokenizer/types"; - -import getClassInfo, {} from "../util/getClassInfo"; -import CJSImportTransformer from "./CJSImportTransformer"; -import ESMImportTransformer from "./ESMImportTransformer"; -import FlowTransformer from "./FlowTransformer"; -import JestHoistTransformer from "./JestHoistTransformer"; -import JSXTransformer from "./JSXTransformer"; -import NumericSeparatorTransformer from "./NumericSeparatorTransformer"; -import OptionalCatchBindingTransformer from "./OptionalCatchBindingTransformer"; -import OptionalChainingNullishTransformer from "./OptionalChainingNullishTransformer"; -import ReactDisplayNameTransformer from "./ReactDisplayNameTransformer"; -import ReactHotLoaderTransformer from "./ReactHotLoaderTransformer"; - -import TypeScriptTransformer from "./TypeScriptTransformer"; - - - - - - - - -export default class RootTransformer { - __init() {this.transformers = []} - - - __init2() {this.generatedVariables = []} - - - - - - constructor( - sucraseContext, - transforms, - enableLegacyBabel5ModuleInterop, - options, - ) {;RootTransformer.prototype.__init.call(this);RootTransformer.prototype.__init2.call(this); - this.nameManager = sucraseContext.nameManager; - this.helperManager = sucraseContext.helperManager; - const {tokenProcessor, importProcessor} = sucraseContext; - this.tokens = tokenProcessor; - this.isImportsTransformEnabled = transforms.includes("imports"); - this.isReactHotLoaderTransformEnabled = transforms.includes("react-hot-loader"); - this.disableESTransforms = Boolean(options.disableESTransforms); - - if (!options.disableESTransforms) { - this.transformers.push( - new OptionalChainingNullishTransformer(tokenProcessor, this.nameManager), - ); - this.transformers.push(new NumericSeparatorTransformer(tokenProcessor)); - this.transformers.push(new OptionalCatchBindingTransformer(tokenProcessor, this.nameManager)); - } - - if (transforms.includes("jsx")) { - if (options.jsxRuntime !== "preserve") { - this.transformers.push( - new JSXTransformer(this, tokenProcessor, importProcessor, this.nameManager, options), - ); - } - this.transformers.push( - new ReactDisplayNameTransformer(this, tokenProcessor, importProcessor, options), - ); - } - - let reactHotLoaderTransformer = null; - if (transforms.includes("react-hot-loader")) { - if (!options.filePath) { - throw new Error("filePath is required when using the react-hot-loader transform."); - } - reactHotLoaderTransformer = new ReactHotLoaderTransformer(tokenProcessor, options.filePath); - this.transformers.push(reactHotLoaderTransformer); - } - - // Note that we always want to enable the imports transformer, even when the import transform - // itself isn't enabled, since we need to do type-only import pruning for both Flow and - // TypeScript. - if (transforms.includes("imports")) { - if (importProcessor === null) { - throw new Error("Expected non-null importProcessor with imports transform enabled."); - } - this.transformers.push( - new CJSImportTransformer( - this, - tokenProcessor, - importProcessor, - this.nameManager, - this.helperManager, - reactHotLoaderTransformer, - enableLegacyBabel5ModuleInterop, - Boolean(options.enableLegacyTypeScriptModuleInterop), - transforms.includes("typescript"), - transforms.includes("flow"), - Boolean(options.preserveDynamicImport), - Boolean(options.keepUnusedImports), - ), - ); - } else { - this.transformers.push( - new ESMImportTransformer( - tokenProcessor, - this.nameManager, - this.helperManager, - reactHotLoaderTransformer, - transforms.includes("typescript"), - transforms.includes("flow"), - Boolean(options.keepUnusedImports), - options, - ), - ); - } - - if (transforms.includes("flow")) { - this.transformers.push( - new FlowTransformer(this, tokenProcessor, transforms.includes("imports")), - ); - } - if (transforms.includes("typescript")) { - this.transformers.push( - new TypeScriptTransformer(this, tokenProcessor, transforms.includes("imports")), - ); - } - if (transforms.includes("jest")) { - this.transformers.push( - new JestHoistTransformer(this, tokenProcessor, this.nameManager, importProcessor), - ); - } - } - - transform() { - this.tokens.reset(); - this.processBalancedCode(); - const shouldAddUseStrict = this.isImportsTransformEnabled; - // "use strict" always needs to be first, so override the normal transformer order. - let prefix = shouldAddUseStrict ? '"use strict";' : ""; - for (const transformer of this.transformers) { - prefix += transformer.getPrefixCode(); - } - prefix += this.helperManager.emitHelpers(); - prefix += this.generatedVariables.map((v) => ` var ${v};`).join(""); - for (const transformer of this.transformers) { - prefix += transformer.getHoistedCode(); - } - let suffix = ""; - for (const transformer of this.transformers) { - suffix += transformer.getSuffixCode(); - } - const result = this.tokens.finish(); - let {code} = result; - if (code.startsWith("#!")) { - let newlineIndex = code.indexOf("\n"); - if (newlineIndex === -1) { - newlineIndex = code.length; - code += "\n"; - } - return { - code: code.slice(0, newlineIndex + 1) + prefix + code.slice(newlineIndex + 1) + suffix, - // The hashbang line has no tokens, so shifting the tokens to account - // for prefix can happen normally. - mappings: this.shiftMappings(result.mappings, prefix.length), - }; - } else { - return { - code: prefix + code + suffix, - mappings: this.shiftMappings(result.mappings, prefix.length), - }; - } - } - - processBalancedCode() { - let braceDepth = 0; - let parenDepth = 0; - while (!this.tokens.isAtEnd()) { - if (this.tokens.matches1(tt.braceL) || this.tokens.matches1(tt.dollarBraceL)) { - braceDepth++; - } else if (this.tokens.matches1(tt.braceR)) { - if (braceDepth === 0) { - return; - } - braceDepth--; - } - if (this.tokens.matches1(tt.parenL)) { - parenDepth++; - } else if (this.tokens.matches1(tt.parenR)) { - if (parenDepth === 0) { - return; - } - parenDepth--; - } - this.processToken(); - } - } - - processToken() { - if (this.tokens.matches1(tt._class)) { - this.processClass(); - return; - } - for (const transformer of this.transformers) { - const wasProcessed = transformer.process(); - if (wasProcessed) { - return; - } - } - this.tokens.copyToken(); - } - - /** - * Skip past a class with a name and return that name. - */ - processNamedClass() { - if (!this.tokens.matches2(tt._class, tt.name)) { - throw new Error("Expected identifier for exported class name."); - } - const name = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); - this.processClass(); - return name; - } - - processClass() { - const classInfo = getClassInfo(this, this.tokens, this.nameManager, this.disableESTransforms); - - // Both static and instance initializers need a class name to use to invoke the initializer, so - // assign to one if necessary. - const needsCommaExpression = - (classInfo.headerInfo.isExpression || !classInfo.headerInfo.className) && - classInfo.staticInitializerNames.length + classInfo.instanceInitializerNames.length > 0; - - let className = classInfo.headerInfo.className; - if (needsCommaExpression) { - className = this.nameManager.claimFreeName("_class"); - this.generatedVariables.push(className); - this.tokens.appendCode(` (${className} =`); - } - - const classToken = this.tokens.currentToken(); - const contextId = classToken.contextId; - if (contextId == null) { - throw new Error("Expected class to have a context ID."); - } - this.tokens.copyExpectedToken(tt._class); - while (!this.tokens.matchesContextIdAndLabel(tt.braceL, contextId)) { - this.processToken(); - } - - this.processClassBody(classInfo, className); - - const staticInitializerStatements = classInfo.staticInitializerNames.map( - (name) => `${className}.${name}()`, - ); - if (needsCommaExpression) { - this.tokens.appendCode( - `, ${staticInitializerStatements.map((s) => `${s}, `).join("")}${className})`, - ); - } else if (classInfo.staticInitializerNames.length > 0) { - this.tokens.appendCode(` ${staticInitializerStatements.map((s) => `${s};`).join(" ")}`); - } - } - - /** - * We want to just handle class fields in all contexts, since TypeScript supports them. Later, - * when some JS implementations support class fields, this should be made optional. - */ - processClassBody(classInfo, className) { - const { - headerInfo, - constructorInsertPos, - constructorInitializerStatements, - fields, - instanceInitializerNames, - rangesToRemove, - } = classInfo; - let fieldIndex = 0; - let rangeToRemoveIndex = 0; - const classContextId = this.tokens.currentToken().contextId; - if (classContextId == null) { - throw new Error("Expected non-null context ID on class."); - } - this.tokens.copyExpectedToken(tt.braceL); - if (this.isReactHotLoaderTransformEnabled) { - this.tokens.appendCode( - "__reactstandin__regenerateByEval(key, code) {this[key] = eval(code);}", - ); - } - - const needsConstructorInit = - constructorInitializerStatements.length + instanceInitializerNames.length > 0; - - if (constructorInsertPos === null && needsConstructorInit) { - const constructorInitializersCode = this.makeConstructorInitCode( - constructorInitializerStatements, - instanceInitializerNames, - className, - ); - if (headerInfo.hasSuperclass) { - const argsName = this.nameManager.claimFreeName("args"); - this.tokens.appendCode( - `constructor(...${argsName}) { super(...${argsName}); ${constructorInitializersCode}; }`, - ); - } else { - this.tokens.appendCode(`constructor() { ${constructorInitializersCode}; }`); - } - } - - while (!this.tokens.matchesContextIdAndLabel(tt.braceR, classContextId)) { - if (fieldIndex < fields.length && this.tokens.currentIndex() === fields[fieldIndex].start) { - let needsCloseBrace = false; - if (this.tokens.matches1(tt.bracketL)) { - this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this`); - } else if (this.tokens.matches1(tt.string) || this.tokens.matches1(tt.num)) { - this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this[`); - needsCloseBrace = true; - } else { - this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this.`); - } - while (this.tokens.currentIndex() < fields[fieldIndex].end) { - if (needsCloseBrace && this.tokens.currentIndex() === fields[fieldIndex].equalsIndex) { - this.tokens.appendCode("]"); - } - this.processToken(); - } - this.tokens.appendCode("}"); - fieldIndex++; - } else if ( - rangeToRemoveIndex < rangesToRemove.length && - this.tokens.currentIndex() >= rangesToRemove[rangeToRemoveIndex].start - ) { - if (this.tokens.currentIndex() < rangesToRemove[rangeToRemoveIndex].end) { - this.tokens.removeInitialToken(); - } - while (this.tokens.currentIndex() < rangesToRemove[rangeToRemoveIndex].end) { - this.tokens.removeToken(); - } - rangeToRemoveIndex++; - } else if (this.tokens.currentIndex() === constructorInsertPos) { - this.tokens.copyToken(); - if (needsConstructorInit) { - this.tokens.appendCode( - `;${this.makeConstructorInitCode( - constructorInitializerStatements, - instanceInitializerNames, - className, - )};`, - ); - } - this.processToken(); - } else { - this.processToken(); - } - } - this.tokens.copyExpectedToken(tt.braceR); - } - - makeConstructorInitCode( - constructorInitializerStatements, - instanceInitializerNames, - className, - ) { - return [ - ...constructorInitializerStatements, - ...instanceInitializerNames.map((name) => `${className}.prototype.${name}.call(this)`), - ].join(";"); - } - - /** - * Normally it's ok to simply remove type tokens, but we need to be more careful when dealing with - * arrow function return types since they can confuse the parser. In that case, we want to move - * the close-paren to the same line as the arrow. - * - * See https://github.com/alangpierce/sucrase/issues/391 for more details. - */ - processPossibleArrowParamEnd() { - if (this.tokens.matches2(tt.parenR, tt.colon) && this.tokens.tokenAtRelativeIndex(1).isType) { - let nextNonTypeIndex = this.tokens.currentIndex() + 1; - // Look ahead to see if this is an arrow function or something else. - while (this.tokens.tokens[nextNonTypeIndex].isType) { - nextNonTypeIndex++; - } - if (this.tokens.matches1AtIndex(nextNonTypeIndex, tt.arrow)) { - this.tokens.removeInitialToken(); - while (this.tokens.currentIndex() < nextNonTypeIndex) { - this.tokens.removeToken(); - } - this.tokens.replaceTokenTrimmingLeftWhitespace(") =>"); - return true; - } - } - return false; - } - - /** - * An async arrow function might be of the form: - * - * async < - * T - * >() => {} - * - * in which case, removing the type parameters will cause a syntax error. Detect this case and - * move the open-paren earlier. - */ - processPossibleAsyncArrowWithTypeParams() { - if ( - !this.tokens.matchesContextual(ContextualKeyword._async) && - !this.tokens.matches1(tt._async) - ) { - return false; - } - const nextToken = this.tokens.tokenAtRelativeIndex(1); - if (nextToken.type !== tt.lessThan || !nextToken.isType) { - return false; - } - - let nextNonTypeIndex = this.tokens.currentIndex() + 1; - // Look ahead to see if this is an arrow function or something else. - while (this.tokens.tokens[nextNonTypeIndex].isType) { - nextNonTypeIndex++; - } - if (this.tokens.matches1AtIndex(nextNonTypeIndex, tt.parenL)) { - this.tokens.replaceToken("async ("); - this.tokens.removeInitialToken(); - while (this.tokens.currentIndex() < nextNonTypeIndex) { - this.tokens.removeToken(); - } - this.tokens.removeToken(); - // We ate a ( token, so we need to process the tokens in between and then the ) token so that - // we remain balanced. - this.processBalancedCode(); - this.processToken(); - return true; - } - return false; - } - - processPossibleTypeRange() { - if (this.tokens.currentToken().isType) { - this.tokens.removeInitialToken(); - while (this.tokens.currentToken().isType) { - this.tokens.removeToken(); - } - return true; - } - return false; - } - - shiftMappings( - mappings, - prefixLength, - ) { - for (let i = 0; i < mappings.length; i++) { - const mapping = mappings[i]; - if (mapping !== undefined) { - mappings[i] = mapping + prefixLength; - } - } - return mappings; - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/Transformer.js b/node_modules/sucrase/dist/esm/transformers/Transformer.js deleted file mode 100644 index 5e8e9e7..0000000 --- a/node_modules/sucrase/dist/esm/transformers/Transformer.js +++ /dev/null @@ -1,16 +0,0 @@ -export default class Transformer { - // Return true if anything was processed, false otherwise. - - - getPrefixCode() { - return ""; - } - - getHoistedCode() { - return ""; - } - - getSuffixCode() { - return ""; - } -} diff --git a/node_modules/sucrase/dist/esm/transformers/TypeScriptTransformer.js b/node_modules/sucrase/dist/esm/transformers/TypeScriptTransformer.js deleted file mode 100644 index 67e1274..0000000 --- a/node_modules/sucrase/dist/esm/transformers/TypeScriptTransformer.js +++ /dev/null @@ -1,279 +0,0 @@ - -import {TokenType as tt} from "../parser/tokenizer/types"; - -import isIdentifier from "../util/isIdentifier"; - -import Transformer from "./Transformer"; - -export default class TypeScriptTransformer extends Transformer { - constructor( - rootTransformer, - tokens, - isImportsTransformEnabled, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.isImportsTransformEnabled = isImportsTransformEnabled;; - } - - process() { - if ( - this.rootTransformer.processPossibleArrowParamEnd() || - this.rootTransformer.processPossibleAsyncArrowWithTypeParams() || - this.rootTransformer.processPossibleTypeRange() - ) { - return true; - } - if ( - this.tokens.matches1(tt._public) || - this.tokens.matches1(tt._protected) || - this.tokens.matches1(tt._private) || - this.tokens.matches1(tt._abstract) || - this.tokens.matches1(tt._readonly) || - this.tokens.matches1(tt._override) || - this.tokens.matches1(tt.nonNullAssertion) - ) { - this.tokens.removeInitialToken(); - return true; - } - if (this.tokens.matches1(tt._enum) || this.tokens.matches2(tt._const, tt._enum)) { - this.processEnum(); - return true; - } - if ( - this.tokens.matches2(tt._export, tt._enum) || - this.tokens.matches3(tt._export, tt._const, tt._enum) - ) { - this.processEnum(true); - return true; - } - return false; - } - - processEnum(isExport = false) { - // We might have "export const enum", so just remove all relevant tokens. - this.tokens.removeInitialToken(); - while (this.tokens.matches1(tt._const) || this.tokens.matches1(tt._enum)) { - this.tokens.removeToken(); - } - const enumName = this.tokens.identifierName(); - this.tokens.removeToken(); - if (isExport && !this.isImportsTransformEnabled) { - this.tokens.appendCode("export "); - } - this.tokens.appendCode(`var ${enumName}; (function (${enumName})`); - this.tokens.copyExpectedToken(tt.braceL); - this.processEnumBody(enumName); - this.tokens.copyExpectedToken(tt.braceR); - if (isExport && this.isImportsTransformEnabled) { - this.tokens.appendCode(`)(${enumName} || (exports.${enumName} = ${enumName} = {}));`); - } else { - this.tokens.appendCode(`)(${enumName} || (${enumName} = {}));`); - } - } - - /** - * Transform an enum into equivalent JS. This has complexity in a few places: - * - TS allows string enums, numeric enums, and a mix of the two styles within an enum. - * - Enum keys are allowed to be referenced in later enum values. - * - Enum keys are allowed to be strings. - * - When enum values are omitted, they should follow an auto-increment behavior. - */ - processEnumBody(enumName) { - // Code that can be used to reference the previous enum member, or null if this is the first - // enum member. - let previousValueCode = null; - while (true) { - if (this.tokens.matches1(tt.braceR)) { - break; - } - const {nameStringCode, variableName} = this.extractEnumKeyInfo(this.tokens.currentToken()); - this.tokens.removeInitialToken(); - - if ( - this.tokens.matches3(tt.eq, tt.string, tt.comma) || - this.tokens.matches3(tt.eq, tt.string, tt.braceR) - ) { - this.processStringLiteralEnumMember(enumName, nameStringCode, variableName); - } else if (this.tokens.matches1(tt.eq)) { - this.processExplicitValueEnumMember(enumName, nameStringCode, variableName); - } else { - this.processImplicitValueEnumMember( - enumName, - nameStringCode, - variableName, - previousValueCode, - ); - } - if (this.tokens.matches1(tt.comma)) { - this.tokens.removeToken(); - } - - if (variableName != null) { - previousValueCode = variableName; - } else { - previousValueCode = `${enumName}[${nameStringCode}]`; - } - } - } - - /** - * Detect name information about this enum key, which will be used to determine which code to emit - * and whether we should declare a variable as part of this declaration. - * - * Some cases to keep in mind: - * - Enum keys can be implicitly referenced later, e.g. `X = 1, Y = X`. In Sucrase, we implement - * this by declaring a variable `X` so that later expressions can use it. - * - In addition to the usual identifier key syntax, enum keys are allowed to be string literals, - * e.g. `"hello world" = 3,`. Template literal syntax is NOT allowed. - * - Even if the enum key is defined as a string literal, it may still be referenced by identifier - * later, e.g. `"X" = 1, Y = X`. That means that we need to detect whether or not a string - * literal is identifier-like and emit a variable if so, even if the declaration did not use an - * identifier. - * - Reserved keywords like `break` are valid enum keys, but are not valid to be referenced later - * and would be a syntax error if we emitted a variable, so we need to skip the variable - * declaration in those cases. - * - * The variableName return value captures these nuances: if non-null, we can and must emit a - * variable declaration, and if null, we can't and shouldn't. - */ - extractEnumKeyInfo(nameToken) { - if (nameToken.type === tt.name) { - const name = this.tokens.identifierNameForToken(nameToken); - return { - nameStringCode: `"${name}"`, - variableName: isIdentifier(name) ? name : null, - }; - } else if (nameToken.type === tt.string) { - const name = this.tokens.stringValueForToken(nameToken); - return { - nameStringCode: this.tokens.code.slice(nameToken.start, nameToken.end), - variableName: isIdentifier(name) ? name : null, - }; - } else { - throw new Error("Expected name or string at beginning of enum element."); - } - } - - /** - * Handle an enum member where the RHS is just a string literal (not omitted, not a number, and - * not a complex expression). This is the typical form for TS string enums, and in this case, we - * do *not* create a reverse mapping. - * - * This is called after deleting the key token, when the token processor is at the equals sign. - * - * Example 1: - * someKey = "some value" - * -> - * const someKey = "some value"; MyEnum["someKey"] = someKey; - * - * Example 2: - * "some key" = "some value" - * -> - * MyEnum["some key"] = "some value"; - */ - processStringLiteralEnumMember( - enumName, - nameStringCode, - variableName, - ) { - if (variableName != null) { - this.tokens.appendCode(`const ${variableName}`); - // = - this.tokens.copyToken(); - // value string - this.tokens.copyToken(); - this.tokens.appendCode(`; ${enumName}[${nameStringCode}] = ${variableName};`); - } else { - this.tokens.appendCode(`${enumName}[${nameStringCode}]`); - // = - this.tokens.copyToken(); - // value string - this.tokens.copyToken(); - this.tokens.appendCode(";"); - } - } - - /** - * Handle an enum member initialized with an expression on the right-hand side (other than a - * string literal). In these cases, we should transform the expression and emit code that sets up - * a reverse mapping. - * - * The TypeScript implementation of this operation distinguishes between expressions that can be - * "constant folded" at compile time (i.e. consist of number literals and simple math operations - * on those numbers) and ones that are dynamic. For constant expressions, it emits the resolved - * numeric value, and auto-incrementing is only allowed in that case. Evaluating expressions at - * compile time would add significant complexity to Sucrase, so Sucrase instead leaves the - * expression as-is, and will later emit something like `MyEnum["previousKey"] + 1` to implement - * auto-incrementing. - * - * This is called after deleting the key token, when the token processor is at the equals sign. - * - * Example 1: - * someKey = 1 + 1 - * -> - * const someKey = 1 + 1; MyEnum[MyEnum["someKey"] = someKey] = "someKey"; - * - * Example 2: - * "some key" = 1 + 1 - * -> - * MyEnum[MyEnum["some key"] = 1 + 1] = "some key"; - */ - processExplicitValueEnumMember( - enumName, - nameStringCode, - variableName, - ) { - const rhsEndIndex = this.tokens.currentToken().rhsEndIndex; - if (rhsEndIndex == null) { - throw new Error("Expected rhsEndIndex on enum assign."); - } - - if (variableName != null) { - this.tokens.appendCode(`const ${variableName}`); - this.tokens.copyToken(); - while (this.tokens.currentIndex() < rhsEndIndex) { - this.rootTransformer.processToken(); - } - this.tokens.appendCode( - `; ${enumName}[${enumName}[${nameStringCode}] = ${variableName}] = ${nameStringCode};`, - ); - } else { - this.tokens.appendCode(`${enumName}[${enumName}[${nameStringCode}]`); - this.tokens.copyToken(); - while (this.tokens.currentIndex() < rhsEndIndex) { - this.rootTransformer.processToken(); - } - this.tokens.appendCode(`] = ${nameStringCode};`); - } - } - - /** - * Handle an enum member with no right-hand side expression. In this case, the value is the - * previous value plus 1, or 0 if there was no previous value. We should also always emit a - * reverse mapping. - * - * Example 1: - * someKey2 - * -> - * const someKey2 = someKey1 + 1; MyEnum[MyEnum["someKey2"] = someKey2] = "someKey2"; - * - * Example 2: - * "some key 2" - * -> - * MyEnum[MyEnum["some key 2"] = someKey1 + 1] = "some key 2"; - */ - processImplicitValueEnumMember( - enumName, - nameStringCode, - variableName, - previousValueCode, - ) { - let valueCode = previousValueCode != null ? `${previousValueCode} + 1` : "0"; - if (variableName != null) { - this.tokens.appendCode(`const ${variableName} = ${valueCode}; `); - valueCode = variableName; - } - this.tokens.appendCode( - `${enumName}[${enumName}[${nameStringCode}] = ${valueCode}] = ${nameStringCode};`, - ); - } -} diff --git a/node_modules/sucrase/dist/esm/util/elideImportEquals.js b/node_modules/sucrase/dist/esm/util/elideImportEquals.js deleted file mode 100644 index 6b18a7a..0000000 --- a/node_modules/sucrase/dist/esm/util/elideImportEquals.js +++ /dev/null @@ -1,29 +0,0 @@ -import {TokenType as tt} from "../parser/tokenizer/types"; - - -export default function elideImportEquals(tokens) { - // import - tokens.removeInitialToken(); - // name - tokens.removeToken(); - // = - tokens.removeToken(); - // name or require - tokens.removeToken(); - // Handle either `import A = require('A')` or `import A = B.C.D`. - if (tokens.matches1(tt.parenL)) { - // ( - tokens.removeToken(); - // path string - tokens.removeToken(); - // ) - tokens.removeToken(); - } else { - while (tokens.matches1(tt.dot)) { - // . - tokens.removeToken(); - // name - tokens.removeToken(); - } - } -} diff --git a/node_modules/sucrase/dist/esm/util/formatTokens.js b/node_modules/sucrase/dist/esm/util/formatTokens.js deleted file mode 100644 index eea07d2..0000000 --- a/node_modules/sucrase/dist/esm/util/formatTokens.js +++ /dev/null @@ -1,74 +0,0 @@ -import LinesAndColumns from "lines-and-columns"; - - -import {formatTokenType} from "../parser/tokenizer/types"; - -export default function formatTokens(code, tokens) { - if (tokens.length === 0) { - return ""; - } - - const tokenKeys = Object.keys(tokens[0]).filter( - (k) => k !== "type" && k !== "value" && k !== "start" && k !== "end" && k !== "loc", - ); - const typeKeys = Object.keys(tokens[0].type).filter((k) => k !== "label" && k !== "keyword"); - - const headings = ["Location", "Label", "Raw", ...tokenKeys, ...typeKeys]; - - const lines = new LinesAndColumns(code); - const rows = [headings, ...tokens.map(getTokenComponents)]; - const padding = headings.map(() => 0); - for (const components of rows) { - for (let i = 0; i < components.length; i++) { - padding[i] = Math.max(padding[i], components[i].length); - } - } - return rows - .map((components) => components.map((component, i) => component.padEnd(padding[i])).join(" ")) - .join("\n"); - - function getTokenComponents(token) { - const raw = code.slice(token.start, token.end); - return [ - formatRange(token.start, token.end), - formatTokenType(token.type), - truncate(String(raw), 14), - // @ts-ignore: Intentional dynamic access by key. - ...tokenKeys.map((key) => formatValue(token[key], key)), - // @ts-ignore: Intentional dynamic access by key. - ...typeKeys.map((key) => formatValue(token.type[key], key)), - ]; - } - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - function formatValue(value, key) { - if (value === true) { - return key; - } else if (value === false || value === null) { - return ""; - } else { - return String(value); - } - } - - function formatRange(start, end) { - return `${formatPos(start)}-${formatPos(end)}`; - } - - function formatPos(pos) { - const location = lines.locationForIndex(pos); - if (!location) { - return "Unknown"; - } else { - return `${location.line + 1}:${location.column + 1}`; - } - } -} - -function truncate(s, length) { - if (s.length > length) { - return `${s.slice(0, length - 3)}...`; - } else { - return s; - } -} diff --git a/node_modules/sucrase/dist/esm/util/getClassInfo.js b/node_modules/sucrase/dist/esm/util/getClassInfo.js deleted file mode 100644 index 0100ad6..0000000 --- a/node_modules/sucrase/dist/esm/util/getClassInfo.js +++ /dev/null @@ -1,352 +0,0 @@ - - -import {ContextualKeyword} from "../parser/tokenizer/keywords"; -import {TokenType as tt} from "../parser/tokenizer/types"; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/** - * Get information about the class fields for this class, given a token processor pointing to the - * open-brace at the start of the class. - */ -export default function getClassInfo( - rootTransformer, - tokens, - nameManager, - disableESTransforms, -) { - const snapshot = tokens.snapshot(); - - const headerInfo = processClassHeader(tokens); - - let constructorInitializerStatements = []; - const instanceInitializerNames = []; - const staticInitializerNames = []; - let constructorInsertPos = null; - const fields = []; - const rangesToRemove = []; - - const classContextId = tokens.currentToken().contextId; - if (classContextId == null) { - throw new Error("Expected non-null class context ID on class open-brace."); - } - - tokens.nextToken(); - while (!tokens.matchesContextIdAndLabel(tt.braceR, classContextId)) { - if (tokens.matchesContextual(ContextualKeyword._constructor) && !tokens.currentToken().isType) { - ({constructorInitializerStatements, constructorInsertPos} = processConstructor(tokens)); - } else if (tokens.matches1(tt.semi)) { - if (!disableESTransforms) { - rangesToRemove.push({start: tokens.currentIndex(), end: tokens.currentIndex() + 1}); - } - tokens.nextToken(); - } else if (tokens.currentToken().isType) { - tokens.nextToken(); - } else { - // Either a method or a field. Skip to the identifier part. - const statementStartIndex = tokens.currentIndex(); - let isStatic = false; - let isESPrivate = false; - let isDeclareOrAbstract = false; - while (isAccessModifier(tokens.currentToken())) { - if (tokens.matches1(tt._static)) { - isStatic = true; - } - if (tokens.matches1(tt.hash)) { - isESPrivate = true; - } - if (tokens.matches1(tt._declare) || tokens.matches1(tt._abstract)) { - isDeclareOrAbstract = true; - } - tokens.nextToken(); - } - if (isStatic && tokens.matches1(tt.braceL)) { - // This is a static block, so don't process it in any special way. - skipToNextClassElement(tokens, classContextId); - continue; - } - if (isESPrivate) { - // Sucrase doesn't attempt to transpile private fields; just leave them as-is. - skipToNextClassElement(tokens, classContextId); - continue; - } - if ( - tokens.matchesContextual(ContextualKeyword._constructor) && - !tokens.currentToken().isType - ) { - ({constructorInitializerStatements, constructorInsertPos} = processConstructor(tokens)); - continue; - } - - const nameStartIndex = tokens.currentIndex(); - skipFieldName(tokens); - if (tokens.matches1(tt.lessThan) || tokens.matches1(tt.parenL)) { - // This is a method, so nothing to process. - skipToNextClassElement(tokens, classContextId); - continue; - } - // There might be a type annotation that we need to skip. - while (tokens.currentToken().isType) { - tokens.nextToken(); - } - if (tokens.matches1(tt.eq)) { - const equalsIndex = tokens.currentIndex(); - // This is an initializer, so we need to wrap in an initializer method. - const valueEnd = tokens.currentToken().rhsEndIndex; - if (valueEnd == null) { - throw new Error("Expected rhsEndIndex on class field assignment."); - } - tokens.nextToken(); - while (tokens.currentIndex() < valueEnd) { - rootTransformer.processToken(); - } - let initializerName; - if (isStatic) { - initializerName = nameManager.claimFreeName("__initStatic"); - staticInitializerNames.push(initializerName); - } else { - initializerName = nameManager.claimFreeName("__init"); - instanceInitializerNames.push(initializerName); - } - // Fields start at the name, so `static x = 1;` has a field range of `x = 1;`. - fields.push({ - initializerName, - equalsIndex, - start: nameStartIndex, - end: tokens.currentIndex(), - }); - } else if (!disableESTransforms || isDeclareOrAbstract) { - // This is a regular field declaration, like `x;`. With the class transform enabled, we just - // remove the line so that no output is produced. With the class transform disabled, we - // usually want to preserve the declaration (but still strip types), but if the `declare` - // or `abstract` keyword is specified, we should remove the line to avoid initializing the - // value to undefined. - rangesToRemove.push({start: statementStartIndex, end: tokens.currentIndex()}); - } - } - } - - tokens.restoreToSnapshot(snapshot); - if (disableESTransforms) { - // With ES transforms disabled, we don't want to transform regular class - // field declarations, and we don't need to do any additional tricks to - // reference the constructor for static init, but we still need to transform - // TypeScript field initializers defined as constructor parameters and we - // still need to remove `declare` fields. For now, we run the same code - // path but omit any field information, as if the class had no field - // declarations. In the future, when we fully drop the class fields - // transform, we can simplify this code significantly. - return { - headerInfo, - constructorInitializerStatements, - instanceInitializerNames: [], - staticInitializerNames: [], - constructorInsertPos, - fields: [], - rangesToRemove, - }; - } else { - return { - headerInfo, - constructorInitializerStatements, - instanceInitializerNames, - staticInitializerNames, - constructorInsertPos, - fields, - rangesToRemove, - }; - } -} - -/** - * Move the token processor to the next method/field in the class. - * - * To do that, we seek forward to the next start of a class name (either an open - * bracket or an identifier, or the closing curly brace), then seek backward to - * include any access modifiers. - */ -function skipToNextClassElement(tokens, classContextId) { - tokens.nextToken(); - while (tokens.currentToken().contextId !== classContextId) { - tokens.nextToken(); - } - while (isAccessModifier(tokens.tokenAtRelativeIndex(-1))) { - tokens.previousToken(); - } -} - -function processClassHeader(tokens) { - const classToken = tokens.currentToken(); - const contextId = classToken.contextId; - if (contextId == null) { - throw new Error("Expected context ID on class token."); - } - const isExpression = classToken.isExpression; - if (isExpression == null) { - throw new Error("Expected isExpression on class token."); - } - let className = null; - let hasSuperclass = false; - tokens.nextToken(); - if (tokens.matches1(tt.name)) { - className = tokens.identifierName(); - } - while (!tokens.matchesContextIdAndLabel(tt.braceL, contextId)) { - // If this has a superclass, there will always be an `extends` token. If it doesn't have a - // superclass, only type parameters and `implements` clauses can show up here, all of which - // consist only of type tokens. A declaration like `class A {` should *not* count - // as having a superclass. - if (tokens.matches1(tt._extends) && !tokens.currentToken().isType) { - hasSuperclass = true; - } - tokens.nextToken(); - } - return {isExpression, className, hasSuperclass}; -} - -/** - * Extract useful information out of a constructor, starting at the "constructor" name. - */ -function processConstructor(tokens) - - - { - const constructorInitializerStatements = []; - - tokens.nextToken(); - const constructorContextId = tokens.currentToken().contextId; - if (constructorContextId == null) { - throw new Error("Expected context ID on open-paren starting constructor params."); - } - // Advance through parameters looking for access modifiers. - while (!tokens.matchesContextIdAndLabel(tt.parenR, constructorContextId)) { - if (tokens.currentToken().contextId === constructorContextId) { - // Current token is an open paren or comma just before a param, so check - // that param for access modifiers. - tokens.nextToken(); - if (isAccessModifier(tokens.currentToken())) { - tokens.nextToken(); - while (isAccessModifier(tokens.currentToken())) { - tokens.nextToken(); - } - const token = tokens.currentToken(); - if (token.type !== tt.name) { - throw new Error("Expected identifier after access modifiers in constructor arg."); - } - const name = tokens.identifierNameForToken(token); - constructorInitializerStatements.push(`this.${name} = ${name}`); - } - } else { - tokens.nextToken(); - } - } - // ) - tokens.nextToken(); - // Constructor type annotations are invalid, but skip them anyway since - // they're easy to skip. - while (tokens.currentToken().isType) { - tokens.nextToken(); - } - let constructorInsertPos = tokens.currentIndex(); - - // Advance through body looking for a super call. - let foundSuperCall = false; - while (!tokens.matchesContextIdAndLabel(tt.braceR, constructorContextId)) { - if (!foundSuperCall && tokens.matches2(tt._super, tt.parenL)) { - tokens.nextToken(); - const superCallContextId = tokens.currentToken().contextId; - if (superCallContextId == null) { - throw new Error("Expected a context ID on the super call"); - } - while (!tokens.matchesContextIdAndLabel(tt.parenR, superCallContextId)) { - tokens.nextToken(); - } - constructorInsertPos = tokens.currentIndex(); - foundSuperCall = true; - } - tokens.nextToken(); - } - // } - tokens.nextToken(); - - return {constructorInitializerStatements, constructorInsertPos}; -} - -/** - * Determine if this is any token that can go before the name in a method/field. - */ -function isAccessModifier(token) { - return [ - tt._async, - tt._get, - tt._set, - tt.plus, - tt.minus, - tt._readonly, - tt._static, - tt._public, - tt._private, - tt._protected, - tt._override, - tt._abstract, - tt.star, - tt._declare, - tt.hash, - ].includes(token.type); -} - -/** - * The next token or set of tokens is either an identifier or an expression in square brackets, for - * a method or field name. - */ -function skipFieldName(tokens) { - if (tokens.matches1(tt.bracketL)) { - const startToken = tokens.currentToken(); - const classContextId = startToken.contextId; - if (classContextId == null) { - throw new Error("Expected class context ID on computed name open bracket."); - } - while (!tokens.matchesContextIdAndLabel(tt.bracketR, classContextId)) { - tokens.nextToken(); - } - tokens.nextToken(); - } else { - tokens.nextToken(); - } -} diff --git a/node_modules/sucrase/dist/esm/util/getDeclarationInfo.js b/node_modules/sucrase/dist/esm/util/getDeclarationInfo.js deleted file mode 100644 index ade9a81..0000000 --- a/node_modules/sucrase/dist/esm/util/getDeclarationInfo.js +++ /dev/null @@ -1,40 +0,0 @@ -import {isTopLevelDeclaration} from "../parser/tokenizer"; -import {TokenType as tt} from "../parser/tokenizer/types"; - - - - - - - -export const EMPTY_DECLARATION_INFO = { - typeDeclarations: new Set(), - valueDeclarations: new Set(), -}; - -/** - * Get all top-level identifiers that should be preserved when exported in TypeScript. - * - * Examples: - * - If an identifier is declared as `const x`, then `export {x}` should be preserved. - * - If it's declared as `type x`, then `export {x}` should be removed. - * - If it's declared as both `const x` and `type x`, then the export should be preserved. - * - Classes and enums should be preserved (even though they also introduce types). - * - Imported identifiers should be preserved since we don't have enough information to - * rule them out. --isolatedModules disallows re-exports, which catches errors here. - */ -export default function getDeclarationInfo(tokens) { - const typeDeclarations = new Set(); - const valueDeclarations = new Set(); - for (let i = 0; i < tokens.tokens.length; i++) { - const token = tokens.tokens[i]; - if (token.type === tt.name && isTopLevelDeclaration(token)) { - if (token.isType) { - typeDeclarations.add(tokens.identifierNameForToken(token)); - } else { - valueDeclarations.add(tokens.identifierNameForToken(token)); - } - } - } - return {typeDeclarations, valueDeclarations}; -} diff --git a/node_modules/sucrase/dist/esm/util/getIdentifierNames.js b/node_modules/sucrase/dist/esm/util/getIdentifierNames.js deleted file mode 100644 index 5b85901..0000000 --- a/node_modules/sucrase/dist/esm/util/getIdentifierNames.js +++ /dev/null @@ -1,15 +0,0 @@ - -import {TokenType as tt} from "../parser/tokenizer/types"; - -/** - * Get all identifier names in the code, in order, including duplicates. - */ -export default function getIdentifierNames(code, tokens) { - const names = []; - for (const token of tokens) { - if (token.type === tt.name) { - names.push(code.slice(token.start, token.end)); - } - } - return names; -} diff --git a/node_modules/sucrase/dist/esm/util/getImportExportSpecifierInfo.js b/node_modules/sucrase/dist/esm/util/getImportExportSpecifierInfo.js deleted file mode 100644 index 3dc6d2c..0000000 --- a/node_modules/sucrase/dist/esm/util/getImportExportSpecifierInfo.js +++ /dev/null @@ -1,92 +0,0 @@ -import {TokenType as tt} from "../parser/tokenizer/types"; - - - - - - - - - - - - - - - - -/** - * Determine information about this named import or named export specifier. - * - * This syntax is the `a` from statements like these: - * import {A} from "./foo"; - * export {A}; - * export {A} from "./foo"; - * - * As it turns out, we can exactly characterize the syntax meaning by simply - * counting the number of tokens, which can be from 1 to 4: - * {A} - * {type A} - * {A as B} - * {type A as B} - * - * In the type case, we never actually need the names in practice, so don't get - * them. - * - * TODO: There's some redundancy with the type detection here and the isType - * flag that's already present on tokens in TS mode. This function could - * potentially be simplified and/or pushed to the call sites to avoid the object - * allocation. - */ -export default function getImportExportSpecifierInfo( - tokens, - index = tokens.currentIndex(), -) { - let endIndex = index + 1; - if (isSpecifierEnd(tokens, endIndex)) { - // import {A} - const name = tokens.identifierNameAtIndex(index); - return { - isType: false, - leftName: name, - rightName: name, - endIndex, - }; - } - endIndex++; - if (isSpecifierEnd(tokens, endIndex)) { - // import {type A} - return { - isType: true, - leftName: null, - rightName: null, - endIndex, - }; - } - endIndex++; - if (isSpecifierEnd(tokens, endIndex)) { - // import {A as B} - return { - isType: false, - leftName: tokens.identifierNameAtIndex(index), - rightName: tokens.identifierNameAtIndex(index + 2), - endIndex, - }; - } - endIndex++; - if (isSpecifierEnd(tokens, endIndex)) { - // import {type A as B} - return { - isType: true, - leftName: null, - rightName: null, - endIndex, - }; - } - throw new Error(`Unexpected import/export specifier at ${index}`); -} - -function isSpecifierEnd(tokens, index) { - const token = tokens.tokens[index]; - return token.type === tt.braceR || token.type === tt.comma; -} diff --git a/node_modules/sucrase/dist/esm/util/getJSXPragmaInfo.js b/node_modules/sucrase/dist/esm/util/getJSXPragmaInfo.js deleted file mode 100644 index 9972342..0000000 --- a/node_modules/sucrase/dist/esm/util/getJSXPragmaInfo.js +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - -export default function getJSXPragmaInfo(options) { - const [base, suffix] = splitPragma(options.jsxPragma || "React.createElement"); - const [fragmentBase, fragmentSuffix] = splitPragma(options.jsxFragmentPragma || "React.Fragment"); - return {base, suffix, fragmentBase, fragmentSuffix}; -} - -function splitPragma(pragma) { - let dotIndex = pragma.indexOf("."); - if (dotIndex === -1) { - dotIndex = pragma.length; - } - return [pragma.slice(0, dotIndex), pragma.slice(dotIndex)]; -} diff --git a/node_modules/sucrase/dist/esm/util/getNonTypeIdentifiers.js b/node_modules/sucrase/dist/esm/util/getNonTypeIdentifiers.js deleted file mode 100644 index 24c73dd..0000000 --- a/node_modules/sucrase/dist/esm/util/getNonTypeIdentifiers.js +++ /dev/null @@ -1,43 +0,0 @@ - -import {IdentifierRole} from "../parser/tokenizer"; -import {TokenType, TokenType as tt} from "../parser/tokenizer/types"; - -import {startsWithLowerCase} from "../transformers/JSXTransformer"; -import getJSXPragmaInfo from "./getJSXPragmaInfo"; - -export function getNonTypeIdentifiers(tokens, options) { - const jsxPragmaInfo = getJSXPragmaInfo(options); - const nonTypeIdentifiers = new Set(); - for (let i = 0; i < tokens.tokens.length; i++) { - const token = tokens.tokens[i]; - if ( - token.type === tt.name && - !token.isType && - (token.identifierRole === IdentifierRole.Access || - token.identifierRole === IdentifierRole.ObjectShorthand || - token.identifierRole === IdentifierRole.ExportAccess) && - !token.shadowsGlobal - ) { - nonTypeIdentifiers.add(tokens.identifierNameForToken(token)); - } - if (token.type === tt.jsxTagStart) { - nonTypeIdentifiers.add(jsxPragmaInfo.base); - } - if ( - token.type === tt.jsxTagStart && - i + 1 < tokens.tokens.length && - tokens.tokens[i + 1].type === tt.jsxTagEnd - ) { - nonTypeIdentifiers.add(jsxPragmaInfo.base); - nonTypeIdentifiers.add(jsxPragmaInfo.fragmentBase); - } - if (token.type === tt.jsxName && token.identifierRole === IdentifierRole.Access) { - const identifierName = tokens.identifierNameForToken(token); - // Lower-case single-component tag names like "div" don't count. - if (!startsWithLowerCase(identifierName) || tokens.tokens[i + 1].type === TokenType.dot) { - nonTypeIdentifiers.add(tokens.identifierNameForToken(token)); - } - } - } - return nonTypeIdentifiers; -} diff --git a/node_modules/sucrase/dist/esm/util/getTSImportedNames.js b/node_modules/sucrase/dist/esm/util/getTSImportedNames.js deleted file mode 100644 index 523181a..0000000 --- a/node_modules/sucrase/dist/esm/util/getTSImportedNames.js +++ /dev/null @@ -1,84 +0,0 @@ -import {TokenType as tt} from "../parser/tokenizer/types"; - -import getImportExportSpecifierInfo from "./getImportExportSpecifierInfo"; - -/** - * Special case code to scan for imported names in ESM TypeScript. We need to do this so we can - * properly get globals so we can compute shadowed globals. - * - * This is similar to logic in CJSImportProcessor, but trimmed down to avoid logic with CJS - * replacement and flow type imports. - */ -export default function getTSImportedNames(tokens) { - const importedNames = new Set(); - for (let i = 0; i < tokens.tokens.length; i++) { - if ( - tokens.matches1AtIndex(i, tt._import) && - !tokens.matches3AtIndex(i, tt._import, tt.name, tt.eq) - ) { - collectNamesForImport(tokens, i, importedNames); - } - } - return importedNames; -} - -function collectNamesForImport( - tokens, - index, - importedNames, -) { - index++; - - if (tokens.matches1AtIndex(index, tt.parenL)) { - // Dynamic import, so nothing to do - return; - } - - if (tokens.matches1AtIndex(index, tt.name)) { - importedNames.add(tokens.identifierNameAtIndex(index)); - index++; - if (tokens.matches1AtIndex(index, tt.comma)) { - index++; - } - } - - if (tokens.matches1AtIndex(index, tt.star)) { - // * as - index += 2; - importedNames.add(tokens.identifierNameAtIndex(index)); - index++; - } - - if (tokens.matches1AtIndex(index, tt.braceL)) { - index++; - collectNamesForNamedImport(tokens, index, importedNames); - } -} - -function collectNamesForNamedImport( - tokens, - index, - importedNames, -) { - while (true) { - if (tokens.matches1AtIndex(index, tt.braceR)) { - return; - } - - const specifierInfo = getImportExportSpecifierInfo(tokens, index); - index = specifierInfo.endIndex; - if (!specifierInfo.isType) { - importedNames.add(specifierInfo.rightName); - } - - if (tokens.matches2AtIndex(index, tt.comma, tt.braceR)) { - return; - } else if (tokens.matches1AtIndex(index, tt.braceR)) { - return; - } else if (tokens.matches1AtIndex(index, tt.comma)) { - index++; - } else { - throw new Error(`Unexpected token: ${JSON.stringify(tokens.tokens[index])}`); - } - } -} diff --git a/node_modules/sucrase/dist/esm/util/isAsyncOperation.js b/node_modules/sucrase/dist/esm/util/isAsyncOperation.js deleted file mode 100644 index af40e9a..0000000 --- a/node_modules/sucrase/dist/esm/util/isAsyncOperation.js +++ /dev/null @@ -1,38 +0,0 @@ -import {ContextualKeyword} from "../parser/tokenizer/keywords"; - - -/** - * Determine whether this optional chain or nullish coalescing operation has any await statements in - * it. If so, we'll need to transpile to an async operation. - * - * We compute this by walking the length of the operation and returning true if we see an await - * keyword used as a real await (rather than an object key or property access). Nested optional - * chain/nullish operations need to be tracked but don't silence await, but a nested async function - * (or any other nested scope) will make the await not count. - */ -export default function isAsyncOperation(tokens) { - let index = tokens.currentIndex(); - let depth = 0; - const startToken = tokens.currentToken(); - do { - const token = tokens.tokens[index]; - if (token.isOptionalChainStart) { - depth++; - } - if (token.isOptionalChainEnd) { - depth--; - } - depth += token.numNullishCoalesceStarts; - depth -= token.numNullishCoalesceEnds; - - if ( - token.contextualKeyword === ContextualKeyword._await && - token.identifierRole == null && - token.scopeDepth === startToken.scopeDepth - ) { - return true; - } - index += 1; - } while (depth > 0 && index < tokens.tokens.length); - return false; -} diff --git a/node_modules/sucrase/dist/esm/util/isExportFrom.js b/node_modules/sucrase/dist/esm/util/isExportFrom.js deleted file mode 100644 index fd33665..0000000 --- a/node_modules/sucrase/dist/esm/util/isExportFrom.js +++ /dev/null @@ -1,18 +0,0 @@ -import {ContextualKeyword} from "../parser/tokenizer/keywords"; -import {TokenType as tt} from "../parser/tokenizer/types"; - - -/** - * Starting at `export {`, look ahead and return `true` if this is an - * `export {...} from` statement and `false` if this is a plain multi-export. - */ -export default function isExportFrom(tokens) { - let closeBraceIndex = tokens.currentIndex(); - while (!tokens.matches1AtIndex(closeBraceIndex, tt.braceR)) { - closeBraceIndex++; - } - return ( - tokens.matchesContextualAtIndex(closeBraceIndex + 1, ContextualKeyword._from) && - tokens.matches1AtIndex(closeBraceIndex + 2, tt.string) - ); -} diff --git a/node_modules/sucrase/dist/esm/util/isIdentifier.js b/node_modules/sucrase/dist/esm/util/isIdentifier.js deleted file mode 100644 index 4a62ff6..0000000 --- a/node_modules/sucrase/dist/esm/util/isIdentifier.js +++ /dev/null @@ -1,81 +0,0 @@ -import {IS_IDENTIFIER_CHAR, IS_IDENTIFIER_START} from "../parser/util/identifier"; - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar -// Hard-code a list of reserved words rather than trying to use keywords or contextual keywords -// from the parser, since currently there are various exceptions, like `package` being reserved -// but unused and various contextual keywords being reserved. Note that we assume that all code -// compiled by Sucrase is in a module, so strict mode words and await are all considered reserved -// here. -const RESERVED_WORDS = new Set([ - // Reserved keywords as of ECMAScript 2015 - "break", - "case", - "catch", - "class", - "const", - "continue", - "debugger", - "default", - "delete", - "do", - "else", - "export", - "extends", - "finally", - "for", - "function", - "if", - "import", - "in", - "instanceof", - "new", - "return", - "super", - "switch", - "this", - "throw", - "try", - "typeof", - "var", - "void", - "while", - "with", - "yield", - // Future reserved keywords - "enum", - "implements", - "interface", - "let", - "package", - "private", - "protected", - "public", - "static", - "await", - // Literals that cannot be used as identifiers - "false", - "null", - "true", -]); - -/** - * Determine if the given name is a legal variable name. - * - * This is needed when transforming TypeScript enums; if an enum key is a valid - * variable name, it might be referenced later in the enum, so we need to - * declare a variable. - */ -export default function isIdentifier(name) { - if (name.length === 0) { - return false; - } - if (!IS_IDENTIFIER_START[name.charCodeAt(0)]) { - return false; - } - for (let i = 1; i < name.length; i++) { - if (!IS_IDENTIFIER_CHAR[name.charCodeAt(i)]) { - return false; - } - } - return !RESERVED_WORDS.has(name); -} diff --git a/node_modules/sucrase/dist/esm/util/removeMaybeImportAttributes.js b/node_modules/sucrase/dist/esm/util/removeMaybeImportAttributes.js deleted file mode 100644 index abced0e..0000000 --- a/node_modules/sucrase/dist/esm/util/removeMaybeImportAttributes.js +++ /dev/null @@ -1,22 +0,0 @@ -import {ContextualKeyword} from "../parser/tokenizer/keywords"; -import {TokenType as tt} from "../parser/tokenizer/types"; - - -/** - * Starting at a potential `with` or (legacy) `assert` token, remove the import - * attributes if they exist. - */ -export function removeMaybeImportAttributes(tokens) { - if ( - tokens.matches2(tt._with, tt.braceL) || - (tokens.matches2(tt.name, tt.braceL) && tokens.matchesContextual(ContextualKeyword._assert)) - ) { - // assert - tokens.removeToken(); - // { - tokens.removeToken(); - tokens.removeBalancedCode(); - // } - tokens.removeToken(); - } -} diff --git a/node_modules/sucrase/dist/esm/util/shouldElideDefaultExport.js b/node_modules/sucrase/dist/esm/util/shouldElideDefaultExport.js deleted file mode 100644 index d3c4693..0000000 --- a/node_modules/sucrase/dist/esm/util/shouldElideDefaultExport.js +++ /dev/null @@ -1,38 +0,0 @@ -import {TokenType as tt} from "../parser/tokenizer/types"; - - - -/** - * Common method sharing code between CJS and ESM cases, since they're the same here. - */ -export default function shouldElideDefaultExport( - isTypeScriptTransformEnabled, - keepUnusedImports, - tokens, - declarationInfo, -) { - if (!isTypeScriptTransformEnabled || keepUnusedImports) { - return false; - } - const exportToken = tokens.currentToken(); - if (exportToken.rhsEndIndex == null) { - throw new Error("Expected non-null rhsEndIndex on export token."); - } - // The export must be of the form `export default a` or `export default a;`. - const numTokens = exportToken.rhsEndIndex - tokens.currentIndex(); - if ( - numTokens !== 3 && - !(numTokens === 4 && tokens.matches1AtIndex(exportToken.rhsEndIndex - 1, tt.semi)) - ) { - return false; - } - const identifierToken = tokens.tokenAtRelativeIndex(2); - if (identifierToken.type !== tt.name) { - return false; - } - const exportedName = tokens.identifierNameForToken(identifierToken); - return ( - declarationInfo.typeDeclarations.has(exportedName) && - !declarationInfo.valueDeclarations.has(exportedName) - ); -} diff --git a/node_modules/sucrase/dist/identifyShadowedGlobals.js b/node_modules/sucrase/dist/identifyShadowedGlobals.js deleted file mode 100644 index 41c8eef..0000000 --- a/node_modules/sucrase/dist/identifyShadowedGlobals.js +++ /dev/null @@ -1,98 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); - - - -var _tokenizer = require('./parser/tokenizer'); - -var _types = require('./parser/tokenizer/types'); - - -/** - * Traverse the given tokens and modify them if necessary to indicate that some names shadow global - * variables. - */ - function identifyShadowedGlobals( - tokens, - scopes, - globalNames, -) { - if (!hasShadowedGlobals(tokens, globalNames)) { - return; - } - markShadowedGlobals(tokens, scopes, globalNames); -} exports.default = identifyShadowedGlobals; - -/** - * We can do a fast up-front check to see if there are any declarations to global names. If not, - * then there's no point in computing scope assignments. - */ -// Exported for testing. - function hasShadowedGlobals(tokens, globalNames) { - for (const token of tokens.tokens) { - if ( - token.type === _types.TokenType.name && - !token.isType && - _tokenizer.isNonTopLevelDeclaration.call(void 0, token) && - globalNames.has(tokens.identifierNameForToken(token)) - ) { - return true; - } - } - return false; -} exports.hasShadowedGlobals = hasShadowedGlobals; - -function markShadowedGlobals( - tokens, - scopes, - globalNames, -) { - const scopeStack = []; - let scopeIndex = scopes.length - 1; - // Scopes were generated at completion time, so they're sorted by end index, so we can maintain a - // good stack by going backwards through them. - for (let i = tokens.tokens.length - 1; ; i--) { - while (scopeStack.length > 0 && scopeStack[scopeStack.length - 1].startTokenIndex === i + 1) { - scopeStack.pop(); - } - while (scopeIndex >= 0 && scopes[scopeIndex].endTokenIndex === i + 1) { - scopeStack.push(scopes[scopeIndex]); - scopeIndex--; - } - // Process scopes after the last iteration so we can make sure we pop all of them. - if (i < 0) { - break; - } - - const token = tokens.tokens[i]; - const name = tokens.identifierNameForToken(token); - if (scopeStack.length > 1 && !token.isType && token.type === _types.TokenType.name && globalNames.has(name)) { - if (_tokenizer.isBlockScopedDeclaration.call(void 0, token)) { - markShadowedForScope(scopeStack[scopeStack.length - 1], tokens, name); - } else if (_tokenizer.isFunctionScopedDeclaration.call(void 0, token)) { - let stackIndex = scopeStack.length - 1; - while (stackIndex > 0 && !scopeStack[stackIndex].isFunctionScope) { - stackIndex--; - } - if (stackIndex < 0) { - throw new Error("Did not find parent function scope."); - } - markShadowedForScope(scopeStack[stackIndex], tokens, name); - } - } - } - if (scopeStack.length > 0) { - throw new Error("Expected empty scope stack after processing file."); - } -} - -function markShadowedForScope(scope, tokens, name) { - for (let i = scope.startTokenIndex; i < scope.endTokenIndex; i++) { - const token = tokens.tokens[i]; - if ( - (token.type === _types.TokenType.name || token.type === _types.TokenType.jsxName) && - tokens.identifierNameForToken(token) === name - ) { - token.shadowsGlobal = true; - } - } -} diff --git a/node_modules/sucrase/dist/index.js b/node_modules/sucrase/dist/index.js deleted file mode 100644 index 27f963b..0000000 --- a/node_modules/sucrase/dist/index.js +++ /dev/null @@ -1,133 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _CJSImportProcessor = require('./CJSImportProcessor'); var _CJSImportProcessor2 = _interopRequireDefault(_CJSImportProcessor); -var _computeSourceMap = require('./computeSourceMap'); var _computeSourceMap2 = _interopRequireDefault(_computeSourceMap); -var _HelperManager = require('./HelperManager'); -var _identifyShadowedGlobals = require('./identifyShadowedGlobals'); var _identifyShadowedGlobals2 = _interopRequireDefault(_identifyShadowedGlobals); -var _NameManager = require('./NameManager'); var _NameManager2 = _interopRequireDefault(_NameManager); -var _Options = require('./Options'); - -var _parser = require('./parser'); - -var _TokenProcessor = require('./TokenProcessor'); var _TokenProcessor2 = _interopRequireDefault(_TokenProcessor); -var _RootTransformer = require('./transformers/RootTransformer'); var _RootTransformer2 = _interopRequireDefault(_RootTransformer); -var _formatTokens = require('./util/formatTokens'); var _formatTokens2 = _interopRequireDefault(_formatTokens); -var _getTSImportedNames = require('./util/getTSImportedNames'); var _getTSImportedNames2 = _interopRequireDefault(_getTSImportedNames); - - - - - - - - - - - - - - -; - - function getVersion() { - /* istanbul ignore next */ - return "3.35.1"; -} exports.getVersion = getVersion; - - function transform(code, options) { - _Options.validateOptions.call(void 0, options); - try { - const sucraseContext = getSucraseContext(code, options); - const transformer = new (0, _RootTransformer2.default)( - sucraseContext, - options.transforms, - Boolean(options.enableLegacyBabel5ModuleInterop), - options, - ); - const transformerResult = transformer.transform(); - let result = {code: transformerResult.code}; - if (options.sourceMapOptions) { - if (!options.filePath) { - throw new Error("filePath must be specified when generating a source map."); - } - result = { - ...result, - sourceMap: _computeSourceMap2.default.call(void 0, - transformerResult, - options.filePath, - options.sourceMapOptions, - code, - sucraseContext.tokenProcessor.tokens, - ), - }; - } - return result; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } catch (e) { - if (options.filePath) { - e.message = `Error transforming ${options.filePath}: ${e.message}`; - } - throw e; - } -} exports.transform = transform; - -/** - * Return a string representation of the sucrase tokens, mostly useful for - * diagnostic purposes. - */ - function getFormattedTokens(code, options) { - const tokens = getSucraseContext(code, options).tokenProcessor.tokens; - return _formatTokens2.default.call(void 0, code, tokens); -} exports.getFormattedTokens = getFormattedTokens; - -/** - * Call into the parser/tokenizer and do some further preprocessing: - * - Come up with a set of used names so that we can assign new names. - * - Preprocess all import/export statements so we know which globals we are interested in. - * - Compute situations where any of those globals are shadowed. - * - * In the future, some of these preprocessing steps can be skipped based on what actual work is - * being done. - */ -function getSucraseContext(code, options) { - const isJSXEnabled = options.transforms.includes("jsx"); - const isTypeScriptEnabled = options.transforms.includes("typescript"); - const isFlowEnabled = options.transforms.includes("flow"); - const disableESTransforms = options.disableESTransforms === true; - const file = _parser.parse.call(void 0, code, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled); - const tokens = file.tokens; - const scopes = file.scopes; - - const nameManager = new (0, _NameManager2.default)(code, tokens); - const helperManager = new (0, _HelperManager.HelperManager)(nameManager); - const tokenProcessor = new (0, _TokenProcessor2.default)( - code, - tokens, - isFlowEnabled, - disableESTransforms, - helperManager, - ); - const enableLegacyTypeScriptModuleInterop = Boolean(options.enableLegacyTypeScriptModuleInterop); - - let importProcessor = null; - if (options.transforms.includes("imports")) { - importProcessor = new (0, _CJSImportProcessor2.default)( - nameManager, - tokenProcessor, - enableLegacyTypeScriptModuleInterop, - options, - options.transforms.includes("typescript"), - Boolean(options.keepUnusedImports), - helperManager, - ); - importProcessor.preprocessTokens(); - // We need to mark shadowed globals after processing imports so we know that the globals are, - // but before type-only import pruning, since that relies on shadowing information. - _identifyShadowedGlobals2.default.call(void 0, tokenProcessor, scopes, importProcessor.getGlobalNames()); - if (options.transforms.includes("typescript") && !options.keepUnusedImports) { - importProcessor.pruneTypeOnlyImports(); - } - } else if (options.transforms.includes("typescript") && !options.keepUnusedImports) { - // Shadowed global detection is needed for TS implicit elision of imported names. - _identifyShadowedGlobals2.default.call(void 0, tokenProcessor, scopes, _getTSImportedNames2.default.call(void 0, tokenProcessor)); - } - return {tokenProcessor, scopes, nameManager, importProcessor, helperManager}; -} diff --git a/node_modules/sucrase/dist/parser/index.js b/node_modules/sucrase/dist/parser/index.js deleted file mode 100644 index 35d832a..0000000 --- a/node_modules/sucrase/dist/parser/index.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); - -var _base = require('./traverser/base'); -var _index = require('./traverser/index'); - - class File { - - - - constructor(tokens, scopes) { - this.tokens = tokens; - this.scopes = scopes; - } -} exports.File = File; - - function parse( - input, - isJSXEnabled, - isTypeScriptEnabled, - isFlowEnabled, -) { - if (isFlowEnabled && isTypeScriptEnabled) { - throw new Error("Cannot combine flow and typescript plugins."); - } - _base.initParser.call(void 0, input, isJSXEnabled, isTypeScriptEnabled, isFlowEnabled); - const result = _index.parseFile.call(void 0, ); - if (_base.state.error) { - throw _base.augmentError.call(void 0, _base.state.error); - } - return result; -} exports.parse = parse; diff --git a/node_modules/sucrase/dist/parser/plugins/flow.js b/node_modules/sucrase/dist/parser/plugins/flow.js deleted file mode 100644 index 9401895..0000000 --- a/node_modules/sucrase/dist/parser/plugins/flow.js +++ /dev/null @@ -1,1105 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});/* eslint max-len: 0 */ - - - - - - - - - - -var _index = require('../tokenizer/index'); -var _keywords = require('../tokenizer/keywords'); -var _types = require('../tokenizer/types'); -var _base = require('../traverser/base'); - - - - - - - - - - - - - -var _expression = require('../traverser/expression'); - - - - - - - - -var _statement = require('../traverser/statement'); - - - - - - - - - -var _util = require('../traverser/util'); - -function isMaybeDefaultImport(lookahead) { - return ( - (lookahead.type === _types.TokenType.name || !!(lookahead.type & _types.TokenType.IS_KEYWORD)) && - lookahead.contextualKeyword !== _keywords.ContextualKeyword._from - ); -} - -function flowParseTypeInitialiser(tok) { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _util.expect.call(void 0, tok || _types.TokenType.colon); - flowParseType(); - _index.popTypeContext.call(void 0, oldIsType); -} - -function flowParsePredicate() { - _util.expect.call(void 0, _types.TokenType.modulo); - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._checks); - if (_index.eat.call(void 0, _types.TokenType.parenL)) { - _expression.parseExpression.call(void 0, ); - _util.expect.call(void 0, _types.TokenType.parenR); - } -} - -function flowParseTypeAndPredicateInitialiser() { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _util.expect.call(void 0, _types.TokenType.colon); - if (_index.match.call(void 0, _types.TokenType.modulo)) { - flowParsePredicate(); - } else { - flowParseType(); - if (_index.match.call(void 0, _types.TokenType.modulo)) { - flowParsePredicate(); - } - } - _index.popTypeContext.call(void 0, oldIsType); -} - -function flowParseDeclareClass() { - _index.next.call(void 0, ); - flowParseInterfaceish(/* isClass */ true); -} - -function flowParseDeclareFunction() { - _index.next.call(void 0, ); - _expression.parseIdentifier.call(void 0, ); - - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseTypeParameterDeclaration(); - } - - _util.expect.call(void 0, _types.TokenType.parenL); - flowParseFunctionTypeParams(); - _util.expect.call(void 0, _types.TokenType.parenR); - - flowParseTypeAndPredicateInitialiser(); - - _util.semicolon.call(void 0, ); -} - -function flowParseDeclare() { - if (_index.match.call(void 0, _types.TokenType._class)) { - flowParseDeclareClass(); - } else if (_index.match.call(void 0, _types.TokenType._function)) { - flowParseDeclareFunction(); - } else if (_index.match.call(void 0, _types.TokenType._var)) { - flowParseDeclareVariable(); - } else if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._module)) { - if (_index.eat.call(void 0, _types.TokenType.dot)) { - flowParseDeclareModuleExports(); - } else { - flowParseDeclareModule(); - } - } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._type)) { - flowParseDeclareTypeAlias(); - } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._opaque)) { - flowParseDeclareOpaqueType(); - } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._interface)) { - flowParseDeclareInterface(); - } else if (_index.match.call(void 0, _types.TokenType._export)) { - flowParseDeclareExportDeclaration(); - } else { - _util.unexpected.call(void 0, ); - } -} - -function flowParseDeclareVariable() { - _index.next.call(void 0, ); - flowParseTypeAnnotatableIdentifier(); - _util.semicolon.call(void 0, ); -} - -function flowParseDeclareModule() { - if (_index.match.call(void 0, _types.TokenType.string)) { - _expression.parseExprAtom.call(void 0, ); - } else { - _expression.parseIdentifier.call(void 0, ); - } - - _util.expect.call(void 0, _types.TokenType.braceL); - while (!_index.match.call(void 0, _types.TokenType.braceR) && !_base.state.error) { - if (_index.match.call(void 0, _types.TokenType._import)) { - _index.next.call(void 0, ); - _statement.parseImport.call(void 0, ); - } else { - _util.unexpected.call(void 0, ); - } - } - _util.expect.call(void 0, _types.TokenType.braceR); -} - -function flowParseDeclareExportDeclaration() { - _util.expect.call(void 0, _types.TokenType._export); - - if (_index.eat.call(void 0, _types.TokenType._default)) { - if (_index.match.call(void 0, _types.TokenType._function) || _index.match.call(void 0, _types.TokenType._class)) { - // declare export default class ... - // declare export default function ... - flowParseDeclare(); - } else { - // declare export default [type]; - flowParseType(); - _util.semicolon.call(void 0, ); - } - } else if ( - _index.match.call(void 0, _types.TokenType._var) || // declare export var ... - _index.match.call(void 0, _types.TokenType._function) || // declare export function ... - _index.match.call(void 0, _types.TokenType._class) || // declare export class ... - _util.isContextual.call(void 0, _keywords.ContextualKeyword._opaque) // declare export opaque .. - ) { - flowParseDeclare(); - } else if ( - _index.match.call(void 0, _types.TokenType.star) || // declare export * from '' - _index.match.call(void 0, _types.TokenType.braceL) || // declare export {} ... - _util.isContextual.call(void 0, _keywords.ContextualKeyword._interface) || // declare export interface ... - _util.isContextual.call(void 0, _keywords.ContextualKeyword._type) || // declare export type ... - _util.isContextual.call(void 0, _keywords.ContextualKeyword._opaque) // declare export opaque type ... - ) { - _statement.parseExport.call(void 0, ); - } else { - _util.unexpected.call(void 0, ); - } -} - -function flowParseDeclareModuleExports() { - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._exports); - flowParseTypeAnnotation(); - _util.semicolon.call(void 0, ); -} - -function flowParseDeclareTypeAlias() { - _index.next.call(void 0, ); - flowParseTypeAlias(); -} - -function flowParseDeclareOpaqueType() { - _index.next.call(void 0, ); - flowParseOpaqueType(true); -} - -function flowParseDeclareInterface() { - _index.next.call(void 0, ); - flowParseInterfaceish(); -} - -// Interfaces - -function flowParseInterfaceish(isClass = false) { - flowParseRestrictedIdentifier(); - - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseTypeParameterDeclaration(); - } - - if (_index.eat.call(void 0, _types.TokenType._extends)) { - do { - flowParseInterfaceExtends(); - } while (!isClass && _index.eat.call(void 0, _types.TokenType.comma)); - } - - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._mixins)) { - _index.next.call(void 0, ); - do { - flowParseInterfaceExtends(); - } while (_index.eat.call(void 0, _types.TokenType.comma)); - } - - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._implements)) { - _index.next.call(void 0, ); - do { - flowParseInterfaceExtends(); - } while (_index.eat.call(void 0, _types.TokenType.comma)); - } - - flowParseObjectType(isClass, false, isClass); -} - -function flowParseInterfaceExtends() { - flowParseQualifiedTypeIdentifier(false); - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseTypeParameterInstantiation(); - } -} - -function flowParseInterface() { - flowParseInterfaceish(); -} - -function flowParseRestrictedIdentifier() { - _expression.parseIdentifier.call(void 0, ); -} - -function flowParseTypeAlias() { - flowParseRestrictedIdentifier(); - - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseTypeParameterDeclaration(); - } - - flowParseTypeInitialiser(_types.TokenType.eq); - _util.semicolon.call(void 0, ); -} - -function flowParseOpaqueType(declare) { - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._type); - flowParseRestrictedIdentifier(); - - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseTypeParameterDeclaration(); - } - - // Parse the supertype - if (_index.match.call(void 0, _types.TokenType.colon)) { - flowParseTypeInitialiser(_types.TokenType.colon); - } - - if (!declare) { - flowParseTypeInitialiser(_types.TokenType.eq); - } - _util.semicolon.call(void 0, ); -} - -function flowParseTypeParameter() { - flowParseVariance(); - flowParseTypeAnnotatableIdentifier(); - - if (_index.eat.call(void 0, _types.TokenType.eq)) { - flowParseType(); - } -} - - function flowParseTypeParameterDeclaration() { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - // istanbul ignore else: this condition is already checked at all call sites - if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.typeParameterStart)) { - _index.next.call(void 0, ); - } else { - _util.unexpected.call(void 0, ); - } - - do { - flowParseTypeParameter(); - if (!_index.match.call(void 0, _types.TokenType.greaterThan)) { - _util.expect.call(void 0, _types.TokenType.comma); - } - } while (!_index.match.call(void 0, _types.TokenType.greaterThan) && !_base.state.error); - _util.expect.call(void 0, _types.TokenType.greaterThan); - _index.popTypeContext.call(void 0, oldIsType); -} exports.flowParseTypeParameterDeclaration = flowParseTypeParameterDeclaration; - -function flowParseTypeParameterInstantiation() { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _util.expect.call(void 0, _types.TokenType.lessThan); - while (!_index.match.call(void 0, _types.TokenType.greaterThan) && !_base.state.error) { - flowParseType(); - if (!_index.match.call(void 0, _types.TokenType.greaterThan)) { - _util.expect.call(void 0, _types.TokenType.comma); - } - } - _util.expect.call(void 0, _types.TokenType.greaterThan); - _index.popTypeContext.call(void 0, oldIsType); -} - -function flowParseInterfaceType() { - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._interface); - if (_index.eat.call(void 0, _types.TokenType._extends)) { - do { - flowParseInterfaceExtends(); - } while (_index.eat.call(void 0, _types.TokenType.comma)); - } - flowParseObjectType(false, false, false); -} - -function flowParseObjectPropertyKey() { - if (_index.match.call(void 0, _types.TokenType.num) || _index.match.call(void 0, _types.TokenType.string)) { - _expression.parseExprAtom.call(void 0, ); - } else { - _expression.parseIdentifier.call(void 0, ); - } -} - -function flowParseObjectTypeIndexer() { - // Note: bracketL has already been consumed - if (_index.lookaheadType.call(void 0, ) === _types.TokenType.colon) { - flowParseObjectPropertyKey(); - flowParseTypeInitialiser(); - } else { - flowParseType(); - } - _util.expect.call(void 0, _types.TokenType.bracketR); - flowParseTypeInitialiser(); -} - -function flowParseObjectTypeInternalSlot() { - // Note: both bracketL have already been consumed - flowParseObjectPropertyKey(); - _util.expect.call(void 0, _types.TokenType.bracketR); - _util.expect.call(void 0, _types.TokenType.bracketR); - if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.parenL)) { - flowParseObjectTypeMethodish(); - } else { - _index.eat.call(void 0, _types.TokenType.question); - flowParseTypeInitialiser(); - } -} - -function flowParseObjectTypeMethodish() { - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseTypeParameterDeclaration(); - } - - _util.expect.call(void 0, _types.TokenType.parenL); - while (!_index.match.call(void 0, _types.TokenType.parenR) && !_index.match.call(void 0, _types.TokenType.ellipsis) && !_base.state.error) { - flowParseFunctionTypeParam(); - if (!_index.match.call(void 0, _types.TokenType.parenR)) { - _util.expect.call(void 0, _types.TokenType.comma); - } - } - - if (_index.eat.call(void 0, _types.TokenType.ellipsis)) { - flowParseFunctionTypeParam(); - } - _util.expect.call(void 0, _types.TokenType.parenR); - flowParseTypeInitialiser(); -} - -function flowParseObjectTypeCallProperty() { - flowParseObjectTypeMethodish(); -} - -function flowParseObjectType(allowStatic, allowExact, allowProto) { - let endDelim; - if (allowExact && _index.match.call(void 0, _types.TokenType.braceBarL)) { - _util.expect.call(void 0, _types.TokenType.braceBarL); - endDelim = _types.TokenType.braceBarR; - } else { - _util.expect.call(void 0, _types.TokenType.braceL); - endDelim = _types.TokenType.braceR; - } - - while (!_index.match.call(void 0, endDelim) && !_base.state.error) { - if (allowProto && _util.isContextual.call(void 0, _keywords.ContextualKeyword._proto)) { - const lookahead = _index.lookaheadType.call(void 0, ); - if (lookahead !== _types.TokenType.colon && lookahead !== _types.TokenType.question) { - _index.next.call(void 0, ); - allowStatic = false; - } - } - if (allowStatic && _util.isContextual.call(void 0, _keywords.ContextualKeyword._static)) { - const lookahead = _index.lookaheadType.call(void 0, ); - if (lookahead !== _types.TokenType.colon && lookahead !== _types.TokenType.question) { - _index.next.call(void 0, ); - } - } - - flowParseVariance(); - - if (_index.eat.call(void 0, _types.TokenType.bracketL)) { - if (_index.eat.call(void 0, _types.TokenType.bracketL)) { - flowParseObjectTypeInternalSlot(); - } else { - flowParseObjectTypeIndexer(); - } - } else if (_index.match.call(void 0, _types.TokenType.parenL) || _index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseObjectTypeCallProperty(); - } else { - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._get) || _util.isContextual.call(void 0, _keywords.ContextualKeyword._set)) { - const lookahead = _index.lookaheadType.call(void 0, ); - if (lookahead === _types.TokenType.name || lookahead === _types.TokenType.string || lookahead === _types.TokenType.num) { - _index.next.call(void 0, ); - } - } - - flowParseObjectTypeProperty(); - } - - flowObjectTypeSemicolon(); - } - - _util.expect.call(void 0, endDelim); -} - -function flowParseObjectTypeProperty() { - if (_index.match.call(void 0, _types.TokenType.ellipsis)) { - _util.expect.call(void 0, _types.TokenType.ellipsis); - if (!_index.eat.call(void 0, _types.TokenType.comma)) { - _index.eat.call(void 0, _types.TokenType.semi); - } - // Explicit inexact object syntax. - if (_index.match.call(void 0, _types.TokenType.braceR)) { - return; - } - flowParseType(); - } else { - flowParseObjectPropertyKey(); - if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.parenL)) { - // This is a method property - flowParseObjectTypeMethodish(); - } else { - _index.eat.call(void 0, _types.TokenType.question); - flowParseTypeInitialiser(); - } - } -} - -function flowObjectTypeSemicolon() { - if (!_index.eat.call(void 0, _types.TokenType.semi) && !_index.eat.call(void 0, _types.TokenType.comma) && !_index.match.call(void 0, _types.TokenType.braceR) && !_index.match.call(void 0, _types.TokenType.braceBarR)) { - _util.unexpected.call(void 0, ); - } -} - -function flowParseQualifiedTypeIdentifier(initialIdAlreadyParsed) { - if (!initialIdAlreadyParsed) { - _expression.parseIdentifier.call(void 0, ); - } - while (_index.eat.call(void 0, _types.TokenType.dot)) { - _expression.parseIdentifier.call(void 0, ); - } -} - -function flowParseGenericType() { - flowParseQualifiedTypeIdentifier(true); - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseTypeParameterInstantiation(); - } -} - -function flowParseTypeofType() { - _util.expect.call(void 0, _types.TokenType._typeof); - flowParsePrimaryType(); -} - -function flowParseTupleType() { - _util.expect.call(void 0, _types.TokenType.bracketL); - // We allow trailing commas - while (_base.state.pos < _base.input.length && !_index.match.call(void 0, _types.TokenType.bracketR)) { - flowParseType(); - if (_index.match.call(void 0, _types.TokenType.bracketR)) { - break; - } - _util.expect.call(void 0, _types.TokenType.comma); - } - _util.expect.call(void 0, _types.TokenType.bracketR); -} - -function flowParseFunctionTypeParam() { - const lookahead = _index.lookaheadType.call(void 0, ); - if (lookahead === _types.TokenType.colon || lookahead === _types.TokenType.question) { - _expression.parseIdentifier.call(void 0, ); - _index.eat.call(void 0, _types.TokenType.question); - flowParseTypeInitialiser(); - } else { - flowParseType(); - } -} - -function flowParseFunctionTypeParams() { - while (!_index.match.call(void 0, _types.TokenType.parenR) && !_index.match.call(void 0, _types.TokenType.ellipsis) && !_base.state.error) { - flowParseFunctionTypeParam(); - if (!_index.match.call(void 0, _types.TokenType.parenR)) { - _util.expect.call(void 0, _types.TokenType.comma); - } - } - if (_index.eat.call(void 0, _types.TokenType.ellipsis)) { - flowParseFunctionTypeParam(); - } -} - -// The parsing of types roughly parallels the parsing of expressions, and -// primary types are kind of like primary expressions...they're the -// primitives with which other types are constructed. -function flowParsePrimaryType() { - let isGroupedType = false; - const oldNoAnonFunctionType = _base.state.noAnonFunctionType; - - switch (_base.state.type) { - case _types.TokenType.name: { - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._interface)) { - flowParseInterfaceType(); - return; - } - _expression.parseIdentifier.call(void 0, ); - flowParseGenericType(); - return; - } - - case _types.TokenType.braceL: - flowParseObjectType(false, false, false); - return; - - case _types.TokenType.braceBarL: - flowParseObjectType(false, true, false); - return; - - case _types.TokenType.bracketL: - flowParseTupleType(); - return; - - case _types.TokenType.lessThan: - flowParseTypeParameterDeclaration(); - _util.expect.call(void 0, _types.TokenType.parenL); - flowParseFunctionTypeParams(); - _util.expect.call(void 0, _types.TokenType.parenR); - _util.expect.call(void 0, _types.TokenType.arrow); - flowParseType(); - return; - - case _types.TokenType.parenL: - _index.next.call(void 0, ); - - // Check to see if this is actually a grouped type - if (!_index.match.call(void 0, _types.TokenType.parenR) && !_index.match.call(void 0, _types.TokenType.ellipsis)) { - if (_index.match.call(void 0, _types.TokenType.name)) { - const token = _index.lookaheadType.call(void 0, ); - isGroupedType = token !== _types.TokenType.question && token !== _types.TokenType.colon; - } else { - isGroupedType = true; - } - } - - if (isGroupedType) { - _base.state.noAnonFunctionType = false; - flowParseType(); - _base.state.noAnonFunctionType = oldNoAnonFunctionType; - - // A `,` or a `) =>` means this is an anonymous function type - if ( - _base.state.noAnonFunctionType || - !(_index.match.call(void 0, _types.TokenType.comma) || (_index.match.call(void 0, _types.TokenType.parenR) && _index.lookaheadType.call(void 0, ) === _types.TokenType.arrow)) - ) { - _util.expect.call(void 0, _types.TokenType.parenR); - return; - } else { - // Eat a comma if there is one - _index.eat.call(void 0, _types.TokenType.comma); - } - } - - flowParseFunctionTypeParams(); - - _util.expect.call(void 0, _types.TokenType.parenR); - _util.expect.call(void 0, _types.TokenType.arrow); - flowParseType(); - return; - - case _types.TokenType.minus: - _index.next.call(void 0, ); - _expression.parseLiteral.call(void 0, ); - return; - - case _types.TokenType.string: - case _types.TokenType.num: - case _types.TokenType._true: - case _types.TokenType._false: - case _types.TokenType._null: - case _types.TokenType._this: - case _types.TokenType._void: - case _types.TokenType.star: - _index.next.call(void 0, ); - return; - - default: - if (_base.state.type === _types.TokenType._typeof) { - flowParseTypeofType(); - return; - } else if (_base.state.type & _types.TokenType.IS_KEYWORD) { - _index.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType.name; - return; - } - } - - _util.unexpected.call(void 0, ); -} - -function flowParsePostfixType() { - flowParsePrimaryType(); - while (!_util.canInsertSemicolon.call(void 0, ) && (_index.match.call(void 0, _types.TokenType.bracketL) || _index.match.call(void 0, _types.TokenType.questionDot))) { - _index.eat.call(void 0, _types.TokenType.questionDot); - _util.expect.call(void 0, _types.TokenType.bracketL); - if (_index.eat.call(void 0, _types.TokenType.bracketR)) { - // Array type - } else { - // Indexed access type - flowParseType(); - _util.expect.call(void 0, _types.TokenType.bracketR); - } - } -} - -function flowParsePrefixType() { - if (_index.eat.call(void 0, _types.TokenType.question)) { - flowParsePrefixType(); - } else { - flowParsePostfixType(); - } -} - -function flowParseAnonFunctionWithoutParens() { - flowParsePrefixType(); - if (!_base.state.noAnonFunctionType && _index.eat.call(void 0, _types.TokenType.arrow)) { - flowParseType(); - } -} - -function flowParseIntersectionType() { - _index.eat.call(void 0, _types.TokenType.bitwiseAND); - flowParseAnonFunctionWithoutParens(); - while (_index.eat.call(void 0, _types.TokenType.bitwiseAND)) { - flowParseAnonFunctionWithoutParens(); - } -} - -function flowParseUnionType() { - _index.eat.call(void 0, _types.TokenType.bitwiseOR); - flowParseIntersectionType(); - while (_index.eat.call(void 0, _types.TokenType.bitwiseOR)) { - flowParseIntersectionType(); - } -} - -function flowParseType() { - flowParseUnionType(); -} - - function flowParseTypeAnnotation() { - flowParseTypeInitialiser(); -} exports.flowParseTypeAnnotation = flowParseTypeAnnotation; - -function flowParseTypeAnnotatableIdentifier() { - _expression.parseIdentifier.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.colon)) { - flowParseTypeAnnotation(); - } -} - - function flowParseVariance() { - if (_index.match.call(void 0, _types.TokenType.plus) || _index.match.call(void 0, _types.TokenType.minus)) { - _index.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].isType = true; - } -} exports.flowParseVariance = flowParseVariance; - -// ================================== -// Overrides -// ================================== - - function flowParseFunctionBodyAndFinish(funcContextId) { - // For arrow functions, `parseArrow` handles the return type itself. - if (_index.match.call(void 0, _types.TokenType.colon)) { - flowParseTypeAndPredicateInitialiser(); - } - - _expression.parseFunctionBody.call(void 0, false, funcContextId); -} exports.flowParseFunctionBodyAndFinish = flowParseFunctionBodyAndFinish; - - function flowParseSubscript( - startTokenIndex, - noCalls, - stopState, -) { - if (_index.match.call(void 0, _types.TokenType.questionDot) && _index.lookaheadType.call(void 0, ) === _types.TokenType.lessThan) { - if (noCalls) { - stopState.stop = true; - return; - } - _index.next.call(void 0, ); - flowParseTypeParameterInstantiation(); - _util.expect.call(void 0, _types.TokenType.parenL); - _expression.parseCallExpressionArguments.call(void 0, ); - return; - } else if (!noCalls && _index.match.call(void 0, _types.TokenType.lessThan)) { - const snapshot = _base.state.snapshot(); - flowParseTypeParameterInstantiation(); - _util.expect.call(void 0, _types.TokenType.parenL); - _expression.parseCallExpressionArguments.call(void 0, ); - if (_base.state.error) { - _base.state.restoreFromSnapshot(snapshot); - } else { - return; - } - } - _expression.baseParseSubscript.call(void 0, startTokenIndex, noCalls, stopState); -} exports.flowParseSubscript = flowParseSubscript; - - function flowStartParseNewArguments() { - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - const snapshot = _base.state.snapshot(); - flowParseTypeParameterInstantiation(); - if (_base.state.error) { - _base.state.restoreFromSnapshot(snapshot); - } - } -} exports.flowStartParseNewArguments = flowStartParseNewArguments; - -// interfaces - function flowTryParseStatement() { - if (_index.match.call(void 0, _types.TokenType.name) && _base.state.contextualKeyword === _keywords.ContextualKeyword._interface) { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _index.next.call(void 0, ); - flowParseInterface(); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._enum)) { - flowParseEnumDeclaration(); - return true; - } - return false; -} exports.flowTryParseStatement = flowTryParseStatement; - - function flowTryParseExportDefaultExpression() { - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._enum)) { - flowParseEnumDeclaration(); - return true; - } - return false; -} exports.flowTryParseExportDefaultExpression = flowTryParseExportDefaultExpression; - -// declares, interfaces and type aliases - function flowParseIdentifierStatement(contextualKeyword) { - if (contextualKeyword === _keywords.ContextualKeyword._declare) { - if ( - _index.match.call(void 0, _types.TokenType._class) || - _index.match.call(void 0, _types.TokenType.name) || - _index.match.call(void 0, _types.TokenType._function) || - _index.match.call(void 0, _types.TokenType._var) || - _index.match.call(void 0, _types.TokenType._export) - ) { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - flowParseDeclare(); - _index.popTypeContext.call(void 0, oldIsType); - } - } else if (_index.match.call(void 0, _types.TokenType.name)) { - if (contextualKeyword === _keywords.ContextualKeyword._interface) { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - flowParseInterface(); - _index.popTypeContext.call(void 0, oldIsType); - } else if (contextualKeyword === _keywords.ContextualKeyword._type) { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - flowParseTypeAlias(); - _index.popTypeContext.call(void 0, oldIsType); - } else if (contextualKeyword === _keywords.ContextualKeyword._opaque) { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - flowParseOpaqueType(false); - _index.popTypeContext.call(void 0, oldIsType); - } - } - _util.semicolon.call(void 0, ); -} exports.flowParseIdentifierStatement = flowParseIdentifierStatement; - -// export type - function flowShouldParseExportDeclaration() { - return ( - _util.isContextual.call(void 0, _keywords.ContextualKeyword._type) || - _util.isContextual.call(void 0, _keywords.ContextualKeyword._interface) || - _util.isContextual.call(void 0, _keywords.ContextualKeyword._opaque) || - _util.isContextual.call(void 0, _keywords.ContextualKeyword._enum) - ); -} exports.flowShouldParseExportDeclaration = flowShouldParseExportDeclaration; - - function flowShouldDisallowExportDefaultSpecifier() { - return ( - _index.match.call(void 0, _types.TokenType.name) && - (_base.state.contextualKeyword === _keywords.ContextualKeyword._type || - _base.state.contextualKeyword === _keywords.ContextualKeyword._interface || - _base.state.contextualKeyword === _keywords.ContextualKeyword._opaque || - _base.state.contextualKeyword === _keywords.ContextualKeyword._enum) - ); -} exports.flowShouldDisallowExportDefaultSpecifier = flowShouldDisallowExportDefaultSpecifier; - - function flowParseExportDeclaration() { - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._type)) { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - _index.next.call(void 0, ); - - if (_index.match.call(void 0, _types.TokenType.braceL)) { - // export type { foo, bar }; - _statement.parseExportSpecifiers.call(void 0, ); - _statement.parseExportFrom.call(void 0, ); - } else { - // export type Foo = Bar; - flowParseTypeAlias(); - } - _index.popTypeContext.call(void 0, oldIsType); - } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._opaque)) { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - _index.next.call(void 0, ); - // export opaque type Foo = Bar; - flowParseOpaqueType(false); - _index.popTypeContext.call(void 0, oldIsType); - } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._interface)) { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - _index.next.call(void 0, ); - flowParseInterface(); - _index.popTypeContext.call(void 0, oldIsType); - } else { - _statement.parseStatement.call(void 0, true); - } -} exports.flowParseExportDeclaration = flowParseExportDeclaration; - - function flowShouldParseExportStar() { - return _index.match.call(void 0, _types.TokenType.star) || (_util.isContextual.call(void 0, _keywords.ContextualKeyword._type) && _index.lookaheadType.call(void 0, ) === _types.TokenType.star); -} exports.flowShouldParseExportStar = flowShouldParseExportStar; - - function flowParseExportStar() { - if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._type)) { - const oldIsType = _index.pushTypeContext.call(void 0, 2); - _statement.baseParseExportStar.call(void 0, ); - _index.popTypeContext.call(void 0, oldIsType); - } else { - _statement.baseParseExportStar.call(void 0, ); - } -} exports.flowParseExportStar = flowParseExportStar; - -// parse a the super class type parameters and implements - function flowAfterParseClassSuper(hasSuper) { - if (hasSuper && _index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseTypeParameterInstantiation(); - } - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._implements)) { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _index.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._implements; - do { - flowParseRestrictedIdentifier(); - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseTypeParameterInstantiation(); - } - } while (_index.eat.call(void 0, _types.TokenType.comma)); - _index.popTypeContext.call(void 0, oldIsType); - } -} exports.flowAfterParseClassSuper = flowAfterParseClassSuper; - -// parse type parameters for object method shorthand - function flowStartParseObjPropValue() { - // method shorthand - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - flowParseTypeParameterDeclaration(); - if (!_index.match.call(void 0, _types.TokenType.parenL)) _util.unexpected.call(void 0, ); - } -} exports.flowStartParseObjPropValue = flowStartParseObjPropValue; - - function flowParseAssignableListItemTypes() { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _index.eat.call(void 0, _types.TokenType.question); - if (_index.match.call(void 0, _types.TokenType.colon)) { - flowParseTypeAnnotation(); - } - _index.popTypeContext.call(void 0, oldIsType); -} exports.flowParseAssignableListItemTypes = flowParseAssignableListItemTypes; - -// parse typeof and type imports - function flowStartParseImportSpecifiers() { - if (_index.match.call(void 0, _types.TokenType._typeof) || _util.isContextual.call(void 0, _keywords.ContextualKeyword._type)) { - const lh = _index.lookaheadTypeAndKeyword.call(void 0, ); - if (isMaybeDefaultImport(lh) || lh.type === _types.TokenType.braceL || lh.type === _types.TokenType.star) { - _index.next.call(void 0, ); - } - } -} exports.flowStartParseImportSpecifiers = flowStartParseImportSpecifiers; - -// parse import-type/typeof shorthand - function flowParseImportSpecifier() { - const isTypeKeyword = - _base.state.contextualKeyword === _keywords.ContextualKeyword._type || _base.state.type === _types.TokenType._typeof; - if (isTypeKeyword) { - _index.next.call(void 0, ); - } else { - _expression.parseIdentifier.call(void 0, ); - } - - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._as) && !_util.isLookaheadContextual.call(void 0, _keywords.ContextualKeyword._as)) { - _expression.parseIdentifier.call(void 0, ); - if (isTypeKeyword && !_index.match.call(void 0, _types.TokenType.name) && !(_base.state.type & _types.TokenType.IS_KEYWORD)) { - // `import {type as ,` or `import {type as }` - } else { - // `import {type as foo` - _expression.parseIdentifier.call(void 0, ); - } - } else { - if (isTypeKeyword && (_index.match.call(void 0, _types.TokenType.name) || !!(_base.state.type & _types.TokenType.IS_KEYWORD))) { - // `import {type foo` - _expression.parseIdentifier.call(void 0, ); - } - if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._as)) { - _expression.parseIdentifier.call(void 0, ); - } - } -} exports.flowParseImportSpecifier = flowParseImportSpecifier; - -// parse function type parameters - function foo() {} - function flowStartParseFunctionParams() { - // Originally this checked if the method is a getter/setter, but if it was, we'd crash soon - // anyway, so don't try to propagate that information. - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - flowParseTypeParameterDeclaration(); - _index.popTypeContext.call(void 0, oldIsType); - } -} exports.flowStartParseFunctionParams = flowStartParseFunctionParams; - -// parse flow type annotations on variable declarator heads - let foo: string = bar - function flowAfterParseVarHead() { - if (_index.match.call(void 0, _types.TokenType.colon)) { - flowParseTypeAnnotation(); - } -} exports.flowAfterParseVarHead = flowAfterParseVarHead; - -// parse the return type of an async arrow function - let foo = (async (): number => {}); - function flowStartParseAsyncArrowFromCallExpression() { - if (_index.match.call(void 0, _types.TokenType.colon)) { - const oldNoAnonFunctionType = _base.state.noAnonFunctionType; - _base.state.noAnonFunctionType = true; - flowParseTypeAnnotation(); - _base.state.noAnonFunctionType = oldNoAnonFunctionType; - } -} exports.flowStartParseAsyncArrowFromCallExpression = flowStartParseAsyncArrowFromCallExpression; - -// We need to support type parameter declarations for arrow functions. This -// is tricky. There are three situations we need to handle -// -// 1. This is either JSX or an arrow function. We'll try JSX first. If that -// fails, we'll try an arrow function. If that fails, we'll throw the JSX -// error. -// 2. This is an arrow function. We'll parse the type parameter declaration, -// parse the rest, make sure the rest is an arrow function, and go from -// there -// 3. This is neither. Just call the super method - function flowParseMaybeAssign(noIn, isWithinParens) { - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - const snapshot = _base.state.snapshot(); - let wasArrow = _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); - if (_base.state.error) { - _base.state.restoreFromSnapshot(snapshot); - _base.state.type = _types.TokenType.typeParameterStart; - } else { - return wasArrow; - } - - const oldIsType = _index.pushTypeContext.call(void 0, 0); - flowParseTypeParameterDeclaration(); - _index.popTypeContext.call(void 0, oldIsType); - wasArrow = _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); - if (wasArrow) { - return true; - } - _util.unexpected.call(void 0, ); - } - - return _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); -} exports.flowParseMaybeAssign = flowParseMaybeAssign; - -// handle return types for arrow functions - function flowParseArrow() { - if (_index.match.call(void 0, _types.TokenType.colon)) { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - const snapshot = _base.state.snapshot(); - - const oldNoAnonFunctionType = _base.state.noAnonFunctionType; - _base.state.noAnonFunctionType = true; - flowParseTypeAndPredicateInitialiser(); - _base.state.noAnonFunctionType = oldNoAnonFunctionType; - - if (_util.canInsertSemicolon.call(void 0, )) _util.unexpected.call(void 0, ); - if (!_index.match.call(void 0, _types.TokenType.arrow)) _util.unexpected.call(void 0, ); - - if (_base.state.error) { - _base.state.restoreFromSnapshot(snapshot); - } - _index.popTypeContext.call(void 0, oldIsType); - } - return _index.eat.call(void 0, _types.TokenType.arrow); -} exports.flowParseArrow = flowParseArrow; - - function flowParseSubscripts(startTokenIndex, noCalls = false) { - if ( - _base.state.tokens[_base.state.tokens.length - 1].contextualKeyword === _keywords.ContextualKeyword._async && - _index.match.call(void 0, _types.TokenType.lessThan) - ) { - const snapshot = _base.state.snapshot(); - const wasArrow = parseAsyncArrowWithTypeParameters(); - if (wasArrow && !_base.state.error) { - return; - } - _base.state.restoreFromSnapshot(snapshot); - } - - _expression.baseParseSubscripts.call(void 0, startTokenIndex, noCalls); -} exports.flowParseSubscripts = flowParseSubscripts; - -// Returns true if there was an arrow function here. -function parseAsyncArrowWithTypeParameters() { - _base.state.scopeDepth++; - const startTokenIndex = _base.state.tokens.length; - _statement.parseFunctionParams.call(void 0, ); - if (!_expression.parseArrow.call(void 0, )) { - return false; - } - _expression.parseArrowExpression.call(void 0, startTokenIndex); - return true; -} - -function flowParseEnumDeclaration() { - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._enum); - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._enum; - _expression.parseIdentifier.call(void 0, ); - flowParseEnumBody(); -} - -function flowParseEnumBody() { - if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._of)) { - _index.next.call(void 0, ); - } - _util.expect.call(void 0, _types.TokenType.braceL); - flowParseEnumMembers(); - _util.expect.call(void 0, _types.TokenType.braceR); -} - -function flowParseEnumMembers() { - while (!_index.match.call(void 0, _types.TokenType.braceR) && !_base.state.error) { - if (_index.eat.call(void 0, _types.TokenType.ellipsis)) { - break; - } - flowParseEnumMember(); - if (!_index.match.call(void 0, _types.TokenType.braceR)) { - _util.expect.call(void 0, _types.TokenType.comma); - } - } -} - -function flowParseEnumMember() { - _expression.parseIdentifier.call(void 0, ); - if (_index.eat.call(void 0, _types.TokenType.eq)) { - // Flow enum values are always just one token (a string, number, or boolean literal). - _index.next.call(void 0, ); - } -} diff --git a/node_modules/sucrase/dist/parser/plugins/jsx/index.js b/node_modules/sucrase/dist/parser/plugins/jsx/index.js deleted file mode 100644 index 41797de..0000000 --- a/node_modules/sucrase/dist/parser/plugins/jsx/index.js +++ /dev/null @@ -1,367 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); - - - - - - - - - -var _index = require('../../tokenizer/index'); -var _types = require('../../tokenizer/types'); -var _base = require('../../traverser/base'); -var _expression = require('../../traverser/expression'); -var _util = require('../../traverser/util'); -var _charcodes = require('../../util/charcodes'); -var _identifier = require('../../util/identifier'); -var _typescript = require('../typescript'); - -/** - * Read token with JSX contents. - * - * In addition to detecting jsxTagStart and also regular tokens that might be - * part of an expression, this code detects the start and end of text ranges - * within JSX children. In order to properly count the number of children, we - * distinguish jsxText from jsxEmptyText, which is a text range that simplifies - * to the empty string after JSX whitespace trimming. - * - * It turns out that a JSX text range will simplify to the empty string if and - * only if both of these conditions hold: - * - The range consists entirely of whitespace characters (only counting space, - * tab, \r, and \n). - * - The range has at least one newline. - * This can be proven by analyzing any implementation of whitespace trimming, - * e.g. formatJSXTextLiteral in Sucrase or cleanJSXElementLiteralChild in Babel. - */ -function jsxReadToken() { - let sawNewline = false; - let sawNonWhitespace = false; - while (true) { - if (_base.state.pos >= _base.input.length) { - _util.unexpected.call(void 0, "Unterminated JSX contents"); - return; - } - - const ch = _base.input.charCodeAt(_base.state.pos); - if (ch === _charcodes.charCodes.lessThan || ch === _charcodes.charCodes.leftCurlyBrace) { - if (_base.state.pos === _base.state.start) { - if (ch === _charcodes.charCodes.lessThan) { - _base.state.pos++; - _index.finishToken.call(void 0, _types.TokenType.jsxTagStart); - return; - } - _index.getTokenFromCode.call(void 0, ch); - return; - } - if (sawNewline && !sawNonWhitespace) { - _index.finishToken.call(void 0, _types.TokenType.jsxEmptyText); - } else { - _index.finishToken.call(void 0, _types.TokenType.jsxText); - } - return; - } - - // This is part of JSX text. - if (ch === _charcodes.charCodes.lineFeed) { - sawNewline = true; - } else if (ch !== _charcodes.charCodes.space && ch !== _charcodes.charCodes.carriageReturn && ch !== _charcodes.charCodes.tab) { - sawNonWhitespace = true; - } - _base.state.pos++; - } -} - -function jsxReadString(quote) { - _base.state.pos++; - for (;;) { - if (_base.state.pos >= _base.input.length) { - _util.unexpected.call(void 0, "Unterminated string constant"); - return; - } - - const ch = _base.input.charCodeAt(_base.state.pos); - if (ch === quote) { - _base.state.pos++; - break; - } - _base.state.pos++; - } - _index.finishToken.call(void 0, _types.TokenType.string); -} - -// Read a JSX identifier (valid tag or attribute name). -// -// Optimized version since JSX identifiers can't contain -// escape characters and so can be read as single slice. -// Also assumes that first character was already checked -// by isIdentifierStart in readToken. - -function jsxReadWord() { - let ch; - do { - if (_base.state.pos > _base.input.length) { - _util.unexpected.call(void 0, "Unexpectedly reached the end of input."); - return; - } - ch = _base.input.charCodeAt(++_base.state.pos); - } while (_identifier.IS_IDENTIFIER_CHAR[ch] || ch === _charcodes.charCodes.dash); - _index.finishToken.call(void 0, _types.TokenType.jsxName); -} - -// Parse next token as JSX identifier -function jsxParseIdentifier() { - nextJSXTagToken(); -} - -// Parse namespaced identifier. -function jsxParseNamespacedName(identifierRole) { - jsxParseIdentifier(); - if (!_index.eat.call(void 0, _types.TokenType.colon)) { - // Plain identifier, so this is an access. - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = identifierRole; - return; - } - // Process the second half of the namespaced name. - jsxParseIdentifier(); -} - -// Parses element name in any form - namespaced, member -// or single identifier. -function jsxParseElementName() { - const firstTokenIndex = _base.state.tokens.length; - jsxParseNamespacedName(_index.IdentifierRole.Access); - let hadDot = false; - while (_index.match.call(void 0, _types.TokenType.dot)) { - hadDot = true; - nextJSXTagToken(); - jsxParseIdentifier(); - } - // For tags like
with a lowercase letter and no dots, the name is - // actually *not* an identifier access, since it's referring to a built-in - // tag name. Remove the identifier role in this case so that it's not - // accidentally transformed by the imports transform when preserving JSX. - if (!hadDot) { - const firstToken = _base.state.tokens[firstTokenIndex]; - const firstChar = _base.input.charCodeAt(firstToken.start); - if (firstChar >= _charcodes.charCodes.lowercaseA && firstChar <= _charcodes.charCodes.lowercaseZ) { - firstToken.identifierRole = null; - } - } -} - -// Parses any type of JSX attribute value. -function jsxParseAttributeValue() { - switch (_base.state.type) { - case _types.TokenType.braceL: - _index.next.call(void 0, ); - _expression.parseExpression.call(void 0, ); - nextJSXTagToken(); - return; - - case _types.TokenType.jsxTagStart: - jsxParseElement(); - nextJSXTagToken(); - return; - - case _types.TokenType.string: - nextJSXTagToken(); - return; - - default: - _util.unexpected.call(void 0, "JSX value should be either an expression or a quoted JSX text"); - } -} - -// Parse JSX spread child, after already processing the { -// Does not parse the closing } -function jsxParseSpreadChild() { - _util.expect.call(void 0, _types.TokenType.ellipsis); - _expression.parseExpression.call(void 0, ); -} - -// Parses JSX opening tag starting after "<". -// Returns true if the tag was self-closing. -// Does not parse the last token. -function jsxParseOpeningElement(initialTokenIndex) { - if (_index.match.call(void 0, _types.TokenType.jsxTagEnd)) { - // This is an open-fragment. - return false; - } - jsxParseElementName(); - if (_base.isTypeScriptEnabled) { - _typescript.tsTryParseJSXTypeArgument.call(void 0, ); - } - let hasSeenPropSpread = false; - while (!_index.match.call(void 0, _types.TokenType.slash) && !_index.match.call(void 0, _types.TokenType.jsxTagEnd) && !_base.state.error) { - if (_index.eat.call(void 0, _types.TokenType.braceL)) { - hasSeenPropSpread = true; - _util.expect.call(void 0, _types.TokenType.ellipsis); - _expression.parseMaybeAssign.call(void 0, ); - // } - nextJSXTagToken(); - continue; - } - if ( - hasSeenPropSpread && - _base.state.end - _base.state.start === 3 && - _base.input.charCodeAt(_base.state.start) === _charcodes.charCodes.lowercaseK && - _base.input.charCodeAt(_base.state.start + 1) === _charcodes.charCodes.lowercaseE && - _base.input.charCodeAt(_base.state.start + 2) === _charcodes.charCodes.lowercaseY - ) { - _base.state.tokens[initialTokenIndex].jsxRole = _index.JSXRole.KeyAfterPropSpread; - } - jsxParseNamespacedName(_index.IdentifierRole.ObjectKey); - if (_index.match.call(void 0, _types.TokenType.eq)) { - nextJSXTagToken(); - jsxParseAttributeValue(); - } - } - const isSelfClosing = _index.match.call(void 0, _types.TokenType.slash); - if (isSelfClosing) { - // / - nextJSXTagToken(); - } - return isSelfClosing; -} - -// Parses JSX closing tag starting after " 1) { - _base.state.tokens[initialTokenIndex].jsxRole = _index.JSXRole.StaticChildren; - } - } - return; - } - numExplicitChildren++; - jsxParseElementAt(); - nextJSXExprToken(); - break; - - case _types.TokenType.jsxText: - numExplicitChildren++; - nextJSXExprToken(); - break; - - case _types.TokenType.jsxEmptyText: - nextJSXExprToken(); - break; - - case _types.TokenType.braceL: - _index.next.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.ellipsis)) { - jsxParseSpreadChild(); - nextJSXExprToken(); - // Spread children are a mechanism to explicitly mark children as - // static, so count it as 2 children to satisfy the "more than one - // child" condition. - numExplicitChildren += 2; - } else { - // If we see {}, this is an empty pseudo-expression that doesn't - // count as a child. - if (!_index.match.call(void 0, _types.TokenType.braceR)) { - numExplicitChildren++; - _expression.parseExpression.call(void 0, ); - } - nextJSXExprToken(); - } - - break; - - // istanbul ignore next - should never happen - default: - _util.unexpected.call(void 0, ); - return; - } - } - } -} - -// Parses entire JSX element from current position. -// Does not parse the last token. - function jsxParseElement() { - nextJSXTagToken(); - jsxParseElementAt(); -} exports.jsxParseElement = jsxParseElement; - -// ================================== -// Overrides -// ================================== - - function nextJSXTagToken() { - _base.state.tokens.push(new (0, _index.Token)()); - _index.skipSpace.call(void 0, ); - _base.state.start = _base.state.pos; - const code = _base.input.charCodeAt(_base.state.pos); - - if (_identifier.IS_IDENTIFIER_START[code]) { - jsxReadWord(); - } else if (code === _charcodes.charCodes.quotationMark || code === _charcodes.charCodes.apostrophe) { - jsxReadString(code); - } else { - // The following tokens are just one character each. - ++_base.state.pos; - switch (code) { - case _charcodes.charCodes.greaterThan: - _index.finishToken.call(void 0, _types.TokenType.jsxTagEnd); - break; - case _charcodes.charCodes.lessThan: - _index.finishToken.call(void 0, _types.TokenType.jsxTagStart); - break; - case _charcodes.charCodes.slash: - _index.finishToken.call(void 0, _types.TokenType.slash); - break; - case _charcodes.charCodes.equalsTo: - _index.finishToken.call(void 0, _types.TokenType.eq); - break; - case _charcodes.charCodes.leftCurlyBrace: - _index.finishToken.call(void 0, _types.TokenType.braceL); - break; - case _charcodes.charCodes.dot: - _index.finishToken.call(void 0, _types.TokenType.dot); - break; - case _charcodes.charCodes.colon: - _index.finishToken.call(void 0, _types.TokenType.colon); - break; - default: - _util.unexpected.call(void 0, ); - } - } -} exports.nextJSXTagToken = nextJSXTagToken; - -function nextJSXExprToken() { - _base.state.tokens.push(new (0, _index.Token)()); - _base.state.start = _base.state.pos; - jsxReadToken(); -} diff --git a/node_modules/sucrase/dist/parser/plugins/jsx/xhtml.js b/node_modules/sucrase/dist/parser/plugins/jsx/xhtml.js deleted file mode 100644 index d8e91c5..0000000 --- a/node_modules/sucrase/dist/parser/plugins/jsx/xhtml.js +++ /dev/null @@ -1,256 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});// Use a Map rather than object to avoid unexpected __proto__ access. -exports. default = new Map([ - ["quot", "\u0022"], - ["amp", "&"], - ["apos", "\u0027"], - ["lt", "<"], - ["gt", ">"], - ["nbsp", "\u00A0"], - ["iexcl", "\u00A1"], - ["cent", "\u00A2"], - ["pound", "\u00A3"], - ["curren", "\u00A4"], - ["yen", "\u00A5"], - ["brvbar", "\u00A6"], - ["sect", "\u00A7"], - ["uml", "\u00A8"], - ["copy", "\u00A9"], - ["ordf", "\u00AA"], - ["laquo", "\u00AB"], - ["not", "\u00AC"], - ["shy", "\u00AD"], - ["reg", "\u00AE"], - ["macr", "\u00AF"], - ["deg", "\u00B0"], - ["plusmn", "\u00B1"], - ["sup2", "\u00B2"], - ["sup3", "\u00B3"], - ["acute", "\u00B4"], - ["micro", "\u00B5"], - ["para", "\u00B6"], - ["middot", "\u00B7"], - ["cedil", "\u00B8"], - ["sup1", "\u00B9"], - ["ordm", "\u00BA"], - ["raquo", "\u00BB"], - ["frac14", "\u00BC"], - ["frac12", "\u00BD"], - ["frac34", "\u00BE"], - ["iquest", "\u00BF"], - ["Agrave", "\u00C0"], - ["Aacute", "\u00C1"], - ["Acirc", "\u00C2"], - ["Atilde", "\u00C3"], - ["Auml", "\u00C4"], - ["Aring", "\u00C5"], - ["AElig", "\u00C6"], - ["Ccedil", "\u00C7"], - ["Egrave", "\u00C8"], - ["Eacute", "\u00C9"], - ["Ecirc", "\u00CA"], - ["Euml", "\u00CB"], - ["Igrave", "\u00CC"], - ["Iacute", "\u00CD"], - ["Icirc", "\u00CE"], - ["Iuml", "\u00CF"], - ["ETH", "\u00D0"], - ["Ntilde", "\u00D1"], - ["Ograve", "\u00D2"], - ["Oacute", "\u00D3"], - ["Ocirc", "\u00D4"], - ["Otilde", "\u00D5"], - ["Ouml", "\u00D6"], - ["times", "\u00D7"], - ["Oslash", "\u00D8"], - ["Ugrave", "\u00D9"], - ["Uacute", "\u00DA"], - ["Ucirc", "\u00DB"], - ["Uuml", "\u00DC"], - ["Yacute", "\u00DD"], - ["THORN", "\u00DE"], - ["szlig", "\u00DF"], - ["agrave", "\u00E0"], - ["aacute", "\u00E1"], - ["acirc", "\u00E2"], - ["atilde", "\u00E3"], - ["auml", "\u00E4"], - ["aring", "\u00E5"], - ["aelig", "\u00E6"], - ["ccedil", "\u00E7"], - ["egrave", "\u00E8"], - ["eacute", "\u00E9"], - ["ecirc", "\u00EA"], - ["euml", "\u00EB"], - ["igrave", "\u00EC"], - ["iacute", "\u00ED"], - ["icirc", "\u00EE"], - ["iuml", "\u00EF"], - ["eth", "\u00F0"], - ["ntilde", "\u00F1"], - ["ograve", "\u00F2"], - ["oacute", "\u00F3"], - ["ocirc", "\u00F4"], - ["otilde", "\u00F5"], - ["ouml", "\u00F6"], - ["divide", "\u00F7"], - ["oslash", "\u00F8"], - ["ugrave", "\u00F9"], - ["uacute", "\u00FA"], - ["ucirc", "\u00FB"], - ["uuml", "\u00FC"], - ["yacute", "\u00FD"], - ["thorn", "\u00FE"], - ["yuml", "\u00FF"], - ["OElig", "\u0152"], - ["oelig", "\u0153"], - ["Scaron", "\u0160"], - ["scaron", "\u0161"], - ["Yuml", "\u0178"], - ["fnof", "\u0192"], - ["circ", "\u02C6"], - ["tilde", "\u02DC"], - ["Alpha", "\u0391"], - ["Beta", "\u0392"], - ["Gamma", "\u0393"], - ["Delta", "\u0394"], - ["Epsilon", "\u0395"], - ["Zeta", "\u0396"], - ["Eta", "\u0397"], - ["Theta", "\u0398"], - ["Iota", "\u0399"], - ["Kappa", "\u039A"], - ["Lambda", "\u039B"], - ["Mu", "\u039C"], - ["Nu", "\u039D"], - ["Xi", "\u039E"], - ["Omicron", "\u039F"], - ["Pi", "\u03A0"], - ["Rho", "\u03A1"], - ["Sigma", "\u03A3"], - ["Tau", "\u03A4"], - ["Upsilon", "\u03A5"], - ["Phi", "\u03A6"], - ["Chi", "\u03A7"], - ["Psi", "\u03A8"], - ["Omega", "\u03A9"], - ["alpha", "\u03B1"], - ["beta", "\u03B2"], - ["gamma", "\u03B3"], - ["delta", "\u03B4"], - ["epsilon", "\u03B5"], - ["zeta", "\u03B6"], - ["eta", "\u03B7"], - ["theta", "\u03B8"], - ["iota", "\u03B9"], - ["kappa", "\u03BA"], - ["lambda", "\u03BB"], - ["mu", "\u03BC"], - ["nu", "\u03BD"], - ["xi", "\u03BE"], - ["omicron", "\u03BF"], - ["pi", "\u03C0"], - ["rho", "\u03C1"], - ["sigmaf", "\u03C2"], - ["sigma", "\u03C3"], - ["tau", "\u03C4"], - ["upsilon", "\u03C5"], - ["phi", "\u03C6"], - ["chi", "\u03C7"], - ["psi", "\u03C8"], - ["omega", "\u03C9"], - ["thetasym", "\u03D1"], - ["upsih", "\u03D2"], - ["piv", "\u03D6"], - ["ensp", "\u2002"], - ["emsp", "\u2003"], - ["thinsp", "\u2009"], - ["zwnj", "\u200C"], - ["zwj", "\u200D"], - ["lrm", "\u200E"], - ["rlm", "\u200F"], - ["ndash", "\u2013"], - ["mdash", "\u2014"], - ["lsquo", "\u2018"], - ["rsquo", "\u2019"], - ["sbquo", "\u201A"], - ["ldquo", "\u201C"], - ["rdquo", "\u201D"], - ["bdquo", "\u201E"], - ["dagger", "\u2020"], - ["Dagger", "\u2021"], - ["bull", "\u2022"], - ["hellip", "\u2026"], - ["permil", "\u2030"], - ["prime", "\u2032"], - ["Prime", "\u2033"], - ["lsaquo", "\u2039"], - ["rsaquo", "\u203A"], - ["oline", "\u203E"], - ["frasl", "\u2044"], - ["euro", "\u20AC"], - ["image", "\u2111"], - ["weierp", "\u2118"], - ["real", "\u211C"], - ["trade", "\u2122"], - ["alefsym", "\u2135"], - ["larr", "\u2190"], - ["uarr", "\u2191"], - ["rarr", "\u2192"], - ["darr", "\u2193"], - ["harr", "\u2194"], - ["crarr", "\u21B5"], - ["lArr", "\u21D0"], - ["uArr", "\u21D1"], - ["rArr", "\u21D2"], - ["dArr", "\u21D3"], - ["hArr", "\u21D4"], - ["forall", "\u2200"], - ["part", "\u2202"], - ["exist", "\u2203"], - ["empty", "\u2205"], - ["nabla", "\u2207"], - ["isin", "\u2208"], - ["notin", "\u2209"], - ["ni", "\u220B"], - ["prod", "\u220F"], - ["sum", "\u2211"], - ["minus", "\u2212"], - ["lowast", "\u2217"], - ["radic", "\u221A"], - ["prop", "\u221D"], - ["infin", "\u221E"], - ["ang", "\u2220"], - ["and", "\u2227"], - ["or", "\u2228"], - ["cap", "\u2229"], - ["cup", "\u222A"], - ["int", "\u222B"], - ["there4", "\u2234"], - ["sim", "\u223C"], - ["cong", "\u2245"], - ["asymp", "\u2248"], - ["ne", "\u2260"], - ["equiv", "\u2261"], - ["le", "\u2264"], - ["ge", "\u2265"], - ["sub", "\u2282"], - ["sup", "\u2283"], - ["nsub", "\u2284"], - ["sube", "\u2286"], - ["supe", "\u2287"], - ["oplus", "\u2295"], - ["otimes", "\u2297"], - ["perp", "\u22A5"], - ["sdot", "\u22C5"], - ["lceil", "\u2308"], - ["rceil", "\u2309"], - ["lfloor", "\u230A"], - ["rfloor", "\u230B"], - ["lang", "\u2329"], - ["rang", "\u232A"], - ["loz", "\u25CA"], - ["spades", "\u2660"], - ["clubs", "\u2663"], - ["hearts", "\u2665"], - ["diams", "\u2666"], -]); diff --git a/node_modules/sucrase/dist/parser/plugins/types.js b/node_modules/sucrase/dist/parser/plugins/types.js deleted file mode 100644 index c892994..0000000 --- a/node_modules/sucrase/dist/parser/plugins/types.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _index = require('../tokenizer/index'); -var _types = require('../tokenizer/types'); -var _base = require('../traverser/base'); -var _expression = require('../traverser/expression'); -var _flow = require('./flow'); -var _typescript = require('./typescript'); - -/** - * Common parser code for TypeScript and Flow. - */ - -// An apparent conditional expression could actually be an optional parameter in an arrow function. - function typedParseConditional(noIn) { - // If we see ?:, this can't possibly be a valid conditional. typedParseParenItem will be called - // later to finish off the arrow parameter. We also need to handle bare ? tokens for optional - // parameters without type annotations, i.e. ?, and ?) . - if (_index.match.call(void 0, _types.TokenType.question)) { - const nextType = _index.lookaheadType.call(void 0, ); - if (nextType === _types.TokenType.colon || nextType === _types.TokenType.comma || nextType === _types.TokenType.parenR) { - return; - } - } - _expression.baseParseConditional.call(void 0, noIn); -} exports.typedParseConditional = typedParseConditional; - -// Note: These "type casts" are *not* valid TS expressions. -// But we parse them here and change them when completing the arrow function. - function typedParseParenItem() { - _index.eatTypeToken.call(void 0, _types.TokenType.question); - if (_index.match.call(void 0, _types.TokenType.colon)) { - if (_base.isTypeScriptEnabled) { - _typescript.tsParseTypeAnnotation.call(void 0, ); - } else if (_base.isFlowEnabled) { - _flow.flowParseTypeAnnotation.call(void 0, ); - } - } -} exports.typedParseParenItem = typedParseParenItem; diff --git a/node_modules/sucrase/dist/parser/plugins/typescript.js b/node_modules/sucrase/dist/parser/plugins/typescript.js deleted file mode 100644 index d1ec6d3..0000000 --- a/node_modules/sucrase/dist/parser/plugins/typescript.js +++ /dev/null @@ -1,1632 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); - - - - - - - - - - - -var _index = require('../tokenizer/index'); -var _keywords = require('../tokenizer/keywords'); -var _types = require('../tokenizer/types'); -var _base = require('../traverser/base'); - - - - - - - - - - - - - - - -var _expression = require('../traverser/expression'); -var _lval = require('../traverser/lval'); - - - - - - - - -var _statement = require('../traverser/statement'); - - - - - - - - - - - -var _util = require('../traverser/util'); -var _jsx = require('./jsx'); - -function tsIsIdentifier() { - // TODO: actually a bit more complex in TypeScript, but shouldn't matter. - // See https://github.com/Microsoft/TypeScript/issues/15008 - return _index.match.call(void 0, _types.TokenType.name); -} - -function isLiteralPropertyName() { - return ( - _index.match.call(void 0, _types.TokenType.name) || - Boolean(_base.state.type & _types.TokenType.IS_KEYWORD) || - _index.match.call(void 0, _types.TokenType.string) || - _index.match.call(void 0, _types.TokenType.num) || - _index.match.call(void 0, _types.TokenType.bigint) || - _index.match.call(void 0, _types.TokenType.decimal) - ); -} - -function tsNextTokenCanFollowModifier() { - // Note: TypeScript's implementation is much more complicated because - // more things are considered modifiers there. - // This implementation only handles modifiers not handled by babylon itself. And "static". - // TODO: Would be nice to avoid lookahead. Want a hasLineBreakUpNext() method... - const snapshot = _base.state.snapshot(); - - _index.next.call(void 0, ); - const canFollowModifier = - (_index.match.call(void 0, _types.TokenType.bracketL) || - _index.match.call(void 0, _types.TokenType.braceL) || - _index.match.call(void 0, _types.TokenType.star) || - _index.match.call(void 0, _types.TokenType.ellipsis) || - _index.match.call(void 0, _types.TokenType.hash) || - isLiteralPropertyName()) && - !_util.hasPrecedingLineBreak.call(void 0, ); - - if (canFollowModifier) { - return true; - } else { - _base.state.restoreFromSnapshot(snapshot); - return false; - } -} - - function tsParseModifiers(allowedModifiers) { - while (true) { - const modifier = tsParseModifier(allowedModifiers); - if (modifier === null) { - break; - } - } -} exports.tsParseModifiers = tsParseModifiers; - -/** Parses a modifier matching one the given modifier names. */ - function tsParseModifier( - allowedModifiers, -) { - if (!_index.match.call(void 0, _types.TokenType.name)) { - return null; - } - - const modifier = _base.state.contextualKeyword; - if (allowedModifiers.indexOf(modifier) !== -1 && tsNextTokenCanFollowModifier()) { - switch (modifier) { - case _keywords.ContextualKeyword._readonly: - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._readonly; - break; - case _keywords.ContextualKeyword._abstract: - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._abstract; - break; - case _keywords.ContextualKeyword._static: - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._static; - break; - case _keywords.ContextualKeyword._public: - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._public; - break; - case _keywords.ContextualKeyword._private: - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._private; - break; - case _keywords.ContextualKeyword._protected: - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._protected; - break; - case _keywords.ContextualKeyword._override: - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._override; - break; - case _keywords.ContextualKeyword._declare: - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._declare; - break; - default: - break; - } - return modifier; - } - return null; -} exports.tsParseModifier = tsParseModifier; - -function tsParseEntityName() { - _expression.parseIdentifier.call(void 0, ); - while (_index.eat.call(void 0, _types.TokenType.dot)) { - _expression.parseIdentifier.call(void 0, ); - } -} - -function tsParseTypeReference() { - tsParseEntityName(); - if (!_util.hasPrecedingLineBreak.call(void 0, ) && _index.match.call(void 0, _types.TokenType.lessThan)) { - tsParseTypeArguments(); - } -} - -function tsParseThisTypePredicate() { - _index.next.call(void 0, ); - tsParseTypeAnnotation(); -} - -function tsParseThisTypeNode() { - _index.next.call(void 0, ); -} - -function tsParseTypeQuery() { - _util.expect.call(void 0, _types.TokenType._typeof); - if (_index.match.call(void 0, _types.TokenType._import)) { - tsParseImportType(); - } else { - tsParseEntityName(); - } - if (!_util.hasPrecedingLineBreak.call(void 0, ) && _index.match.call(void 0, _types.TokenType.lessThan)) { - tsParseTypeArguments(); - } -} - -function tsParseImportType() { - _util.expect.call(void 0, _types.TokenType._import); - _util.expect.call(void 0, _types.TokenType.parenL); - _util.expect.call(void 0, _types.TokenType.string); - _util.expect.call(void 0, _types.TokenType.parenR); - if (_index.eat.call(void 0, _types.TokenType.dot)) { - tsParseEntityName(); - } - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - tsParseTypeArguments(); - } -} - -function tsParseTypeParameter() { - _index.eat.call(void 0, _types.TokenType._const); - const hadIn = _index.eat.call(void 0, _types.TokenType._in); - const hadOut = _util.eatContextual.call(void 0, _keywords.ContextualKeyword._out); - _index.eat.call(void 0, _types.TokenType._const); - if ((hadIn || hadOut) && !_index.match.call(void 0, _types.TokenType.name)) { - // The "in" or "out" keyword must have actually been the type parameter - // name, so set it as the name. - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType.name; - } else { - _expression.parseIdentifier.call(void 0, ); - } - - if (_index.eat.call(void 0, _types.TokenType._extends)) { - tsParseType(); - } - if (_index.eat.call(void 0, _types.TokenType.eq)) { - tsParseType(); - } -} - - function tsTryParseTypeParameters() { - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - tsParseTypeParameters(); - } -} exports.tsTryParseTypeParameters = tsTryParseTypeParameters; - -function tsParseTypeParameters() { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.typeParameterStart)) { - _index.next.call(void 0, ); - } else { - _util.unexpected.call(void 0, ); - } - - while (!_index.eat.call(void 0, _types.TokenType.greaterThan) && !_base.state.error) { - tsParseTypeParameter(); - _index.eat.call(void 0, _types.TokenType.comma); - } - _index.popTypeContext.call(void 0, oldIsType); -} - -// Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`, -// but here it's always false, because this is only used for types. -function tsFillSignature(returnToken) { - // Arrow fns *must* have return token (`=>`). Normal functions can omit it. - const returnTokenRequired = returnToken === _types.TokenType.arrow; - tsTryParseTypeParameters(); - _util.expect.call(void 0, _types.TokenType.parenL); - // Create a scope even though we're doing type parsing so we don't accidentally - // treat params as top-level bindings. - _base.state.scopeDepth++; - tsParseBindingListForSignature(false /* isBlockScope */); - _base.state.scopeDepth--; - if (returnTokenRequired) { - tsParseTypeOrTypePredicateAnnotation(returnToken); - } else if (_index.match.call(void 0, returnToken)) { - tsParseTypeOrTypePredicateAnnotation(returnToken); - } -} - -function tsParseBindingListForSignature(isBlockScope) { - _lval.parseBindingList.call(void 0, _types.TokenType.parenR, isBlockScope); -} - -function tsParseTypeMemberSemicolon() { - if (!_index.eat.call(void 0, _types.TokenType.comma)) { - _util.semicolon.call(void 0, ); - } -} - -function tsParseSignatureMember() { - tsFillSignature(_types.TokenType.colon); - tsParseTypeMemberSemicolon(); -} - -function tsIsUnambiguouslyIndexSignature() { - const snapshot = _base.state.snapshot(); - _index.next.call(void 0, ); // Skip '{' - const isIndexSignature = _index.eat.call(void 0, _types.TokenType.name) && _index.match.call(void 0, _types.TokenType.colon); - _base.state.restoreFromSnapshot(snapshot); - return isIndexSignature; -} - -function tsTryParseIndexSignature() { - if (!(_index.match.call(void 0, _types.TokenType.bracketL) && tsIsUnambiguouslyIndexSignature())) { - return false; - } - - const oldIsType = _index.pushTypeContext.call(void 0, 0); - - _util.expect.call(void 0, _types.TokenType.bracketL); - _expression.parseIdentifier.call(void 0, ); - tsParseTypeAnnotation(); - _util.expect.call(void 0, _types.TokenType.bracketR); - - tsTryParseTypeAnnotation(); - tsParseTypeMemberSemicolon(); - - _index.popTypeContext.call(void 0, oldIsType); - return true; -} - -function tsParsePropertyOrMethodSignature(isReadonly) { - _index.eat.call(void 0, _types.TokenType.question); - - if (!isReadonly && (_index.match.call(void 0, _types.TokenType.parenL) || _index.match.call(void 0, _types.TokenType.lessThan))) { - tsFillSignature(_types.TokenType.colon); - tsParseTypeMemberSemicolon(); - } else { - tsTryParseTypeAnnotation(); - tsParseTypeMemberSemicolon(); - } -} - -function tsParseTypeMember() { - if (_index.match.call(void 0, _types.TokenType.parenL) || _index.match.call(void 0, _types.TokenType.lessThan)) { - // call signature - tsParseSignatureMember(); - return; - } - if (_index.match.call(void 0, _types.TokenType._new)) { - _index.next.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.parenL) || _index.match.call(void 0, _types.TokenType.lessThan)) { - // constructor signature - tsParseSignatureMember(); - } else { - tsParsePropertyOrMethodSignature(false); - } - return; - } - const readonly = !!tsParseModifier([_keywords.ContextualKeyword._readonly]); - - const found = tsTryParseIndexSignature(); - if (found) { - return; - } - if ( - (_util.isContextual.call(void 0, _keywords.ContextualKeyword._get) || _util.isContextual.call(void 0, _keywords.ContextualKeyword._set)) && - tsNextTokenCanFollowModifier() - ) { - // This is a getter/setter on a type. The tsNextTokenCanFollowModifier - // function already called next() for us, so continue parsing the name. - } - _expression.parsePropertyName.call(void 0, -1 /* Types don't need context IDs. */); - tsParsePropertyOrMethodSignature(readonly); -} - -function tsParseTypeLiteral() { - tsParseObjectTypeMembers(); -} - -function tsParseObjectTypeMembers() { - _util.expect.call(void 0, _types.TokenType.braceL); - while (!_index.eat.call(void 0, _types.TokenType.braceR) && !_base.state.error) { - tsParseTypeMember(); - } -} - -function tsLookaheadIsStartOfMappedType() { - const snapshot = _base.state.snapshot(); - const isStartOfMappedType = tsIsStartOfMappedType(); - _base.state.restoreFromSnapshot(snapshot); - return isStartOfMappedType; -} - -function tsIsStartOfMappedType() { - _index.next.call(void 0, ); - if (_index.eat.call(void 0, _types.TokenType.plus) || _index.eat.call(void 0, _types.TokenType.minus)) { - return _util.isContextual.call(void 0, _keywords.ContextualKeyword._readonly); - } - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._readonly)) { - _index.next.call(void 0, ); - } - if (!_index.match.call(void 0, _types.TokenType.bracketL)) { - return false; - } - _index.next.call(void 0, ); - if (!tsIsIdentifier()) { - return false; - } - _index.next.call(void 0, ); - return _index.match.call(void 0, _types.TokenType._in); -} - -function tsParseMappedTypeParameter() { - _expression.parseIdentifier.call(void 0, ); - _util.expect.call(void 0, _types.TokenType._in); - tsParseType(); -} - -function tsParseMappedType() { - _util.expect.call(void 0, _types.TokenType.braceL); - if (_index.match.call(void 0, _types.TokenType.plus) || _index.match.call(void 0, _types.TokenType.minus)) { - _index.next.call(void 0, ); - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._readonly); - } else { - _util.eatContextual.call(void 0, _keywords.ContextualKeyword._readonly); - } - _util.expect.call(void 0, _types.TokenType.bracketL); - tsParseMappedTypeParameter(); - if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._as)) { - tsParseType(); - } - _util.expect.call(void 0, _types.TokenType.bracketR); - if (_index.match.call(void 0, _types.TokenType.plus) || _index.match.call(void 0, _types.TokenType.minus)) { - _index.next.call(void 0, ); - _util.expect.call(void 0, _types.TokenType.question); - } else { - _index.eat.call(void 0, _types.TokenType.question); - } - tsTryParseType(); - _util.semicolon.call(void 0, ); - _util.expect.call(void 0, _types.TokenType.braceR); -} - -function tsParseTupleType() { - _util.expect.call(void 0, _types.TokenType.bracketL); - while (!_index.eat.call(void 0, _types.TokenType.bracketR) && !_base.state.error) { - // Do not validate presence of either none or only labeled elements - tsParseTupleElementType(); - _index.eat.call(void 0, _types.TokenType.comma); - } -} - -function tsParseTupleElementType() { - // parses `...TsType[]` - if (_index.eat.call(void 0, _types.TokenType.ellipsis)) { - tsParseType(); - } else { - // parses `TsType?` - tsParseType(); - _index.eat.call(void 0, _types.TokenType.question); - } - - // The type we parsed above was actually a label - if (_index.eat.call(void 0, _types.TokenType.colon)) { - // Labeled tuple types must affix the label with `...` or `?`, so no need to handle those here - tsParseType(); - } -} - -function tsParseParenthesizedType() { - _util.expect.call(void 0, _types.TokenType.parenL); - tsParseType(); - _util.expect.call(void 0, _types.TokenType.parenR); -} - -function tsParseTemplateLiteralType() { - // Finish `, read quasi - _index.nextTemplateToken.call(void 0, ); - // Finish quasi, read ${ - _index.nextTemplateToken.call(void 0, ); - while (!_index.match.call(void 0, _types.TokenType.backQuote) && !_base.state.error) { - _util.expect.call(void 0, _types.TokenType.dollarBraceL); - tsParseType(); - // Finish }, read quasi - _index.nextTemplateToken.call(void 0, ); - // Finish quasi, read either ${ or ` - _index.nextTemplateToken.call(void 0, ); - } - _index.next.call(void 0, ); -} - -var FunctionType; (function (FunctionType) { - const TSFunctionType = 0; FunctionType[FunctionType["TSFunctionType"] = TSFunctionType] = "TSFunctionType"; - const TSConstructorType = TSFunctionType + 1; FunctionType[FunctionType["TSConstructorType"] = TSConstructorType] = "TSConstructorType"; - const TSAbstractConstructorType = TSConstructorType + 1; FunctionType[FunctionType["TSAbstractConstructorType"] = TSAbstractConstructorType] = "TSAbstractConstructorType"; -})(FunctionType || (FunctionType = {})); - -function tsParseFunctionOrConstructorType(type) { - if (type === FunctionType.TSAbstractConstructorType) { - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._abstract); - } - if (type === FunctionType.TSConstructorType || type === FunctionType.TSAbstractConstructorType) { - _util.expect.call(void 0, _types.TokenType._new); - } - const oldInDisallowConditionalTypesContext = _base.state.inDisallowConditionalTypesContext; - _base.state.inDisallowConditionalTypesContext = false; - tsFillSignature(_types.TokenType.arrow); - _base.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; -} - -function tsParseNonArrayType() { - switch (_base.state.type) { - case _types.TokenType.name: - tsParseTypeReference(); - return; - case _types.TokenType._void: - case _types.TokenType._null: - _index.next.call(void 0, ); - return; - case _types.TokenType.string: - case _types.TokenType.num: - case _types.TokenType.bigint: - case _types.TokenType.decimal: - case _types.TokenType._true: - case _types.TokenType._false: - _expression.parseLiteral.call(void 0, ); - return; - case _types.TokenType.minus: - _index.next.call(void 0, ); - _expression.parseLiteral.call(void 0, ); - return; - case _types.TokenType._this: { - tsParseThisTypeNode(); - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._is) && !_util.hasPrecedingLineBreak.call(void 0, )) { - tsParseThisTypePredicate(); - } - return; - } - case _types.TokenType._typeof: - tsParseTypeQuery(); - return; - case _types.TokenType._import: - tsParseImportType(); - return; - case _types.TokenType.braceL: - if (tsLookaheadIsStartOfMappedType()) { - tsParseMappedType(); - } else { - tsParseTypeLiteral(); - } - return; - case _types.TokenType.bracketL: - tsParseTupleType(); - return; - case _types.TokenType.parenL: - tsParseParenthesizedType(); - return; - case _types.TokenType.backQuote: - tsParseTemplateLiteralType(); - return; - default: - if (_base.state.type & _types.TokenType.IS_KEYWORD) { - _index.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType.name; - return; - } - break; - } - - _util.unexpected.call(void 0, ); -} - -function tsParseArrayTypeOrHigher() { - tsParseNonArrayType(); - while (!_util.hasPrecedingLineBreak.call(void 0, ) && _index.eat.call(void 0, _types.TokenType.bracketL)) { - if (!_index.eat.call(void 0, _types.TokenType.bracketR)) { - // If we hit ] immediately, this is an array type, otherwise it's an indexed access type. - tsParseType(); - _util.expect.call(void 0, _types.TokenType.bracketR); - } - } -} - -function tsParseInferType() { - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._infer); - _expression.parseIdentifier.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType._extends)) { - // Infer type constraints introduce an ambiguity about whether the "extends" - // is a constraint for this infer type or is another conditional type. - const snapshot = _base.state.snapshot(); - _util.expect.call(void 0, _types.TokenType._extends); - const oldInDisallowConditionalTypesContext = _base.state.inDisallowConditionalTypesContext; - _base.state.inDisallowConditionalTypesContext = true; - tsParseType(); - _base.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; - if (_base.state.error || (!_base.state.inDisallowConditionalTypesContext && _index.match.call(void 0, _types.TokenType.question))) { - _base.state.restoreFromSnapshot(snapshot); - } - } -} - -function tsParseTypeOperatorOrHigher() { - if ( - _util.isContextual.call(void 0, _keywords.ContextualKeyword._keyof) || - _util.isContextual.call(void 0, _keywords.ContextualKeyword._unique) || - _util.isContextual.call(void 0, _keywords.ContextualKeyword._readonly) - ) { - _index.next.call(void 0, ); - tsParseTypeOperatorOrHigher(); - } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._infer)) { - tsParseInferType(); - } else { - const oldInDisallowConditionalTypesContext = _base.state.inDisallowConditionalTypesContext; - _base.state.inDisallowConditionalTypesContext = false; - tsParseArrayTypeOrHigher(); - _base.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; - } -} - -function tsParseIntersectionTypeOrHigher() { - _index.eat.call(void 0, _types.TokenType.bitwiseAND); - tsParseTypeOperatorOrHigher(); - if (_index.match.call(void 0, _types.TokenType.bitwiseAND)) { - while (_index.eat.call(void 0, _types.TokenType.bitwiseAND)) { - tsParseTypeOperatorOrHigher(); - } - } -} - -function tsParseUnionTypeOrHigher() { - _index.eat.call(void 0, _types.TokenType.bitwiseOR); - tsParseIntersectionTypeOrHigher(); - if (_index.match.call(void 0, _types.TokenType.bitwiseOR)) { - while (_index.eat.call(void 0, _types.TokenType.bitwiseOR)) { - tsParseIntersectionTypeOrHigher(); - } - } -} - -function tsIsStartOfFunctionType() { - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - return true; - } - return _index.match.call(void 0, _types.TokenType.parenL) && tsLookaheadIsUnambiguouslyStartOfFunctionType(); -} - -function tsSkipParameterStart() { - if (_index.match.call(void 0, _types.TokenType.name) || _index.match.call(void 0, _types.TokenType._this)) { - _index.next.call(void 0, ); - return true; - } - // If this is a possible array/object destructure, walk to the matching bracket/brace. - // The next token after will tell us definitively whether this is a function param. - if (_index.match.call(void 0, _types.TokenType.braceL) || _index.match.call(void 0, _types.TokenType.bracketL)) { - let depth = 1; - _index.next.call(void 0, ); - while (depth > 0 && !_base.state.error) { - if (_index.match.call(void 0, _types.TokenType.braceL) || _index.match.call(void 0, _types.TokenType.bracketL)) { - depth++; - } else if (_index.match.call(void 0, _types.TokenType.braceR) || _index.match.call(void 0, _types.TokenType.bracketR)) { - depth--; - } - _index.next.call(void 0, ); - } - return true; - } - return false; -} - -function tsLookaheadIsUnambiguouslyStartOfFunctionType() { - const snapshot = _base.state.snapshot(); - const isUnambiguouslyStartOfFunctionType = tsIsUnambiguouslyStartOfFunctionType(); - _base.state.restoreFromSnapshot(snapshot); - return isUnambiguouslyStartOfFunctionType; -} - -function tsIsUnambiguouslyStartOfFunctionType() { - _index.next.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.parenR) || _index.match.call(void 0, _types.TokenType.ellipsis)) { - // ( ) - // ( ... - return true; - } - if (tsSkipParameterStart()) { - if (_index.match.call(void 0, _types.TokenType.colon) || _index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.question) || _index.match.call(void 0, _types.TokenType.eq)) { - // ( xxx : - // ( xxx , - // ( xxx ? - // ( xxx = - return true; - } - if (_index.match.call(void 0, _types.TokenType.parenR)) { - _index.next.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.arrow)) { - // ( xxx ) => - return true; - } - } - } - return false; -} - -function tsParseTypeOrTypePredicateAnnotation(returnToken) { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _util.expect.call(void 0, returnToken); - const finishedReturn = tsParseTypePredicateOrAssertsPrefix(); - if (!finishedReturn) { - tsParseType(); - } - _index.popTypeContext.call(void 0, oldIsType); -} - -function tsTryParseTypeOrTypePredicateAnnotation() { - if (_index.match.call(void 0, _types.TokenType.colon)) { - tsParseTypeOrTypePredicateAnnotation(_types.TokenType.colon); - } -} - - function tsTryParseTypeAnnotation() { - if (_index.match.call(void 0, _types.TokenType.colon)) { - tsParseTypeAnnotation(); - } -} exports.tsTryParseTypeAnnotation = tsTryParseTypeAnnotation; - -function tsTryParseType() { - if (_index.eat.call(void 0, _types.TokenType.colon)) { - tsParseType(); - } -} - -/** - * Detect a few special return syntax cases: `x is T`, `asserts x`, `asserts x is T`, - * `asserts this is T`. - * - * Returns true if we parsed the return type, false if there's still a type to be parsed. - */ -function tsParseTypePredicateOrAssertsPrefix() { - const snapshot = _base.state.snapshot(); - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._asserts)) { - // Normally this is `asserts x is T`, but at this point, it might be `asserts is T` (a user- - // defined type guard on the `asserts` variable) or just a type called `asserts`. - _index.next.call(void 0, ); - if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._is)) { - // If we see `asserts is`, then this must be of the form `asserts is T`, since - // `asserts is is T` isn't valid. - tsParseType(); - return true; - } else if (tsIsIdentifier() || _index.match.call(void 0, _types.TokenType._this)) { - _index.next.call(void 0, ); - if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._is)) { - // If we see `is`, then this is `asserts x is T`. Otherwise, it's `asserts x`. - tsParseType(); - } - return true; - } else { - // Regular type, so bail out and start type parsing from scratch. - _base.state.restoreFromSnapshot(snapshot); - return false; - } - } else if (tsIsIdentifier() || _index.match.call(void 0, _types.TokenType._this)) { - // This is a regular identifier, which may or may not have "is" after it. - _index.next.call(void 0, ); - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._is) && !_util.hasPrecedingLineBreak.call(void 0, )) { - _index.next.call(void 0, ); - tsParseType(); - return true; - } else { - // Regular type, so bail out and start type parsing from scratch. - _base.state.restoreFromSnapshot(snapshot); - return false; - } - } - return false; -} - - function tsParseTypeAnnotation() { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _util.expect.call(void 0, _types.TokenType.colon); - tsParseType(); - _index.popTypeContext.call(void 0, oldIsType); -} exports.tsParseTypeAnnotation = tsParseTypeAnnotation; - - function tsParseType() { - tsParseNonConditionalType(); - if (_base.state.inDisallowConditionalTypesContext || _util.hasPrecedingLineBreak.call(void 0, ) || !_index.eat.call(void 0, _types.TokenType._extends)) { - return; - } - // extends type - const oldInDisallowConditionalTypesContext = _base.state.inDisallowConditionalTypesContext; - _base.state.inDisallowConditionalTypesContext = true; - tsParseNonConditionalType(); - _base.state.inDisallowConditionalTypesContext = oldInDisallowConditionalTypesContext; - - _util.expect.call(void 0, _types.TokenType.question); - // true type - tsParseType(); - _util.expect.call(void 0, _types.TokenType.colon); - // false type - tsParseType(); -} exports.tsParseType = tsParseType; - -function isAbstractConstructorSignature() { - return _util.isContextual.call(void 0, _keywords.ContextualKeyword._abstract) && _index.lookaheadType.call(void 0, ) === _types.TokenType._new; -} - - function tsParseNonConditionalType() { - if (tsIsStartOfFunctionType()) { - tsParseFunctionOrConstructorType(FunctionType.TSFunctionType); - return; - } - if (_index.match.call(void 0, _types.TokenType._new)) { - // As in `new () => Date` - tsParseFunctionOrConstructorType(FunctionType.TSConstructorType); - return; - } else if (isAbstractConstructorSignature()) { - // As in `abstract new () => Date` - tsParseFunctionOrConstructorType(FunctionType.TSAbstractConstructorType); - return; - } - tsParseUnionTypeOrHigher(); -} exports.tsParseNonConditionalType = tsParseNonConditionalType; - - function tsParseTypeAssertion() { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - tsParseType(); - _util.expect.call(void 0, _types.TokenType.greaterThan); - _index.popTypeContext.call(void 0, oldIsType); - _expression.parseMaybeUnary.call(void 0, ); -} exports.tsParseTypeAssertion = tsParseTypeAssertion; - - function tsTryParseJSXTypeArgument() { - if (_index.eat.call(void 0, _types.TokenType.jsxTagStart)) { - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType.typeParameterStart; - const oldIsType = _index.pushTypeContext.call(void 0, 1); - while (!_index.match.call(void 0, _types.TokenType.greaterThan) && !_base.state.error) { - tsParseType(); - _index.eat.call(void 0, _types.TokenType.comma); - } - // Process >, but the one after needs to be parsed JSX-style. - _jsx.nextJSXTagToken.call(void 0, ); - _index.popTypeContext.call(void 0, oldIsType); - } -} exports.tsTryParseJSXTypeArgument = tsTryParseJSXTypeArgument; - -function tsParseHeritageClause() { - while (!_index.match.call(void 0, _types.TokenType.braceL) && !_base.state.error) { - tsParseExpressionWithTypeArguments(); - _index.eat.call(void 0, _types.TokenType.comma); - } -} - -function tsParseExpressionWithTypeArguments() { - // Note: TS uses parseLeftHandSideExpressionOrHigher, - // then has grammar errors later if it's not an EntityName. - tsParseEntityName(); - if (_index.match.call(void 0, _types.TokenType.lessThan)) { - tsParseTypeArguments(); - } -} - -function tsParseInterfaceDeclaration() { - _lval.parseBindingIdentifier.call(void 0, false); - tsTryParseTypeParameters(); - if (_index.eat.call(void 0, _types.TokenType._extends)) { - tsParseHeritageClause(); - } - tsParseObjectTypeMembers(); -} - -function tsParseTypeAliasDeclaration() { - _lval.parseBindingIdentifier.call(void 0, false); - tsTryParseTypeParameters(); - _util.expect.call(void 0, _types.TokenType.eq); - tsParseType(); - _util.semicolon.call(void 0, ); -} - -function tsParseEnumMember() { - // Computed property names are grammar errors in an enum, so accept just string literal or identifier. - if (_index.match.call(void 0, _types.TokenType.string)) { - _expression.parseLiteral.call(void 0, ); - } else { - _expression.parseIdentifier.call(void 0, ); - } - if (_index.eat.call(void 0, _types.TokenType.eq)) { - const eqIndex = _base.state.tokens.length - 1; - _expression.parseMaybeAssign.call(void 0, ); - _base.state.tokens[eqIndex].rhsEndIndex = _base.state.tokens.length; - } -} - -function tsParseEnumDeclaration() { - _lval.parseBindingIdentifier.call(void 0, false); - _util.expect.call(void 0, _types.TokenType.braceL); - while (!_index.eat.call(void 0, _types.TokenType.braceR) && !_base.state.error) { - tsParseEnumMember(); - _index.eat.call(void 0, _types.TokenType.comma); - } -} - -function tsParseModuleBlock() { - _util.expect.call(void 0, _types.TokenType.braceL); - _statement.parseBlockBody.call(void 0, /* end */ _types.TokenType.braceR); -} - -function tsParseModuleOrNamespaceDeclaration() { - _lval.parseBindingIdentifier.call(void 0, false); - if (_index.eat.call(void 0, _types.TokenType.dot)) { - tsParseModuleOrNamespaceDeclaration(); - } else { - tsParseModuleBlock(); - } -} - -function tsParseAmbientExternalModuleDeclaration() { - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._global)) { - _expression.parseIdentifier.call(void 0, ); - } else if (_index.match.call(void 0, _types.TokenType.string)) { - _expression.parseExprAtom.call(void 0, ); - } else { - _util.unexpected.call(void 0, ); - } - - if (_index.match.call(void 0, _types.TokenType.braceL)) { - tsParseModuleBlock(); - } else { - _util.semicolon.call(void 0, ); - } -} - - function tsParseImportEqualsDeclaration() { - _lval.parseImportedIdentifier.call(void 0, ); - _util.expect.call(void 0, _types.TokenType.eq); - tsParseModuleReference(); - _util.semicolon.call(void 0, ); -} exports.tsParseImportEqualsDeclaration = tsParseImportEqualsDeclaration; - -function tsIsExternalModuleReference() { - return _util.isContextual.call(void 0, _keywords.ContextualKeyword._require) && _index.lookaheadType.call(void 0, ) === _types.TokenType.parenL; -} - -function tsParseModuleReference() { - if (tsIsExternalModuleReference()) { - tsParseExternalModuleReference(); - } else { - tsParseEntityName(); - } -} - -function tsParseExternalModuleReference() { - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._require); - _util.expect.call(void 0, _types.TokenType.parenL); - if (!_index.match.call(void 0, _types.TokenType.string)) { - _util.unexpected.call(void 0, ); - } - _expression.parseLiteral.call(void 0, ); - _util.expect.call(void 0, _types.TokenType.parenR); -} - -// Utilities - -// Returns true if a statement matched. -function tsTryParseDeclare() { - if (_util.isLineTerminator.call(void 0, )) { - return false; - } - switch (_base.state.type) { - case _types.TokenType._function: { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - _index.next.call(void 0, ); - // We don't need to precisely get the function start here, since it's only used to mark - // the function as a type if it's bodiless, and it's already a type here. - const functionStart = _base.state.start; - _statement.parseFunction.call(void 0, functionStart, /* isStatement */ true); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } - case _types.TokenType._class: { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - _statement.parseClass.call(void 0, /* isStatement */ true, /* optionalId */ false); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } - case _types.TokenType._const: { - if (_index.match.call(void 0, _types.TokenType._const) && _util.isLookaheadContextual.call(void 0, _keywords.ContextualKeyword._enum)) { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - // `const enum = 0;` not allowed because "enum" is a strict mode reserved word. - _util.expect.call(void 0, _types.TokenType._const); - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._enum); - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._enum; - tsParseEnumDeclaration(); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } - } - // falls through - case _types.TokenType._var: - case _types.TokenType._let: { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - _statement.parseVarStatement.call(void 0, _base.state.type !== _types.TokenType._var); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } - case _types.TokenType.name: { - const oldIsType = _index.pushTypeContext.call(void 0, 1); - const contextualKeyword = _base.state.contextualKeyword; - let matched = false; - if (contextualKeyword === _keywords.ContextualKeyword._global) { - tsParseAmbientExternalModuleDeclaration(); - matched = true; - } else { - matched = tsParseDeclaration(contextualKeyword, /* isBeforeToken */ true); - } - _index.popTypeContext.call(void 0, oldIsType); - return matched; - } - default: - return false; - } -} - -// Note: this won't be called unless the keyword is allowed in `shouldParseExportDeclaration`. -// Returns true if it matched a declaration. -function tsTryParseExportDeclaration() { - return tsParseDeclaration(_base.state.contextualKeyword, /* isBeforeToken */ true); -} - -// Returns true if it matched a statement. -function tsParseExpressionStatement(contextualKeyword) { - switch (contextualKeyword) { - case _keywords.ContextualKeyword._declare: { - const declareTokenIndex = _base.state.tokens.length - 1; - const matched = tsTryParseDeclare(); - if (matched) { - _base.state.tokens[declareTokenIndex].type = _types.TokenType._declare; - return true; - } - break; - } - case _keywords.ContextualKeyword._global: - // `global { }` (with no `declare`) may appear inside an ambient module declaration. - // Would like to use tsParseAmbientExternalModuleDeclaration here, but already ran past "global". - if (_index.match.call(void 0, _types.TokenType.braceL)) { - tsParseModuleBlock(); - return true; - } - break; - - default: - return tsParseDeclaration(contextualKeyword, /* isBeforeToken */ false); - } - return false; -} - -/** - * Common code for parsing a declaration. - * - * isBeforeToken indicates that the current parser state is at the contextual - * keyword (and that it is not yet emitted) rather than reading the token after - * it. When isBeforeToken is true, we may be preceded by an `export` token and - * should include that token in a type context we create, e.g. to handle - * `export interface` or `export type`. (This is a bit of a hack and should be - * cleaned up at some point.) - * - * Returns true if it matched a declaration. - */ -function tsParseDeclaration(contextualKeyword, isBeforeToken) { - switch (contextualKeyword) { - case _keywords.ContextualKeyword._abstract: - if (tsCheckLineTerminator(isBeforeToken) && _index.match.call(void 0, _types.TokenType._class)) { - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._abstract; - _statement.parseClass.call(void 0, /* isStatement */ true, /* optionalId */ false); - return true; - } - break; - - case _keywords.ContextualKeyword._enum: - if (tsCheckLineTerminator(isBeforeToken) && _index.match.call(void 0, _types.TokenType.name)) { - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._enum; - tsParseEnumDeclaration(); - return true; - } - break; - - case _keywords.ContextualKeyword._interface: - if (tsCheckLineTerminator(isBeforeToken) && _index.match.call(void 0, _types.TokenType.name)) { - // `next` is true in "export" and "declare" contexts, so we want to remove that token - // as well. - const oldIsType = _index.pushTypeContext.call(void 0, isBeforeToken ? 2 : 1); - tsParseInterfaceDeclaration(); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } - break; - - case _keywords.ContextualKeyword._module: - if (tsCheckLineTerminator(isBeforeToken)) { - if (_index.match.call(void 0, _types.TokenType.string)) { - const oldIsType = _index.pushTypeContext.call(void 0, isBeforeToken ? 2 : 1); - tsParseAmbientExternalModuleDeclaration(); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } else if (_index.match.call(void 0, _types.TokenType.name)) { - const oldIsType = _index.pushTypeContext.call(void 0, isBeforeToken ? 2 : 1); - tsParseModuleOrNamespaceDeclaration(); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } - } - break; - - case _keywords.ContextualKeyword._namespace: - if (tsCheckLineTerminator(isBeforeToken) && _index.match.call(void 0, _types.TokenType.name)) { - const oldIsType = _index.pushTypeContext.call(void 0, isBeforeToken ? 2 : 1); - tsParseModuleOrNamespaceDeclaration(); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } - break; - - case _keywords.ContextualKeyword._type: - if (tsCheckLineTerminator(isBeforeToken) && _index.match.call(void 0, _types.TokenType.name)) { - const oldIsType = _index.pushTypeContext.call(void 0, isBeforeToken ? 2 : 1); - tsParseTypeAliasDeclaration(); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } - break; - - default: - break; - } - return false; -} - -function tsCheckLineTerminator(isBeforeToken) { - if (isBeforeToken) { - // Babel checks hasFollowingLineBreak here and returns false, but this - // doesn't actually come up, e.g. `export interface` can never be on its own - // line in valid code. - _index.next.call(void 0, ); - return true; - } else { - return !_util.isLineTerminator.call(void 0, ); - } -} - -// Returns true if there was a generic async arrow function. -function tsTryParseGenericAsyncArrowFunction() { - const snapshot = _base.state.snapshot(); - - tsParseTypeParameters(); - _statement.parseFunctionParams.call(void 0, ); - tsTryParseTypeOrTypePredicateAnnotation(); - _util.expect.call(void 0, _types.TokenType.arrow); - - if (_base.state.error) { - _base.state.restoreFromSnapshot(snapshot); - return false; - } - - _expression.parseFunctionBody.call(void 0, true); - return true; -} - -/** - * If necessary, hack the tokenizer state so that this bitshift was actually a - * less-than token, then keep parsing. This should only be used in situations - * where we restore from snapshot on error (which reverts this change) or - * where bitshift would be illegal anyway (e.g. in a class "extends" clause). - * - * This hack is useful to handle situations like foo<() => void>() where - * there can legitimately be two open-angle-brackets in a row in TS. - */ -function tsParseTypeArgumentsWithPossibleBitshift() { - if (_base.state.type === _types.TokenType.bitShiftL) { - _base.state.pos -= 1; - _index.finishToken.call(void 0, _types.TokenType.lessThan); - } - tsParseTypeArguments(); -} - -function tsParseTypeArguments() { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _util.expect.call(void 0, _types.TokenType.lessThan); - while (!_index.match.call(void 0, _types.TokenType.greaterThan) && !_base.state.error) { - tsParseType(); - _index.eat.call(void 0, _types.TokenType.comma); - } - if (!oldIsType) { - // If the type arguments are present in an expression context, e.g. - // f(), then the > sign should be tokenized as a non-type token. - // In particular, f(a < b, c >= d) should parse the >= as a single token, - // resulting in a syntax error and fallback to the non-type-args - // interpretation. In the success case, even though the > is tokenized as a - // non-type token, it still must be marked as a type token so that it is - // erased. - _index.popTypeContext.call(void 0, oldIsType); - _index.rescan_gt.call(void 0, ); - _util.expect.call(void 0, _types.TokenType.greaterThan); - _base.state.tokens[_base.state.tokens.length - 1].isType = true; - } else { - _util.expect.call(void 0, _types.TokenType.greaterThan); - _index.popTypeContext.call(void 0, oldIsType); - } -} - - function tsIsDeclarationStart() { - if (_index.match.call(void 0, _types.TokenType.name)) { - switch (_base.state.contextualKeyword) { - case _keywords.ContextualKeyword._abstract: - case _keywords.ContextualKeyword._declare: - case _keywords.ContextualKeyword._enum: - case _keywords.ContextualKeyword._interface: - case _keywords.ContextualKeyword._module: - case _keywords.ContextualKeyword._namespace: - case _keywords.ContextualKeyword._type: - return true; - default: - break; - } - } - - return false; -} exports.tsIsDeclarationStart = tsIsDeclarationStart; - -// ====================================================== -// OVERRIDES -// ====================================================== - - function tsParseFunctionBodyAndFinish(functionStart, funcContextId) { - // For arrow functions, `parseArrow` handles the return type itself. - if (_index.match.call(void 0, _types.TokenType.colon)) { - tsParseTypeOrTypePredicateAnnotation(_types.TokenType.colon); - } - - // The original code checked the node type to make sure this function type allows a missing - // body, but we skip that to avoid sending around the node type. We instead just use the - // allowExpressionBody boolean to make sure it's not an arrow function. - if (!_index.match.call(void 0, _types.TokenType.braceL) && _util.isLineTerminator.call(void 0, )) { - // Retroactively mark the function declaration as a type. - let i = _base.state.tokens.length - 1; - while ( - i >= 0 && - (_base.state.tokens[i].start >= functionStart || - _base.state.tokens[i].type === _types.TokenType._default || - _base.state.tokens[i].type === _types.TokenType._export) - ) { - _base.state.tokens[i].isType = true; - i--; - } - return; - } - - _expression.parseFunctionBody.call(void 0, false, funcContextId); -} exports.tsParseFunctionBodyAndFinish = tsParseFunctionBodyAndFinish; - - function tsParseSubscript( - startTokenIndex, - noCalls, - stopState, -) { - if (!_util.hasPrecedingLineBreak.call(void 0, ) && _index.eat.call(void 0, _types.TokenType.bang)) { - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType.nonNullAssertion; - return; - } - - if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.bitShiftL)) { - // There are number of things we are going to "maybe" parse, like type arguments on - // tagged template expressions. If any of them fail, walk it back and continue. - const snapshot = _base.state.snapshot(); - - if (!noCalls && _expression.atPossibleAsync.call(void 0, )) { - // Almost certainly this is a generic async function `async () => ... - // But it might be a call with a type argument `async();` - const asyncArrowFn = tsTryParseGenericAsyncArrowFunction(); - if (asyncArrowFn) { - return; - } - } - tsParseTypeArgumentsWithPossibleBitshift(); - if (!noCalls && _index.eat.call(void 0, _types.TokenType.parenL)) { - // With f(), the subscriptStartIndex marker is on the ( token. - _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - _expression.parseCallExpressionArguments.call(void 0, ); - } else if (_index.match.call(void 0, _types.TokenType.backQuote)) { - // Tagged template with a type argument. - _expression.parseTemplate.call(void 0, ); - } else if ( - // The remaining possible case is an instantiation expression, e.g. - // Array . Check for a few cases that would disqualify it and - // cause us to bail out. - // a>c is not (a)>c, but a<(b>>c) - _base.state.type === _types.TokenType.greaterThan || - // ac is (ac - (_base.state.type !== _types.TokenType.parenL && - Boolean(_base.state.type & _types.TokenType.IS_EXPRESSION_START) && - !_util.hasPrecedingLineBreak.call(void 0, )) - ) { - // Bail out. We have something like ac, which is not an expression with - // type arguments but an (a < b) > c comparison. - _util.unexpected.call(void 0, ); - } - - if (_base.state.error) { - _base.state.restoreFromSnapshot(snapshot); - } else { - return; - } - } else if (!noCalls && _index.match.call(void 0, _types.TokenType.questionDot) && _index.lookaheadType.call(void 0, ) === _types.TokenType.lessThan) { - // If we see f?.<, then this must be an optional call with a type argument. - _index.next.call(void 0, ); - _base.state.tokens[startTokenIndex].isOptionalChainStart = true; - // With f?.(), the subscriptStartIndex marker is on the ?. token. - _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - - tsParseTypeArguments(); - _util.expect.call(void 0, _types.TokenType.parenL); - _expression.parseCallExpressionArguments.call(void 0, ); - } - _expression.baseParseSubscript.call(void 0, startTokenIndex, noCalls, stopState); -} exports.tsParseSubscript = tsParseSubscript; - - function tsTryParseExport() { - if (_index.eat.call(void 0, _types.TokenType._import)) { - // One of these cases: - // export import A = B; - // export import type A = require("A"); - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._type) && _index.lookaheadType.call(void 0, ) !== _types.TokenType.eq) { - // Eat a `type` token, unless it's actually an identifier name. - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._type); - } - tsParseImportEqualsDeclaration(); - return true; - } else if (_index.eat.call(void 0, _types.TokenType.eq)) { - // `export = x;` - _expression.parseExpression.call(void 0, ); - _util.semicolon.call(void 0, ); - return true; - } else if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._as)) { - // `export as namespace A;` - // See `parseNamespaceExportDeclaration` in TypeScript's own parser - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._namespace); - _expression.parseIdentifier.call(void 0, ); - _util.semicolon.call(void 0, ); - return true; - } else { - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._type)) { - const nextType = _index.lookaheadType.call(void 0, ); - // export type {foo} from 'a'; - // export type * from 'a';' - // export type * as ns from 'a';' - if (nextType === _types.TokenType.braceL || nextType === _types.TokenType.star) { - _index.next.call(void 0, ); - } - } - return false; - } -} exports.tsTryParseExport = tsTryParseExport; - -/** - * Parse a TS import specifier, which may be prefixed with "type" and may be of - * the form `foo as bar`. - * - * The number of identifier-like tokens we see happens to be enough to uniquely - * identify the form, so simply count the number of identifiers rather than - * matching the words `type` or `as`. This is particularly important because - * `type` and `as` could each actually be plain identifiers rather than - * keywords. - */ - function tsParseImportSpecifier() { - _expression.parseIdentifier.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { - // import {foo} - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration; - return; - } - _expression.parseIdentifier.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { - // import {type foo} - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration; - _base.state.tokens[_base.state.tokens.length - 2].isType = true; - _base.state.tokens[_base.state.tokens.length - 1].isType = true; - return; - } - _expression.parseIdentifier.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { - // import {foo as bar} - _base.state.tokens[_base.state.tokens.length - 3].identifierRole = _index.IdentifierRole.ImportAccess; - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration; - return; - } - _expression.parseIdentifier.call(void 0, ); - // import {type foo as bar} - _base.state.tokens[_base.state.tokens.length - 3].identifierRole = _index.IdentifierRole.ImportAccess; - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration; - _base.state.tokens[_base.state.tokens.length - 4].isType = true; - _base.state.tokens[_base.state.tokens.length - 3].isType = true; - _base.state.tokens[_base.state.tokens.length - 2].isType = true; - _base.state.tokens[_base.state.tokens.length - 1].isType = true; -} exports.tsParseImportSpecifier = tsParseImportSpecifier; - -/** - * Just like named import specifiers, export specifiers can have from 1 to 4 - * tokens, inclusive, and the number of tokens determines the role of each token. - */ - function tsParseExportSpecifier() { - _expression.parseIdentifier.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { - // export {foo} - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ExportAccess; - return; - } - _expression.parseIdentifier.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { - // export {type foo} - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ExportAccess; - _base.state.tokens[_base.state.tokens.length - 2].isType = true; - _base.state.tokens[_base.state.tokens.length - 1].isType = true; - return; - } - _expression.parseIdentifier.call(void 0, ); - if (_index.match.call(void 0, _types.TokenType.comma) || _index.match.call(void 0, _types.TokenType.braceR)) { - // export {foo as bar} - _base.state.tokens[_base.state.tokens.length - 3].identifierRole = _index.IdentifierRole.ExportAccess; - return; - } - _expression.parseIdentifier.call(void 0, ); - // export {type foo as bar} - _base.state.tokens[_base.state.tokens.length - 3].identifierRole = _index.IdentifierRole.ExportAccess; - _base.state.tokens[_base.state.tokens.length - 4].isType = true; - _base.state.tokens[_base.state.tokens.length - 3].isType = true; - _base.state.tokens[_base.state.tokens.length - 2].isType = true; - _base.state.tokens[_base.state.tokens.length - 1].isType = true; -} exports.tsParseExportSpecifier = tsParseExportSpecifier; - - function tsTryParseExportDefaultExpression() { - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._abstract) && _index.lookaheadType.call(void 0, ) === _types.TokenType._class) { - _base.state.type = _types.TokenType._abstract; - _index.next.call(void 0, ); // Skip "abstract" - _statement.parseClass.call(void 0, true, true); - return true; - } - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._interface)) { - // Make sure "export default" are considered type tokens so the whole thing is removed. - const oldIsType = _index.pushTypeContext.call(void 0, 2); - tsParseDeclaration(_keywords.ContextualKeyword._interface, true); - _index.popTypeContext.call(void 0, oldIsType); - return true; - } - return false; -} exports.tsTryParseExportDefaultExpression = tsTryParseExportDefaultExpression; - - function tsTryParseStatementContent() { - if (_base.state.type === _types.TokenType._const) { - const ahead = _index.lookaheadTypeAndKeyword.call(void 0, ); - if (ahead.type === _types.TokenType.name && ahead.contextualKeyword === _keywords.ContextualKeyword._enum) { - _util.expect.call(void 0, _types.TokenType._const); - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._enum); - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._enum; - tsParseEnumDeclaration(); - return true; - } - } - return false; -} exports.tsTryParseStatementContent = tsTryParseStatementContent; - - function tsTryParseClassMemberWithIsStatic(isStatic) { - const memberStartIndexAfterStatic = _base.state.tokens.length; - tsParseModifiers([ - _keywords.ContextualKeyword._abstract, - _keywords.ContextualKeyword._readonly, - _keywords.ContextualKeyword._declare, - _keywords.ContextualKeyword._static, - _keywords.ContextualKeyword._override, - ]); - - const modifiersEndIndex = _base.state.tokens.length; - const found = tsTryParseIndexSignature(); - if (found) { - // Index signatures are type declarations, so set the modifier tokens as - // type tokens. Most tokens could be assumed to be type tokens, but `static` - // is ambiguous unless we set it explicitly here. - const memberStartIndex = isStatic - ? memberStartIndexAfterStatic - 1 - : memberStartIndexAfterStatic; - for (let i = memberStartIndex; i < modifiersEndIndex; i++) { - _base.state.tokens[i].isType = true; - } - return true; - } - return false; -} exports.tsTryParseClassMemberWithIsStatic = tsTryParseClassMemberWithIsStatic; - -// Note: The reason we do this in `parseIdentifierStatement` and not `parseStatement` -// is that e.g. `type()` is valid JS, so we must try parsing that first. -// If it's really a type, we will parse `type` as the statement, and can correct it here -// by parsing the rest. - function tsParseIdentifierStatement(contextualKeyword) { - const matched = tsParseExpressionStatement(contextualKeyword); - if (!matched) { - _util.semicolon.call(void 0, ); - } -} exports.tsParseIdentifierStatement = tsParseIdentifierStatement; - - function tsParseExportDeclaration() { - // "export declare" is equivalent to just "export". - const isDeclare = _util.eatContextual.call(void 0, _keywords.ContextualKeyword._declare); - if (isDeclare) { - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._declare; - } - - let matchedDeclaration = false; - if (_index.match.call(void 0, _types.TokenType.name)) { - if (isDeclare) { - const oldIsType = _index.pushTypeContext.call(void 0, 2); - matchedDeclaration = tsTryParseExportDeclaration(); - _index.popTypeContext.call(void 0, oldIsType); - } else { - matchedDeclaration = tsTryParseExportDeclaration(); - } - } - if (!matchedDeclaration) { - if (isDeclare) { - const oldIsType = _index.pushTypeContext.call(void 0, 2); - _statement.parseStatement.call(void 0, true); - _index.popTypeContext.call(void 0, oldIsType); - } else { - _statement.parseStatement.call(void 0, true); - } - } -} exports.tsParseExportDeclaration = tsParseExportDeclaration; - - function tsAfterParseClassSuper(hasSuper) { - if (hasSuper && (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.bitShiftL))) { - tsParseTypeArgumentsWithPossibleBitshift(); - } - if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._implements)) { - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._implements; - const oldIsType = _index.pushTypeContext.call(void 0, 1); - tsParseHeritageClause(); - _index.popTypeContext.call(void 0, oldIsType); - } -} exports.tsAfterParseClassSuper = tsAfterParseClassSuper; - - function tsStartParseObjPropValue() { - tsTryParseTypeParameters(); -} exports.tsStartParseObjPropValue = tsStartParseObjPropValue; - - function tsStartParseFunctionParams() { - tsTryParseTypeParameters(); -} exports.tsStartParseFunctionParams = tsStartParseFunctionParams; - -// `let x: number;` - function tsAfterParseVarHead() { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - if (!_util.hasPrecedingLineBreak.call(void 0, )) { - _index.eat.call(void 0, _types.TokenType.bang); - } - tsTryParseTypeAnnotation(); - _index.popTypeContext.call(void 0, oldIsType); -} exports.tsAfterParseVarHead = tsAfterParseVarHead; - -// parse the return type of an async arrow function - let foo = (async (): number => {}); - function tsStartParseAsyncArrowFromCallExpression() { - if (_index.match.call(void 0, _types.TokenType.colon)) { - tsParseTypeAnnotation(); - } -} exports.tsStartParseAsyncArrowFromCallExpression = tsStartParseAsyncArrowFromCallExpression; - -// Returns true if the expression was an arrow function. - function tsParseMaybeAssign(noIn, isWithinParens) { - // Note: When the JSX plugin is on, type assertions (` x`) aren't valid syntax. - if (_base.isJSXEnabled) { - return tsParseMaybeAssignWithJSX(noIn, isWithinParens); - } else { - return tsParseMaybeAssignWithoutJSX(noIn, isWithinParens); - } -} exports.tsParseMaybeAssign = tsParseMaybeAssign; - - function tsParseMaybeAssignWithJSX(noIn, isWithinParens) { - if (!_index.match.call(void 0, _types.TokenType.lessThan)) { - return _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); - } - - // Prefer to parse JSX if possible. But may be an arrow fn. - const snapshot = _base.state.snapshot(); - let wasArrow = _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); - if (_base.state.error) { - _base.state.restoreFromSnapshot(snapshot); - } else { - return wasArrow; - } - - // Otherwise, try as type-parameterized arrow function. - _base.state.type = _types.TokenType.typeParameterStart; - // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`. - tsParseTypeParameters(); - wasArrow = _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); - if (!wasArrow) { - _util.unexpected.call(void 0, ); - } - - return wasArrow; -} exports.tsParseMaybeAssignWithJSX = tsParseMaybeAssignWithJSX; - - function tsParseMaybeAssignWithoutJSX(noIn, isWithinParens) { - if (!_index.match.call(void 0, _types.TokenType.lessThan)) { - return _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); - } - - const snapshot = _base.state.snapshot(); - // This is similar to TypeScript's `tryParseParenthesizedArrowFunctionExpression`. - tsParseTypeParameters(); - const wasArrow = _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); - if (!wasArrow) { - _util.unexpected.call(void 0, ); - } - if (_base.state.error) { - _base.state.restoreFromSnapshot(snapshot); - } else { - return wasArrow; - } - - // Try parsing a type cast instead of an arrow function. - // This will start with a type assertion (via parseMaybeUnary). - // But don't directly call `tsParseTypeAssertion` because we want to handle any binary after it. - return _expression.baseParseMaybeAssign.call(void 0, noIn, isWithinParens); -} exports.tsParseMaybeAssignWithoutJSX = tsParseMaybeAssignWithoutJSX; - - function tsParseArrow() { - if (_index.match.call(void 0, _types.TokenType.colon)) { - // This is different from how the TS parser does it. - // TS uses lookahead. Babylon parses it as a parenthesized expression and converts. - const snapshot = _base.state.snapshot(); - - tsParseTypeOrTypePredicateAnnotation(_types.TokenType.colon); - if (_util.canInsertSemicolon.call(void 0, )) _util.unexpected.call(void 0, ); - if (!_index.match.call(void 0, _types.TokenType.arrow)) _util.unexpected.call(void 0, ); - - if (_base.state.error) { - _base.state.restoreFromSnapshot(snapshot); - } - } - return _index.eat.call(void 0, _types.TokenType.arrow); -} exports.tsParseArrow = tsParseArrow; - -// Allow type annotations inside of a parameter list. - function tsParseAssignableListItemTypes() { - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _index.eat.call(void 0, _types.TokenType.question); - tsTryParseTypeAnnotation(); - _index.popTypeContext.call(void 0, oldIsType); -} exports.tsParseAssignableListItemTypes = tsParseAssignableListItemTypes; - - function tsParseMaybeDecoratorArguments() { - if (_index.match.call(void 0, _types.TokenType.lessThan) || _index.match.call(void 0, _types.TokenType.bitShiftL)) { - tsParseTypeArgumentsWithPossibleBitshift(); - } - _statement.baseParseMaybeDecoratorArguments.call(void 0, ); -} exports.tsParseMaybeDecoratorArguments = tsParseMaybeDecoratorArguments; diff --git a/node_modules/sucrase/dist/parser/tokenizer/index.js b/node_modules/sucrase/dist/parser/tokenizer/index.js deleted file mode 100644 index 84f5e14..0000000 --- a/node_modules/sucrase/dist/parser/tokenizer/index.js +++ /dev/null @@ -1,1004 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }/* eslint max-len: 0 */ - -var _base = require('../traverser/base'); -var _util = require('../traverser/util'); -var _charcodes = require('../util/charcodes'); -var _identifier = require('../util/identifier'); -var _whitespace = require('../util/whitespace'); -var _keywords = require('./keywords'); -var _readWord = require('./readWord'); var _readWord2 = _interopRequireDefault(_readWord); -var _types = require('./types'); - -var IdentifierRole; (function (IdentifierRole) { - const Access = 0; IdentifierRole[IdentifierRole["Access"] = Access] = "Access"; - const ExportAccess = Access + 1; IdentifierRole[IdentifierRole["ExportAccess"] = ExportAccess] = "ExportAccess"; - const TopLevelDeclaration = ExportAccess + 1; IdentifierRole[IdentifierRole["TopLevelDeclaration"] = TopLevelDeclaration] = "TopLevelDeclaration"; - const FunctionScopedDeclaration = TopLevelDeclaration + 1; IdentifierRole[IdentifierRole["FunctionScopedDeclaration"] = FunctionScopedDeclaration] = "FunctionScopedDeclaration"; - const BlockScopedDeclaration = FunctionScopedDeclaration + 1; IdentifierRole[IdentifierRole["BlockScopedDeclaration"] = BlockScopedDeclaration] = "BlockScopedDeclaration"; - const ObjectShorthandTopLevelDeclaration = BlockScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandTopLevelDeclaration"] = ObjectShorthandTopLevelDeclaration] = "ObjectShorthandTopLevelDeclaration"; - const ObjectShorthandFunctionScopedDeclaration = ObjectShorthandTopLevelDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandFunctionScopedDeclaration"] = ObjectShorthandFunctionScopedDeclaration] = "ObjectShorthandFunctionScopedDeclaration"; - const ObjectShorthandBlockScopedDeclaration = ObjectShorthandFunctionScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthandBlockScopedDeclaration"] = ObjectShorthandBlockScopedDeclaration] = "ObjectShorthandBlockScopedDeclaration"; - const ObjectShorthand = ObjectShorthandBlockScopedDeclaration + 1; IdentifierRole[IdentifierRole["ObjectShorthand"] = ObjectShorthand] = "ObjectShorthand"; - // Any identifier bound in an import statement, e.g. both A and b from - // `import A, * as b from 'A';` - const ImportDeclaration = ObjectShorthand + 1; IdentifierRole[IdentifierRole["ImportDeclaration"] = ImportDeclaration] = "ImportDeclaration"; - const ObjectKey = ImportDeclaration + 1; IdentifierRole[IdentifierRole["ObjectKey"] = ObjectKey] = "ObjectKey"; - // The `foo` in `import {foo as bar} from "./abc";`. - const ImportAccess = ObjectKey + 1; IdentifierRole[IdentifierRole["ImportAccess"] = ImportAccess] = "ImportAccess"; -})(IdentifierRole || (exports.IdentifierRole = IdentifierRole = {})); - -/** - * Extra information on jsxTagStart tokens, used to determine which of the three - * jsx functions are called in the automatic transform. - */ -var JSXRole; (function (JSXRole) { - // The element is self-closing or has a body that resolves to empty. We - // shouldn't emit children at all in this case. - const NoChildren = 0; JSXRole[JSXRole["NoChildren"] = NoChildren] = "NoChildren"; - // The element has a single explicit child, which might still be an arbitrary - // expression like an array. We should emit that expression as the children. - const OneChild = NoChildren + 1; JSXRole[JSXRole["OneChild"] = OneChild] = "OneChild"; - // The element has at least two explicitly-specified children or has spread - // children, so child positions are assumed to be "static". We should wrap - // these children in an array. - const StaticChildren = OneChild + 1; JSXRole[JSXRole["StaticChildren"] = StaticChildren] = "StaticChildren"; - // The element has a prop named "key" after a prop spread, so we should fall - // back to the createElement function. - const KeyAfterPropSpread = StaticChildren + 1; JSXRole[JSXRole["KeyAfterPropSpread"] = KeyAfterPropSpread] = "KeyAfterPropSpread"; -})(JSXRole || (exports.JSXRole = JSXRole = {})); - - function isDeclaration(token) { - const role = token.identifierRole; - return ( - role === IdentifierRole.TopLevelDeclaration || - role === IdentifierRole.FunctionScopedDeclaration || - role === IdentifierRole.BlockScopedDeclaration || - role === IdentifierRole.ObjectShorthandTopLevelDeclaration || - role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration || - role === IdentifierRole.ObjectShorthandBlockScopedDeclaration - ); -} exports.isDeclaration = isDeclaration; - - function isNonTopLevelDeclaration(token) { - const role = token.identifierRole; - return ( - role === IdentifierRole.FunctionScopedDeclaration || - role === IdentifierRole.BlockScopedDeclaration || - role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration || - role === IdentifierRole.ObjectShorthandBlockScopedDeclaration - ); -} exports.isNonTopLevelDeclaration = isNonTopLevelDeclaration; - - function isTopLevelDeclaration(token) { - const role = token.identifierRole; - return ( - role === IdentifierRole.TopLevelDeclaration || - role === IdentifierRole.ObjectShorthandTopLevelDeclaration || - role === IdentifierRole.ImportDeclaration - ); -} exports.isTopLevelDeclaration = isTopLevelDeclaration; - - function isBlockScopedDeclaration(token) { - const role = token.identifierRole; - // Treat top-level declarations as block scope since the distinction doesn't matter here. - return ( - role === IdentifierRole.TopLevelDeclaration || - role === IdentifierRole.BlockScopedDeclaration || - role === IdentifierRole.ObjectShorthandTopLevelDeclaration || - role === IdentifierRole.ObjectShorthandBlockScopedDeclaration - ); -} exports.isBlockScopedDeclaration = isBlockScopedDeclaration; - - function isFunctionScopedDeclaration(token) { - const role = token.identifierRole; - return ( - role === IdentifierRole.FunctionScopedDeclaration || - role === IdentifierRole.ObjectShorthandFunctionScopedDeclaration - ); -} exports.isFunctionScopedDeclaration = isFunctionScopedDeclaration; - - function isObjectShorthandDeclaration(token) { - return ( - token.identifierRole === IdentifierRole.ObjectShorthandTopLevelDeclaration || - token.identifierRole === IdentifierRole.ObjectShorthandBlockScopedDeclaration || - token.identifierRole === IdentifierRole.ObjectShorthandFunctionScopedDeclaration - ); -} exports.isObjectShorthandDeclaration = isObjectShorthandDeclaration; - -// Object type used to represent tokens. Note that normally, tokens -// simply exist as properties on the parser object. This is only -// used for the onToken callback and the external tokenizer. - class Token { - constructor() { - this.type = _base.state.type; - this.contextualKeyword = _base.state.contextualKeyword; - this.start = _base.state.start; - this.end = _base.state.end; - this.scopeDepth = _base.state.scopeDepth; - this.isType = _base.state.isType; - this.identifierRole = null; - this.jsxRole = null; - this.shadowsGlobal = false; - this.isAsyncOperation = false; - this.contextId = null; - this.rhsEndIndex = null; - this.isExpression = false; - this.numNullishCoalesceStarts = 0; - this.numNullishCoalesceEnds = 0; - this.isOptionalChainStart = false; - this.isOptionalChainEnd = false; - this.subscriptStartIndex = null; - this.nullishStartIndex = null; - } - - - - - - - - - - // Initially false for all tokens, then may be computed in a follow-up step that does scope - // analysis. - - // Initially false for all tokens, but may be set during transform to mark it as containing an - // await operation. - - - // For assignments, the index of the RHS. For export tokens, the end of the export. - - // For class tokens, records if the class is a class expression or a class statement. - - // Number of times to insert a `nullishCoalesce(` snippet before this token. - - // Number of times to insert a `)` snippet after this token. - - // If true, insert an `optionalChain([` snippet before this token. - - // If true, insert a `])` snippet after this token. - - // Tag for `.`, `?.`, `[`, `?.[`, `(`, and `?.(` to denote the "root" token for this - // subscript chain. This can be used to determine if this chain is an optional chain. - - // Tag for `??` operators to denote the root token for this nullish coalescing call. - -} exports.Token = Token; - -// ## Tokenizer - -// Move to the next token - function next() { - _base.state.tokens.push(new Token()); - nextToken(); -} exports.next = next; - -// Call instead of next when inside a template, since that needs to be handled differently. - function nextTemplateToken() { - _base.state.tokens.push(new Token()); - _base.state.start = _base.state.pos; - readTmplToken(); -} exports.nextTemplateToken = nextTemplateToken; - -// The tokenizer never parses regexes by default. Instead, the parser is responsible for -// instructing it to parse a regex when we see a slash at the start of an expression. - function retokenizeSlashAsRegex() { - if (_base.state.type === _types.TokenType.assign) { - --_base.state.pos; - } - readRegexp(); -} exports.retokenizeSlashAsRegex = retokenizeSlashAsRegex; - - function pushTypeContext(existingTokensInType) { - for (let i = _base.state.tokens.length - existingTokensInType; i < _base.state.tokens.length; i++) { - _base.state.tokens[i].isType = true; - } - const oldIsType = _base.state.isType; - _base.state.isType = true; - return oldIsType; -} exports.pushTypeContext = pushTypeContext; - - function popTypeContext(oldIsType) { - _base.state.isType = oldIsType; -} exports.popTypeContext = popTypeContext; - - function eat(type) { - if (match(type)) { - next(); - return true; - } else { - return false; - } -} exports.eat = eat; - - function eatTypeToken(tokenType) { - const oldIsType = _base.state.isType; - _base.state.isType = true; - eat(tokenType); - _base.state.isType = oldIsType; -} exports.eatTypeToken = eatTypeToken; - - function match(type) { - return _base.state.type === type; -} exports.match = match; - - function lookaheadType() { - const snapshot = _base.state.snapshot(); - next(); - const type = _base.state.type; - _base.state.restoreFromSnapshot(snapshot); - return type; -} exports.lookaheadType = lookaheadType; - - class TypeAndKeyword { - - - constructor(type, contextualKeyword) { - this.type = type; - this.contextualKeyword = contextualKeyword; - } -} exports.TypeAndKeyword = TypeAndKeyword; - - function lookaheadTypeAndKeyword() { - const snapshot = _base.state.snapshot(); - next(); - const type = _base.state.type; - const contextualKeyword = _base.state.contextualKeyword; - _base.state.restoreFromSnapshot(snapshot); - return new TypeAndKeyword(type, contextualKeyword); -} exports.lookaheadTypeAndKeyword = lookaheadTypeAndKeyword; - - function nextTokenStart() { - return nextTokenStartSince(_base.state.pos); -} exports.nextTokenStart = nextTokenStart; - - function nextTokenStartSince(pos) { - _whitespace.skipWhiteSpace.lastIndex = pos; - const skip = _whitespace.skipWhiteSpace.exec(_base.input); - return pos + skip[0].length; -} exports.nextTokenStartSince = nextTokenStartSince; - - function lookaheadCharCode() { - return _base.input.charCodeAt(nextTokenStart()); -} exports.lookaheadCharCode = lookaheadCharCode; - -// Read a single token, updating the parser object's token-related -// properties. - function nextToken() { - skipSpace(); - _base.state.start = _base.state.pos; - if (_base.state.pos >= _base.input.length) { - const tokens = _base.state.tokens; - // We normally run past the end a bit, but if we're way past the end, avoid an infinite loop. - // Also check the token positions rather than the types since sometimes we rewrite the token - // type to something else. - if ( - tokens.length >= 2 && - tokens[tokens.length - 1].start >= _base.input.length && - tokens[tokens.length - 2].start >= _base.input.length - ) { - _util.unexpected.call(void 0, "Unexpectedly reached the end of input."); - } - finishToken(_types.TokenType.eof); - return; - } - readToken(_base.input.charCodeAt(_base.state.pos)); -} exports.nextToken = nextToken; - -function readToken(code) { - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if ( - _identifier.IS_IDENTIFIER_START[code] || - code === _charcodes.charCodes.backslash || - (code === _charcodes.charCodes.atSign && _base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.atSign) - ) { - _readWord2.default.call(void 0, ); - } else { - getTokenFromCode(code); - } -} - -function skipBlockComment() { - while ( - _base.input.charCodeAt(_base.state.pos) !== _charcodes.charCodes.asterisk || - _base.input.charCodeAt(_base.state.pos + 1) !== _charcodes.charCodes.slash - ) { - _base.state.pos++; - if (_base.state.pos > _base.input.length) { - _util.unexpected.call(void 0, "Unterminated comment", _base.state.pos - 2); - return; - } - } - _base.state.pos += 2; -} - - function skipLineComment(startSkip) { - let ch = _base.input.charCodeAt((_base.state.pos += startSkip)); - if (_base.state.pos < _base.input.length) { - while ( - ch !== _charcodes.charCodes.lineFeed && - ch !== _charcodes.charCodes.carriageReturn && - ch !== _charcodes.charCodes.lineSeparator && - ch !== _charcodes.charCodes.paragraphSeparator && - ++_base.state.pos < _base.input.length - ) { - ch = _base.input.charCodeAt(_base.state.pos); - } - } -} exports.skipLineComment = skipLineComment; - -// Called at the start of the parse and after every token. Skips -// whitespace and comments. - function skipSpace() { - while (_base.state.pos < _base.input.length) { - const ch = _base.input.charCodeAt(_base.state.pos); - switch (ch) { - case _charcodes.charCodes.carriageReturn: - if (_base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.lineFeed) { - ++_base.state.pos; - } - - case _charcodes.charCodes.lineFeed: - case _charcodes.charCodes.lineSeparator: - case _charcodes.charCodes.paragraphSeparator: - ++_base.state.pos; - break; - - case _charcodes.charCodes.slash: - switch (_base.input.charCodeAt(_base.state.pos + 1)) { - case _charcodes.charCodes.asterisk: - _base.state.pos += 2; - skipBlockComment(); - break; - - case _charcodes.charCodes.slash: - skipLineComment(2); - break; - - default: - return; - } - break; - - default: - if (_whitespace.IS_WHITESPACE[ch]) { - ++_base.state.pos; - } else { - return; - } - } - } -} exports.skipSpace = skipSpace; - -// Called at the end of every token. Sets various fields, and skips the space after the token, so -// that the next one's `start` will point at the right position. - function finishToken( - type, - contextualKeyword = _keywords.ContextualKeyword.NONE, -) { - _base.state.end = _base.state.pos; - _base.state.type = type; - _base.state.contextualKeyword = contextualKeyword; -} exports.finishToken = finishToken; - -// ### Token reading - -// This is the function that is called to fetch the next token. It -// is somewhat obscure, because it works in character codes rather -// than characters, and because operator parsing has been inlined -// into it. -// -// All in the name of speed. -function readToken_dot() { - const nextChar = _base.input.charCodeAt(_base.state.pos + 1); - if (nextChar >= _charcodes.charCodes.digit0 && nextChar <= _charcodes.charCodes.digit9) { - readNumber(true); - return; - } - - if (nextChar === _charcodes.charCodes.dot && _base.input.charCodeAt(_base.state.pos + 2) === _charcodes.charCodes.dot) { - _base.state.pos += 3; - finishToken(_types.TokenType.ellipsis); - } else { - ++_base.state.pos; - finishToken(_types.TokenType.dot); - } -} - -function readToken_slash() { - const nextChar = _base.input.charCodeAt(_base.state.pos + 1); - if (nextChar === _charcodes.charCodes.equalsTo) { - finishOp(_types.TokenType.assign, 2); - } else { - finishOp(_types.TokenType.slash, 1); - } -} - -function readToken_mult_modulo(code) { - // '%*' - let tokenType = code === _charcodes.charCodes.asterisk ? _types.TokenType.star : _types.TokenType.modulo; - let width = 1; - let nextChar = _base.input.charCodeAt(_base.state.pos + 1); - - // Exponentiation operator ** - if (code === _charcodes.charCodes.asterisk && nextChar === _charcodes.charCodes.asterisk) { - width++; - nextChar = _base.input.charCodeAt(_base.state.pos + 2); - tokenType = _types.TokenType.exponent; - } - - // Match *= or %=, disallowing *=> which can be valid in flow. - if ( - nextChar === _charcodes.charCodes.equalsTo && - _base.input.charCodeAt(_base.state.pos + 2) !== _charcodes.charCodes.greaterThan - ) { - width++; - tokenType = _types.TokenType.assign; - } - - finishOp(tokenType, width); -} - -function readToken_pipe_amp(code) { - // '|&' - const nextChar = _base.input.charCodeAt(_base.state.pos + 1); - - if (nextChar === code) { - if (_base.input.charCodeAt(_base.state.pos + 2) === _charcodes.charCodes.equalsTo) { - // ||= or &&= - finishOp(_types.TokenType.assign, 3); - } else { - // || or && - finishOp(code === _charcodes.charCodes.verticalBar ? _types.TokenType.logicalOR : _types.TokenType.logicalAND, 2); - } - return; - } - - if (code === _charcodes.charCodes.verticalBar) { - // '|>' - if (nextChar === _charcodes.charCodes.greaterThan) { - finishOp(_types.TokenType.pipeline, 2); - return; - } else if (nextChar === _charcodes.charCodes.rightCurlyBrace && _base.isFlowEnabled) { - // '|}' - finishOp(_types.TokenType.braceBarR, 2); - return; - } - } - - if (nextChar === _charcodes.charCodes.equalsTo) { - finishOp(_types.TokenType.assign, 2); - return; - } - - finishOp(code === _charcodes.charCodes.verticalBar ? _types.TokenType.bitwiseOR : _types.TokenType.bitwiseAND, 1); -} - -function readToken_caret() { - // '^' - const nextChar = _base.input.charCodeAt(_base.state.pos + 1); - if (nextChar === _charcodes.charCodes.equalsTo) { - finishOp(_types.TokenType.assign, 2); - } else { - finishOp(_types.TokenType.bitwiseXOR, 1); - } -} - -function readToken_plus_min(code) { - // '+-' - const nextChar = _base.input.charCodeAt(_base.state.pos + 1); - - if (nextChar === code) { - // Tentatively call this a prefix operator, but it might be changed to postfix later. - finishOp(_types.TokenType.preIncDec, 2); - return; - } - - if (nextChar === _charcodes.charCodes.equalsTo) { - finishOp(_types.TokenType.assign, 2); - } else if (code === _charcodes.charCodes.plusSign) { - finishOp(_types.TokenType.plus, 1); - } else { - finishOp(_types.TokenType.minus, 1); - } -} - -function readToken_lt() { - const nextChar = _base.input.charCodeAt(_base.state.pos + 1); - - if (nextChar === _charcodes.charCodes.lessThan) { - if (_base.input.charCodeAt(_base.state.pos + 2) === _charcodes.charCodes.equalsTo) { - finishOp(_types.TokenType.assign, 3); - return; - } - // We see <<, but need to be really careful about whether to treat it as a - // true left-shift or as two < tokens. - if (_base.state.isType) { - // Within a type, << might come up in a snippet like `Array<() => void>`, - // so treat it as two < tokens. Importantly, this should only override << - // rather than other tokens like <= . If we treated <= as < in a type - // context, then the snippet `a as T <= 1` would incorrectly start parsing - // a type argument on T. We don't need to worry about `a as T << 1` - // because TypeScript disallows that syntax. - finishOp(_types.TokenType.lessThan, 1); - } else { - // Outside a type, this might be a true left-shift operator, or it might - // still be two open-type-arg tokens, such as in `f<() => void>()`. We - // look at the token while considering the `f`, so we don't yet know that - // we're in a type context. In this case, we initially tokenize as a - // left-shift and correct after-the-fact as necessary in - // tsParseTypeArgumentsWithPossibleBitshift . - finishOp(_types.TokenType.bitShiftL, 2); - } - return; - } - - if (nextChar === _charcodes.charCodes.equalsTo) { - // <= - finishOp(_types.TokenType.relationalOrEqual, 2); - } else { - finishOp(_types.TokenType.lessThan, 1); - } -} - -function readToken_gt() { - if (_base.state.isType) { - // Avoid right-shift for things like `Array>` and - // greater-than-or-equal for things like `const a: Array=[];`. - finishOp(_types.TokenType.greaterThan, 1); - return; - } - - const nextChar = _base.input.charCodeAt(_base.state.pos + 1); - - if (nextChar === _charcodes.charCodes.greaterThan) { - const size = _base.input.charCodeAt(_base.state.pos + 2) === _charcodes.charCodes.greaterThan ? 3 : 2; - if (_base.input.charCodeAt(_base.state.pos + size) === _charcodes.charCodes.equalsTo) { - finishOp(_types.TokenType.assign, size + 1); - return; - } - finishOp(_types.TokenType.bitShiftR, size); - return; - } - - if (nextChar === _charcodes.charCodes.equalsTo) { - // >= - finishOp(_types.TokenType.relationalOrEqual, 2); - } else { - finishOp(_types.TokenType.greaterThan, 1); - } -} - -/** - * Reinterpret a possible > token when transitioning from a type to a non-type - * context. - * - * This comes up in two situations where >= needs to be treated as one token: - * - After an `as` expression, like in the code `a as T >= 1`. - * - In a type argument in an expression context, e.g. `f(a < b, c >= d)`, we - * need to see the token as >= so that we get an error and backtrack to - * normal expression parsing. - * - * Other situations require >= to be seen as two tokens, e.g. - * `const x: Array=[];`, so it's important to treat > as its own token in - * typical type parsing situations. - */ - function rescan_gt() { - if (_base.state.type === _types.TokenType.greaterThan) { - _base.state.pos -= 1; - readToken_gt(); - } -} exports.rescan_gt = rescan_gt; - -function readToken_eq_excl(code) { - // '=!' - const nextChar = _base.input.charCodeAt(_base.state.pos + 1); - if (nextChar === _charcodes.charCodes.equalsTo) { - finishOp(_types.TokenType.equality, _base.input.charCodeAt(_base.state.pos + 2) === _charcodes.charCodes.equalsTo ? 3 : 2); - return; - } - if (code === _charcodes.charCodes.equalsTo && nextChar === _charcodes.charCodes.greaterThan) { - // '=>' - _base.state.pos += 2; - finishToken(_types.TokenType.arrow); - return; - } - finishOp(code === _charcodes.charCodes.equalsTo ? _types.TokenType.eq : _types.TokenType.bang, 1); -} - -function readToken_question() { - // '?' - const nextChar = _base.input.charCodeAt(_base.state.pos + 1); - const nextChar2 = _base.input.charCodeAt(_base.state.pos + 2); - if ( - nextChar === _charcodes.charCodes.questionMark && - // In Flow (but not TypeScript), ??string is a valid type that should be - // tokenized as two individual ? tokens. - !(_base.isFlowEnabled && _base.state.isType) - ) { - if (nextChar2 === _charcodes.charCodes.equalsTo) { - // '??=' - finishOp(_types.TokenType.assign, 3); - } else { - // '??' - finishOp(_types.TokenType.nullishCoalescing, 2); - } - } else if ( - nextChar === _charcodes.charCodes.dot && - !(nextChar2 >= _charcodes.charCodes.digit0 && nextChar2 <= _charcodes.charCodes.digit9) - ) { - // '.' not followed by a number - _base.state.pos += 2; - finishToken(_types.TokenType.questionDot); - } else { - ++_base.state.pos; - finishToken(_types.TokenType.question); - } -} - - function getTokenFromCode(code) { - switch (code) { - case _charcodes.charCodes.numberSign: - ++_base.state.pos; - finishToken(_types.TokenType.hash); - return; - - // The interpretation of a dot depends on whether it is followed - // by a digit or another two dots. - - case _charcodes.charCodes.dot: - readToken_dot(); - return; - - // Punctuation tokens. - case _charcodes.charCodes.leftParenthesis: - ++_base.state.pos; - finishToken(_types.TokenType.parenL); - return; - case _charcodes.charCodes.rightParenthesis: - ++_base.state.pos; - finishToken(_types.TokenType.parenR); - return; - case _charcodes.charCodes.semicolon: - ++_base.state.pos; - finishToken(_types.TokenType.semi); - return; - case _charcodes.charCodes.comma: - ++_base.state.pos; - finishToken(_types.TokenType.comma); - return; - case _charcodes.charCodes.leftSquareBracket: - ++_base.state.pos; - finishToken(_types.TokenType.bracketL); - return; - case _charcodes.charCodes.rightSquareBracket: - ++_base.state.pos; - finishToken(_types.TokenType.bracketR); - return; - - case _charcodes.charCodes.leftCurlyBrace: - if (_base.isFlowEnabled && _base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.verticalBar) { - finishOp(_types.TokenType.braceBarL, 2); - } else { - ++_base.state.pos; - finishToken(_types.TokenType.braceL); - } - return; - - case _charcodes.charCodes.rightCurlyBrace: - ++_base.state.pos; - finishToken(_types.TokenType.braceR); - return; - - case _charcodes.charCodes.colon: - if (_base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.colon) { - finishOp(_types.TokenType.doubleColon, 2); - } else { - ++_base.state.pos; - finishToken(_types.TokenType.colon); - } - return; - - case _charcodes.charCodes.questionMark: - readToken_question(); - return; - case _charcodes.charCodes.atSign: - ++_base.state.pos; - finishToken(_types.TokenType.at); - return; - - case _charcodes.charCodes.graveAccent: - ++_base.state.pos; - finishToken(_types.TokenType.backQuote); - return; - - case _charcodes.charCodes.digit0: { - const nextChar = _base.input.charCodeAt(_base.state.pos + 1); - // '0x', '0X', '0o', '0O', '0b', '0B' - if ( - nextChar === _charcodes.charCodes.lowercaseX || - nextChar === _charcodes.charCodes.uppercaseX || - nextChar === _charcodes.charCodes.lowercaseO || - nextChar === _charcodes.charCodes.uppercaseO || - nextChar === _charcodes.charCodes.lowercaseB || - nextChar === _charcodes.charCodes.uppercaseB - ) { - readRadixNumber(); - return; - } - } - // Anything else beginning with a digit is an integer, octal - // number, or float. - case _charcodes.charCodes.digit1: - case _charcodes.charCodes.digit2: - case _charcodes.charCodes.digit3: - case _charcodes.charCodes.digit4: - case _charcodes.charCodes.digit5: - case _charcodes.charCodes.digit6: - case _charcodes.charCodes.digit7: - case _charcodes.charCodes.digit8: - case _charcodes.charCodes.digit9: - readNumber(false); - return; - - // Quotes produce strings. - case _charcodes.charCodes.quotationMark: - case _charcodes.charCodes.apostrophe: - readString(code); - return; - - // Operators are parsed inline in tiny state machines. '=' (charCodes.equalsTo) is - // often referred to. `finishOp` simply skips the amount of - // characters it is given as second argument, and returns a token - // of the type given by its first argument. - - case _charcodes.charCodes.slash: - readToken_slash(); - return; - - case _charcodes.charCodes.percentSign: - case _charcodes.charCodes.asterisk: - readToken_mult_modulo(code); - return; - - case _charcodes.charCodes.verticalBar: - case _charcodes.charCodes.ampersand: - readToken_pipe_amp(code); - return; - - case _charcodes.charCodes.caret: - readToken_caret(); - return; - - case _charcodes.charCodes.plusSign: - case _charcodes.charCodes.dash: - readToken_plus_min(code); - return; - - case _charcodes.charCodes.lessThan: - readToken_lt(); - return; - - case _charcodes.charCodes.greaterThan: - readToken_gt(); - return; - - case _charcodes.charCodes.equalsTo: - case _charcodes.charCodes.exclamationMark: - readToken_eq_excl(code); - return; - - case _charcodes.charCodes.tilde: - finishOp(_types.TokenType.tilde, 1); - return; - - default: - break; - } - - _util.unexpected.call(void 0, `Unexpected character '${String.fromCharCode(code)}'`, _base.state.pos); -} exports.getTokenFromCode = getTokenFromCode; - -function finishOp(type, size) { - _base.state.pos += size; - finishToken(type); -} - -function readRegexp() { - const start = _base.state.pos; - let escaped = false; - let inClass = false; - for (;;) { - if (_base.state.pos >= _base.input.length) { - _util.unexpected.call(void 0, "Unterminated regular expression", start); - return; - } - const code = _base.input.charCodeAt(_base.state.pos); - if (escaped) { - escaped = false; - } else { - if (code === _charcodes.charCodes.leftSquareBracket) { - inClass = true; - } else if (code === _charcodes.charCodes.rightSquareBracket && inClass) { - inClass = false; - } else if (code === _charcodes.charCodes.slash && !inClass) { - break; - } - escaped = code === _charcodes.charCodes.backslash; - } - ++_base.state.pos; - } - ++_base.state.pos; - // Need to use `skipWord` because '\uXXXX' sequences are allowed here (don't ask). - skipWord(); - - finishToken(_types.TokenType.regexp); -} - -/** - * Read a decimal integer. Note that this can't be unified with the similar code - * in readRadixNumber (which also handles hex digits) because "e" needs to be - * the end of the integer so that we can properly handle scientific notation. - */ -function readInt() { - while (true) { - const code = _base.input.charCodeAt(_base.state.pos); - if ((code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9) || code === _charcodes.charCodes.underscore) { - _base.state.pos++; - } else { - break; - } - } -} - -function readRadixNumber() { - _base.state.pos += 2; // 0x - - // Walk to the end of the number, allowing hex digits. - while (true) { - const code = _base.input.charCodeAt(_base.state.pos); - if ( - (code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9) || - (code >= _charcodes.charCodes.lowercaseA && code <= _charcodes.charCodes.lowercaseF) || - (code >= _charcodes.charCodes.uppercaseA && code <= _charcodes.charCodes.uppercaseF) || - code === _charcodes.charCodes.underscore - ) { - _base.state.pos++; - } else { - break; - } - } - - const nextChar = _base.input.charCodeAt(_base.state.pos); - if (nextChar === _charcodes.charCodes.lowercaseN) { - ++_base.state.pos; - finishToken(_types.TokenType.bigint); - } else { - finishToken(_types.TokenType.num); - } -} - -// Read an integer, octal integer, or floating-point number. -function readNumber(startsWithDot) { - let isBigInt = false; - let isDecimal = false; - - if (!startsWithDot) { - readInt(); - } - - let nextChar = _base.input.charCodeAt(_base.state.pos); - if (nextChar === _charcodes.charCodes.dot) { - ++_base.state.pos; - readInt(); - nextChar = _base.input.charCodeAt(_base.state.pos); - } - - if (nextChar === _charcodes.charCodes.uppercaseE || nextChar === _charcodes.charCodes.lowercaseE) { - nextChar = _base.input.charCodeAt(++_base.state.pos); - if (nextChar === _charcodes.charCodes.plusSign || nextChar === _charcodes.charCodes.dash) { - ++_base.state.pos; - } - readInt(); - nextChar = _base.input.charCodeAt(_base.state.pos); - } - - if (nextChar === _charcodes.charCodes.lowercaseN) { - ++_base.state.pos; - isBigInt = true; - } else if (nextChar === _charcodes.charCodes.lowercaseM) { - ++_base.state.pos; - isDecimal = true; - } - - if (isBigInt) { - finishToken(_types.TokenType.bigint); - return; - } - - if (isDecimal) { - finishToken(_types.TokenType.decimal); - return; - } - - finishToken(_types.TokenType.num); -} - -function readString(quote) { - _base.state.pos++; - for (;;) { - if (_base.state.pos >= _base.input.length) { - _util.unexpected.call(void 0, "Unterminated string constant"); - return; - } - const ch = _base.input.charCodeAt(_base.state.pos); - if (ch === _charcodes.charCodes.backslash) { - _base.state.pos++; - } else if (ch === quote) { - break; - } - _base.state.pos++; - } - _base.state.pos++; - finishToken(_types.TokenType.string); -} - -// Reads template string tokens. -function readTmplToken() { - for (;;) { - if (_base.state.pos >= _base.input.length) { - _util.unexpected.call(void 0, "Unterminated template"); - return; - } - const ch = _base.input.charCodeAt(_base.state.pos); - if ( - ch === _charcodes.charCodes.graveAccent || - (ch === _charcodes.charCodes.dollarSign && _base.input.charCodeAt(_base.state.pos + 1) === _charcodes.charCodes.leftCurlyBrace) - ) { - if (_base.state.pos === _base.state.start && match(_types.TokenType.template)) { - if (ch === _charcodes.charCodes.dollarSign) { - _base.state.pos += 2; - finishToken(_types.TokenType.dollarBraceL); - return; - } else { - ++_base.state.pos; - finishToken(_types.TokenType.backQuote); - return; - } - } - finishToken(_types.TokenType.template); - return; - } - if (ch === _charcodes.charCodes.backslash) { - _base.state.pos++; - } - _base.state.pos++; - } -} - -// Skip to the end of the current word. Note that this is the same as the snippet at the end of -// readWord, but calling skipWord from readWord seems to slightly hurt performance from some rough -// measurements. - function skipWord() { - while (_base.state.pos < _base.input.length) { - const ch = _base.input.charCodeAt(_base.state.pos); - if (_identifier.IS_IDENTIFIER_CHAR[ch]) { - _base.state.pos++; - } else if (ch === _charcodes.charCodes.backslash) { - // \u - _base.state.pos += 2; - if (_base.input.charCodeAt(_base.state.pos) === _charcodes.charCodes.leftCurlyBrace) { - while ( - _base.state.pos < _base.input.length && - _base.input.charCodeAt(_base.state.pos) !== _charcodes.charCodes.rightCurlyBrace - ) { - _base.state.pos++; - } - _base.state.pos++; - } - } else { - break; - } - } -} exports.skipWord = skipWord; diff --git a/node_modules/sucrase/dist/parser/tokenizer/keywords.js b/node_modules/sucrase/dist/parser/tokenizer/keywords.js deleted file mode 100644 index e741926..0000000 --- a/node_modules/sucrase/dist/parser/tokenizer/keywords.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var ContextualKeyword; (function (ContextualKeyword) { - const NONE = 0; ContextualKeyword[ContextualKeyword["NONE"] = NONE] = "NONE"; - const _abstract = NONE + 1; ContextualKeyword[ContextualKeyword["_abstract"] = _abstract] = "_abstract"; - const _accessor = _abstract + 1; ContextualKeyword[ContextualKeyword["_accessor"] = _accessor] = "_accessor"; - const _as = _accessor + 1; ContextualKeyword[ContextualKeyword["_as"] = _as] = "_as"; - const _assert = _as + 1; ContextualKeyword[ContextualKeyword["_assert"] = _assert] = "_assert"; - const _asserts = _assert + 1; ContextualKeyword[ContextualKeyword["_asserts"] = _asserts] = "_asserts"; - const _async = _asserts + 1; ContextualKeyword[ContextualKeyword["_async"] = _async] = "_async"; - const _await = _async + 1; ContextualKeyword[ContextualKeyword["_await"] = _await] = "_await"; - const _checks = _await + 1; ContextualKeyword[ContextualKeyword["_checks"] = _checks] = "_checks"; - const _constructor = _checks + 1; ContextualKeyword[ContextualKeyword["_constructor"] = _constructor] = "_constructor"; - const _declare = _constructor + 1; ContextualKeyword[ContextualKeyword["_declare"] = _declare] = "_declare"; - const _enum = _declare + 1; ContextualKeyword[ContextualKeyword["_enum"] = _enum] = "_enum"; - const _exports = _enum + 1; ContextualKeyword[ContextualKeyword["_exports"] = _exports] = "_exports"; - const _from = _exports + 1; ContextualKeyword[ContextualKeyword["_from"] = _from] = "_from"; - const _get = _from + 1; ContextualKeyword[ContextualKeyword["_get"] = _get] = "_get"; - const _global = _get + 1; ContextualKeyword[ContextualKeyword["_global"] = _global] = "_global"; - const _implements = _global + 1; ContextualKeyword[ContextualKeyword["_implements"] = _implements] = "_implements"; - const _infer = _implements + 1; ContextualKeyword[ContextualKeyword["_infer"] = _infer] = "_infer"; - const _interface = _infer + 1; ContextualKeyword[ContextualKeyword["_interface"] = _interface] = "_interface"; - const _is = _interface + 1; ContextualKeyword[ContextualKeyword["_is"] = _is] = "_is"; - const _keyof = _is + 1; ContextualKeyword[ContextualKeyword["_keyof"] = _keyof] = "_keyof"; - const _mixins = _keyof + 1; ContextualKeyword[ContextualKeyword["_mixins"] = _mixins] = "_mixins"; - const _module = _mixins + 1; ContextualKeyword[ContextualKeyword["_module"] = _module] = "_module"; - const _namespace = _module + 1; ContextualKeyword[ContextualKeyword["_namespace"] = _namespace] = "_namespace"; - const _of = _namespace + 1; ContextualKeyword[ContextualKeyword["_of"] = _of] = "_of"; - const _opaque = _of + 1; ContextualKeyword[ContextualKeyword["_opaque"] = _opaque] = "_opaque"; - const _out = _opaque + 1; ContextualKeyword[ContextualKeyword["_out"] = _out] = "_out"; - const _override = _out + 1; ContextualKeyword[ContextualKeyword["_override"] = _override] = "_override"; - const _private = _override + 1; ContextualKeyword[ContextualKeyword["_private"] = _private] = "_private"; - const _protected = _private + 1; ContextualKeyword[ContextualKeyword["_protected"] = _protected] = "_protected"; - const _proto = _protected + 1; ContextualKeyword[ContextualKeyword["_proto"] = _proto] = "_proto"; - const _public = _proto + 1; ContextualKeyword[ContextualKeyword["_public"] = _public] = "_public"; - const _readonly = _public + 1; ContextualKeyword[ContextualKeyword["_readonly"] = _readonly] = "_readonly"; - const _require = _readonly + 1; ContextualKeyword[ContextualKeyword["_require"] = _require] = "_require"; - const _satisfies = _require + 1; ContextualKeyword[ContextualKeyword["_satisfies"] = _satisfies] = "_satisfies"; - const _set = _satisfies + 1; ContextualKeyword[ContextualKeyword["_set"] = _set] = "_set"; - const _static = _set + 1; ContextualKeyword[ContextualKeyword["_static"] = _static] = "_static"; - const _symbol = _static + 1; ContextualKeyword[ContextualKeyword["_symbol"] = _symbol] = "_symbol"; - const _type = _symbol + 1; ContextualKeyword[ContextualKeyword["_type"] = _type] = "_type"; - const _unique = _type + 1; ContextualKeyword[ContextualKeyword["_unique"] = _unique] = "_unique"; - const _using = _unique + 1; ContextualKeyword[ContextualKeyword["_using"] = _using] = "_using"; -})(ContextualKeyword || (exports.ContextualKeyword = ContextualKeyword = {})); diff --git a/node_modules/sucrase/dist/parser/tokenizer/readWord.js b/node_modules/sucrase/dist/parser/tokenizer/readWord.js deleted file mode 100644 index 69ed5c9..0000000 --- a/node_modules/sucrase/dist/parser/tokenizer/readWord.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _base = require('../traverser/base'); -var _charcodes = require('../util/charcodes'); -var _identifier = require('../util/identifier'); -var _index = require('./index'); -var _readWordTree = require('./readWordTree'); -var _types = require('./types'); - -/** - * Read an identifier, producing either a name token or matching on one of the existing keywords. - * For performance, we pre-generate big decision tree that we traverse. Each node represents a - * prefix and has 27 values, where the first value is the token or contextual token, if any (-1 if - * not), and the other 26 values are the transitions to other nodes, or -1 to stop. - */ - function readWord() { - let treePos = 0; - let code = 0; - let pos = _base.state.pos; - while (pos < _base.input.length) { - code = _base.input.charCodeAt(pos); - if (code < _charcodes.charCodes.lowercaseA || code > _charcodes.charCodes.lowercaseZ) { - break; - } - const next = _readWordTree.READ_WORD_TREE[treePos + (code - _charcodes.charCodes.lowercaseA) + 1]; - if (next === -1) { - break; - } else { - treePos = next; - pos++; - } - } - - const keywordValue = _readWordTree.READ_WORD_TREE[treePos]; - if (keywordValue > -1 && !_identifier.IS_IDENTIFIER_CHAR[code]) { - _base.state.pos = pos; - if (keywordValue & 1) { - _index.finishToken.call(void 0, keywordValue >>> 1); - } else { - _index.finishToken.call(void 0, _types.TokenType.name, keywordValue >>> 1); - } - return; - } - - while (pos < _base.input.length) { - const ch = _base.input.charCodeAt(pos); - if (_identifier.IS_IDENTIFIER_CHAR[ch]) { - pos++; - } else if (ch === _charcodes.charCodes.backslash) { - // \u - pos += 2; - if (_base.input.charCodeAt(pos) === _charcodes.charCodes.leftCurlyBrace) { - while (pos < _base.input.length && _base.input.charCodeAt(pos) !== _charcodes.charCodes.rightCurlyBrace) { - pos++; - } - pos++; - } - } else if (ch === _charcodes.charCodes.atSign && _base.input.charCodeAt(pos + 1) === _charcodes.charCodes.atSign) { - pos += 2; - } else { - break; - } - } - _base.state.pos = pos; - _index.finishToken.call(void 0, _types.TokenType.name); -} exports.default = readWord; diff --git a/node_modules/sucrase/dist/parser/tokenizer/readWordTree.js b/node_modules/sucrase/dist/parser/tokenizer/readWordTree.js deleted file mode 100644 index fcc7733..0000000 --- a/node_modules/sucrase/dist/parser/tokenizer/readWordTree.js +++ /dev/null @@ -1,671 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});// Generated file, do not edit! Run "yarn generate" to re-generate this file. -var _keywords = require('./keywords'); -var _types = require('./types'); - -// prettier-ignore - const READ_WORD_TREE = new Int32Array([ - // "" - -1, 27, 783, 918, 1755, 2376, 2862, 3483, -1, 3699, -1, 4617, 4752, 4833, 5130, 5508, 5940, -1, 6480, 6939, 7749, 8181, 8451, 8613, -1, 8829, -1, - // "a" - -1, -1, 54, 243, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 432, -1, -1, -1, 675, -1, -1, -1, - // "ab" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, -1, -1, -1, - // "abs" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 108, -1, -1, -1, -1, -1, -1, - // "abst" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 135, -1, -1, -1, -1, -1, -1, -1, -1, - // "abstr" - -1, 162, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "abstra" - -1, -1, -1, 189, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "abstrac" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 216, -1, -1, -1, -1, -1, -1, - // "abstract" - _keywords.ContextualKeyword._abstract << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ac" - -1, -1, -1, 270, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "acc" - -1, -1, -1, -1, -1, 297, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "acce" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 324, -1, -1, -1, -1, -1, -1, -1, - // "acces" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 351, -1, -1, -1, -1, -1, -1, -1, - // "access" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 378, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "accesso" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 405, -1, -1, -1, -1, -1, -1, -1, -1, - // "accessor" - _keywords.ContextualKeyword._accessor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "as" - _keywords.ContextualKeyword._as << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 459, -1, -1, -1, -1, -1, 594, -1, - // "ass" - -1, -1, -1, -1, -1, 486, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "asse" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 513, -1, -1, -1, -1, -1, -1, -1, -1, - // "asser" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 540, -1, -1, -1, -1, -1, -1, - // "assert" - _keywords.ContextualKeyword._assert << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 567, -1, -1, -1, -1, -1, -1, -1, - // "asserts" - _keywords.ContextualKeyword._asserts << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "asy" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 621, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "asyn" - -1, -1, -1, 648, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "async" - _keywords.ContextualKeyword._async << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "aw" - -1, 702, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "awa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 729, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "awai" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 756, -1, -1, -1, -1, -1, -1, - // "await" - _keywords.ContextualKeyword._await << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "b" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 810, -1, -1, -1, -1, -1, -1, -1, -1, - // "br" - -1, -1, -1, -1, -1, 837, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "bre" - -1, 864, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "brea" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 891, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "break" - (_types.TokenType._break << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "c" - -1, 945, -1, -1, -1, -1, -1, -1, 1107, -1, -1, -1, 1242, -1, -1, 1350, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ca" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 972, 1026, -1, -1, -1, -1, -1, -1, - // "cas" - -1, -1, -1, -1, -1, 999, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "case" - (_types.TokenType._case << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "cat" - -1, -1, -1, 1053, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "catc" - -1, -1, -1, -1, -1, -1, -1, -1, 1080, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "catch" - (_types.TokenType._catch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ch" - -1, -1, -1, -1, -1, 1134, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "che" - -1, -1, -1, 1161, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "chec" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1188, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "check" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1215, -1, -1, -1, -1, -1, -1, -1, - // "checks" - _keywords.ContextualKeyword._checks << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "cl" - -1, 1269, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "cla" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1296, -1, -1, -1, -1, -1, -1, -1, - // "clas" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1323, -1, -1, -1, -1, -1, -1, -1, - // "class" - (_types.TokenType._class << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "co" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1377, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "con" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1404, 1620, -1, -1, -1, -1, -1, -1, - // "cons" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1431, -1, -1, -1, -1, -1, -1, - // "const" - (_types.TokenType._const << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1458, -1, -1, -1, -1, -1, -1, -1, -1, - // "constr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1485, -1, -1, -1, -1, -1, - // "constru" - -1, -1, -1, 1512, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "construc" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1539, -1, -1, -1, -1, -1, -1, - // "construct" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1566, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "constructo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1593, -1, -1, -1, -1, -1, -1, -1, -1, - // "constructor" - _keywords.ContextualKeyword._constructor << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "cont" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1647, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "conti" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1674, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "contin" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1701, -1, -1, -1, -1, -1, - // "continu" - -1, -1, -1, -1, -1, 1728, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "continue" - (_types.TokenType._continue << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "d" - -1, -1, -1, -1, -1, 1782, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2349, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "de" - -1, -1, 1809, 1971, -1, -1, 2106, -1, -1, -1, -1, -1, 2241, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "deb" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1836, -1, -1, -1, -1, -1, - // "debu" - -1, -1, -1, -1, -1, -1, -1, 1863, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "debug" - -1, -1, -1, -1, -1, -1, -1, 1890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "debugg" - -1, -1, -1, -1, -1, 1917, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "debugge" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1944, -1, -1, -1, -1, -1, -1, -1, -1, - // "debugger" - (_types.TokenType._debugger << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "dec" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1998, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "decl" - -1, 2025, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "decla" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2052, -1, -1, -1, -1, -1, -1, -1, -1, - // "declar" - -1, -1, -1, -1, -1, 2079, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "declare" - _keywords.ContextualKeyword._declare << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "def" - -1, 2133, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "defa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2160, -1, -1, -1, -1, -1, - // "defau" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2187, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "defaul" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2214, -1, -1, -1, -1, -1, -1, - // "default" - (_types.TokenType._default << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "del" - -1, -1, -1, -1, -1, 2268, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "dele" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2295, -1, -1, -1, -1, -1, -1, - // "delet" - -1, -1, -1, -1, -1, 2322, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "delete" - (_types.TokenType._delete << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "do" - (_types.TokenType._do << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "e" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2403, -1, 2484, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2565, -1, -1, - // "el" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2430, -1, -1, -1, -1, -1, -1, -1, - // "els" - -1, -1, -1, -1, -1, 2457, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "else" - (_types.TokenType._else << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "en" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2511, -1, -1, -1, -1, -1, - // "enu" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2538, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "enum" - _keywords.ContextualKeyword._enum << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ex" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2592, -1, -1, -1, 2727, -1, -1, -1, -1, -1, -1, - // "exp" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2619, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "expo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2646, -1, -1, -1, -1, -1, -1, -1, -1, - // "expor" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2673, -1, -1, -1, -1, -1, -1, - // "export" - (_types.TokenType._export << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2700, -1, -1, -1, -1, -1, -1, -1, - // "exports" - _keywords.ContextualKeyword._exports << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ext" - -1, -1, -1, -1, -1, 2754, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "exte" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2781, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "exten" - -1, -1, -1, -1, 2808, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "extend" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2835, -1, -1, -1, -1, -1, -1, -1, - // "extends" - (_types.TokenType._extends << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "f" - -1, 2889, -1, -1, -1, -1, -1, -1, -1, 2997, -1, -1, -1, -1, -1, 3159, -1, -1, 3213, -1, -1, 3294, -1, -1, -1, -1, -1, - // "fa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2916, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fal" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2943, -1, -1, -1, -1, -1, -1, -1, - // "fals" - -1, -1, -1, -1, -1, 2970, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "false" - (_types.TokenType._false << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3024, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fin" - -1, 3051, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fina" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3078, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "final" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3105, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "finall" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3132, -1, - // "finally" - (_types.TokenType._finally << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3186, -1, -1, -1, -1, -1, -1, -1, -1, - // "for" - (_types.TokenType._for << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3240, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fro" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3267, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "from" - _keywords.ContextualKeyword._from << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fu" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3321, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "fun" - -1, -1, -1, 3348, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "func" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3375, -1, -1, -1, -1, -1, -1, - // "funct" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 3402, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "functi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3429, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "functio" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3456, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "function" - (_types.TokenType._function << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "g" - -1, -1, -1, -1, -1, 3510, -1, -1, -1, -1, -1, -1, 3564, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ge" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3537, -1, -1, -1, -1, -1, -1, - // "get" - _keywords.ContextualKeyword._get << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "gl" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3591, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "glo" - -1, -1, 3618, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "glob" - -1, 3645, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "globa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3672, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "global" - _keywords.ContextualKeyword._global << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "i" - -1, -1, -1, -1, -1, -1, 3726, -1, -1, -1, -1, -1, -1, 3753, 4077, -1, -1, -1, -1, 4590, -1, -1, -1, -1, -1, -1, -1, - // "if" - (_types.TokenType._if << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "im" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3780, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "imp" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3807, -1, -1, 3996, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "impl" - -1, -1, -1, -1, -1, 3834, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "imple" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3861, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "implem" - -1, -1, -1, -1, -1, 3888, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "impleme" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3915, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "implemen" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3942, -1, -1, -1, -1, -1, -1, - // "implement" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 3969, -1, -1, -1, -1, -1, -1, -1, - // "implements" - _keywords.ContextualKeyword._implements << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "impo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4023, -1, -1, -1, -1, -1, -1, -1, -1, - // "impor" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4050, -1, -1, -1, -1, -1, -1, - // "import" - (_types.TokenType._import << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "in" - (_types.TokenType._in << 1) + 1, -1, -1, -1, -1, -1, 4104, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4185, 4401, -1, -1, -1, -1, -1, -1, - // "inf" - -1, -1, -1, -1, -1, 4131, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "infe" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4158, -1, -1, -1, -1, -1, -1, -1, -1, - // "infer" - _keywords.ContextualKeyword._infer << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ins" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4212, -1, -1, -1, -1, -1, -1, - // "inst" - -1, 4239, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "insta" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4266, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "instan" - -1, -1, -1, 4293, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "instanc" - -1, -1, -1, -1, -1, 4320, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "instance" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4347, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "instanceo" - -1, -1, -1, -1, -1, -1, 4374, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "instanceof" - (_types.TokenType._instanceof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "int" - -1, -1, -1, -1, -1, 4428, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "inte" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4455, -1, -1, -1, -1, -1, -1, -1, -1, - // "inter" - -1, -1, -1, -1, -1, -1, 4482, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "interf" - -1, 4509, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "interfa" - -1, -1, -1, 4536, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "interfac" - -1, -1, -1, -1, -1, 4563, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "interface" - _keywords.ContextualKeyword._interface << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "is" - _keywords.ContextualKeyword._is << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "k" - -1, -1, -1, -1, -1, 4644, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ke" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4671, -1, - // "key" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4698, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "keyo" - -1, -1, -1, -1, -1, -1, 4725, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "keyof" - _keywords.ContextualKeyword._keyof << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "l" - -1, -1, -1, -1, -1, 4779, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "le" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4806, -1, -1, -1, -1, -1, -1, - // "let" - (_types.TokenType._let << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "m" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 4860, -1, -1, -1, -1, -1, 4995, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "mi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4887, -1, -1, - // "mix" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 4914, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "mixi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4941, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "mixin" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 4968, -1, -1, -1, -1, -1, -1, -1, - // "mixins" - _keywords.ContextualKeyword._mixins << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "mo" - -1, -1, -1, -1, 5022, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "mod" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5049, -1, -1, -1, -1, -1, - // "modu" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5076, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "modul" - -1, -1, -1, -1, -1, 5103, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "module" - _keywords.ContextualKeyword._module << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "n" - -1, 5157, -1, -1, -1, 5373, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5427, -1, -1, -1, -1, -1, - // "na" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5184, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "nam" - -1, -1, -1, -1, -1, 5211, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "name" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5238, -1, -1, -1, -1, -1, -1, -1, - // "names" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5265, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "namesp" - -1, 5292, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "namespa" - -1, -1, -1, 5319, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "namespac" - -1, -1, -1, -1, -1, 5346, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "namespace" - _keywords.ContextualKeyword._namespace << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ne" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5400, -1, -1, -1, - // "new" - (_types.TokenType._new << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "nu" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5454, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "nul" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5481, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "null" - (_types.TokenType._null << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "o" - -1, -1, -1, -1, -1, -1, 5535, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5562, -1, -1, -1, -1, 5697, 5751, -1, -1, -1, -1, - // "of" - _keywords.ContextualKeyword._of << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "op" - -1, 5589, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "opa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5616, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "opaq" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5643, -1, -1, -1, -1, -1, - // "opaqu" - -1, -1, -1, -1, -1, 5670, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "opaque" - _keywords.ContextualKeyword._opaque << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ou" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5724, -1, -1, -1, -1, -1, -1, - // "out" - _keywords.ContextualKeyword._out << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ov" - -1, -1, -1, -1, -1, 5778, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ove" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5805, -1, -1, -1, -1, -1, -1, -1, -1, - // "over" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5832, -1, -1, -1, -1, -1, -1, -1, -1, - // "overr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 5859, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "overri" - -1, -1, -1, -1, 5886, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "overrid" - -1, -1, -1, -1, -1, 5913, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "override" - _keywords.ContextualKeyword._override << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "p" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 5967, -1, -1, 6345, -1, -1, -1, -1, -1, - // "pr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 5994, -1, -1, -1, -1, -1, 6129, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "pri" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6021, -1, -1, -1, -1, - // "priv" - -1, 6048, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "priva" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6075, -1, -1, -1, -1, -1, -1, - // "privat" - -1, -1, -1, -1, -1, 6102, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "private" - _keywords.ContextualKeyword._private << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "pro" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6156, -1, -1, -1, -1, -1, -1, - // "prot" - -1, -1, -1, -1, -1, 6183, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6318, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "prote" - -1, -1, -1, 6210, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "protec" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6237, -1, -1, -1, -1, -1, -1, - // "protect" - -1, -1, -1, -1, -1, 6264, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "protecte" - -1, -1, -1, -1, 6291, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "protected" - _keywords.ContextualKeyword._protected << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "proto" - _keywords.ContextualKeyword._proto << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "pu" - -1, -1, 6372, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "pub" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6399, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "publ" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 6426, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "publi" - -1, -1, -1, 6453, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "public" - _keywords.ContextualKeyword._public << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "r" - -1, -1, -1, -1, -1, 6507, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "re" - -1, 6534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6696, -1, -1, 6831, -1, -1, -1, -1, -1, -1, - // "rea" - -1, -1, -1, -1, 6561, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "read" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6588, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "reado" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6615, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "readon" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6642, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "readonl" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6669, -1, - // "readonly" - _keywords.ContextualKeyword._readonly << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "req" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6723, -1, -1, -1, -1, -1, - // "requ" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 6750, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "requi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6777, -1, -1, -1, -1, -1, -1, -1, -1, - // "requir" - -1, -1, -1, -1, -1, 6804, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "require" - _keywords.ContextualKeyword._require << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ret" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6858, -1, -1, -1, -1, -1, - // "retu" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6885, -1, -1, -1, -1, -1, -1, -1, -1, - // "retur" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6912, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "return" - (_types.TokenType._return << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "s" - -1, 6966, -1, -1, -1, 7182, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7236, 7371, -1, 7479, -1, 7614, -1, - // "sa" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 6993, -1, -1, -1, -1, -1, -1, - // "sat" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7020, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sati" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7047, -1, -1, -1, -1, -1, -1, -1, - // "satis" - -1, -1, -1, -1, -1, -1, 7074, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "satisf" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7101, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "satisfi" - -1, -1, -1, -1, -1, 7128, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "satisfie" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7155, -1, -1, -1, -1, -1, -1, -1, - // "satisfies" - _keywords.ContextualKeyword._satisfies << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "se" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7209, -1, -1, -1, -1, -1, -1, - // "set" - _keywords.ContextualKeyword._set << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "st" - -1, 7263, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sta" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7290, -1, -1, -1, -1, -1, -1, - // "stat" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7317, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "stati" - -1, -1, -1, 7344, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "static" - _keywords.ContextualKeyword._static << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "su" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7398, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sup" - -1, -1, -1, -1, -1, 7425, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "supe" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7452, -1, -1, -1, -1, -1, -1, -1, -1, - // "super" - (_types.TokenType._super << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sw" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7506, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "swi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7533, -1, -1, -1, -1, -1, -1, - // "swit" - -1, -1, -1, 7560, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "switc" - -1, -1, -1, -1, -1, -1, -1, -1, 7587, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "switch" - (_types.TokenType._switch << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sy" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7641, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "sym" - -1, -1, 7668, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "symb" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7695, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "symbo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7722, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "symbol" - _keywords.ContextualKeyword._symbol << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "t" - -1, -1, -1, -1, -1, -1, -1, -1, 7776, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7938, -1, -1, -1, -1, -1, -1, 8046, -1, - // "th" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 7803, -1, -1, -1, -1, -1, -1, -1, -1, 7857, -1, -1, -1, -1, -1, -1, -1, -1, - // "thi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7830, -1, -1, -1, -1, -1, -1, -1, - // "this" - (_types.TokenType._this << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "thr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7884, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "thro" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7911, -1, -1, -1, - // "throw" - (_types.TokenType._throw << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "tr" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 7965, -1, -1, -1, 8019, -1, - // "tru" - -1, -1, -1, -1, -1, 7992, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "true" - (_types.TokenType._true << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "try" - (_types.TokenType._try << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "ty" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8073, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "typ" - -1, -1, -1, -1, -1, 8100, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "type" - _keywords.ContextualKeyword._type << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8127, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "typeo" - -1, -1, -1, -1, -1, -1, 8154, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "typeof" - (_types.TokenType._typeof << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "u" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8208, -1, -1, -1, -1, 8343, -1, -1, -1, -1, -1, -1, -1, - // "un" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8235, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "uni" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8262, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "uniq" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8289, -1, -1, -1, -1, -1, - // "uniqu" - -1, -1, -1, -1, -1, 8316, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "unique" - _keywords.ContextualKeyword._unique << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "us" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8370, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "usi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8397, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "usin" - -1, -1, -1, -1, -1, -1, -1, 8424, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "using" - _keywords.ContextualKeyword._using << 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "v" - -1, 8478, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8532, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "va" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8505, -1, -1, -1, -1, -1, -1, -1, -1, - // "var" - (_types.TokenType._var << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "vo" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8559, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "voi" - -1, -1, -1, -1, 8586, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "void" - (_types.TokenType._void << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "w" - -1, -1, -1, -1, -1, -1, -1, -1, 8640, 8748, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "wh" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8667, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "whi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8694, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "whil" - -1, -1, -1, -1, -1, 8721, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "while" - (_types.TokenType._while << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "wi" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8775, -1, -1, -1, -1, -1, -1, - // "wit" - -1, -1, -1, -1, -1, -1, -1, -1, 8802, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "with" - (_types.TokenType._with << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "y" - -1, -1, -1, -1, -1, -1, -1, -1, -1, 8856, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "yi" - -1, -1, -1, -1, -1, 8883, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "yie" - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8910, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "yiel" - -1, -1, -1, -1, 8937, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - // "yield" - (_types.TokenType._yield << 1) + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -]); exports.READ_WORD_TREE = READ_WORD_TREE; diff --git a/node_modules/sucrase/dist/parser/tokenizer/state.js b/node_modules/sucrase/dist/parser/tokenizer/state.js deleted file mode 100644 index 359e1b4..0000000 --- a/node_modules/sucrase/dist/parser/tokenizer/state.js +++ /dev/null @@ -1,106 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); -var _keywords = require('./keywords'); -var _types = require('./types'); - - class Scope { - - - - - constructor(startTokenIndex, endTokenIndex, isFunctionScope) { - this.startTokenIndex = startTokenIndex; - this.endTokenIndex = endTokenIndex; - this.isFunctionScope = isFunctionScope; - } -} exports.Scope = Scope; - - class StateSnapshot { - constructor( - potentialArrowAt, - noAnonFunctionType, - inDisallowConditionalTypesContext, - tokensLength, - scopesLength, - pos, - type, - contextualKeyword, - start, - end, - isType, - scopeDepth, - error, - ) {;this.potentialArrowAt = potentialArrowAt;this.noAnonFunctionType = noAnonFunctionType;this.inDisallowConditionalTypesContext = inDisallowConditionalTypesContext;this.tokensLength = tokensLength;this.scopesLength = scopesLength;this.pos = pos;this.type = type;this.contextualKeyword = contextualKeyword;this.start = start;this.end = end;this.isType = isType;this.scopeDepth = scopeDepth;this.error = error;} -} exports.StateSnapshot = StateSnapshot; - - class State {constructor() { State.prototype.__init.call(this);State.prototype.__init2.call(this);State.prototype.__init3.call(this);State.prototype.__init4.call(this);State.prototype.__init5.call(this);State.prototype.__init6.call(this);State.prototype.__init7.call(this);State.prototype.__init8.call(this);State.prototype.__init9.call(this);State.prototype.__init10.call(this);State.prototype.__init11.call(this);State.prototype.__init12.call(this);State.prototype.__init13.call(this); } - // Used to signify the start of a potential arrow function - __init() {this.potentialArrowAt = -1} - - // Used by Flow to handle an edge case involving function type parsing. - __init2() {this.noAnonFunctionType = false} - - // Used by TypeScript to handle ambiguities when parsing conditional types. - __init3() {this.inDisallowConditionalTypesContext = false} - - // Token store. - __init4() {this.tokens = []} - - // Array of all observed scopes, ordered by their ending position. - __init5() {this.scopes = []} - - // The current position of the tokenizer in the input. - __init6() {this.pos = 0} - - // Information about the current token. - __init7() {this.type = _types.TokenType.eof} - __init8() {this.contextualKeyword = _keywords.ContextualKeyword.NONE} - __init9() {this.start = 0} - __init10() {this.end = 0} - - __init11() {this.isType = false} - __init12() {this.scopeDepth = 0} - - /** - * If the parser is in an error state, then the token is always tt.eof and all functions can - * keep executing but should be written so they don't get into an infinite loop in this situation. - * - * This approach, combined with the ability to snapshot and restore state, allows us to implement - * backtracking without exceptions and without needing to explicitly propagate error states - * everywhere. - */ - __init13() {this.error = null} - - snapshot() { - return new StateSnapshot( - this.potentialArrowAt, - this.noAnonFunctionType, - this.inDisallowConditionalTypesContext, - this.tokens.length, - this.scopes.length, - this.pos, - this.type, - this.contextualKeyword, - this.start, - this.end, - this.isType, - this.scopeDepth, - this.error, - ); - } - - restoreFromSnapshot(snapshot) { - this.potentialArrowAt = snapshot.potentialArrowAt; - this.noAnonFunctionType = snapshot.noAnonFunctionType; - this.inDisallowConditionalTypesContext = snapshot.inDisallowConditionalTypesContext; - this.tokens.length = snapshot.tokensLength; - this.scopes.length = snapshot.scopesLength; - this.pos = snapshot.pos; - this.type = snapshot.type; - this.contextualKeyword = snapshot.contextualKeyword; - this.start = snapshot.start; - this.end = snapshot.end; - this.isType = snapshot.isType; - this.scopeDepth = snapshot.scopeDepth; - this.error = snapshot.error; - } -} exports.default = State; diff --git a/node_modules/sucrase/dist/parser/tokenizer/types.js b/node_modules/sucrase/dist/parser/tokenizer/types.js deleted file mode 100644 index c1f2a81..0000000 --- a/node_modules/sucrase/dist/parser/tokenizer/types.js +++ /dev/null @@ -1,361 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});// Generated file, do not edit! Run "yarn generate" to re-generate this file. -/* istanbul ignore file */ -/** - * Enum of all token types, with bit fields to signify meaningful properties. - */ -var TokenType; (function (TokenType) { - // Precedence 0 means not an operator; otherwise it is a positive number up to 12. - const PRECEDENCE_MASK = 0xf; TokenType[TokenType["PRECEDENCE_MASK"] = PRECEDENCE_MASK] = "PRECEDENCE_MASK"; - const IS_KEYWORD = 1 << 4; TokenType[TokenType["IS_KEYWORD"] = IS_KEYWORD] = "IS_KEYWORD"; - const IS_ASSIGN = 1 << 5; TokenType[TokenType["IS_ASSIGN"] = IS_ASSIGN] = "IS_ASSIGN"; - const IS_RIGHT_ASSOCIATIVE = 1 << 6; TokenType[TokenType["IS_RIGHT_ASSOCIATIVE"] = IS_RIGHT_ASSOCIATIVE] = "IS_RIGHT_ASSOCIATIVE"; - const IS_PREFIX = 1 << 7; TokenType[TokenType["IS_PREFIX"] = IS_PREFIX] = "IS_PREFIX"; - const IS_POSTFIX = 1 << 8; TokenType[TokenType["IS_POSTFIX"] = IS_POSTFIX] = "IS_POSTFIX"; - const IS_EXPRESSION_START = 1 << 9; TokenType[TokenType["IS_EXPRESSION_START"] = IS_EXPRESSION_START] = "IS_EXPRESSION_START"; - - const num = 512; TokenType[TokenType["num"] = num] = "num"; // num startsExpr - const bigint = 1536; TokenType[TokenType["bigint"] = bigint] = "bigint"; // bigint startsExpr - const decimal = 2560; TokenType[TokenType["decimal"] = decimal] = "decimal"; // decimal startsExpr - const regexp = 3584; TokenType[TokenType["regexp"] = regexp] = "regexp"; // regexp startsExpr - const string = 4608; TokenType[TokenType["string"] = string] = "string"; // string startsExpr - const name = 5632; TokenType[TokenType["name"] = name] = "name"; // name startsExpr - const eof = 6144; TokenType[TokenType["eof"] = eof] = "eof"; // eof - const bracketL = 7680; TokenType[TokenType["bracketL"] = bracketL] = "bracketL"; // [ startsExpr - const bracketR = 8192; TokenType[TokenType["bracketR"] = bracketR] = "bracketR"; // ] - const braceL = 9728; TokenType[TokenType["braceL"] = braceL] = "braceL"; // { startsExpr - const braceBarL = 10752; TokenType[TokenType["braceBarL"] = braceBarL] = "braceBarL"; // {| startsExpr - const braceR = 11264; TokenType[TokenType["braceR"] = braceR] = "braceR"; // } - const braceBarR = 12288; TokenType[TokenType["braceBarR"] = braceBarR] = "braceBarR"; // |} - const parenL = 13824; TokenType[TokenType["parenL"] = parenL] = "parenL"; // ( startsExpr - const parenR = 14336; TokenType[TokenType["parenR"] = parenR] = "parenR"; // ) - const comma = 15360; TokenType[TokenType["comma"] = comma] = "comma"; // , - const semi = 16384; TokenType[TokenType["semi"] = semi] = "semi"; // ; - const colon = 17408; TokenType[TokenType["colon"] = colon] = "colon"; // : - const doubleColon = 18432; TokenType[TokenType["doubleColon"] = doubleColon] = "doubleColon"; // :: - const dot = 19456; TokenType[TokenType["dot"] = dot] = "dot"; // . - const question = 20480; TokenType[TokenType["question"] = question] = "question"; // ? - const questionDot = 21504; TokenType[TokenType["questionDot"] = questionDot] = "questionDot"; // ?. - const arrow = 22528; TokenType[TokenType["arrow"] = arrow] = "arrow"; // => - const template = 23552; TokenType[TokenType["template"] = template] = "template"; // template - const ellipsis = 24576; TokenType[TokenType["ellipsis"] = ellipsis] = "ellipsis"; // ... - const backQuote = 25600; TokenType[TokenType["backQuote"] = backQuote] = "backQuote"; // ` - const dollarBraceL = 27136; TokenType[TokenType["dollarBraceL"] = dollarBraceL] = "dollarBraceL"; // ${ startsExpr - const at = 27648; TokenType[TokenType["at"] = at] = "at"; // @ - const hash = 29184; TokenType[TokenType["hash"] = hash] = "hash"; // # startsExpr - const eq = 29728; TokenType[TokenType["eq"] = eq] = "eq"; // = isAssign - const assign = 30752; TokenType[TokenType["assign"] = assign] = "assign"; // _= isAssign - const preIncDec = 32640; TokenType[TokenType["preIncDec"] = preIncDec] = "preIncDec"; // ++/-- prefix postfix startsExpr - const postIncDec = 33664; TokenType[TokenType["postIncDec"] = postIncDec] = "postIncDec"; // ++/-- prefix postfix startsExpr - const bang = 34432; TokenType[TokenType["bang"] = bang] = "bang"; // ! prefix startsExpr - const tilde = 35456; TokenType[TokenType["tilde"] = tilde] = "tilde"; // ~ prefix startsExpr - const pipeline = 35841; TokenType[TokenType["pipeline"] = pipeline] = "pipeline"; // |> prec:1 - const nullishCoalescing = 36866; TokenType[TokenType["nullishCoalescing"] = nullishCoalescing] = "nullishCoalescing"; // ?? prec:2 - const logicalOR = 37890; TokenType[TokenType["logicalOR"] = logicalOR] = "logicalOR"; // || prec:2 - const logicalAND = 38915; TokenType[TokenType["logicalAND"] = logicalAND] = "logicalAND"; // && prec:3 - const bitwiseOR = 39940; TokenType[TokenType["bitwiseOR"] = bitwiseOR] = "bitwiseOR"; // | prec:4 - const bitwiseXOR = 40965; TokenType[TokenType["bitwiseXOR"] = bitwiseXOR] = "bitwiseXOR"; // ^ prec:5 - const bitwiseAND = 41990; TokenType[TokenType["bitwiseAND"] = bitwiseAND] = "bitwiseAND"; // & prec:6 - const equality = 43015; TokenType[TokenType["equality"] = equality] = "equality"; // ==/!= prec:7 - const lessThan = 44040; TokenType[TokenType["lessThan"] = lessThan] = "lessThan"; // < prec:8 - const greaterThan = 45064; TokenType[TokenType["greaterThan"] = greaterThan] = "greaterThan"; // > prec:8 - const relationalOrEqual = 46088; TokenType[TokenType["relationalOrEqual"] = relationalOrEqual] = "relationalOrEqual"; // <=/>= prec:8 - const bitShiftL = 47113; TokenType[TokenType["bitShiftL"] = bitShiftL] = "bitShiftL"; // << prec:9 - const bitShiftR = 48137; TokenType[TokenType["bitShiftR"] = bitShiftR] = "bitShiftR"; // >>/>>> prec:9 - const plus = 49802; TokenType[TokenType["plus"] = plus] = "plus"; // + prec:10 prefix startsExpr - const minus = 50826; TokenType[TokenType["minus"] = minus] = "minus"; // - prec:10 prefix startsExpr - const modulo = 51723; TokenType[TokenType["modulo"] = modulo] = "modulo"; // % prec:11 startsExpr - const star = 52235; TokenType[TokenType["star"] = star] = "star"; // * prec:11 - const slash = 53259; TokenType[TokenType["slash"] = slash] = "slash"; // / prec:11 - const exponent = 54348; TokenType[TokenType["exponent"] = exponent] = "exponent"; // ** prec:12 rightAssociative - const jsxName = 55296; TokenType[TokenType["jsxName"] = jsxName] = "jsxName"; // jsxName - const jsxText = 56320; TokenType[TokenType["jsxText"] = jsxText] = "jsxText"; // jsxText - const jsxEmptyText = 57344; TokenType[TokenType["jsxEmptyText"] = jsxEmptyText] = "jsxEmptyText"; // jsxEmptyText - const jsxTagStart = 58880; TokenType[TokenType["jsxTagStart"] = jsxTagStart] = "jsxTagStart"; // jsxTagStart startsExpr - const jsxTagEnd = 59392; TokenType[TokenType["jsxTagEnd"] = jsxTagEnd] = "jsxTagEnd"; // jsxTagEnd - const typeParameterStart = 60928; TokenType[TokenType["typeParameterStart"] = typeParameterStart] = "typeParameterStart"; // typeParameterStart startsExpr - const nonNullAssertion = 61440; TokenType[TokenType["nonNullAssertion"] = nonNullAssertion] = "nonNullAssertion"; // nonNullAssertion - const _break = 62480; TokenType[TokenType["_break"] = _break] = "_break"; // break keyword - const _case = 63504; TokenType[TokenType["_case"] = _case] = "_case"; // case keyword - const _catch = 64528; TokenType[TokenType["_catch"] = _catch] = "_catch"; // catch keyword - const _continue = 65552; TokenType[TokenType["_continue"] = _continue] = "_continue"; // continue keyword - const _debugger = 66576; TokenType[TokenType["_debugger"] = _debugger] = "_debugger"; // debugger keyword - const _default = 67600; TokenType[TokenType["_default"] = _default] = "_default"; // default keyword - const _do = 68624; TokenType[TokenType["_do"] = _do] = "_do"; // do keyword - const _else = 69648; TokenType[TokenType["_else"] = _else] = "_else"; // else keyword - const _finally = 70672; TokenType[TokenType["_finally"] = _finally] = "_finally"; // finally keyword - const _for = 71696; TokenType[TokenType["_for"] = _for] = "_for"; // for keyword - const _function = 73232; TokenType[TokenType["_function"] = _function] = "_function"; // function keyword startsExpr - const _if = 73744; TokenType[TokenType["_if"] = _if] = "_if"; // if keyword - const _return = 74768; TokenType[TokenType["_return"] = _return] = "_return"; // return keyword - const _switch = 75792; TokenType[TokenType["_switch"] = _switch] = "_switch"; // switch keyword - const _throw = 77456; TokenType[TokenType["_throw"] = _throw] = "_throw"; // throw keyword prefix startsExpr - const _try = 77840; TokenType[TokenType["_try"] = _try] = "_try"; // try keyword - const _var = 78864; TokenType[TokenType["_var"] = _var] = "_var"; // var keyword - const _let = 79888; TokenType[TokenType["_let"] = _let] = "_let"; // let keyword - const _const = 80912; TokenType[TokenType["_const"] = _const] = "_const"; // const keyword - const _while = 81936; TokenType[TokenType["_while"] = _while] = "_while"; // while keyword - const _with = 82960; TokenType[TokenType["_with"] = _with] = "_with"; // with keyword - const _new = 84496; TokenType[TokenType["_new"] = _new] = "_new"; // new keyword startsExpr - const _this = 85520; TokenType[TokenType["_this"] = _this] = "_this"; // this keyword startsExpr - const _super = 86544; TokenType[TokenType["_super"] = _super] = "_super"; // super keyword startsExpr - const _class = 87568; TokenType[TokenType["_class"] = _class] = "_class"; // class keyword startsExpr - const _extends = 88080; TokenType[TokenType["_extends"] = _extends] = "_extends"; // extends keyword - const _export = 89104; TokenType[TokenType["_export"] = _export] = "_export"; // export keyword - const _import = 90640; TokenType[TokenType["_import"] = _import] = "_import"; // import keyword startsExpr - const _yield = 91664; TokenType[TokenType["_yield"] = _yield] = "_yield"; // yield keyword startsExpr - const _null = 92688; TokenType[TokenType["_null"] = _null] = "_null"; // null keyword startsExpr - const _true = 93712; TokenType[TokenType["_true"] = _true] = "_true"; // true keyword startsExpr - const _false = 94736; TokenType[TokenType["_false"] = _false] = "_false"; // false keyword startsExpr - const _in = 95256; TokenType[TokenType["_in"] = _in] = "_in"; // in prec:8 keyword - const _instanceof = 96280; TokenType[TokenType["_instanceof"] = _instanceof] = "_instanceof"; // instanceof prec:8 keyword - const _typeof = 97936; TokenType[TokenType["_typeof"] = _typeof] = "_typeof"; // typeof keyword prefix startsExpr - const _void = 98960; TokenType[TokenType["_void"] = _void] = "_void"; // void keyword prefix startsExpr - const _delete = 99984; TokenType[TokenType["_delete"] = _delete] = "_delete"; // delete keyword prefix startsExpr - const _async = 100880; TokenType[TokenType["_async"] = _async] = "_async"; // async keyword startsExpr - const _get = 101904; TokenType[TokenType["_get"] = _get] = "_get"; // get keyword startsExpr - const _set = 102928; TokenType[TokenType["_set"] = _set] = "_set"; // set keyword startsExpr - const _declare = 103952; TokenType[TokenType["_declare"] = _declare] = "_declare"; // declare keyword startsExpr - const _readonly = 104976; TokenType[TokenType["_readonly"] = _readonly] = "_readonly"; // readonly keyword startsExpr - const _abstract = 106000; TokenType[TokenType["_abstract"] = _abstract] = "_abstract"; // abstract keyword startsExpr - const _static = 107024; TokenType[TokenType["_static"] = _static] = "_static"; // static keyword startsExpr - const _public = 107536; TokenType[TokenType["_public"] = _public] = "_public"; // public keyword - const _private = 108560; TokenType[TokenType["_private"] = _private] = "_private"; // private keyword - const _protected = 109584; TokenType[TokenType["_protected"] = _protected] = "_protected"; // protected keyword - const _override = 110608; TokenType[TokenType["_override"] = _override] = "_override"; // override keyword - const _as = 112144; TokenType[TokenType["_as"] = _as] = "_as"; // as keyword startsExpr - const _enum = 113168; TokenType[TokenType["_enum"] = _enum] = "_enum"; // enum keyword startsExpr - const _type = 114192; TokenType[TokenType["_type"] = _type] = "_type"; // type keyword startsExpr - const _implements = 115216; TokenType[TokenType["_implements"] = _implements] = "_implements"; // implements keyword startsExpr -})(TokenType || (exports.TokenType = TokenType = {})); - function formatTokenType(tokenType) { - switch (tokenType) { - case TokenType.num: - return "num"; - case TokenType.bigint: - return "bigint"; - case TokenType.decimal: - return "decimal"; - case TokenType.regexp: - return "regexp"; - case TokenType.string: - return "string"; - case TokenType.name: - return "name"; - case TokenType.eof: - return "eof"; - case TokenType.bracketL: - return "["; - case TokenType.bracketR: - return "]"; - case TokenType.braceL: - return "{"; - case TokenType.braceBarL: - return "{|"; - case TokenType.braceR: - return "}"; - case TokenType.braceBarR: - return "|}"; - case TokenType.parenL: - return "("; - case TokenType.parenR: - return ")"; - case TokenType.comma: - return ","; - case TokenType.semi: - return ";"; - case TokenType.colon: - return ":"; - case TokenType.doubleColon: - return "::"; - case TokenType.dot: - return "."; - case TokenType.question: - return "?"; - case TokenType.questionDot: - return "?."; - case TokenType.arrow: - return "=>"; - case TokenType.template: - return "template"; - case TokenType.ellipsis: - return "..."; - case TokenType.backQuote: - return "`"; - case TokenType.dollarBraceL: - return "${"; - case TokenType.at: - return "@"; - case TokenType.hash: - return "#"; - case TokenType.eq: - return "="; - case TokenType.assign: - return "_="; - case TokenType.preIncDec: - return "++/--"; - case TokenType.postIncDec: - return "++/--"; - case TokenType.bang: - return "!"; - case TokenType.tilde: - return "~"; - case TokenType.pipeline: - return "|>"; - case TokenType.nullishCoalescing: - return "??"; - case TokenType.logicalOR: - return "||"; - case TokenType.logicalAND: - return "&&"; - case TokenType.bitwiseOR: - return "|"; - case TokenType.bitwiseXOR: - return "^"; - case TokenType.bitwiseAND: - return "&"; - case TokenType.equality: - return "==/!="; - case TokenType.lessThan: - return "<"; - case TokenType.greaterThan: - return ">"; - case TokenType.relationalOrEqual: - return "<=/>="; - case TokenType.bitShiftL: - return "<<"; - case TokenType.bitShiftR: - return ">>/>>>"; - case TokenType.plus: - return "+"; - case TokenType.minus: - return "-"; - case TokenType.modulo: - return "%"; - case TokenType.star: - return "*"; - case TokenType.slash: - return "/"; - case TokenType.exponent: - return "**"; - case TokenType.jsxName: - return "jsxName"; - case TokenType.jsxText: - return "jsxText"; - case TokenType.jsxEmptyText: - return "jsxEmptyText"; - case TokenType.jsxTagStart: - return "jsxTagStart"; - case TokenType.jsxTagEnd: - return "jsxTagEnd"; - case TokenType.typeParameterStart: - return "typeParameterStart"; - case TokenType.nonNullAssertion: - return "nonNullAssertion"; - case TokenType._break: - return "break"; - case TokenType._case: - return "case"; - case TokenType._catch: - return "catch"; - case TokenType._continue: - return "continue"; - case TokenType._debugger: - return "debugger"; - case TokenType._default: - return "default"; - case TokenType._do: - return "do"; - case TokenType._else: - return "else"; - case TokenType._finally: - return "finally"; - case TokenType._for: - return "for"; - case TokenType._function: - return "function"; - case TokenType._if: - return "if"; - case TokenType._return: - return "return"; - case TokenType._switch: - return "switch"; - case TokenType._throw: - return "throw"; - case TokenType._try: - return "try"; - case TokenType._var: - return "var"; - case TokenType._let: - return "let"; - case TokenType._const: - return "const"; - case TokenType._while: - return "while"; - case TokenType._with: - return "with"; - case TokenType._new: - return "new"; - case TokenType._this: - return "this"; - case TokenType._super: - return "super"; - case TokenType._class: - return "class"; - case TokenType._extends: - return "extends"; - case TokenType._export: - return "export"; - case TokenType._import: - return "import"; - case TokenType._yield: - return "yield"; - case TokenType._null: - return "null"; - case TokenType._true: - return "true"; - case TokenType._false: - return "false"; - case TokenType._in: - return "in"; - case TokenType._instanceof: - return "instanceof"; - case TokenType._typeof: - return "typeof"; - case TokenType._void: - return "void"; - case TokenType._delete: - return "delete"; - case TokenType._async: - return "async"; - case TokenType._get: - return "get"; - case TokenType._set: - return "set"; - case TokenType._declare: - return "declare"; - case TokenType._readonly: - return "readonly"; - case TokenType._abstract: - return "abstract"; - case TokenType._static: - return "static"; - case TokenType._public: - return "public"; - case TokenType._private: - return "private"; - case TokenType._protected: - return "protected"; - case TokenType._override: - return "override"; - case TokenType._as: - return "as"; - case TokenType._enum: - return "enum"; - case TokenType._type: - return "type"; - case TokenType._implements: - return "implements"; - default: - return ""; - } -} exports.formatTokenType = formatTokenType; diff --git a/node_modules/sucrase/dist/parser/traverser/base.js b/node_modules/sucrase/dist/parser/traverser/base.js deleted file mode 100644 index 85c9c17..0000000 --- a/node_modules/sucrase/dist/parser/traverser/base.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _state = require('../tokenizer/state'); var _state2 = _interopRequireDefault(_state); -var _charcodes = require('../util/charcodes'); - - exports.isJSXEnabled; - exports.isTypeScriptEnabled; - exports.isFlowEnabled; - exports.state; - exports.input; - exports.nextContextId; - - function getNextContextId() { - return exports.nextContextId++; -} exports.getNextContextId = getNextContextId; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any - function augmentError(error) { - if ("pos" in error) { - const loc = locationForIndex(error.pos); - error.message += ` (${loc.line}:${loc.column})`; - error.loc = loc; - } - return error; -} exports.augmentError = augmentError; - - class Loc { - - - constructor(line, column) { - this.line = line; - this.column = column; - } -} exports.Loc = Loc; - - function locationForIndex(pos) { - let line = 1; - let column = 1; - for (let i = 0; i < pos; i++) { - if (exports.input.charCodeAt(i) === _charcodes.charCodes.lineFeed) { - line++; - column = 1; - } else { - column++; - } - } - return new Loc(line, column); -} exports.locationForIndex = locationForIndex; - - function initParser( - inputCode, - isJSXEnabledArg, - isTypeScriptEnabledArg, - isFlowEnabledArg, -) { - exports.input = inputCode; - exports.state = new (0, _state2.default)(); - exports.nextContextId = 1; - exports.isJSXEnabled = isJSXEnabledArg; - exports.isTypeScriptEnabled = isTypeScriptEnabledArg; - exports.isFlowEnabled = isFlowEnabledArg; -} exports.initParser = initParser; diff --git a/node_modules/sucrase/dist/parser/traverser/expression.js b/node_modules/sucrase/dist/parser/traverser/expression.js deleted file mode 100644 index d0011e3..0000000 --- a/node_modules/sucrase/dist/parser/traverser/expression.js +++ /dev/null @@ -1,1022 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});/* eslint max-len: 0 */ - -// A recursive descent parser operates by defining functions for all -// syntactic elements, and recursively calling those, each function -// advancing the input stream and returning an AST node. Precedence -// of constructs (for example, the fact that `!x[1]` means `!(x[1])` -// instead of `(!x)[1]` is handled by the fact that the parser -// function that parses unary prefix operators is called first, and -// in turn calls the function that parses `[]` subscripts — that -// way, it'll receive the node for `x[1]` already parsed, and wraps -// *that* in the unary operator node. -// -// Acorn uses an [operator precedence parser][opp] to handle binary -// operator precedence, because it is much more compact than using -// the technique outlined above, which uses different, nesting -// functions to specify precedence, for all of the ten binary -// precedence levels that JavaScript defines. -// -// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser - - - - - - - - - - - -var _flow = require('../plugins/flow'); -var _index = require('../plugins/jsx/index'); -var _types = require('../plugins/types'); - - - - - - - - - -var _typescript = require('../plugins/typescript'); - - - - - - - - - - - - -var _index3 = require('../tokenizer/index'); -var _keywords = require('../tokenizer/keywords'); -var _state = require('../tokenizer/state'); -var _types3 = require('../tokenizer/types'); -var _charcodes = require('../util/charcodes'); -var _identifier = require('../util/identifier'); -var _base = require('./base'); - - - - - - -var _lval = require('./lval'); - - - - - - - -var _statement = require('./statement'); - - - - - - - - - -var _util = require('./util'); - - class StopState { - - constructor(stop) { - this.stop = stop; - } -} exports.StopState = StopState; - -// ### Expression parsing - -// These nest, from the most general expression type at the top to -// 'atomic', nondivisible expression types at the bottom. Most of -// the functions will simply let the function (s) below them parse, -// and, *if* the syntactic construct they handle is present, wrap -// the AST node that the inner parser gave them in another node. - function parseExpression(noIn = false) { - parseMaybeAssign(noIn); - if (_index3.match.call(void 0, _types3.TokenType.comma)) { - while (_index3.eat.call(void 0, _types3.TokenType.comma)) { - parseMaybeAssign(noIn); - } - } -} exports.parseExpression = parseExpression; - -/** - * noIn is used when parsing a for loop so that we don't interpret a following "in" as the binary - * operatior. - * isWithinParens is used to indicate that we're parsing something that might be a comma expression - * or might be an arrow function or might be a Flow type assertion (which requires explicit parens). - * In these cases, we should allow : and ?: after the initial "left" part. - */ - function parseMaybeAssign(noIn = false, isWithinParens = false) { - if (_base.isTypeScriptEnabled) { - return _typescript.tsParseMaybeAssign.call(void 0, noIn, isWithinParens); - } else if (_base.isFlowEnabled) { - return _flow.flowParseMaybeAssign.call(void 0, noIn, isWithinParens); - } else { - return baseParseMaybeAssign(noIn, isWithinParens); - } -} exports.parseMaybeAssign = parseMaybeAssign; - -// Parse an assignment expression. This includes applications of -// operators like `+=`. -// Returns true if the expression was an arrow function. - function baseParseMaybeAssign(noIn, isWithinParens) { - if (_index3.match.call(void 0, _types3.TokenType._yield)) { - parseYield(); - return false; - } - - if (_index3.match.call(void 0, _types3.TokenType.parenL) || _index3.match.call(void 0, _types3.TokenType.name) || _index3.match.call(void 0, _types3.TokenType._yield)) { - _base.state.potentialArrowAt = _base.state.start; - } - - const wasArrow = parseMaybeConditional(noIn); - if (isWithinParens) { - parseParenItem(); - } - if (_base.state.type & _types3.TokenType.IS_ASSIGN) { - _index3.next.call(void 0, ); - parseMaybeAssign(noIn); - return false; - } - return wasArrow; -} exports.baseParseMaybeAssign = baseParseMaybeAssign; - -// Parse a ternary conditional (`?:`) operator. -// Returns true if the expression was an arrow function. -function parseMaybeConditional(noIn) { - const wasArrow = parseExprOps(noIn); - if (wasArrow) { - return true; - } - parseConditional(noIn); - return false; -} - -function parseConditional(noIn) { - if (_base.isTypeScriptEnabled || _base.isFlowEnabled) { - _types.typedParseConditional.call(void 0, noIn); - } else { - baseParseConditional(noIn); - } -} - - function baseParseConditional(noIn) { - if (_index3.eat.call(void 0, _types3.TokenType.question)) { - parseMaybeAssign(); - _util.expect.call(void 0, _types3.TokenType.colon); - parseMaybeAssign(noIn); - } -} exports.baseParseConditional = baseParseConditional; - -// Start the precedence parser. -// Returns true if this was an arrow function -function parseExprOps(noIn) { - const startTokenIndex = _base.state.tokens.length; - const wasArrow = parseMaybeUnary(); - if (wasArrow) { - return true; - } - parseExprOp(startTokenIndex, -1, noIn); - return false; -} - -// Parse binary operators with the operator precedence parsing -// algorithm. `left` is the left-hand side of the operator. -// `minPrec` provides context that allows the function to stop and -// defer further parser to one of its callers when it encounters an -// operator that has a lower precedence than the set it is parsing. -function parseExprOp(startTokenIndex, minPrec, noIn) { - if ( - _base.isTypeScriptEnabled && - (_types3.TokenType._in & _types3.TokenType.PRECEDENCE_MASK) > minPrec && - !_util.hasPrecedingLineBreak.call(void 0, ) && - (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._as) || _util.eatContextual.call(void 0, _keywords.ContextualKeyword._satisfies)) - ) { - const oldIsType = _index3.pushTypeContext.call(void 0, 1); - _typescript.tsParseType.call(void 0, ); - _index3.popTypeContext.call(void 0, oldIsType); - _index3.rescan_gt.call(void 0, ); - parseExprOp(startTokenIndex, minPrec, noIn); - return; - } - - const prec = _base.state.type & _types3.TokenType.PRECEDENCE_MASK; - if (prec > 0 && (!noIn || !_index3.match.call(void 0, _types3.TokenType._in))) { - if (prec > minPrec) { - const op = _base.state.type; - _index3.next.call(void 0, ); - if (op === _types3.TokenType.nullishCoalescing) { - _base.state.tokens[_base.state.tokens.length - 1].nullishStartIndex = startTokenIndex; - } - - const rhsStartTokenIndex = _base.state.tokens.length; - parseMaybeUnary(); - // Extend the right operand of this operator if possible. - parseExprOp(rhsStartTokenIndex, op & _types3.TokenType.IS_RIGHT_ASSOCIATIVE ? prec - 1 : prec, noIn); - if (op === _types3.TokenType.nullishCoalescing) { - _base.state.tokens[startTokenIndex].numNullishCoalesceStarts++; - _base.state.tokens[_base.state.tokens.length - 1].numNullishCoalesceEnds++; - } - // Continue with any future operator holding this expression as the left operand. - parseExprOp(startTokenIndex, minPrec, noIn); - } - } -} - -// Parse unary operators, both prefix and postfix. -// Returns true if this was an arrow function. - function parseMaybeUnary() { - if (_base.isTypeScriptEnabled && !_base.isJSXEnabled && _index3.eat.call(void 0, _types3.TokenType.lessThan)) { - _typescript.tsParseTypeAssertion.call(void 0, ); - return false; - } - if ( - _util.isContextual.call(void 0, _keywords.ContextualKeyword._module) && - _index3.lookaheadCharCode.call(void 0, ) === _charcodes.charCodes.leftCurlyBrace && - !_util.hasFollowingLineBreak.call(void 0, ) - ) { - parseModuleExpression(); - return false; - } - if (_base.state.type & _types3.TokenType.IS_PREFIX) { - _index3.next.call(void 0, ); - parseMaybeUnary(); - return false; - } - - const wasArrow = parseExprSubscripts(); - if (wasArrow) { - return true; - } - while (_base.state.type & _types3.TokenType.IS_POSTFIX && !_util.canInsertSemicolon.call(void 0, )) { - // The tokenizer calls everything a preincrement, so make it a postincrement when - // we see it in that context. - if (_base.state.type === _types3.TokenType.preIncDec) { - _base.state.type = _types3.TokenType.postIncDec; - } - _index3.next.call(void 0, ); - } - return false; -} exports.parseMaybeUnary = parseMaybeUnary; - -// Parse call, dot, and `[]`-subscript expressions. -// Returns true if this was an arrow function. - function parseExprSubscripts() { - const startTokenIndex = _base.state.tokens.length; - const wasArrow = parseExprAtom(); - if (wasArrow) { - return true; - } - parseSubscripts(startTokenIndex); - // If there was any optional chain operation, the start token would be marked - // as such, so also mark the end now. - if (_base.state.tokens.length > startTokenIndex && _base.state.tokens[startTokenIndex].isOptionalChainStart) { - _base.state.tokens[_base.state.tokens.length - 1].isOptionalChainEnd = true; - } - return false; -} exports.parseExprSubscripts = parseExprSubscripts; - -function parseSubscripts(startTokenIndex, noCalls = false) { - if (_base.isFlowEnabled) { - _flow.flowParseSubscripts.call(void 0, startTokenIndex, noCalls); - } else { - baseParseSubscripts(startTokenIndex, noCalls); - } -} - - function baseParseSubscripts(startTokenIndex, noCalls = false) { - const stopState = new StopState(false); - do { - parseSubscript(startTokenIndex, noCalls, stopState); - } while (!stopState.stop && !_base.state.error); -} exports.baseParseSubscripts = baseParseSubscripts; - -function parseSubscript(startTokenIndex, noCalls, stopState) { - if (_base.isTypeScriptEnabled) { - _typescript.tsParseSubscript.call(void 0, startTokenIndex, noCalls, stopState); - } else if (_base.isFlowEnabled) { - _flow.flowParseSubscript.call(void 0, startTokenIndex, noCalls, stopState); - } else { - baseParseSubscript(startTokenIndex, noCalls, stopState); - } -} - -/** Set 'state.stop = true' to indicate that we should stop parsing subscripts. */ - function baseParseSubscript( - startTokenIndex, - noCalls, - stopState, -) { - if (!noCalls && _index3.eat.call(void 0, _types3.TokenType.doubleColon)) { - parseNoCallExpr(); - stopState.stop = true; - // Propagate startTokenIndex so that `a::b?.()` will keep `a` as the first token. We may want - // to revisit this in the future when fully supporting bind syntax. - parseSubscripts(startTokenIndex, noCalls); - } else if (_index3.match.call(void 0, _types3.TokenType.questionDot)) { - _base.state.tokens[startTokenIndex].isOptionalChainStart = true; - if (noCalls && _index3.lookaheadType.call(void 0, ) === _types3.TokenType.parenL) { - stopState.stop = true; - return; - } - _index3.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - - if (_index3.eat.call(void 0, _types3.TokenType.bracketL)) { - parseExpression(); - _util.expect.call(void 0, _types3.TokenType.bracketR); - } else if (_index3.eat.call(void 0, _types3.TokenType.parenL)) { - parseCallExpressionArguments(); - } else { - parseMaybePrivateName(); - } - } else if (_index3.eat.call(void 0, _types3.TokenType.dot)) { - _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - parseMaybePrivateName(); - } else if (_index3.eat.call(void 0, _types3.TokenType.bracketL)) { - _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - parseExpression(); - _util.expect.call(void 0, _types3.TokenType.bracketR); - } else if (!noCalls && _index3.match.call(void 0, _types3.TokenType.parenL)) { - if (atPossibleAsync()) { - // We see "async", but it's possible it's a usage of the name "async". Parse as if it's a - // function call, and if we see an arrow later, backtrack and re-parse as a parameter list. - const snapshot = _base.state.snapshot(); - const asyncStartTokenIndex = _base.state.tokens.length; - _index3.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - - const callContextId = _base.getNextContextId.call(void 0, ); - - _base.state.tokens[_base.state.tokens.length - 1].contextId = callContextId; - parseCallExpressionArguments(); - _base.state.tokens[_base.state.tokens.length - 1].contextId = callContextId; - - if (shouldParseAsyncArrow()) { - // We hit an arrow, so backtrack and start again parsing function parameters. - _base.state.restoreFromSnapshot(snapshot); - stopState.stop = true; - _base.state.scopeDepth++; - - _statement.parseFunctionParams.call(void 0, ); - parseAsyncArrowFromCallExpression(asyncStartTokenIndex); - } - } else { - _index3.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].subscriptStartIndex = startTokenIndex; - const callContextId = _base.getNextContextId.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].contextId = callContextId; - parseCallExpressionArguments(); - _base.state.tokens[_base.state.tokens.length - 1].contextId = callContextId; - } - } else if (_index3.match.call(void 0, _types3.TokenType.backQuote)) { - // Tagged template expression. - parseTemplate(); - } else { - stopState.stop = true; - } -} exports.baseParseSubscript = baseParseSubscript; - - function atPossibleAsync() { - // This was made less strict than the original version to avoid passing around nodes, but it - // should be safe to have rare false positives here. - return ( - _base.state.tokens[_base.state.tokens.length - 1].contextualKeyword === _keywords.ContextualKeyword._async && - !_util.canInsertSemicolon.call(void 0, ) - ); -} exports.atPossibleAsync = atPossibleAsync; - - function parseCallExpressionArguments() { - let first = true; - while (!_index3.eat.call(void 0, _types3.TokenType.parenR) && !_base.state.error) { - if (first) { - first = false; - } else { - _util.expect.call(void 0, _types3.TokenType.comma); - if (_index3.eat.call(void 0, _types3.TokenType.parenR)) { - break; - } - } - - parseExprListItem(false); - } -} exports.parseCallExpressionArguments = parseCallExpressionArguments; - -function shouldParseAsyncArrow() { - return _index3.match.call(void 0, _types3.TokenType.colon) || _index3.match.call(void 0, _types3.TokenType.arrow); -} - -function parseAsyncArrowFromCallExpression(startTokenIndex) { - if (_base.isTypeScriptEnabled) { - _typescript.tsStartParseAsyncArrowFromCallExpression.call(void 0, ); - } else if (_base.isFlowEnabled) { - _flow.flowStartParseAsyncArrowFromCallExpression.call(void 0, ); - } - _util.expect.call(void 0, _types3.TokenType.arrow); - parseArrowExpression(startTokenIndex); -} - -// Parse a no-call expression (like argument of `new` or `::` operators). - -function parseNoCallExpr() { - const startTokenIndex = _base.state.tokens.length; - parseExprAtom(); - parseSubscripts(startTokenIndex, true); -} - -// Parse an atomic expression — either a single token that is an -// expression, an expression started by a keyword like `function` or -// `new`, or an expression wrapped in punctuation like `()`, `[]`, -// or `{}`. -// Returns true if the parsed expression was an arrow function. - function parseExprAtom() { - if (_index3.eat.call(void 0, _types3.TokenType.modulo)) { - // V8 intrinsic expression. Just parse the identifier, and the function invocation is parsed - // naturally. - parseIdentifier(); - return false; - } - - if (_index3.match.call(void 0, _types3.TokenType.jsxText) || _index3.match.call(void 0, _types3.TokenType.jsxEmptyText)) { - parseLiteral(); - return false; - } else if (_index3.match.call(void 0, _types3.TokenType.lessThan) && _base.isJSXEnabled) { - _base.state.type = _types3.TokenType.jsxTagStart; - _index.jsxParseElement.call(void 0, ); - _index3.next.call(void 0, ); - return false; - } - - const canBeArrow = _base.state.potentialArrowAt === _base.state.start; - switch (_base.state.type) { - case _types3.TokenType.slash: - case _types3.TokenType.assign: - _index3.retokenizeSlashAsRegex.call(void 0, ); - // Fall through. - - case _types3.TokenType._super: - case _types3.TokenType._this: - case _types3.TokenType.regexp: - case _types3.TokenType.num: - case _types3.TokenType.bigint: - case _types3.TokenType.decimal: - case _types3.TokenType.string: - case _types3.TokenType._null: - case _types3.TokenType._true: - case _types3.TokenType._false: - _index3.next.call(void 0, ); - return false; - - case _types3.TokenType._import: - _index3.next.call(void 0, ); - if (_index3.match.call(void 0, _types3.TokenType.dot)) { - // import.meta - _base.state.tokens[_base.state.tokens.length - 1].type = _types3.TokenType.name; - _index3.next.call(void 0, ); - parseIdentifier(); - } - return false; - - case _types3.TokenType.name: { - const startTokenIndex = _base.state.tokens.length; - const functionStart = _base.state.start; - const contextualKeyword = _base.state.contextualKeyword; - parseIdentifier(); - if (contextualKeyword === _keywords.ContextualKeyword._await) { - parseAwait(); - return false; - } else if ( - contextualKeyword === _keywords.ContextualKeyword._async && - _index3.match.call(void 0, _types3.TokenType._function) && - !_util.canInsertSemicolon.call(void 0, ) - ) { - _index3.next.call(void 0, ); - _statement.parseFunction.call(void 0, functionStart, false); - return false; - } else if ( - canBeArrow && - contextualKeyword === _keywords.ContextualKeyword._async && - !_util.canInsertSemicolon.call(void 0, ) && - _index3.match.call(void 0, _types3.TokenType.name) - ) { - _base.state.scopeDepth++; - _lval.parseBindingIdentifier.call(void 0, false); - _util.expect.call(void 0, _types3.TokenType.arrow); - // let foo = async bar => {}; - parseArrowExpression(startTokenIndex); - return true; - } else if (_index3.match.call(void 0, _types3.TokenType._do) && !_util.canInsertSemicolon.call(void 0, )) { - _index3.next.call(void 0, ); - _statement.parseBlock.call(void 0, ); - return false; - } - - if (canBeArrow && !_util.canInsertSemicolon.call(void 0, ) && _index3.match.call(void 0, _types3.TokenType.arrow)) { - _base.state.scopeDepth++; - _lval.markPriorBindingIdentifier.call(void 0, false); - _util.expect.call(void 0, _types3.TokenType.arrow); - parseArrowExpression(startTokenIndex); - return true; - } - - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index3.IdentifierRole.Access; - return false; - } - - case _types3.TokenType._do: { - _index3.next.call(void 0, ); - _statement.parseBlock.call(void 0, ); - return false; - } - - case _types3.TokenType.parenL: { - const wasArrow = parseParenAndDistinguishExpression(canBeArrow); - return wasArrow; - } - - case _types3.TokenType.bracketL: - _index3.next.call(void 0, ); - parseExprList(_types3.TokenType.bracketR, true); - return false; - - case _types3.TokenType.braceL: - parseObj(false, false); - return false; - - case _types3.TokenType._function: - parseFunctionExpression(); - return false; - - case _types3.TokenType.at: - _statement.parseDecorators.call(void 0, ); - // Fall through. - - case _types3.TokenType._class: - _statement.parseClass.call(void 0, false); - return false; - - case _types3.TokenType._new: - parseNew(); - return false; - - case _types3.TokenType.backQuote: - parseTemplate(); - return false; - - case _types3.TokenType.doubleColon: { - _index3.next.call(void 0, ); - parseNoCallExpr(); - return false; - } - - case _types3.TokenType.hash: { - const code = _index3.lookaheadCharCode.call(void 0, ); - if (_identifier.IS_IDENTIFIER_START[code] || code === _charcodes.charCodes.backslash) { - parseMaybePrivateName(); - } else { - _index3.next.call(void 0, ); - } - // Smart pipeline topic reference. - return false; - } - - default: - _util.unexpected.call(void 0, ); - return false; - } -} exports.parseExprAtom = parseExprAtom; - -function parseMaybePrivateName() { - _index3.eat.call(void 0, _types3.TokenType.hash); - parseIdentifier(); -} - -function parseFunctionExpression() { - const functionStart = _base.state.start; - parseIdentifier(); - if (_index3.eat.call(void 0, _types3.TokenType.dot)) { - // function.sent - parseIdentifier(); - } - _statement.parseFunction.call(void 0, functionStart, false); -} - - function parseLiteral() { - _index3.next.call(void 0, ); -} exports.parseLiteral = parseLiteral; - - function parseParenExpression() { - _util.expect.call(void 0, _types3.TokenType.parenL); - parseExpression(); - _util.expect.call(void 0, _types3.TokenType.parenR); -} exports.parseParenExpression = parseParenExpression; - -// Returns true if this was an arrow expression. -function parseParenAndDistinguishExpression(canBeArrow) { - // Assume this is a normal parenthesized expression, but if we see an arrow, we'll bail and - // start over as a parameter list. - const snapshot = _base.state.snapshot(); - - const startTokenIndex = _base.state.tokens.length; - _util.expect.call(void 0, _types3.TokenType.parenL); - - let first = true; - - while (!_index3.match.call(void 0, _types3.TokenType.parenR) && !_base.state.error) { - if (first) { - first = false; - } else { - _util.expect.call(void 0, _types3.TokenType.comma); - if (_index3.match.call(void 0, _types3.TokenType.parenR)) { - break; - } - } - - if (_index3.match.call(void 0, _types3.TokenType.ellipsis)) { - _lval.parseRest.call(void 0, false /* isBlockScope */); - parseParenItem(); - break; - } else { - parseMaybeAssign(false, true); - } - } - - _util.expect.call(void 0, _types3.TokenType.parenR); - - if (canBeArrow && shouldParseArrow()) { - const wasArrow = parseArrow(); - if (wasArrow) { - // It was an arrow function this whole time, so start over and parse it as params so that we - // get proper token annotations. - _base.state.restoreFromSnapshot(snapshot); - _base.state.scopeDepth++; - // Don't specify a context ID because arrow functions don't need a context ID. - _statement.parseFunctionParams.call(void 0, ); - parseArrow(); - parseArrowExpression(startTokenIndex); - if (_base.state.error) { - // Nevermind! This must have been something that looks very much like an - // arrow function but where its "parameter list" isn't actually a valid - // parameter list. Force non-arrow parsing. - // See https://github.com/alangpierce/sucrase/issues/666 for an example. - _base.state.restoreFromSnapshot(snapshot); - parseParenAndDistinguishExpression(false); - return false; - } - return true; - } - } - - return false; -} - -function shouldParseArrow() { - return _index3.match.call(void 0, _types3.TokenType.colon) || !_util.canInsertSemicolon.call(void 0, ); -} - -// Returns whether there was an arrow token. - function parseArrow() { - if (_base.isTypeScriptEnabled) { - return _typescript.tsParseArrow.call(void 0, ); - } else if (_base.isFlowEnabled) { - return _flow.flowParseArrow.call(void 0, ); - } else { - return _index3.eat.call(void 0, _types3.TokenType.arrow); - } -} exports.parseArrow = parseArrow; - -function parseParenItem() { - if (_base.isTypeScriptEnabled || _base.isFlowEnabled) { - _types.typedParseParenItem.call(void 0, ); - } -} - -// New's precedence is slightly tricky. It must allow its argument to -// be a `[]` or dot subscript expression, but not a call — at least, -// not without wrapping it in parentheses. Thus, it uses the noCalls -// argument to parseSubscripts to prevent it from consuming the -// argument list. -function parseNew() { - _util.expect.call(void 0, _types3.TokenType._new); - if (_index3.eat.call(void 0, _types3.TokenType.dot)) { - // new.target - parseIdentifier(); - return; - } - parseNewCallee(); - if (_base.isFlowEnabled) { - _flow.flowStartParseNewArguments.call(void 0, ); - } - if (_index3.eat.call(void 0, _types3.TokenType.parenL)) { - parseExprList(_types3.TokenType.parenR); - } -} - -function parseNewCallee() { - parseNoCallExpr(); - _index3.eat.call(void 0, _types3.TokenType.questionDot); -} - - function parseTemplate() { - // Finish `, read quasi - _index3.nextTemplateToken.call(void 0, ); - // Finish quasi, read ${ - _index3.nextTemplateToken.call(void 0, ); - while (!_index3.match.call(void 0, _types3.TokenType.backQuote) && !_base.state.error) { - _util.expect.call(void 0, _types3.TokenType.dollarBraceL); - parseExpression(); - // Finish }, read quasi - _index3.nextTemplateToken.call(void 0, ); - // Finish quasi, read either ${ or ` - _index3.nextTemplateToken.call(void 0, ); - } - _index3.next.call(void 0, ); -} exports.parseTemplate = parseTemplate; - -// Parse an object literal or binding pattern. - function parseObj(isPattern, isBlockScope) { - // Attach a context ID to the object open and close brace and each object key. - const contextId = _base.getNextContextId.call(void 0, ); - let first = true; - - _index3.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; - - while (!_index3.eat.call(void 0, _types3.TokenType.braceR) && !_base.state.error) { - if (first) { - first = false; - } else { - _util.expect.call(void 0, _types3.TokenType.comma); - if (_index3.eat.call(void 0, _types3.TokenType.braceR)) { - break; - } - } - - let isGenerator = false; - if (_index3.match.call(void 0, _types3.TokenType.ellipsis)) { - const previousIndex = _base.state.tokens.length; - _lval.parseSpread.call(void 0, ); - if (isPattern) { - // Mark role when the only thing being spread over is an identifier. - if (_base.state.tokens.length === previousIndex + 2) { - _lval.markPriorBindingIdentifier.call(void 0, isBlockScope); - } - if (_index3.eat.call(void 0, _types3.TokenType.braceR)) { - break; - } - } - continue; - } - - if (!isPattern) { - isGenerator = _index3.eat.call(void 0, _types3.TokenType.star); - } - - if (!isPattern && _util.isContextual.call(void 0, _keywords.ContextualKeyword._async)) { - if (isGenerator) _util.unexpected.call(void 0, ); - - parseIdentifier(); - if ( - _index3.match.call(void 0, _types3.TokenType.colon) || - _index3.match.call(void 0, _types3.TokenType.parenL) || - _index3.match.call(void 0, _types3.TokenType.braceR) || - _index3.match.call(void 0, _types3.TokenType.eq) || - _index3.match.call(void 0, _types3.TokenType.comma) - ) { - // This is a key called "async" rather than an async function. - } else { - if (_index3.match.call(void 0, _types3.TokenType.star)) { - _index3.next.call(void 0, ); - isGenerator = true; - } - parsePropertyName(contextId); - } - } else { - parsePropertyName(contextId); - } - - parseObjPropValue(isPattern, isBlockScope, contextId); - } - - _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; -} exports.parseObj = parseObj; - -function isGetterOrSetterMethod(isPattern) { - // We go off of the next and don't bother checking if the node key is actually "get" or "set". - // This lets us avoid generating a node, and should only make the validation worse. - return ( - !isPattern && - (_index3.match.call(void 0, _types3.TokenType.string) || // get "string"() {} - _index3.match.call(void 0, _types3.TokenType.num) || // get 1() {} - _index3.match.call(void 0, _types3.TokenType.bracketL) || // get ["string"]() {} - _index3.match.call(void 0, _types3.TokenType.name) || // get foo() {} - !!(_base.state.type & _types3.TokenType.IS_KEYWORD)) // get debugger() {} - ); -} - -// Returns true if this was a method. -function parseObjectMethod(isPattern, objectContextId) { - // We don't need to worry about modifiers because object methods can't have optional bodies, so - // the start will never be used. - const functionStart = _base.state.start; - if (_index3.match.call(void 0, _types3.TokenType.parenL)) { - if (isPattern) _util.unexpected.call(void 0, ); - parseMethod(functionStart, /* isConstructor */ false); - return true; - } - - if (isGetterOrSetterMethod(isPattern)) { - parsePropertyName(objectContextId); - parseMethod(functionStart, /* isConstructor */ false); - return true; - } - return false; -} - -function parseObjectProperty(isPattern, isBlockScope) { - if (_index3.eat.call(void 0, _types3.TokenType.colon)) { - if (isPattern) { - _lval.parseMaybeDefault.call(void 0, isBlockScope); - } else { - parseMaybeAssign(false); - } - return; - } - - // Since there's no colon, we assume this is an object shorthand. - - // If we're in a destructuring, we've now discovered that the key was actually an assignee, so - // we need to tag it as a declaration with the appropriate scope. Otherwise, we might need to - // transform it on access, so mark it as a normal object shorthand. - let identifierRole; - if (isPattern) { - if (_base.state.scopeDepth === 0) { - identifierRole = _index3.IdentifierRole.ObjectShorthandTopLevelDeclaration; - } else if (isBlockScope) { - identifierRole = _index3.IdentifierRole.ObjectShorthandBlockScopedDeclaration; - } else { - identifierRole = _index3.IdentifierRole.ObjectShorthandFunctionScopedDeclaration; - } - } else { - identifierRole = _index3.IdentifierRole.ObjectShorthand; - } - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = identifierRole; - - // Regardless of whether we know this to be a pattern or if we're in an ambiguous context, allow - // parsing as if there's a default value. - _lval.parseMaybeDefault.call(void 0, isBlockScope, true); -} - -function parseObjPropValue( - isPattern, - isBlockScope, - objectContextId, -) { - if (_base.isTypeScriptEnabled) { - _typescript.tsStartParseObjPropValue.call(void 0, ); - } else if (_base.isFlowEnabled) { - _flow.flowStartParseObjPropValue.call(void 0, ); - } - const wasMethod = parseObjectMethod(isPattern, objectContextId); - if (!wasMethod) { - parseObjectProperty(isPattern, isBlockScope); - } -} - - function parsePropertyName(objectContextId) { - if (_base.isFlowEnabled) { - _flow.flowParseVariance.call(void 0, ); - } - if (_index3.eat.call(void 0, _types3.TokenType.bracketL)) { - _base.state.tokens[_base.state.tokens.length - 1].contextId = objectContextId; - parseMaybeAssign(); - _util.expect.call(void 0, _types3.TokenType.bracketR); - _base.state.tokens[_base.state.tokens.length - 1].contextId = objectContextId; - } else { - if (_index3.match.call(void 0, _types3.TokenType.num) || _index3.match.call(void 0, _types3.TokenType.string) || _index3.match.call(void 0, _types3.TokenType.bigint) || _index3.match.call(void 0, _types3.TokenType.decimal)) { - parseExprAtom(); - } else { - parseMaybePrivateName(); - } - - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index3.IdentifierRole.ObjectKey; - _base.state.tokens[_base.state.tokens.length - 1].contextId = objectContextId; - } -} exports.parsePropertyName = parsePropertyName; - -// Parse object or class method. - function parseMethod(functionStart, isConstructor) { - const funcContextId = _base.getNextContextId.call(void 0, ); - - _base.state.scopeDepth++; - const startTokenIndex = _base.state.tokens.length; - const allowModifiers = isConstructor; // For TypeScript parameter properties - _statement.parseFunctionParams.call(void 0, allowModifiers, funcContextId); - parseFunctionBodyAndFinish(functionStart, funcContextId); - const endTokenIndex = _base.state.tokens.length; - _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, true)); - _base.state.scopeDepth--; -} exports.parseMethod = parseMethod; - -// Parse arrow function expression. -// If the parameters are provided, they will be converted to an -// assignable list. - function parseArrowExpression(startTokenIndex) { - parseFunctionBody(true); - const endTokenIndex = _base.state.tokens.length; - _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, true)); - _base.state.scopeDepth--; -} exports.parseArrowExpression = parseArrowExpression; - - function parseFunctionBodyAndFinish(functionStart, funcContextId = 0) { - if (_base.isTypeScriptEnabled) { - _typescript.tsParseFunctionBodyAndFinish.call(void 0, functionStart, funcContextId); - } else if (_base.isFlowEnabled) { - _flow.flowParseFunctionBodyAndFinish.call(void 0, funcContextId); - } else { - parseFunctionBody(false, funcContextId); - } -} exports.parseFunctionBodyAndFinish = parseFunctionBodyAndFinish; - - function parseFunctionBody(allowExpression, funcContextId = 0) { - const isExpression = allowExpression && !_index3.match.call(void 0, _types3.TokenType.braceL); - - if (isExpression) { - parseMaybeAssign(); - } else { - _statement.parseBlock.call(void 0, true /* isFunctionScope */, funcContextId); - } -} exports.parseFunctionBody = parseFunctionBody; - -// Parses a comma-separated list of expressions, and returns them as -// an array. `close` is the token type that ends the list, and -// `allowEmpty` can be turned on to allow subsequent commas with -// nothing in between them to be parsed as `null` (which is needed -// for array literals). - -function parseExprList(close, allowEmpty = false) { - let first = true; - while (!_index3.eat.call(void 0, close) && !_base.state.error) { - if (first) { - first = false; - } else { - _util.expect.call(void 0, _types3.TokenType.comma); - if (_index3.eat.call(void 0, close)) break; - } - parseExprListItem(allowEmpty); - } -} - -function parseExprListItem(allowEmpty) { - if (allowEmpty && _index3.match.call(void 0, _types3.TokenType.comma)) { - // Empty item; nothing more to parse for this item. - } else if (_index3.match.call(void 0, _types3.TokenType.ellipsis)) { - _lval.parseSpread.call(void 0, ); - parseParenItem(); - } else if (_index3.match.call(void 0, _types3.TokenType.question)) { - // Partial function application proposal. - _index3.next.call(void 0, ); - } else { - parseMaybeAssign(false, true); - } -} - -// Parse the next token as an identifier. - function parseIdentifier() { - _index3.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].type = _types3.TokenType.name; -} exports.parseIdentifier = parseIdentifier; - -// Parses await expression inside async function. -function parseAwait() { - parseMaybeUnary(); -} - -// Parses yield expression inside generator. -function parseYield() { - _index3.next.call(void 0, ); - if (!_index3.match.call(void 0, _types3.TokenType.semi) && !_util.canInsertSemicolon.call(void 0, )) { - _index3.eat.call(void 0, _types3.TokenType.star); - parseMaybeAssign(); - } -} - -// https://github.com/tc39/proposal-js-module-blocks -function parseModuleExpression() { - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._module); - _util.expect.call(void 0, _types3.TokenType.braceL); - // For now, just call parseBlockBody to parse the block. In the future when we - // implement full support, we'll want to emit scopes and possibly other - // information. - _statement.parseBlockBody.call(void 0, _types3.TokenType.braceR); -} diff --git a/node_modules/sucrase/dist/parser/traverser/index.js b/node_modules/sucrase/dist/parser/traverser/index.js deleted file mode 100644 index 72e4130..0000000 --- a/node_modules/sucrase/dist/parser/traverser/index.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); -var _index = require('../tokenizer/index'); -var _charcodes = require('../util/charcodes'); -var _base = require('./base'); -var _statement = require('./statement'); - - function parseFile() { - // If enabled, skip leading hashbang line. - if ( - _base.state.pos === 0 && - _base.input.charCodeAt(0) === _charcodes.charCodes.numberSign && - _base.input.charCodeAt(1) === _charcodes.charCodes.exclamationMark - ) { - _index.skipLineComment.call(void 0, 2); - } - _index.nextToken.call(void 0, ); - return _statement.parseTopLevel.call(void 0, ); -} exports.parseFile = parseFile; diff --git a/node_modules/sucrase/dist/parser/traverser/lval.js b/node_modules/sucrase/dist/parser/traverser/lval.js deleted file mode 100644 index 9057497..0000000 --- a/node_modules/sucrase/dist/parser/traverser/lval.js +++ /dev/null @@ -1,159 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _flow = require('../plugins/flow'); -var _typescript = require('../plugins/typescript'); - - - - - - - -var _index = require('../tokenizer/index'); -var _keywords = require('../tokenizer/keywords'); -var _types = require('../tokenizer/types'); -var _base = require('./base'); -var _expression = require('./expression'); -var _util = require('./util'); - - function parseSpread() { - _index.next.call(void 0, ); - _expression.parseMaybeAssign.call(void 0, false); -} exports.parseSpread = parseSpread; - - function parseRest(isBlockScope) { - _index.next.call(void 0, ); - parseBindingAtom(isBlockScope); -} exports.parseRest = parseRest; - - function parseBindingIdentifier(isBlockScope) { - _expression.parseIdentifier.call(void 0, ); - markPriorBindingIdentifier(isBlockScope); -} exports.parseBindingIdentifier = parseBindingIdentifier; - - function parseImportedIdentifier() { - _expression.parseIdentifier.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _index.IdentifierRole.ImportDeclaration; -} exports.parseImportedIdentifier = parseImportedIdentifier; - - function markPriorBindingIdentifier(isBlockScope) { - let identifierRole; - if (_base.state.scopeDepth === 0) { - identifierRole = _index.IdentifierRole.TopLevelDeclaration; - } else if (isBlockScope) { - identifierRole = _index.IdentifierRole.BlockScopedDeclaration; - } else { - identifierRole = _index.IdentifierRole.FunctionScopedDeclaration; - } - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = identifierRole; -} exports.markPriorBindingIdentifier = markPriorBindingIdentifier; - -// Parses lvalue (assignable) atom. - function parseBindingAtom(isBlockScope) { - switch (_base.state.type) { - case _types.TokenType._this: { - // In TypeScript, "this" may be the name of a parameter, so allow it. - const oldIsType = _index.pushTypeContext.call(void 0, 0); - _index.next.call(void 0, ); - _index.popTypeContext.call(void 0, oldIsType); - return; - } - - case _types.TokenType._yield: - case _types.TokenType.name: { - _base.state.type = _types.TokenType.name; - parseBindingIdentifier(isBlockScope); - return; - } - - case _types.TokenType.bracketL: { - _index.next.call(void 0, ); - parseBindingList(_types.TokenType.bracketR, isBlockScope, true /* allowEmpty */); - return; - } - - case _types.TokenType.braceL: - _expression.parseObj.call(void 0, true, isBlockScope); - return; - - default: - _util.unexpected.call(void 0, ); - } -} exports.parseBindingAtom = parseBindingAtom; - - function parseBindingList( - close, - isBlockScope, - allowEmpty = false, - allowModifiers = false, - contextId = 0, -) { - let first = true; - - let hasRemovedComma = false; - const firstItemTokenIndex = _base.state.tokens.length; - - while (!_index.eat.call(void 0, close) && !_base.state.error) { - if (first) { - first = false; - } else { - _util.expect.call(void 0, _types.TokenType.comma); - _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; - // After a "this" type in TypeScript, we need to set the following comma (if any) to also be - // a type token so that it will be removed. - if (!hasRemovedComma && _base.state.tokens[firstItemTokenIndex].isType) { - _base.state.tokens[_base.state.tokens.length - 1].isType = true; - hasRemovedComma = true; - } - } - if (allowEmpty && _index.match.call(void 0, _types.TokenType.comma)) { - // Empty item; nothing further to parse for this item. - } else if (_index.eat.call(void 0, close)) { - break; - } else if (_index.match.call(void 0, _types.TokenType.ellipsis)) { - parseRest(isBlockScope); - parseAssignableListItemTypes(); - // Support rest element trailing commas allowed by TypeScript <2.9. - _index.eat.call(void 0, _types.TokenType.comma); - _util.expect.call(void 0, close); - break; - } else { - parseAssignableListItem(allowModifiers, isBlockScope); - } - } -} exports.parseBindingList = parseBindingList; - -function parseAssignableListItem(allowModifiers, isBlockScope) { - if (allowModifiers) { - _typescript.tsParseModifiers.call(void 0, [ - _keywords.ContextualKeyword._public, - _keywords.ContextualKeyword._protected, - _keywords.ContextualKeyword._private, - _keywords.ContextualKeyword._readonly, - _keywords.ContextualKeyword._override, - ]); - } - - parseMaybeDefault(isBlockScope); - parseAssignableListItemTypes(); - parseMaybeDefault(isBlockScope, true /* leftAlreadyParsed */); -} - -function parseAssignableListItemTypes() { - if (_base.isFlowEnabled) { - _flow.flowParseAssignableListItemTypes.call(void 0, ); - } else if (_base.isTypeScriptEnabled) { - _typescript.tsParseAssignableListItemTypes.call(void 0, ); - } -} - -// Parses assignment pattern around given atom if possible. - function parseMaybeDefault(isBlockScope, leftAlreadyParsed = false) { - if (!leftAlreadyParsed) { - parseBindingAtom(isBlockScope); - } - if (!_index.eat.call(void 0, _types.TokenType.eq)) { - return; - } - const eqIndex = _base.state.tokens.length - 1; - _expression.parseMaybeAssign.call(void 0, ); - _base.state.tokens[eqIndex].rhsEndIndex = _base.state.tokens.length; -} exports.parseMaybeDefault = parseMaybeDefault; diff --git a/node_modules/sucrase/dist/parser/traverser/statement.js b/node_modules/sucrase/dist/parser/traverser/statement.js deleted file mode 100644 index 6be3391..0000000 --- a/node_modules/sucrase/dist/parser/traverser/statement.js +++ /dev/null @@ -1,1332 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});/* eslint max-len: 0 */ - -var _index = require('../index'); - - - - - - - - - - - - - - - - -var _flow = require('../plugins/flow'); - - - - - - - - - - - - - - - - - - -var _typescript = require('../plugins/typescript'); - - - - - - - - - - - - -var _tokenizer = require('../tokenizer'); -var _keywords = require('../tokenizer/keywords'); -var _state = require('../tokenizer/state'); -var _types = require('../tokenizer/types'); -var _charcodes = require('../util/charcodes'); -var _base = require('./base'); - - - - - - - - - - - - -var _expression = require('./expression'); - - - - - -var _lval = require('./lval'); - - - - - - - - - - - - -var _util = require('./util'); - - function parseTopLevel() { - parseBlockBody(_types.TokenType.eof); - _base.state.scopes.push(new (0, _state.Scope)(0, _base.state.tokens.length, true)); - if (_base.state.scopeDepth !== 0) { - throw new Error(`Invalid scope depth at end of file: ${_base.state.scopeDepth}`); - } - return new (0, _index.File)(_base.state.tokens, _base.state.scopes); -} exports.parseTopLevel = parseTopLevel; - -// Parse a single statement. -// -// If expecting a statement and finding a slash operator, parse a -// regular expression literal. This is to handle cases like -// `if (foo) /blah/.exec(foo)`, where looking at the previous token -// does not help. - - function parseStatement(declaration) { - if (_base.isFlowEnabled) { - if (_flow.flowTryParseStatement.call(void 0, )) { - return; - } - } - if (_tokenizer.match.call(void 0, _types.TokenType.at)) { - parseDecorators(); - } - parseStatementContent(declaration); -} exports.parseStatement = parseStatement; - -function parseStatementContent(declaration) { - if (_base.isTypeScriptEnabled) { - if (_typescript.tsTryParseStatementContent.call(void 0, )) { - return; - } - } - - const starttype = _base.state.type; - - // Most types of statements are recognized by the keyword they - // start with. Many are trivial to parse, some require a bit of - // complexity. - - switch (starttype) { - case _types.TokenType._break: - case _types.TokenType._continue: - parseBreakContinueStatement(); - return; - case _types.TokenType._debugger: - parseDebuggerStatement(); - return; - case _types.TokenType._do: - parseDoStatement(); - return; - case _types.TokenType._for: - parseForStatement(); - return; - case _types.TokenType._function: - if (_tokenizer.lookaheadType.call(void 0, ) === _types.TokenType.dot) break; - if (!declaration) _util.unexpected.call(void 0, ); - parseFunctionStatement(); - return; - - case _types.TokenType._class: - if (!declaration) _util.unexpected.call(void 0, ); - parseClass(true); - return; - - case _types.TokenType._if: - parseIfStatement(); - return; - case _types.TokenType._return: - parseReturnStatement(); - return; - case _types.TokenType._switch: - parseSwitchStatement(); - return; - case _types.TokenType._throw: - parseThrowStatement(); - return; - case _types.TokenType._try: - parseTryStatement(); - return; - - case _types.TokenType._let: - case _types.TokenType._const: - if (!declaration) _util.unexpected.call(void 0, ); // NOTE: falls through to _var - - case _types.TokenType._var: - parseVarStatement(starttype !== _types.TokenType._var); - return; - - case _types.TokenType._while: - parseWhileStatement(); - return; - case _types.TokenType.braceL: - parseBlock(); - return; - case _types.TokenType.semi: - parseEmptyStatement(); - return; - case _types.TokenType._export: - case _types.TokenType._import: { - const nextType = _tokenizer.lookaheadType.call(void 0, ); - if (nextType === _types.TokenType.parenL || nextType === _types.TokenType.dot) { - break; - } - _tokenizer.next.call(void 0, ); - if (starttype === _types.TokenType._import) { - parseImport(); - } else { - parseExport(); - } - return; - } - case _types.TokenType.name: - if (_base.state.contextualKeyword === _keywords.ContextualKeyword._async) { - const functionStart = _base.state.start; - // peek ahead and see if next token is a function - const snapshot = _base.state.snapshot(); - _tokenizer.next.call(void 0, ); - if (_tokenizer.match.call(void 0, _types.TokenType._function) && !_util.canInsertSemicolon.call(void 0, )) { - _util.expect.call(void 0, _types.TokenType._function); - parseFunction(functionStart, true); - return; - } else { - _base.state.restoreFromSnapshot(snapshot); - } - } else if ( - _base.state.contextualKeyword === _keywords.ContextualKeyword._using && - !_util.hasFollowingLineBreak.call(void 0, ) && - // Statements like `using[0]` and `using in foo` aren't actual using - // declarations. - _tokenizer.lookaheadType.call(void 0, ) === _types.TokenType.name - ) { - parseVarStatement(true); - return; - } else if (startsAwaitUsing()) { - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._await); - parseVarStatement(true); - return; - } - default: - // Do nothing. - break; - } - - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - const initialTokensLength = _base.state.tokens.length; - _expression.parseExpression.call(void 0, ); - let simpleName = null; - if (_base.state.tokens.length === initialTokensLength + 1) { - const token = _base.state.tokens[_base.state.tokens.length - 1]; - if (token.type === _types.TokenType.name) { - simpleName = token.contextualKeyword; - } - } - if (simpleName == null) { - _util.semicolon.call(void 0, ); - return; - } - if (_tokenizer.eat.call(void 0, _types.TokenType.colon)) { - parseLabeledStatement(); - } else { - // This was an identifier, so we might want to handle flow/typescript-specific cases. - parseIdentifierStatement(simpleName); - } -} - -/** - * Determine if we're positioned at an `await using` declaration. - * - * Note that this can happen either in place of a regular variable declaration - * or in a loop body, and in both places, there are similar-looking cases where - * we need to return false. - * - * Examples returning true: - * await using foo = bar(); - * for (await using a of b) {} - * - * Examples returning false: - * await using - * await using + 1 - * await using instanceof T - * for (await using;;) {} - * - * For now, we early return if we don't see `await`, then do a simple - * backtracking-based lookahead for the `using` and identifier tokens. In the - * future, this could be optimized with a character-based approach. - */ -function startsAwaitUsing() { - if (!_util.isContextual.call(void 0, _keywords.ContextualKeyword._await)) { - return false; - } - const snapshot = _base.state.snapshot(); - // await - _tokenizer.next.call(void 0, ); - if (!_util.isContextual.call(void 0, _keywords.ContextualKeyword._using) || _util.hasPrecedingLineBreak.call(void 0, )) { - _base.state.restoreFromSnapshot(snapshot); - return false; - } - // using - _tokenizer.next.call(void 0, ); - if (!_tokenizer.match.call(void 0, _types.TokenType.name) || _util.hasPrecedingLineBreak.call(void 0, )) { - _base.state.restoreFromSnapshot(snapshot); - return false; - } - _base.state.restoreFromSnapshot(snapshot); - return true; -} - - function parseDecorators() { - while (_tokenizer.match.call(void 0, _types.TokenType.at)) { - parseDecorator(); - } -} exports.parseDecorators = parseDecorators; - -function parseDecorator() { - _tokenizer.next.call(void 0, ); - if (_tokenizer.eat.call(void 0, _types.TokenType.parenL)) { - _expression.parseExpression.call(void 0, ); - _util.expect.call(void 0, _types.TokenType.parenR); - } else { - _expression.parseIdentifier.call(void 0, ); - while (_tokenizer.eat.call(void 0, _types.TokenType.dot)) { - _expression.parseIdentifier.call(void 0, ); - } - parseMaybeDecoratorArguments(); - } -} - -function parseMaybeDecoratorArguments() { - if (_base.isTypeScriptEnabled) { - _typescript.tsParseMaybeDecoratorArguments.call(void 0, ); - } else { - baseParseMaybeDecoratorArguments(); - } -} - - function baseParseMaybeDecoratorArguments() { - if (_tokenizer.eat.call(void 0, _types.TokenType.parenL)) { - _expression.parseCallExpressionArguments.call(void 0, ); - } -} exports.baseParseMaybeDecoratorArguments = baseParseMaybeDecoratorArguments; - -function parseBreakContinueStatement() { - _tokenizer.next.call(void 0, ); - if (!_util.isLineTerminator.call(void 0, )) { - _expression.parseIdentifier.call(void 0, ); - _util.semicolon.call(void 0, ); - } -} - -function parseDebuggerStatement() { - _tokenizer.next.call(void 0, ); - _util.semicolon.call(void 0, ); -} - -function parseDoStatement() { - _tokenizer.next.call(void 0, ); - parseStatement(false); - _util.expect.call(void 0, _types.TokenType._while); - _expression.parseParenExpression.call(void 0, ); - _tokenizer.eat.call(void 0, _types.TokenType.semi); -} - -function parseForStatement() { - _base.state.scopeDepth++; - const startTokenIndex = _base.state.tokens.length; - parseAmbiguousForStatement(); - const endTokenIndex = _base.state.tokens.length; - _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, false)); - _base.state.scopeDepth--; -} - -/** - * Determine if this token is a `using` declaration (explicit resource - * management) as part of a loop. - * https://github.com/tc39/proposal-explicit-resource-management - */ -function isUsingInLoop() { - if (!_util.isContextual.call(void 0, _keywords.ContextualKeyword._using)) { - return false; - } - // This must be `for (using of`, where `using` is the name of the loop - // variable. - if (_util.isLookaheadContextual.call(void 0, _keywords.ContextualKeyword._of)) { - return false; - } - return true; -} - -// Disambiguating between a `for` and a `for`/`in` or `for`/`of` -// loop is non-trivial. Basically, we have to parse the init `var` -// statement or expression, disallowing the `in` operator (see -// the second parameter to `parseExpression`), and then check -// whether the next token is `in` or `of`. When there is no init -// part (semicolon immediately after the opening parenthesis), it -// is a regular `for` loop. -function parseAmbiguousForStatement() { - _tokenizer.next.call(void 0, ); - - let forAwait = false; - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._await)) { - forAwait = true; - _tokenizer.next.call(void 0, ); - } - _util.expect.call(void 0, _types.TokenType.parenL); - - if (_tokenizer.match.call(void 0, _types.TokenType.semi)) { - if (forAwait) { - _util.unexpected.call(void 0, ); - } - parseFor(); - return; - } - - const isAwaitUsing = startsAwaitUsing(); - if (isAwaitUsing || _tokenizer.match.call(void 0, _types.TokenType._var) || _tokenizer.match.call(void 0, _types.TokenType._let) || _tokenizer.match.call(void 0, _types.TokenType._const) || isUsingInLoop()) { - if (isAwaitUsing) { - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._await); - } - _tokenizer.next.call(void 0, ); - parseVar(true, _base.state.type !== _types.TokenType._var); - if (_tokenizer.match.call(void 0, _types.TokenType._in) || _util.isContextual.call(void 0, _keywords.ContextualKeyword._of)) { - parseForIn(forAwait); - return; - } - parseFor(); - return; - } - - _expression.parseExpression.call(void 0, true); - if (_tokenizer.match.call(void 0, _types.TokenType._in) || _util.isContextual.call(void 0, _keywords.ContextualKeyword._of)) { - parseForIn(forAwait); - return; - } - if (forAwait) { - _util.unexpected.call(void 0, ); - } - parseFor(); -} - -function parseFunctionStatement() { - const functionStart = _base.state.start; - _tokenizer.next.call(void 0, ); - parseFunction(functionStart, true); -} - -function parseIfStatement() { - _tokenizer.next.call(void 0, ); - _expression.parseParenExpression.call(void 0, ); - parseStatement(false); - if (_tokenizer.eat.call(void 0, _types.TokenType._else)) { - parseStatement(false); - } -} - -function parseReturnStatement() { - _tokenizer.next.call(void 0, ); - - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. - - if (!_util.isLineTerminator.call(void 0, )) { - _expression.parseExpression.call(void 0, ); - _util.semicolon.call(void 0, ); - } -} - -function parseSwitchStatement() { - _tokenizer.next.call(void 0, ); - _expression.parseParenExpression.call(void 0, ); - _base.state.scopeDepth++; - const startTokenIndex = _base.state.tokens.length; - _util.expect.call(void 0, _types.TokenType.braceL); - - // Don't bother validation; just go through any sequence of cases, defaults, and statements. - while (!_tokenizer.match.call(void 0, _types.TokenType.braceR) && !_base.state.error) { - if (_tokenizer.match.call(void 0, _types.TokenType._case) || _tokenizer.match.call(void 0, _types.TokenType._default)) { - const isCase = _tokenizer.match.call(void 0, _types.TokenType._case); - _tokenizer.next.call(void 0, ); - if (isCase) { - _expression.parseExpression.call(void 0, ); - } - _util.expect.call(void 0, _types.TokenType.colon); - } else { - parseStatement(true); - } - } - _tokenizer.next.call(void 0, ); // Closing brace - const endTokenIndex = _base.state.tokens.length; - _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, false)); - _base.state.scopeDepth--; -} - -function parseThrowStatement() { - _tokenizer.next.call(void 0, ); - _expression.parseExpression.call(void 0, ); - _util.semicolon.call(void 0, ); -} - -function parseCatchClauseParam() { - _lval.parseBindingAtom.call(void 0, true /* isBlockScope */); - - if (_base.isTypeScriptEnabled) { - _typescript.tsTryParseTypeAnnotation.call(void 0, ); - } -} - -function parseTryStatement() { - _tokenizer.next.call(void 0, ); - - parseBlock(); - - if (_tokenizer.match.call(void 0, _types.TokenType._catch)) { - _tokenizer.next.call(void 0, ); - let catchBindingStartTokenIndex = null; - if (_tokenizer.match.call(void 0, _types.TokenType.parenL)) { - _base.state.scopeDepth++; - catchBindingStartTokenIndex = _base.state.tokens.length; - _util.expect.call(void 0, _types.TokenType.parenL); - parseCatchClauseParam(); - _util.expect.call(void 0, _types.TokenType.parenR); - } - parseBlock(); - if (catchBindingStartTokenIndex != null) { - // We need a special scope for the catch binding which includes the binding itself and the - // catch block. - const endTokenIndex = _base.state.tokens.length; - _base.state.scopes.push(new (0, _state.Scope)(catchBindingStartTokenIndex, endTokenIndex, false)); - _base.state.scopeDepth--; - } - } - if (_tokenizer.eat.call(void 0, _types.TokenType._finally)) { - parseBlock(); - } -} - - function parseVarStatement(isBlockScope) { - _tokenizer.next.call(void 0, ); - parseVar(false, isBlockScope); - _util.semicolon.call(void 0, ); -} exports.parseVarStatement = parseVarStatement; - -function parseWhileStatement() { - _tokenizer.next.call(void 0, ); - _expression.parseParenExpression.call(void 0, ); - parseStatement(false); -} - -function parseEmptyStatement() { - _tokenizer.next.call(void 0, ); -} - -function parseLabeledStatement() { - parseStatement(true); -} - -/** - * Parse a statement starting with an identifier of the given name. Subclasses match on the name - * to handle statements like "declare". - */ -function parseIdentifierStatement(contextualKeyword) { - if (_base.isTypeScriptEnabled) { - _typescript.tsParseIdentifierStatement.call(void 0, contextualKeyword); - } else if (_base.isFlowEnabled) { - _flow.flowParseIdentifierStatement.call(void 0, contextualKeyword); - } else { - _util.semicolon.call(void 0, ); - } -} - -// Parse a semicolon-enclosed block of statements. - function parseBlock(isFunctionScope = false, contextId = 0) { - const startTokenIndex = _base.state.tokens.length; - _base.state.scopeDepth++; - _util.expect.call(void 0, _types.TokenType.braceL); - if (contextId) { - _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; - } - parseBlockBody(_types.TokenType.braceR); - if (contextId) { - _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; - } - const endTokenIndex = _base.state.tokens.length; - _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, isFunctionScope)); - _base.state.scopeDepth--; -} exports.parseBlock = parseBlock; - - function parseBlockBody(end) { - while (!_tokenizer.eat.call(void 0, end) && !_base.state.error) { - parseStatement(true); - } -} exports.parseBlockBody = parseBlockBody; - -// Parse a regular `for` loop. The disambiguation code in -// `parseStatement` will already have parsed the init statement or -// expression. - -function parseFor() { - _util.expect.call(void 0, _types.TokenType.semi); - if (!_tokenizer.match.call(void 0, _types.TokenType.semi)) { - _expression.parseExpression.call(void 0, ); - } - _util.expect.call(void 0, _types.TokenType.semi); - if (!_tokenizer.match.call(void 0, _types.TokenType.parenR)) { - _expression.parseExpression.call(void 0, ); - } - _util.expect.call(void 0, _types.TokenType.parenR); - parseStatement(false); -} - -// Parse a `for`/`in` and `for`/`of` loop, which are almost -// same from parser's perspective. - -function parseForIn(forAwait) { - if (forAwait) { - _util.eatContextual.call(void 0, _keywords.ContextualKeyword._of); - } else { - _tokenizer.next.call(void 0, ); - } - _expression.parseExpression.call(void 0, ); - _util.expect.call(void 0, _types.TokenType.parenR); - parseStatement(false); -} - -// Parse a list of variable declarations. - -function parseVar(isFor, isBlockScope) { - while (true) { - parseVarHead(isBlockScope); - if (_tokenizer.eat.call(void 0, _types.TokenType.eq)) { - const eqIndex = _base.state.tokens.length - 1; - _expression.parseMaybeAssign.call(void 0, isFor); - _base.state.tokens[eqIndex].rhsEndIndex = _base.state.tokens.length; - } - if (!_tokenizer.eat.call(void 0, _types.TokenType.comma)) { - break; - } - } -} - -function parseVarHead(isBlockScope) { - _lval.parseBindingAtom.call(void 0, isBlockScope); - if (_base.isTypeScriptEnabled) { - _typescript.tsAfterParseVarHead.call(void 0, ); - } else if (_base.isFlowEnabled) { - _flow.flowAfterParseVarHead.call(void 0, ); - } -} - -// Parse a function declaration or literal (depending on the -// `isStatement` parameter). - - function parseFunction( - functionStart, - isStatement, - optionalId = false, -) { - if (_tokenizer.match.call(void 0, _types.TokenType.star)) { - _tokenizer.next.call(void 0, ); - } - - if (isStatement && !optionalId && !_tokenizer.match.call(void 0, _types.TokenType.name) && !_tokenizer.match.call(void 0, _types.TokenType._yield)) { - _util.unexpected.call(void 0, ); - } - - let nameScopeStartTokenIndex = null; - - if (_tokenizer.match.call(void 0, _types.TokenType.name)) { - // Expression-style functions should limit their name's scope to the function body, so we make - // a new function scope to enforce that. - if (!isStatement) { - nameScopeStartTokenIndex = _base.state.tokens.length; - _base.state.scopeDepth++; - } - _lval.parseBindingIdentifier.call(void 0, false); - } - - const startTokenIndex = _base.state.tokens.length; - _base.state.scopeDepth++; - parseFunctionParams(); - _expression.parseFunctionBodyAndFinish.call(void 0, functionStart); - const endTokenIndex = _base.state.tokens.length; - // In addition to the block scope of the function body, we need a separate function-style scope - // that includes the params. - _base.state.scopes.push(new (0, _state.Scope)(startTokenIndex, endTokenIndex, true)); - _base.state.scopeDepth--; - if (nameScopeStartTokenIndex !== null) { - _base.state.scopes.push(new (0, _state.Scope)(nameScopeStartTokenIndex, endTokenIndex, true)); - _base.state.scopeDepth--; - } -} exports.parseFunction = parseFunction; - - function parseFunctionParams( - allowModifiers = false, - funcContextId = 0, -) { - if (_base.isTypeScriptEnabled) { - _typescript.tsStartParseFunctionParams.call(void 0, ); - } else if (_base.isFlowEnabled) { - _flow.flowStartParseFunctionParams.call(void 0, ); - } - - _util.expect.call(void 0, _types.TokenType.parenL); - if (funcContextId) { - _base.state.tokens[_base.state.tokens.length - 1].contextId = funcContextId; - } - _lval.parseBindingList.call(void 0, - _types.TokenType.parenR, - false /* isBlockScope */, - false /* allowEmpty */, - allowModifiers, - funcContextId, - ); - if (funcContextId) { - _base.state.tokens[_base.state.tokens.length - 1].contextId = funcContextId; - } -} exports.parseFunctionParams = parseFunctionParams; - -// Parse a class declaration or literal (depending on the -// `isStatement` parameter). - - function parseClass(isStatement, optionalId = false) { - // Put a context ID on the class keyword, the open-brace, and the close-brace, so that later - // code can easily navigate to meaningful points on the class. - const contextId = _base.getNextContextId.call(void 0, ); - - _tokenizer.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; - _base.state.tokens[_base.state.tokens.length - 1].isExpression = !isStatement; - // Like with functions, we declare a special "name scope" from the start of the name to the end - // of the class, but only with expression-style classes, to represent the fact that the name is - // available to the body of the class but not an outer declaration. - let nameScopeStartTokenIndex = null; - if (!isStatement) { - nameScopeStartTokenIndex = _base.state.tokens.length; - _base.state.scopeDepth++; - } - parseClassId(isStatement, optionalId); - parseClassSuper(); - const openBraceIndex = _base.state.tokens.length; - parseClassBody(contextId); - if (_base.state.error) { - return; - } - _base.state.tokens[openBraceIndex].contextId = contextId; - _base.state.tokens[_base.state.tokens.length - 1].contextId = contextId; - if (nameScopeStartTokenIndex !== null) { - const endTokenIndex = _base.state.tokens.length; - _base.state.scopes.push(new (0, _state.Scope)(nameScopeStartTokenIndex, endTokenIndex, false)); - _base.state.scopeDepth--; - } -} exports.parseClass = parseClass; - -function isClassProperty() { - return _tokenizer.match.call(void 0, _types.TokenType.eq) || _tokenizer.match.call(void 0, _types.TokenType.semi) || _tokenizer.match.call(void 0, _types.TokenType.braceR) || _tokenizer.match.call(void 0, _types.TokenType.bang) || _tokenizer.match.call(void 0, _types.TokenType.colon); -} - -function isClassMethod() { - return _tokenizer.match.call(void 0, _types.TokenType.parenL) || _tokenizer.match.call(void 0, _types.TokenType.lessThan); -} - -function parseClassBody(classContextId) { - _util.expect.call(void 0, _types.TokenType.braceL); - - while (!_tokenizer.eat.call(void 0, _types.TokenType.braceR) && !_base.state.error) { - if (_tokenizer.eat.call(void 0, _types.TokenType.semi)) { - continue; - } - - if (_tokenizer.match.call(void 0, _types.TokenType.at)) { - parseDecorator(); - continue; - } - const memberStart = _base.state.start; - parseClassMember(memberStart, classContextId); - } -} - -function parseClassMember(memberStart, classContextId) { - if (_base.isTypeScriptEnabled) { - _typescript.tsParseModifiers.call(void 0, [ - _keywords.ContextualKeyword._declare, - _keywords.ContextualKeyword._public, - _keywords.ContextualKeyword._protected, - _keywords.ContextualKeyword._private, - _keywords.ContextualKeyword._override, - ]); - } - let isStatic = false; - if (_tokenizer.match.call(void 0, _types.TokenType.name) && _base.state.contextualKeyword === _keywords.ContextualKeyword._static) { - _expression.parseIdentifier.call(void 0, ); // eats 'static' - if (isClassMethod()) { - parseClassMethod(memberStart, /* isConstructor */ false); - return; - } else if (isClassProperty()) { - parseClassProperty(); - return; - } - // otherwise something static - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._static; - isStatic = true; - - if (_tokenizer.match.call(void 0, _types.TokenType.braceL)) { - // This is a static block. Mark the word "static" with the class context ID for class element - // detection and parse as a regular block. - _base.state.tokens[_base.state.tokens.length - 1].contextId = classContextId; - parseBlock(); - return; - } - } - - parseClassMemberWithIsStatic(memberStart, isStatic, classContextId); -} - -function parseClassMemberWithIsStatic( - memberStart, - isStatic, - classContextId, -) { - if (_base.isTypeScriptEnabled) { - if (_typescript.tsTryParseClassMemberWithIsStatic.call(void 0, isStatic)) { - return; - } - } - if (_tokenizer.eat.call(void 0, _types.TokenType.star)) { - // a generator - parseClassPropertyName(classContextId); - parseClassMethod(memberStart, /* isConstructor */ false); - return; - } - - // Get the identifier name so we can tell if it's actually a keyword like "async", "get", or - // "set". - parseClassPropertyName(classContextId); - let isConstructor = false; - const token = _base.state.tokens[_base.state.tokens.length - 1]; - // We allow "constructor" as either an identifier or a string. - if (token.contextualKeyword === _keywords.ContextualKeyword._constructor) { - isConstructor = true; - } - parsePostMemberNameModifiers(); - - if (isClassMethod()) { - parseClassMethod(memberStart, isConstructor); - } else if (isClassProperty()) { - parseClassProperty(); - } else if (token.contextualKeyword === _keywords.ContextualKeyword._async && !_util.isLineTerminator.call(void 0, )) { - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._async; - // an async method - const isGenerator = _tokenizer.match.call(void 0, _types.TokenType.star); - if (isGenerator) { - _tokenizer.next.call(void 0, ); - } - - // The so-called parsed name would have been "async": get the real name. - parseClassPropertyName(classContextId); - parsePostMemberNameModifiers(); - parseClassMethod(memberStart, false /* isConstructor */); - } else if ( - (token.contextualKeyword === _keywords.ContextualKeyword._get || - token.contextualKeyword === _keywords.ContextualKeyword._set) && - !(_util.isLineTerminator.call(void 0, ) && _tokenizer.match.call(void 0, _types.TokenType.star)) - ) { - if (token.contextualKeyword === _keywords.ContextualKeyword._get) { - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._get; - } else { - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._set; - } - // `get\n*` is an uninitialized property named 'get' followed by a generator. - // a getter or setter - // The so-called parsed name would have been "get/set": get the real name. - parseClassPropertyName(classContextId); - parseClassMethod(memberStart, /* isConstructor */ false); - } else if (token.contextualKeyword === _keywords.ContextualKeyword._accessor && !_util.isLineTerminator.call(void 0, )) { - parseClassPropertyName(classContextId); - parseClassProperty(); - } else if (_util.isLineTerminator.call(void 0, )) { - // an uninitialized class property (due to ASI, since we don't otherwise recognize the next token) - parseClassProperty(); - } else { - _util.unexpected.call(void 0, ); - } -} - -function parseClassMethod(functionStart, isConstructor) { - if (_base.isTypeScriptEnabled) { - _typescript.tsTryParseTypeParameters.call(void 0, ); - } else if (_base.isFlowEnabled) { - if (_tokenizer.match.call(void 0, _types.TokenType.lessThan)) { - _flow.flowParseTypeParameterDeclaration.call(void 0, ); - } - } - _expression.parseMethod.call(void 0, functionStart, isConstructor); -} - -// Return the name of the class property, if it is a simple identifier. - function parseClassPropertyName(classContextId) { - _expression.parsePropertyName.call(void 0, classContextId); -} exports.parseClassPropertyName = parseClassPropertyName; - - function parsePostMemberNameModifiers() { - if (_base.isTypeScriptEnabled) { - const oldIsType = _tokenizer.pushTypeContext.call(void 0, 0); - _tokenizer.eat.call(void 0, _types.TokenType.question); - _tokenizer.popTypeContext.call(void 0, oldIsType); - } -} exports.parsePostMemberNameModifiers = parsePostMemberNameModifiers; - - function parseClassProperty() { - if (_base.isTypeScriptEnabled) { - _tokenizer.eatTypeToken.call(void 0, _types.TokenType.bang); - _typescript.tsTryParseTypeAnnotation.call(void 0, ); - } else if (_base.isFlowEnabled) { - if (_tokenizer.match.call(void 0, _types.TokenType.colon)) { - _flow.flowParseTypeAnnotation.call(void 0, ); - } - } - - if (_tokenizer.match.call(void 0, _types.TokenType.eq)) { - const equalsTokenIndex = _base.state.tokens.length; - _tokenizer.next.call(void 0, ); - _expression.parseMaybeAssign.call(void 0, ); - _base.state.tokens[equalsTokenIndex].rhsEndIndex = _base.state.tokens.length; - } - _util.semicolon.call(void 0, ); -} exports.parseClassProperty = parseClassProperty; - -function parseClassId(isStatement, optionalId = false) { - if ( - _base.isTypeScriptEnabled && - (!isStatement || optionalId) && - _util.isContextual.call(void 0, _keywords.ContextualKeyword._implements) - ) { - return; - } - - if (_tokenizer.match.call(void 0, _types.TokenType.name)) { - _lval.parseBindingIdentifier.call(void 0, true); - } - - if (_base.isTypeScriptEnabled) { - _typescript.tsTryParseTypeParameters.call(void 0, ); - } else if (_base.isFlowEnabled) { - if (_tokenizer.match.call(void 0, _types.TokenType.lessThan)) { - _flow.flowParseTypeParameterDeclaration.call(void 0, ); - } - } -} - -// Returns true if there was a superclass. -function parseClassSuper() { - let hasSuper = false; - if (_tokenizer.eat.call(void 0, _types.TokenType._extends)) { - _expression.parseExprSubscripts.call(void 0, ); - hasSuper = true; - } else { - hasSuper = false; - } - if (_base.isTypeScriptEnabled) { - _typescript.tsAfterParseClassSuper.call(void 0, hasSuper); - } else if (_base.isFlowEnabled) { - _flow.flowAfterParseClassSuper.call(void 0, hasSuper); - } -} - -// Parses module export declaration. - - function parseExport() { - const exportIndex = _base.state.tokens.length - 1; - if (_base.isTypeScriptEnabled) { - if (_typescript.tsTryParseExport.call(void 0, )) { - return; - } - } - // export * from '...' - if (shouldParseExportStar()) { - parseExportStar(); - } else if (isExportDefaultSpecifier()) { - // export default from - _expression.parseIdentifier.call(void 0, ); - if (_tokenizer.match.call(void 0, _types.TokenType.comma) && _tokenizer.lookaheadType.call(void 0, ) === _types.TokenType.star) { - _util.expect.call(void 0, _types.TokenType.comma); - _util.expect.call(void 0, _types.TokenType.star); - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._as); - _expression.parseIdentifier.call(void 0, ); - } else { - parseExportSpecifiersMaybe(); - } - parseExportFrom(); - } else if (_tokenizer.eat.call(void 0, _types.TokenType._default)) { - // export default ... - parseExportDefaultExpression(); - } else if (shouldParseExportDeclaration()) { - parseExportDeclaration(); - } else { - // export { x, y as z } [from '...'] - parseExportSpecifiers(); - parseExportFrom(); - } - _base.state.tokens[exportIndex].rhsEndIndex = _base.state.tokens.length; -} exports.parseExport = parseExport; - -function parseExportDefaultExpression() { - if (_base.isTypeScriptEnabled) { - if (_typescript.tsTryParseExportDefaultExpression.call(void 0, )) { - return; - } - } - if (_base.isFlowEnabled) { - if (_flow.flowTryParseExportDefaultExpression.call(void 0, )) { - return; - } - } - const functionStart = _base.state.start; - if (_tokenizer.eat.call(void 0, _types.TokenType._function)) { - parseFunction(functionStart, true, true); - } else if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._async) && _tokenizer.lookaheadType.call(void 0, ) === _types.TokenType._function) { - // async function declaration - _util.eatContextual.call(void 0, _keywords.ContextualKeyword._async); - _tokenizer.eat.call(void 0, _types.TokenType._function); - parseFunction(functionStart, true, true); - } else if (_tokenizer.match.call(void 0, _types.TokenType._class)) { - parseClass(true, true); - } else if (_tokenizer.match.call(void 0, _types.TokenType.at)) { - parseDecorators(); - parseClass(true, true); - } else { - _expression.parseMaybeAssign.call(void 0, ); - _util.semicolon.call(void 0, ); - } -} - -function parseExportDeclaration() { - if (_base.isTypeScriptEnabled) { - _typescript.tsParseExportDeclaration.call(void 0, ); - } else if (_base.isFlowEnabled) { - _flow.flowParseExportDeclaration.call(void 0, ); - } else { - parseStatement(true); - } -} - -function isExportDefaultSpecifier() { - if (_base.isTypeScriptEnabled && _typescript.tsIsDeclarationStart.call(void 0, )) { - return false; - } else if (_base.isFlowEnabled && _flow.flowShouldDisallowExportDefaultSpecifier.call(void 0, )) { - return false; - } - if (_tokenizer.match.call(void 0, _types.TokenType.name)) { - return _base.state.contextualKeyword !== _keywords.ContextualKeyword._async; - } - - if (!_tokenizer.match.call(void 0, _types.TokenType._default)) { - return false; - } - - const _next = _tokenizer.nextTokenStart.call(void 0, ); - const lookahead = _tokenizer.lookaheadTypeAndKeyword.call(void 0, ); - const hasFrom = - lookahead.type === _types.TokenType.name && lookahead.contextualKeyword === _keywords.ContextualKeyword._from; - if (lookahead.type === _types.TokenType.comma) { - return true; - } - // lookahead again when `export default from` is seen - if (hasFrom) { - const nextAfterFrom = _base.input.charCodeAt(_tokenizer.nextTokenStartSince.call(void 0, _next + 4)); - return nextAfterFrom === _charcodes.charCodes.quotationMark || nextAfterFrom === _charcodes.charCodes.apostrophe; - } - return false; -} - -function parseExportSpecifiersMaybe() { - if (_tokenizer.eat.call(void 0, _types.TokenType.comma)) { - parseExportSpecifiers(); - } -} - - function parseExportFrom() { - if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._from)) { - _expression.parseExprAtom.call(void 0, ); - maybeParseImportAttributes(); - } - _util.semicolon.call(void 0, ); -} exports.parseExportFrom = parseExportFrom; - -function shouldParseExportStar() { - if (_base.isFlowEnabled) { - return _flow.flowShouldParseExportStar.call(void 0, ); - } else { - return _tokenizer.match.call(void 0, _types.TokenType.star); - } -} - -function parseExportStar() { - if (_base.isFlowEnabled) { - _flow.flowParseExportStar.call(void 0, ); - } else { - baseParseExportStar(); - } -} - - function baseParseExportStar() { - _util.expect.call(void 0, _types.TokenType.star); - - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._as)) { - parseExportNamespace(); - } else { - parseExportFrom(); - } -} exports.baseParseExportStar = baseParseExportStar; - -function parseExportNamespace() { - _tokenizer.next.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].type = _types.TokenType._as; - _expression.parseIdentifier.call(void 0, ); - parseExportSpecifiersMaybe(); - parseExportFrom(); -} - -function shouldParseExportDeclaration() { - return ( - (_base.isTypeScriptEnabled && _typescript.tsIsDeclarationStart.call(void 0, )) || - (_base.isFlowEnabled && _flow.flowShouldParseExportDeclaration.call(void 0, )) || - _base.state.type === _types.TokenType._var || - _base.state.type === _types.TokenType._const || - _base.state.type === _types.TokenType._let || - _base.state.type === _types.TokenType._function || - _base.state.type === _types.TokenType._class || - _util.isContextual.call(void 0, _keywords.ContextualKeyword._async) || - _tokenizer.match.call(void 0, _types.TokenType.at) - ); -} - -// Parses a comma-separated list of module exports. - function parseExportSpecifiers() { - let first = true; - - // export { x, y as z } [from '...'] - _util.expect.call(void 0, _types.TokenType.braceL); - - while (!_tokenizer.eat.call(void 0, _types.TokenType.braceR) && !_base.state.error) { - if (first) { - first = false; - } else { - _util.expect.call(void 0, _types.TokenType.comma); - if (_tokenizer.eat.call(void 0, _types.TokenType.braceR)) { - break; - } - } - parseExportSpecifier(); - } -} exports.parseExportSpecifiers = parseExportSpecifiers; - -function parseExportSpecifier() { - if (_base.isTypeScriptEnabled) { - _typescript.tsParseExportSpecifier.call(void 0, ); - return; - } - _expression.parseIdentifier.call(void 0, ); - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _tokenizer.IdentifierRole.ExportAccess; - if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._as)) { - _expression.parseIdentifier.call(void 0, ); - } -} - -/** - * Starting at the `module` token in an import, determine if it was truly an - * import reflection token or just looks like one. - * - * Returns true for: - * import module foo from "foo"; - * import module from from "foo"; - * - * Returns false for: - * import module from "foo"; - * import module, {bar} from "foo"; - */ -function isImportReflection() { - const snapshot = _base.state.snapshot(); - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._module); - if (_util.eatContextual.call(void 0, _keywords.ContextualKeyword._from)) { - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._from)) { - _base.state.restoreFromSnapshot(snapshot); - return true; - } else { - _base.state.restoreFromSnapshot(snapshot); - return false; - } - } else if (_tokenizer.match.call(void 0, _types.TokenType.comma)) { - _base.state.restoreFromSnapshot(snapshot); - return false; - } else { - _base.state.restoreFromSnapshot(snapshot); - return true; - } -} - -/** - * Eat the "module" token from the import reflection proposal. - * https://github.com/tc39/proposal-import-reflection - */ -function parseMaybeImportReflection() { - // isImportReflection does snapshot/restore, so only run it if we see the word - // "module". - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._module) && isImportReflection()) { - _tokenizer.next.call(void 0, ); - } -} - -// Parses import declaration. - - function parseImport() { - if (_base.isTypeScriptEnabled && _tokenizer.match.call(void 0, _types.TokenType.name) && _tokenizer.lookaheadType.call(void 0, ) === _types.TokenType.eq) { - _typescript.tsParseImportEqualsDeclaration.call(void 0, ); - return; - } - if (_base.isTypeScriptEnabled && _util.isContextual.call(void 0, _keywords.ContextualKeyword._type)) { - const lookahead = _tokenizer.lookaheadTypeAndKeyword.call(void 0, ); - if (lookahead.type === _types.TokenType.name && lookahead.contextualKeyword !== _keywords.ContextualKeyword._from) { - // One of these `import type` cases: - // import type T = require('T'); - // import type A from 'A'; - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._type); - if (_tokenizer.lookaheadType.call(void 0, ) === _types.TokenType.eq) { - _typescript.tsParseImportEqualsDeclaration.call(void 0, ); - return; - } - // If this is an `import type...from` statement, then we already ate the - // type token, so proceed to the regular import parser. - } else if (lookahead.type === _types.TokenType.star || lookahead.type === _types.TokenType.braceL) { - // One of these `import type` cases, in which case we can eat the type token - // and proceed as normal: - // import type * as A from 'A'; - // import type {a} from 'A'; - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._type); - } - // Otherwise, we are importing the name "type". - } - - // import '...' - if (_tokenizer.match.call(void 0, _types.TokenType.string)) { - _expression.parseExprAtom.call(void 0, ); - } else { - parseMaybeImportReflection(); - parseImportSpecifiers(); - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._from); - _expression.parseExprAtom.call(void 0, ); - } - maybeParseImportAttributes(); - _util.semicolon.call(void 0, ); -} exports.parseImport = parseImport; - -// eslint-disable-next-line no-unused-vars -function shouldParseDefaultImport() { - return _tokenizer.match.call(void 0, _types.TokenType.name); -} - -function parseImportSpecifierLocal() { - _lval.parseImportedIdentifier.call(void 0, ); -} - -// Parses a comma-separated list of module imports. -function parseImportSpecifiers() { - if (_base.isFlowEnabled) { - _flow.flowStartParseImportSpecifiers.call(void 0, ); - } - - let first = true; - if (shouldParseDefaultImport()) { - // import defaultObj, { x, y as z } from '...' - parseImportSpecifierLocal(); - - if (!_tokenizer.eat.call(void 0, _types.TokenType.comma)) return; - } - - if (_tokenizer.match.call(void 0, _types.TokenType.star)) { - _tokenizer.next.call(void 0, ); - _util.expectContextual.call(void 0, _keywords.ContextualKeyword._as); - - parseImportSpecifierLocal(); - - return; - } - - _util.expect.call(void 0, _types.TokenType.braceL); - while (!_tokenizer.eat.call(void 0, _types.TokenType.braceR) && !_base.state.error) { - if (first) { - first = false; - } else { - // Detect an attempt to deep destructure - if (_tokenizer.eat.call(void 0, _types.TokenType.colon)) { - _util.unexpected.call(void 0, - "ES2015 named imports do not destructure. Use another statement for destructuring after the import.", - ); - } - - _util.expect.call(void 0, _types.TokenType.comma); - if (_tokenizer.eat.call(void 0, _types.TokenType.braceR)) { - break; - } - } - - parseImportSpecifier(); - } -} - -function parseImportSpecifier() { - if (_base.isTypeScriptEnabled) { - _typescript.tsParseImportSpecifier.call(void 0, ); - return; - } - if (_base.isFlowEnabled) { - _flow.flowParseImportSpecifier.call(void 0, ); - return; - } - _lval.parseImportedIdentifier.call(void 0, ); - if (_util.isContextual.call(void 0, _keywords.ContextualKeyword._as)) { - _base.state.tokens[_base.state.tokens.length - 1].identifierRole = _tokenizer.IdentifierRole.ImportAccess; - _tokenizer.next.call(void 0, ); - _lval.parseImportedIdentifier.call(void 0, ); - } -} - -/** - * Parse import attributes like `with {type: "json"}`, or the legacy form - * `assert {type: "json"}`. - * - * Import attributes technically have their own syntax, but are always parseable - * as a plain JS object, so just do that for simplicity. - */ -function maybeParseImportAttributes() { - if (_tokenizer.match.call(void 0, _types.TokenType._with) || (_util.isContextual.call(void 0, _keywords.ContextualKeyword._assert) && !_util.hasPrecedingLineBreak.call(void 0, ))) { - _tokenizer.next.call(void 0, ); - _expression.parseObj.call(void 0, false, false); - } -} diff --git a/node_modules/sucrase/dist/parser/traverser/util.js b/node_modules/sucrase/dist/parser/traverser/util.js deleted file mode 100644 index 8ade800..0000000 --- a/node_modules/sucrase/dist/parser/traverser/util.js +++ /dev/null @@ -1,104 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _index = require('../tokenizer/index'); - -var _types = require('../tokenizer/types'); -var _charcodes = require('../util/charcodes'); -var _base = require('./base'); - -// ## Parser utilities - -// Tests whether parsed token is a contextual keyword. - function isContextual(contextualKeyword) { - return _base.state.contextualKeyword === contextualKeyword; -} exports.isContextual = isContextual; - - function isLookaheadContextual(contextualKeyword) { - const l = _index.lookaheadTypeAndKeyword.call(void 0, ); - return l.type === _types.TokenType.name && l.contextualKeyword === contextualKeyword; -} exports.isLookaheadContextual = isLookaheadContextual; - -// Consumes contextual keyword if possible. - function eatContextual(contextualKeyword) { - return _base.state.contextualKeyword === contextualKeyword && _index.eat.call(void 0, _types.TokenType.name); -} exports.eatContextual = eatContextual; - -// Asserts that following token is given contextual keyword. - function expectContextual(contextualKeyword) { - if (!eatContextual(contextualKeyword)) { - unexpected(); - } -} exports.expectContextual = expectContextual; - -// Test whether a semicolon can be inserted at the current position. - function canInsertSemicolon() { - return _index.match.call(void 0, _types.TokenType.eof) || _index.match.call(void 0, _types.TokenType.braceR) || hasPrecedingLineBreak(); -} exports.canInsertSemicolon = canInsertSemicolon; - - function hasPrecedingLineBreak() { - const prevToken = _base.state.tokens[_base.state.tokens.length - 1]; - const lastTokEnd = prevToken ? prevToken.end : 0; - for (let i = lastTokEnd; i < _base.state.start; i++) { - const code = _base.input.charCodeAt(i); - if ( - code === _charcodes.charCodes.lineFeed || - code === _charcodes.charCodes.carriageReturn || - code === 0x2028 || - code === 0x2029 - ) { - return true; - } - } - return false; -} exports.hasPrecedingLineBreak = hasPrecedingLineBreak; - - function hasFollowingLineBreak() { - const nextStart = _index.nextTokenStart.call(void 0, ); - for (let i = _base.state.end; i < nextStart; i++) { - const code = _base.input.charCodeAt(i); - if ( - code === _charcodes.charCodes.lineFeed || - code === _charcodes.charCodes.carriageReturn || - code === 0x2028 || - code === 0x2029 - ) { - return true; - } - } - return false; -} exports.hasFollowingLineBreak = hasFollowingLineBreak; - - function isLineTerminator() { - return _index.eat.call(void 0, _types.TokenType.semi) || canInsertSemicolon(); -} exports.isLineTerminator = isLineTerminator; - -// Consume a semicolon, or, failing that, see if we are allowed to -// pretend that there is a semicolon at this position. - function semicolon() { - if (!isLineTerminator()) { - unexpected('Unexpected token, expected ";"'); - } -} exports.semicolon = semicolon; - -// Expect a token of a given type. If found, consume it, otherwise, -// raise an unexpected token error at given pos. - function expect(type) { - const matched = _index.eat.call(void 0, type); - if (!matched) { - unexpected(`Unexpected token, expected "${_types.formatTokenType.call(void 0, type)}"`); - } -} exports.expect = expect; - -/** - * Transition the parser to an error state. All code needs to be written to naturally unwind in this - * state, which allows us to backtrack without exceptions and without error plumbing everywhere. - */ - function unexpected(message = "Unexpected token", pos = _base.state.start) { - if (_base.state.error) { - return; - } - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const err = new SyntaxError(message); - err.pos = pos; - _base.state.error = err; - _base.state.pos = _base.input.length; - _index.finishToken.call(void 0, _types.TokenType.eof); -} exports.unexpected = unexpected; diff --git a/node_modules/sucrase/dist/parser/util/charcodes.js b/node_modules/sucrase/dist/parser/util/charcodes.js deleted file mode 100644 index 52bebc4..0000000 --- a/node_modules/sucrase/dist/parser/util/charcodes.js +++ /dev/null @@ -1,115 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var charCodes; (function (charCodes) { - const backSpace = 8; charCodes[charCodes["backSpace"] = backSpace] = "backSpace"; - const lineFeed = 10; charCodes[charCodes["lineFeed"] = lineFeed] = "lineFeed"; // '\n' - const tab = 9; charCodes[charCodes["tab"] = tab] = "tab"; // '\t' - const carriageReturn = 13; charCodes[charCodes["carriageReturn"] = carriageReturn] = "carriageReturn"; // '\r' - const shiftOut = 14; charCodes[charCodes["shiftOut"] = shiftOut] = "shiftOut"; - const space = 32; charCodes[charCodes["space"] = space] = "space"; - const exclamationMark = 33; charCodes[charCodes["exclamationMark"] = exclamationMark] = "exclamationMark"; // '!' - const quotationMark = 34; charCodes[charCodes["quotationMark"] = quotationMark] = "quotationMark"; // '"' - const numberSign = 35; charCodes[charCodes["numberSign"] = numberSign] = "numberSign"; // '#' - const dollarSign = 36; charCodes[charCodes["dollarSign"] = dollarSign] = "dollarSign"; // '$' - const percentSign = 37; charCodes[charCodes["percentSign"] = percentSign] = "percentSign"; // '%' - const ampersand = 38; charCodes[charCodes["ampersand"] = ampersand] = "ampersand"; // '&' - const apostrophe = 39; charCodes[charCodes["apostrophe"] = apostrophe] = "apostrophe"; // ''' - const leftParenthesis = 40; charCodes[charCodes["leftParenthesis"] = leftParenthesis] = "leftParenthesis"; // '(' - const rightParenthesis = 41; charCodes[charCodes["rightParenthesis"] = rightParenthesis] = "rightParenthesis"; // ')' - const asterisk = 42; charCodes[charCodes["asterisk"] = asterisk] = "asterisk"; // '*' - const plusSign = 43; charCodes[charCodes["plusSign"] = plusSign] = "plusSign"; // '+' - const comma = 44; charCodes[charCodes["comma"] = comma] = "comma"; // ',' - const dash = 45; charCodes[charCodes["dash"] = dash] = "dash"; // '-' - const dot = 46; charCodes[charCodes["dot"] = dot] = "dot"; // '.' - const slash = 47; charCodes[charCodes["slash"] = slash] = "slash"; // '/' - const digit0 = 48; charCodes[charCodes["digit0"] = digit0] = "digit0"; // '0' - const digit1 = 49; charCodes[charCodes["digit1"] = digit1] = "digit1"; // '1' - const digit2 = 50; charCodes[charCodes["digit2"] = digit2] = "digit2"; // '2' - const digit3 = 51; charCodes[charCodes["digit3"] = digit3] = "digit3"; // '3' - const digit4 = 52; charCodes[charCodes["digit4"] = digit4] = "digit4"; // '4' - const digit5 = 53; charCodes[charCodes["digit5"] = digit5] = "digit5"; // '5' - const digit6 = 54; charCodes[charCodes["digit6"] = digit6] = "digit6"; // '6' - const digit7 = 55; charCodes[charCodes["digit7"] = digit7] = "digit7"; // '7' - const digit8 = 56; charCodes[charCodes["digit8"] = digit8] = "digit8"; // '8' - const digit9 = 57; charCodes[charCodes["digit9"] = digit9] = "digit9"; // '9' - const colon = 58; charCodes[charCodes["colon"] = colon] = "colon"; // ':' - const semicolon = 59; charCodes[charCodes["semicolon"] = semicolon] = "semicolon"; // ';' - const lessThan = 60; charCodes[charCodes["lessThan"] = lessThan] = "lessThan"; // '<' - const equalsTo = 61; charCodes[charCodes["equalsTo"] = equalsTo] = "equalsTo"; // '=' - const greaterThan = 62; charCodes[charCodes["greaterThan"] = greaterThan] = "greaterThan"; // '>' - const questionMark = 63; charCodes[charCodes["questionMark"] = questionMark] = "questionMark"; // '?' - const atSign = 64; charCodes[charCodes["atSign"] = atSign] = "atSign"; // '@' - const uppercaseA = 65; charCodes[charCodes["uppercaseA"] = uppercaseA] = "uppercaseA"; // 'A' - const uppercaseB = 66; charCodes[charCodes["uppercaseB"] = uppercaseB] = "uppercaseB"; // 'B' - const uppercaseC = 67; charCodes[charCodes["uppercaseC"] = uppercaseC] = "uppercaseC"; // 'C' - const uppercaseD = 68; charCodes[charCodes["uppercaseD"] = uppercaseD] = "uppercaseD"; // 'D' - const uppercaseE = 69; charCodes[charCodes["uppercaseE"] = uppercaseE] = "uppercaseE"; // 'E' - const uppercaseF = 70; charCodes[charCodes["uppercaseF"] = uppercaseF] = "uppercaseF"; // 'F' - const uppercaseG = 71; charCodes[charCodes["uppercaseG"] = uppercaseG] = "uppercaseG"; // 'G' - const uppercaseH = 72; charCodes[charCodes["uppercaseH"] = uppercaseH] = "uppercaseH"; // 'H' - const uppercaseI = 73; charCodes[charCodes["uppercaseI"] = uppercaseI] = "uppercaseI"; // 'I' - const uppercaseJ = 74; charCodes[charCodes["uppercaseJ"] = uppercaseJ] = "uppercaseJ"; // 'J' - const uppercaseK = 75; charCodes[charCodes["uppercaseK"] = uppercaseK] = "uppercaseK"; // 'K' - const uppercaseL = 76; charCodes[charCodes["uppercaseL"] = uppercaseL] = "uppercaseL"; // 'L' - const uppercaseM = 77; charCodes[charCodes["uppercaseM"] = uppercaseM] = "uppercaseM"; // 'M' - const uppercaseN = 78; charCodes[charCodes["uppercaseN"] = uppercaseN] = "uppercaseN"; // 'N' - const uppercaseO = 79; charCodes[charCodes["uppercaseO"] = uppercaseO] = "uppercaseO"; // 'O' - const uppercaseP = 80; charCodes[charCodes["uppercaseP"] = uppercaseP] = "uppercaseP"; // 'P' - const uppercaseQ = 81; charCodes[charCodes["uppercaseQ"] = uppercaseQ] = "uppercaseQ"; // 'Q' - const uppercaseR = 82; charCodes[charCodes["uppercaseR"] = uppercaseR] = "uppercaseR"; // 'R' - const uppercaseS = 83; charCodes[charCodes["uppercaseS"] = uppercaseS] = "uppercaseS"; // 'S' - const uppercaseT = 84; charCodes[charCodes["uppercaseT"] = uppercaseT] = "uppercaseT"; // 'T' - const uppercaseU = 85; charCodes[charCodes["uppercaseU"] = uppercaseU] = "uppercaseU"; // 'U' - const uppercaseV = 86; charCodes[charCodes["uppercaseV"] = uppercaseV] = "uppercaseV"; // 'V' - const uppercaseW = 87; charCodes[charCodes["uppercaseW"] = uppercaseW] = "uppercaseW"; // 'W' - const uppercaseX = 88; charCodes[charCodes["uppercaseX"] = uppercaseX] = "uppercaseX"; // 'X' - const uppercaseY = 89; charCodes[charCodes["uppercaseY"] = uppercaseY] = "uppercaseY"; // 'Y' - const uppercaseZ = 90; charCodes[charCodes["uppercaseZ"] = uppercaseZ] = "uppercaseZ"; // 'Z' - const leftSquareBracket = 91; charCodes[charCodes["leftSquareBracket"] = leftSquareBracket] = "leftSquareBracket"; // '[' - const backslash = 92; charCodes[charCodes["backslash"] = backslash] = "backslash"; // '\ ' - const rightSquareBracket = 93; charCodes[charCodes["rightSquareBracket"] = rightSquareBracket] = "rightSquareBracket"; // ']' - const caret = 94; charCodes[charCodes["caret"] = caret] = "caret"; // '^' - const underscore = 95; charCodes[charCodes["underscore"] = underscore] = "underscore"; // '_' - const graveAccent = 96; charCodes[charCodes["graveAccent"] = graveAccent] = "graveAccent"; // '`' - const lowercaseA = 97; charCodes[charCodes["lowercaseA"] = lowercaseA] = "lowercaseA"; // 'a' - const lowercaseB = 98; charCodes[charCodes["lowercaseB"] = lowercaseB] = "lowercaseB"; // 'b' - const lowercaseC = 99; charCodes[charCodes["lowercaseC"] = lowercaseC] = "lowercaseC"; // 'c' - const lowercaseD = 100; charCodes[charCodes["lowercaseD"] = lowercaseD] = "lowercaseD"; // 'd' - const lowercaseE = 101; charCodes[charCodes["lowercaseE"] = lowercaseE] = "lowercaseE"; // 'e' - const lowercaseF = 102; charCodes[charCodes["lowercaseF"] = lowercaseF] = "lowercaseF"; // 'f' - const lowercaseG = 103; charCodes[charCodes["lowercaseG"] = lowercaseG] = "lowercaseG"; // 'g' - const lowercaseH = 104; charCodes[charCodes["lowercaseH"] = lowercaseH] = "lowercaseH"; // 'h' - const lowercaseI = 105; charCodes[charCodes["lowercaseI"] = lowercaseI] = "lowercaseI"; // 'i' - const lowercaseJ = 106; charCodes[charCodes["lowercaseJ"] = lowercaseJ] = "lowercaseJ"; // 'j' - const lowercaseK = 107; charCodes[charCodes["lowercaseK"] = lowercaseK] = "lowercaseK"; // 'k' - const lowercaseL = 108; charCodes[charCodes["lowercaseL"] = lowercaseL] = "lowercaseL"; // 'l' - const lowercaseM = 109; charCodes[charCodes["lowercaseM"] = lowercaseM] = "lowercaseM"; // 'm' - const lowercaseN = 110; charCodes[charCodes["lowercaseN"] = lowercaseN] = "lowercaseN"; // 'n' - const lowercaseO = 111; charCodes[charCodes["lowercaseO"] = lowercaseO] = "lowercaseO"; // 'o' - const lowercaseP = 112; charCodes[charCodes["lowercaseP"] = lowercaseP] = "lowercaseP"; // 'p' - const lowercaseQ = 113; charCodes[charCodes["lowercaseQ"] = lowercaseQ] = "lowercaseQ"; // 'q' - const lowercaseR = 114; charCodes[charCodes["lowercaseR"] = lowercaseR] = "lowercaseR"; // 'r' - const lowercaseS = 115; charCodes[charCodes["lowercaseS"] = lowercaseS] = "lowercaseS"; // 's' - const lowercaseT = 116; charCodes[charCodes["lowercaseT"] = lowercaseT] = "lowercaseT"; // 't' - const lowercaseU = 117; charCodes[charCodes["lowercaseU"] = lowercaseU] = "lowercaseU"; // 'u' - const lowercaseV = 118; charCodes[charCodes["lowercaseV"] = lowercaseV] = "lowercaseV"; // 'v' - const lowercaseW = 119; charCodes[charCodes["lowercaseW"] = lowercaseW] = "lowercaseW"; // 'w' - const lowercaseX = 120; charCodes[charCodes["lowercaseX"] = lowercaseX] = "lowercaseX"; // 'x' - const lowercaseY = 121; charCodes[charCodes["lowercaseY"] = lowercaseY] = "lowercaseY"; // 'y' - const lowercaseZ = 122; charCodes[charCodes["lowercaseZ"] = lowercaseZ] = "lowercaseZ"; // 'z' - const leftCurlyBrace = 123; charCodes[charCodes["leftCurlyBrace"] = leftCurlyBrace] = "leftCurlyBrace"; // '{' - const verticalBar = 124; charCodes[charCodes["verticalBar"] = verticalBar] = "verticalBar"; // '|' - const rightCurlyBrace = 125; charCodes[charCodes["rightCurlyBrace"] = rightCurlyBrace] = "rightCurlyBrace"; // '}' - const tilde = 126; charCodes[charCodes["tilde"] = tilde] = "tilde"; // '~' - const nonBreakingSpace = 160; charCodes[charCodes["nonBreakingSpace"] = nonBreakingSpace] = "nonBreakingSpace"; - // eslint-disable-next-line no-irregular-whitespace - const oghamSpaceMark = 5760; charCodes[charCodes["oghamSpaceMark"] = oghamSpaceMark] = "oghamSpaceMark"; // ' ' - const lineSeparator = 8232; charCodes[charCodes["lineSeparator"] = lineSeparator] = "lineSeparator"; - const paragraphSeparator = 8233; charCodes[charCodes["paragraphSeparator"] = paragraphSeparator] = "paragraphSeparator"; -})(charCodes || (exports.charCodes = charCodes = {})); - - function isDigit(code) { - return ( - (code >= charCodes.digit0 && code <= charCodes.digit9) || - (code >= charCodes.lowercaseA && code <= charCodes.lowercaseF) || - (code >= charCodes.uppercaseA && code <= charCodes.uppercaseF) - ); -} exports.isDigit = isDigit; diff --git a/node_modules/sucrase/dist/parser/util/identifier.js b/node_modules/sucrase/dist/parser/util/identifier.js deleted file mode 100644 index 9a2813c..0000000 --- a/node_modules/sucrase/dist/parser/util/identifier.js +++ /dev/null @@ -1,34 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _charcodes = require('./charcodes'); -var _whitespace = require('./whitespace'); - -function computeIsIdentifierChar(code) { - if (code < 48) return code === 36; - if (code < 58) return true; - if (code < 65) return false; - if (code < 91) return true; - if (code < 97) return code === 95; - if (code < 123) return true; - if (code < 128) return false; - throw new Error("Should not be called with non-ASCII char code."); -} - - const IS_IDENTIFIER_CHAR = new Uint8Array(65536); exports.IS_IDENTIFIER_CHAR = IS_IDENTIFIER_CHAR; -for (let i = 0; i < 128; i++) { - exports.IS_IDENTIFIER_CHAR[i] = computeIsIdentifierChar(i) ? 1 : 0; -} -for (let i = 128; i < 65536; i++) { - exports.IS_IDENTIFIER_CHAR[i] = 1; -} -// Aside from whitespace and newlines, all characters outside the ASCII space are either -// identifier characters or invalid. Since we're not performing code validation, we can just -// treat all invalid characters as identifier characters. -for (const whitespaceChar of _whitespace.WHITESPACE_CHARS) { - exports.IS_IDENTIFIER_CHAR[whitespaceChar] = 0; -} -exports.IS_IDENTIFIER_CHAR[0x2028] = 0; -exports.IS_IDENTIFIER_CHAR[0x2029] = 0; - - const IS_IDENTIFIER_START = exports.IS_IDENTIFIER_CHAR.slice(); exports.IS_IDENTIFIER_START = IS_IDENTIFIER_START; -for (let numChar = _charcodes.charCodes.digit0; numChar <= _charcodes.charCodes.digit9; numChar++) { - exports.IS_IDENTIFIER_START[numChar] = 0; -} diff --git a/node_modules/sucrase/dist/parser/util/whitespace.js b/node_modules/sucrase/dist/parser/util/whitespace.js deleted file mode 100644 index 55bb994..0000000 --- a/node_modules/sucrase/dist/parser/util/whitespace.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _charcodes = require('./charcodes'); - -// https://tc39.github.io/ecma262/#sec-white-space - const WHITESPACE_CHARS = [ - 0x0009, - 0x000b, - 0x000c, - _charcodes.charCodes.space, - _charcodes.charCodes.nonBreakingSpace, - _charcodes.charCodes.oghamSpaceMark, - 0x2000, // EN QUAD - 0x2001, // EM QUAD - 0x2002, // EN SPACE - 0x2003, // EM SPACE - 0x2004, // THREE-PER-EM SPACE - 0x2005, // FOUR-PER-EM SPACE - 0x2006, // SIX-PER-EM SPACE - 0x2007, // FIGURE SPACE - 0x2008, // PUNCTUATION SPACE - 0x2009, // THIN SPACE - 0x200a, // HAIR SPACE - 0x202f, // NARROW NO-BREAK SPACE - 0x205f, // MEDIUM MATHEMATICAL SPACE - 0x3000, // IDEOGRAPHIC SPACE - 0xfeff, // ZERO WIDTH NO-BREAK SPACE -]; exports.WHITESPACE_CHARS = WHITESPACE_CHARS; - - const skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g; exports.skipWhiteSpace = skipWhiteSpace; - - const IS_WHITESPACE = new Uint8Array(65536); exports.IS_WHITESPACE = IS_WHITESPACE; -for (const char of exports.WHITESPACE_CHARS) { - exports.IS_WHITESPACE[char] = 1; -} diff --git a/node_modules/sucrase/dist/register.js b/node_modules/sucrase/dist/register.js deleted file mode 100644 index 1325f30..0000000 --- a/node_modules/sucrase/dist/register.js +++ /dev/null @@ -1,88 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _pirates = require('pirates'); var pirates = _interopRequireWildcard(_pirates); - -var _index = require('./index'); - - - - - - - - - function addHook( - extension, - sucraseOptions, - hookOptions, -) { - let mergedSucraseOptions = sucraseOptions; - const sucraseOptionsEnvJSON = process.env.SUCRASE_OPTIONS; - if (sucraseOptionsEnvJSON) { - mergedSucraseOptions = {...mergedSucraseOptions, ...JSON.parse(sucraseOptionsEnvJSON)}; - } - return pirates.addHook( - (code, filePath) => { - const {code: transformedCode, sourceMap} = _index.transform.call(void 0, code, { - ...mergedSucraseOptions, - sourceMapOptions: {compiledFilename: filePath}, - filePath, - }); - const mapBase64 = Buffer.from(JSON.stringify(sourceMap)).toString("base64"); - const suffix = `//# sourceMappingURL=data:application/json;charset=utf-8;base64,${mapBase64}`; - return `${transformedCode}\n${suffix}`; - }, - {...hookOptions, exts: [extension]}, - ); -} exports.addHook = addHook; - - function registerJS(hookOptions) { - return addHook(".js", {transforms: ["imports", "flow", "jsx"]}, hookOptions); -} exports.registerJS = registerJS; - - function registerJSX(hookOptions) { - return addHook(".jsx", {transforms: ["imports", "flow", "jsx"]}, hookOptions); -} exports.registerJSX = registerJSX; - - function registerTS(hookOptions) { - return addHook(".ts", {transforms: ["imports", "typescript"]}, hookOptions); -} exports.registerTS = registerTS; - - function registerTSX(hookOptions) { - return addHook(".tsx", {transforms: ["imports", "typescript", "jsx"]}, hookOptions); -} exports.registerTSX = registerTSX; - - function registerTSLegacyModuleInterop(hookOptions) { - return addHook( - ".ts", - { - transforms: ["imports", "typescript"], - enableLegacyTypeScriptModuleInterop: true, - }, - hookOptions, - ); -} exports.registerTSLegacyModuleInterop = registerTSLegacyModuleInterop; - - function registerTSXLegacyModuleInterop(hookOptions) { - return addHook( - ".tsx", - { - transforms: ["imports", "typescript", "jsx"], - enableLegacyTypeScriptModuleInterop: true, - }, - hookOptions, - ); -} exports.registerTSXLegacyModuleInterop = registerTSXLegacyModuleInterop; - - function registerAll(hookOptions) { - const reverts = [ - registerJS(hookOptions), - registerJSX(hookOptions), - registerTS(hookOptions), - registerTSX(hookOptions), - ]; - - return () => { - for (const fn of reverts) { - fn(); - } - }; -} exports.registerAll = registerAll; diff --git a/node_modules/sucrase/dist/transformers/CJSImportTransformer.js b/node_modules/sucrase/dist/transformers/CJSImportTransformer.js deleted file mode 100644 index 170e5bb..0000000 --- a/node_modules/sucrase/dist/transformers/CJSImportTransformer.js +++ /dev/null @@ -1,916 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - -var _tokenizer = require('../parser/tokenizer'); -var _keywords = require('../parser/tokenizer/keywords'); -var _types = require('../parser/tokenizer/types'); - -var _elideImportEquals = require('../util/elideImportEquals'); var _elideImportEquals2 = _interopRequireDefault(_elideImportEquals); - - - -var _getDeclarationInfo = require('../util/getDeclarationInfo'); var _getDeclarationInfo2 = _interopRequireDefault(_getDeclarationInfo); -var _getImportExportSpecifierInfo = require('../util/getImportExportSpecifierInfo'); var _getImportExportSpecifierInfo2 = _interopRequireDefault(_getImportExportSpecifierInfo); -var _isExportFrom = require('../util/isExportFrom'); var _isExportFrom2 = _interopRequireDefault(_isExportFrom); -var _removeMaybeImportAttributes = require('../util/removeMaybeImportAttributes'); -var _shouldElideDefaultExport = require('../util/shouldElideDefaultExport'); var _shouldElideDefaultExport2 = _interopRequireDefault(_shouldElideDefaultExport); - - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - -/** - * Class for editing import statements when we are transforming to commonjs. - */ - class CJSImportTransformer extends _Transformer2.default { - __init() {this.hadExport = false} - __init2() {this.hadNamedExport = false} - __init3() {this.hadDefaultExport = false} - - - constructor( - rootTransformer, - tokens, - importProcessor, - nameManager, - helperManager, - reactHotLoaderTransformer, - enableLegacyBabel5ModuleInterop, - enableLegacyTypeScriptModuleInterop, - isTypeScriptTransformEnabled, - isFlowTransformEnabled, - preserveDynamicImport, - keepUnusedImports, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.nameManager = nameManager;this.helperManager = helperManager;this.reactHotLoaderTransformer = reactHotLoaderTransformer;this.enableLegacyBabel5ModuleInterop = enableLegacyBabel5ModuleInterop;this.enableLegacyTypeScriptModuleInterop = enableLegacyTypeScriptModuleInterop;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.isFlowTransformEnabled = isFlowTransformEnabled;this.preserveDynamicImport = preserveDynamicImport;this.keepUnusedImports = keepUnusedImports;CJSImportTransformer.prototype.__init.call(this);CJSImportTransformer.prototype.__init2.call(this);CJSImportTransformer.prototype.__init3.call(this);; - this.declarationInfo = isTypeScriptTransformEnabled - ? _getDeclarationInfo2.default.call(void 0, tokens) - : _getDeclarationInfo.EMPTY_DECLARATION_INFO; - } - - getPrefixCode() { - let prefix = ""; - if (this.hadExport) { - prefix += 'Object.defineProperty(exports, "__esModule", {value: true});'; - } - return prefix; - } - - getSuffixCode() { - if (this.enableLegacyBabel5ModuleInterop && this.hadDefaultExport && !this.hadNamedExport) { - return "\nmodule.exports = exports.default;\n"; - } - return ""; - } - - process() { - // TypeScript `import foo = require('foo');` should always just be translated to plain require. - if (this.tokens.matches3(_types.TokenType._import, _types.TokenType.name, _types.TokenType.eq)) { - return this.processImportEquals(); - } - if (this.tokens.matches1(_types.TokenType._import)) { - this.processImport(); - return true; - } - if (this.tokens.matches2(_types.TokenType._export, _types.TokenType.eq)) { - this.tokens.replaceToken("module.exports"); - return true; - } - if (this.tokens.matches1(_types.TokenType._export) && !this.tokens.currentToken().isType) { - this.hadExport = true; - return this.processExport(); - } - if (this.tokens.matches2(_types.TokenType.name, _types.TokenType.postIncDec)) { - // Fall through to normal identifier matching if this doesn't apply. - if (this.processPostIncDec()) { - return true; - } - } - if (this.tokens.matches1(_types.TokenType.name) || this.tokens.matches1(_types.TokenType.jsxName)) { - return this.processIdentifier(); - } - if (this.tokens.matches1(_types.TokenType.eq)) { - return this.processAssignment(); - } - if (this.tokens.matches1(_types.TokenType.assign)) { - return this.processComplexAssignment(); - } - if (this.tokens.matches1(_types.TokenType.preIncDec)) { - return this.processPreIncDec(); - } - return false; - } - - processImportEquals() { - const importName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); - if (this.importProcessor.shouldAutomaticallyElideImportedName(importName)) { - // If this name is only used as a type, elide the whole import. - _elideImportEquals2.default.call(void 0, this.tokens); - } else { - // Otherwise, switch `import` to `const`. - this.tokens.replaceToken("const"); - } - return true; - } - - /** - * Transform this: - * import foo, {bar} from 'baz'; - * into - * var _baz = require('baz'); var _baz2 = _interopRequireDefault(_baz); - * - * The import code was already generated in the import preprocessing step, so - * we just need to look it up. - */ - processImport() { - if (this.tokens.matches2(_types.TokenType._import, _types.TokenType.parenL)) { - if (this.preserveDynamicImport) { - // Bail out, only making progress for this one token. - this.tokens.copyToken(); - return; - } - const requireWrapper = this.enableLegacyTypeScriptModuleInterop - ? "" - : `${this.helperManager.getHelperName("interopRequireWildcard")}(`; - this.tokens.replaceToken(`Promise.resolve().then(() => ${requireWrapper}require`); - const contextId = this.tokens.currentToken().contextId; - if (contextId == null) { - throw new Error("Expected context ID on dynamic import invocation."); - } - this.tokens.copyToken(); - while (!this.tokens.matchesContextIdAndLabel(_types.TokenType.parenR, contextId)) { - this.rootTransformer.processToken(); - } - this.tokens.replaceToken(requireWrapper ? ")))" : "))"); - return; - } - - const shouldElideImport = this.removeImportAndDetectIfShouldElide(); - if (shouldElideImport) { - this.tokens.removeToken(); - } else { - const path = this.tokens.stringValue(); - this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); - this.tokens.appendCode(this.importProcessor.claimImportCode(path)); - } - _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); - if (this.tokens.matches1(_types.TokenType.semi)) { - this.tokens.removeToken(); - } - } - - /** - * Erase this import (since any CJS output would be completely different), and - * return true if this import is should be elided due to being a type-only - * import. Such imports will not be emitted at all to avoid side effects. - * - * Import elision only happens with the TypeScript or Flow transforms enabled. - * - * TODO: This function has some awkward overlap with - * CJSImportProcessor.pruneTypeOnlyImports , and the two should be unified. - * That function handles TypeScript implicit import name elision, and removes - * an import if all typical imported names (without `type`) are removed due - * to being type-only imports. This function handles Flow import removal and - * properly distinguishes `import 'foo'` from `import {} from 'foo'` for TS - * purposes. - * - * The position should end at the import string. - */ - removeImportAndDetectIfShouldElide() { - this.tokens.removeInitialToken(); - if ( - this.tokens.matchesContextual(_keywords.ContextualKeyword._type) && - !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, _types.TokenType.comma) && - !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, _keywords.ContextualKeyword._from) - ) { - // This is an "import type" statement, so exit early. - this.removeRemainingImport(); - return true; - } - - if (this.tokens.matches1(_types.TokenType.name) || this.tokens.matches1(_types.TokenType.star)) { - // We have a default import or namespace import, so there must be some - // non-type import. - this.removeRemainingImport(); - return false; - } - - if (this.tokens.matches1(_types.TokenType.string)) { - // This is a bare import, so we should proceed with the import. - return false; - } - - let foundNonTypeImport = false; - let foundAnyNamedImport = false; - while (!this.tokens.matches1(_types.TokenType.string)) { - // Check if any named imports are of the form "foo" or "foo as bar", with - // no leading "type". - if ( - (!foundNonTypeImport && this.tokens.matches1(_types.TokenType.braceL)) || - this.tokens.matches1(_types.TokenType.comma) - ) { - this.tokens.removeToken(); - if (!this.tokens.matches1(_types.TokenType.braceR)) { - foundAnyNamedImport = true; - } - if ( - this.tokens.matches2(_types.TokenType.name, _types.TokenType.comma) || - this.tokens.matches2(_types.TokenType.name, _types.TokenType.braceR) || - this.tokens.matches4(_types.TokenType.name, _types.TokenType.name, _types.TokenType.name, _types.TokenType.comma) || - this.tokens.matches4(_types.TokenType.name, _types.TokenType.name, _types.TokenType.name, _types.TokenType.braceR) - ) { - foundNonTypeImport = true; - } - } - this.tokens.removeToken(); - } - if (this.keepUnusedImports) { - return false; - } - if (this.isTypeScriptTransformEnabled) { - return !foundNonTypeImport; - } else if (this.isFlowTransformEnabled) { - // In Flow, unlike TS, `import {} from 'foo';` preserves the import. - return foundAnyNamedImport && !foundNonTypeImport; - } else { - return false; - } - } - - removeRemainingImport() { - while (!this.tokens.matches1(_types.TokenType.string)) { - this.tokens.removeToken(); - } - } - - processIdentifier() { - const token = this.tokens.currentToken(); - if (token.shadowsGlobal) { - return false; - } - - if (token.identifierRole === _tokenizer.IdentifierRole.ObjectShorthand) { - return this.processObjectShorthand(); - } - - if (token.identifierRole !== _tokenizer.IdentifierRole.Access) { - return false; - } - const replacement = this.importProcessor.getIdentifierReplacement( - this.tokens.identifierNameForToken(token), - ); - if (!replacement) { - return false; - } - // Tolerate any number of closing parens while looking for an opening paren - // that indicates a function call. - let possibleOpenParenIndex = this.tokens.currentIndex() + 1; - while ( - possibleOpenParenIndex < this.tokens.tokens.length && - this.tokens.tokens[possibleOpenParenIndex].type === _types.TokenType.parenR - ) { - possibleOpenParenIndex++; - } - // Avoid treating imported functions as methods of their `exports` object - // by using `(0, f)` when the identifier is in a paren expression. Else - // use `Function.prototype.call` when the identifier is a guaranteed - // function call. When using `call`, pass undefined as the context. - if (this.tokens.tokens[possibleOpenParenIndex].type === _types.TokenType.parenL) { - if ( - this.tokens.tokenAtRelativeIndex(1).type === _types.TokenType.parenL && - this.tokens.tokenAtRelativeIndex(-1).type !== _types.TokenType._new - ) { - this.tokens.replaceToken(`${replacement}.call(void 0, `); - // Remove the old paren. - this.tokens.removeToken(); - // Balance out the new paren. - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(_types.TokenType.parenR); - } else { - // See here: http://2ality.com/2015/12/references.html - this.tokens.replaceToken(`(0, ${replacement})`); - } - } else { - this.tokens.replaceToken(replacement); - } - return true; - } - - processObjectShorthand() { - const identifier = this.tokens.identifierName(); - const replacement = this.importProcessor.getIdentifierReplacement(identifier); - if (!replacement) { - return false; - } - this.tokens.replaceToken(`${identifier}: ${replacement}`); - return true; - } - - processExport() { - if ( - this.tokens.matches2(_types.TokenType._export, _types.TokenType._enum) || - this.tokens.matches3(_types.TokenType._export, _types.TokenType._const, _types.TokenType._enum) - ) { - this.hadNamedExport = true; - // Let the TypeScript transform handle it. - return false; - } - if (this.tokens.matches2(_types.TokenType._export, _types.TokenType._default)) { - if (this.tokens.matches3(_types.TokenType._export, _types.TokenType._default, _types.TokenType._enum)) { - this.hadDefaultExport = true; - // Flow export default enums need some special handling, so handle them - // in that tranform rather than this one. - return false; - } - this.processExportDefault(); - return true; - } else if (this.tokens.matches2(_types.TokenType._export, _types.TokenType.braceL)) { - this.processExportBindings(); - return true; - } else if ( - this.tokens.matches2(_types.TokenType._export, _types.TokenType.name) && - this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, _keywords.ContextualKeyword._type) - ) { - // export type {a}; - // export type {a as b}; - // export type {a} from './b'; - // export type * from './b'; - // export type * as ns from './b'; - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - if (this.tokens.matches1(_types.TokenType.braceL)) { - while (!this.tokens.matches1(_types.TokenType.braceR)) { - this.tokens.removeToken(); - } - this.tokens.removeToken(); - } else { - // * - this.tokens.removeToken(); - if (this.tokens.matches1(_types.TokenType._as)) { - // as - this.tokens.removeToken(); - // ns - this.tokens.removeToken(); - } - } - // Remove type re-export `... } from './T'` - if ( - this.tokens.matchesContextual(_keywords.ContextualKeyword._from) && - this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, _types.TokenType.string) - ) { - this.tokens.removeToken(); - this.tokens.removeToken(); - _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); - } - return true; - } - this.hadNamedExport = true; - if ( - this.tokens.matches2(_types.TokenType._export, _types.TokenType._var) || - this.tokens.matches2(_types.TokenType._export, _types.TokenType._let) || - this.tokens.matches2(_types.TokenType._export, _types.TokenType._const) - ) { - this.processExportVar(); - return true; - } else if ( - this.tokens.matches2(_types.TokenType._export, _types.TokenType._function) || - // export async function - this.tokens.matches3(_types.TokenType._export, _types.TokenType.name, _types.TokenType._function) - ) { - this.processExportFunction(); - return true; - } else if ( - this.tokens.matches2(_types.TokenType._export, _types.TokenType._class) || - this.tokens.matches3(_types.TokenType._export, _types.TokenType._abstract, _types.TokenType._class) || - this.tokens.matches2(_types.TokenType._export, _types.TokenType.at) - ) { - this.processExportClass(); - return true; - } else if (this.tokens.matches2(_types.TokenType._export, _types.TokenType.star)) { - this.processExportStar(); - return true; - } else { - throw new Error("Unrecognized export syntax."); - } - } - - processAssignment() { - const index = this.tokens.currentIndex(); - const identifierToken = this.tokens.tokens[index - 1]; - // If the LHS is a type identifier, this must be a declaration like `let a: b = c;`, - // with `b` as the identifier, so nothing needs to be done in that case. - if (identifierToken.isType || identifierToken.type !== _types.TokenType.name) { - return false; - } - if (identifierToken.shadowsGlobal) { - return false; - } - if (index >= 2 && this.tokens.matches1AtIndex(index - 2, _types.TokenType.dot)) { - return false; - } - if (index >= 2 && [_types.TokenType._var, _types.TokenType._let, _types.TokenType._const].includes(this.tokens.tokens[index - 2].type)) { - // Declarations don't need an extra assignment. This doesn't avoid the - // assignment for comma-separated declarations, but it's still correct - // since the assignment is just redundant. - return false; - } - const assignmentSnippet = this.importProcessor.resolveExportBinding( - this.tokens.identifierNameForToken(identifierToken), - ); - if (!assignmentSnippet) { - return false; - } - this.tokens.copyToken(); - this.tokens.appendCode(` ${assignmentSnippet} =`); - return true; - } - - /** - * Process something like `a += 3`, where `a` might be an exported value. - */ - processComplexAssignment() { - const index = this.tokens.currentIndex(); - const identifierToken = this.tokens.tokens[index - 1]; - if (identifierToken.type !== _types.TokenType.name) { - return false; - } - if (identifierToken.shadowsGlobal) { - return false; - } - if (index >= 2 && this.tokens.matches1AtIndex(index - 2, _types.TokenType.dot)) { - return false; - } - const assignmentSnippet = this.importProcessor.resolveExportBinding( - this.tokens.identifierNameForToken(identifierToken), - ); - if (!assignmentSnippet) { - return false; - } - this.tokens.appendCode(` = ${assignmentSnippet}`); - this.tokens.copyToken(); - return true; - } - - /** - * Process something like `++a`, where `a` might be an exported value. - */ - processPreIncDec() { - const index = this.tokens.currentIndex(); - const identifierToken = this.tokens.tokens[index + 1]; - if (identifierToken.type !== _types.TokenType.name) { - return false; - } - if (identifierToken.shadowsGlobal) { - return false; - } - // Ignore things like ++a.b and ++a[b] and ++a().b. - if ( - index + 2 < this.tokens.tokens.length && - (this.tokens.matches1AtIndex(index + 2, _types.TokenType.dot) || - this.tokens.matches1AtIndex(index + 2, _types.TokenType.bracketL) || - this.tokens.matches1AtIndex(index + 2, _types.TokenType.parenL)) - ) { - return false; - } - const identifierName = this.tokens.identifierNameForToken(identifierToken); - const assignmentSnippet = this.importProcessor.resolveExportBinding(identifierName); - if (!assignmentSnippet) { - return false; - } - this.tokens.appendCode(`${assignmentSnippet} = `); - this.tokens.copyToken(); - return true; - } - - /** - * Process something like `a++`, where `a` might be an exported value. - * This starts at the `a`, not at the `++`. - */ - processPostIncDec() { - const index = this.tokens.currentIndex(); - const identifierToken = this.tokens.tokens[index]; - const operatorToken = this.tokens.tokens[index + 1]; - if (identifierToken.type !== _types.TokenType.name) { - return false; - } - if (identifierToken.shadowsGlobal) { - return false; - } - if (index >= 1 && this.tokens.matches1AtIndex(index - 1, _types.TokenType.dot)) { - return false; - } - const identifierName = this.tokens.identifierNameForToken(identifierToken); - const assignmentSnippet = this.importProcessor.resolveExportBinding(identifierName); - if (!assignmentSnippet) { - return false; - } - const operatorCode = this.tokens.rawCodeForToken(operatorToken); - // We might also replace the identifier with something like exports.x, so - // do that replacement here as well. - const base = this.importProcessor.getIdentifierReplacement(identifierName) || identifierName; - if (operatorCode === "++") { - this.tokens.replaceToken(`(${base} = ${assignmentSnippet} = ${base} + 1, ${base} - 1)`); - } else if (operatorCode === "--") { - this.tokens.replaceToken(`(${base} = ${assignmentSnippet} = ${base} - 1, ${base} + 1)`); - } else { - throw new Error(`Unexpected operator: ${operatorCode}`); - } - this.tokens.removeToken(); - return true; - } - - processExportDefault() { - let exportedRuntimeValue = true; - if ( - this.tokens.matches4(_types.TokenType._export, _types.TokenType._default, _types.TokenType._function, _types.TokenType.name) || - // export default async function - (this.tokens.matches5(_types.TokenType._export, _types.TokenType._default, _types.TokenType.name, _types.TokenType._function, _types.TokenType.name) && - this.tokens.matchesContextualAtIndex( - this.tokens.currentIndex() + 2, - _keywords.ContextualKeyword._async, - )) - ) { - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - // Named function export case: change it to a top-level function - // declaration followed by exports statement. - const name = this.processNamedFunction(); - this.tokens.appendCode(` exports.default = ${name};`); - } else if ( - this.tokens.matches4(_types.TokenType._export, _types.TokenType._default, _types.TokenType._class, _types.TokenType.name) || - this.tokens.matches5(_types.TokenType._export, _types.TokenType._default, _types.TokenType._abstract, _types.TokenType._class, _types.TokenType.name) || - this.tokens.matches3(_types.TokenType._export, _types.TokenType._default, _types.TokenType.at) - ) { - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - this.copyDecorators(); - if (this.tokens.matches1(_types.TokenType._abstract)) { - this.tokens.removeToken(); - } - const name = this.rootTransformer.processNamedClass(); - this.tokens.appendCode(` exports.default = ${name};`); - // After this point, this is a plain "export default E" statement. - } else if ( - _shouldElideDefaultExport2.default.call(void 0, - this.isTypeScriptTransformEnabled, - this.keepUnusedImports, - this.tokens, - this.declarationInfo, - ) - ) { - // If the exported value is just an identifier and should be elided by TypeScript - // rules, then remove it entirely. It will always have the form `export default e`, - // where `e` is an identifier. - exportedRuntimeValue = false; - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - this.tokens.removeToken(); - } else if (this.reactHotLoaderTransformer) { - // We need to assign E to a variable. Change "export default E" to - // "let _default; exports.default = _default = E" - const defaultVarName = this.nameManager.claimFreeName("_default"); - this.tokens.replaceToken(`let ${defaultVarName}; exports.`); - this.tokens.copyToken(); - this.tokens.appendCode(` = ${defaultVarName} =`); - this.reactHotLoaderTransformer.setExtractedDefaultExportName(defaultVarName); - } else { - // Change "export default E" to "exports.default = E" - this.tokens.replaceToken("exports."); - this.tokens.copyToken(); - this.tokens.appendCode(" ="); - } - if (exportedRuntimeValue) { - this.hadDefaultExport = true; - } - } - - copyDecorators() { - while (this.tokens.matches1(_types.TokenType.at)) { - this.tokens.copyToken(); - if (this.tokens.matches1(_types.TokenType.parenL)) { - this.tokens.copyExpectedToken(_types.TokenType.parenL); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(_types.TokenType.parenR); - } else { - this.tokens.copyExpectedToken(_types.TokenType.name); - while (this.tokens.matches1(_types.TokenType.dot)) { - this.tokens.copyExpectedToken(_types.TokenType.dot); - this.tokens.copyExpectedToken(_types.TokenType.name); - } - if (this.tokens.matches1(_types.TokenType.parenL)) { - this.tokens.copyExpectedToken(_types.TokenType.parenL); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(_types.TokenType.parenR); - } - } - } - } - - /** - * Transform a declaration like `export var`, `export let`, or `export const`. - */ - processExportVar() { - if (this.isSimpleExportVar()) { - this.processSimpleExportVar(); - } else { - this.processComplexExportVar(); - } - } - - /** - * Determine if the export is of the form: - * export var/let/const [varName] = [expr]; - * In other words, determine if function name inference might apply. - */ - isSimpleExportVar() { - let tokenIndex = this.tokens.currentIndex(); - // export - tokenIndex++; - // var/let/const - tokenIndex++; - if (!this.tokens.matches1AtIndex(tokenIndex, _types.TokenType.name)) { - return false; - } - tokenIndex++; - while (tokenIndex < this.tokens.tokens.length && this.tokens.tokens[tokenIndex].isType) { - tokenIndex++; - } - if (!this.tokens.matches1AtIndex(tokenIndex, _types.TokenType.eq)) { - return false; - } - return true; - } - - /** - * Transform an `export var` declaration initializing a single variable. - * - * For example, this: - * export const f = () => {}; - * becomes this: - * const f = () => {}; exports.f = f; - * - * The variable is unused (e.g. exports.f has the true value of the export). - * We need to produce an assignment of this form so that the function will - * have an inferred name of "f", which wouldn't happen in the more general - * case below. - */ - processSimpleExportVar() { - // export - this.tokens.removeInitialToken(); - // var/let/const - this.tokens.copyToken(); - const varName = this.tokens.identifierName(); - // x: number -> x - while (!this.tokens.matches1(_types.TokenType.eq)) { - this.rootTransformer.processToken(); - } - const endIndex = this.tokens.currentToken().rhsEndIndex; - if (endIndex == null) { - throw new Error("Expected = token with an end index."); - } - while (this.tokens.currentIndex() < endIndex) { - this.rootTransformer.processToken(); - } - this.tokens.appendCode(`; exports.${varName} = ${varName}`); - } - - /** - * Transform normal declaration exports, including handling destructuring. - * For example, this: - * export const {x: [a = 2, b], c} = d; - * becomes this: - * ({x: [exports.a = 2, exports.b], c: exports.c} = d;) - */ - processComplexExportVar() { - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - const needsParens = this.tokens.matches1(_types.TokenType.braceL); - if (needsParens) { - this.tokens.appendCode("("); - } - - let depth = 0; - while (true) { - if ( - this.tokens.matches1(_types.TokenType.braceL) || - this.tokens.matches1(_types.TokenType.dollarBraceL) || - this.tokens.matches1(_types.TokenType.bracketL) - ) { - depth++; - this.tokens.copyToken(); - } else if (this.tokens.matches1(_types.TokenType.braceR) || this.tokens.matches1(_types.TokenType.bracketR)) { - depth--; - this.tokens.copyToken(); - } else if ( - depth === 0 && - !this.tokens.matches1(_types.TokenType.name) && - !this.tokens.currentToken().isType - ) { - break; - } else if (this.tokens.matches1(_types.TokenType.eq)) { - // Default values might have assignments in the RHS that we want to ignore, so skip past - // them. - const endIndex = this.tokens.currentToken().rhsEndIndex; - if (endIndex == null) { - throw new Error("Expected = token with an end index."); - } - while (this.tokens.currentIndex() < endIndex) { - this.rootTransformer.processToken(); - } - } else { - const token = this.tokens.currentToken(); - if (_tokenizer.isDeclaration.call(void 0, token)) { - const name = this.tokens.identifierName(); - let replacement = this.importProcessor.getIdentifierReplacement(name); - if (replacement === null) { - throw new Error(`Expected a replacement for ${name} in \`export var\` syntax.`); - } - if (_tokenizer.isObjectShorthandDeclaration.call(void 0, token)) { - replacement = `${name}: ${replacement}`; - } - this.tokens.replaceToken(replacement); - } else { - this.rootTransformer.processToken(); - } - } - } - - if (needsParens) { - // Seek to the end of the RHS. - const endIndex = this.tokens.currentToken().rhsEndIndex; - if (endIndex == null) { - throw new Error("Expected = token with an end index."); - } - while (this.tokens.currentIndex() < endIndex) { - this.rootTransformer.processToken(); - } - this.tokens.appendCode(")"); - } - } - - /** - * Transform this: - * export function foo() {} - * into this: - * function foo() {} exports.foo = foo; - */ - processExportFunction() { - this.tokens.replaceToken(""); - const name = this.processNamedFunction(); - this.tokens.appendCode(` exports.${name} = ${name};`); - } - - /** - * Skip past a function with a name and return that name. - */ - processNamedFunction() { - if (this.tokens.matches1(_types.TokenType._function)) { - this.tokens.copyToken(); - } else if (this.tokens.matches2(_types.TokenType.name, _types.TokenType._function)) { - if (!this.tokens.matchesContextual(_keywords.ContextualKeyword._async)) { - throw new Error("Expected async keyword in function export."); - } - this.tokens.copyToken(); - this.tokens.copyToken(); - } - if (this.tokens.matches1(_types.TokenType.star)) { - this.tokens.copyToken(); - } - if (!this.tokens.matches1(_types.TokenType.name)) { - throw new Error("Expected identifier for exported function name."); - } - const name = this.tokens.identifierName(); - this.tokens.copyToken(); - if (this.tokens.currentToken().isType) { - this.tokens.removeInitialToken(); - while (this.tokens.currentToken().isType) { - this.tokens.removeToken(); - } - } - this.tokens.copyExpectedToken(_types.TokenType.parenL); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(_types.TokenType.parenR); - this.rootTransformer.processPossibleTypeRange(); - this.tokens.copyExpectedToken(_types.TokenType.braceL); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(_types.TokenType.braceR); - return name; - } - - /** - * Transform this: - * export class A {} - * into this: - * class A {} exports.A = A; - */ - processExportClass() { - this.tokens.removeInitialToken(); - this.copyDecorators(); - if (this.tokens.matches1(_types.TokenType._abstract)) { - this.tokens.removeToken(); - } - const name = this.rootTransformer.processNamedClass(); - this.tokens.appendCode(` exports.${name} = ${name};`); - } - - /** - * Transform this: - * export {a, b as c}; - * into this: - * exports.a = a; exports.c = b; - * - * OR - * - * Transform this: - * export {a, b as c} from './foo'; - * into the pre-generated Object.defineProperty code from the ImportProcessor. - * - * For the first case, if the TypeScript transform is enabled, we need to skip - * exports that are only defined as types. - */ - processExportBindings() { - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - - const isReExport = _isExportFrom2.default.call(void 0, this.tokens); - - const exportStatements = []; - while (true) { - if (this.tokens.matches1(_types.TokenType.braceR)) { - this.tokens.removeToken(); - break; - } - - const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, this.tokens); - - while (this.tokens.currentIndex() < specifierInfo.endIndex) { - this.tokens.removeToken(); - } - - const shouldRemoveExport = - specifierInfo.isType || - (!isReExport && this.shouldElideExportedIdentifier(specifierInfo.leftName)); - if (!shouldRemoveExport) { - const exportedName = specifierInfo.rightName; - if (exportedName === "default") { - this.hadDefaultExport = true; - } else { - this.hadNamedExport = true; - } - const localName = specifierInfo.leftName; - const newLocalName = this.importProcessor.getIdentifierReplacement(localName); - exportStatements.push(`exports.${exportedName} = ${newLocalName || localName};`); - } - - if (this.tokens.matches1(_types.TokenType.braceR)) { - this.tokens.removeToken(); - break; - } - if (this.tokens.matches2(_types.TokenType.comma, _types.TokenType.braceR)) { - this.tokens.removeToken(); - this.tokens.removeToken(); - break; - } else if (this.tokens.matches1(_types.TokenType.comma)) { - this.tokens.removeToken(); - } else { - throw new Error(`Unexpected token: ${JSON.stringify(this.tokens.currentToken())}`); - } - } - - if (this.tokens.matchesContextual(_keywords.ContextualKeyword._from)) { - // This is an export...from, so throw away the normal named export code - // and use the Object.defineProperty code from ImportProcessor. - this.tokens.removeToken(); - const path = this.tokens.stringValue(); - this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); - _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); - } else { - // This is a normal named export, so use that. - this.tokens.appendCode(exportStatements.join(" ")); - } - - if (this.tokens.matches1(_types.TokenType.semi)) { - this.tokens.removeToken(); - } - } - - processExportStar() { - this.tokens.removeInitialToken(); - while (!this.tokens.matches1(_types.TokenType.string)) { - this.tokens.removeToken(); - } - const path = this.tokens.stringValue(); - this.tokens.replaceTokenTrimmingLeftWhitespace(this.importProcessor.claimImportCode(path)); - _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); - if (this.tokens.matches1(_types.TokenType.semi)) { - this.tokens.removeToken(); - } - } - - shouldElideExportedIdentifier(name) { - return ( - this.isTypeScriptTransformEnabled && - !this.keepUnusedImports && - !this.declarationInfo.valueDeclarations.has(name) - ); - } -} exports.default = CJSImportTransformer; diff --git a/node_modules/sucrase/dist/transformers/ESMImportTransformer.js b/node_modules/sucrase/dist/transformers/ESMImportTransformer.js deleted file mode 100644 index d89e5ea..0000000 --- a/node_modules/sucrase/dist/transformers/ESMImportTransformer.js +++ /dev/null @@ -1,415 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - -var _keywords = require('../parser/tokenizer/keywords'); -var _types = require('../parser/tokenizer/types'); - -var _elideImportEquals = require('../util/elideImportEquals'); var _elideImportEquals2 = _interopRequireDefault(_elideImportEquals); - - - -var _getDeclarationInfo = require('../util/getDeclarationInfo'); var _getDeclarationInfo2 = _interopRequireDefault(_getDeclarationInfo); -var _getImportExportSpecifierInfo = require('../util/getImportExportSpecifierInfo'); var _getImportExportSpecifierInfo2 = _interopRequireDefault(_getImportExportSpecifierInfo); -var _getNonTypeIdentifiers = require('../util/getNonTypeIdentifiers'); -var _isExportFrom = require('../util/isExportFrom'); var _isExportFrom2 = _interopRequireDefault(_isExportFrom); -var _removeMaybeImportAttributes = require('../util/removeMaybeImportAttributes'); -var _shouldElideDefaultExport = require('../util/shouldElideDefaultExport'); var _shouldElideDefaultExport2 = _interopRequireDefault(_shouldElideDefaultExport); - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - -/** - * Class for editing import statements when we are keeping the code as ESM. We still need to remove - * type-only imports in TypeScript and Flow. - */ - class ESMImportTransformer extends _Transformer2.default { - - - - - constructor( - tokens, - nameManager, - helperManager, - reactHotLoaderTransformer, - isTypeScriptTransformEnabled, - isFlowTransformEnabled, - keepUnusedImports, - options, - ) { - super();this.tokens = tokens;this.nameManager = nameManager;this.helperManager = helperManager;this.reactHotLoaderTransformer = reactHotLoaderTransformer;this.isTypeScriptTransformEnabled = isTypeScriptTransformEnabled;this.isFlowTransformEnabled = isFlowTransformEnabled;this.keepUnusedImports = keepUnusedImports;; - this.nonTypeIdentifiers = - isTypeScriptTransformEnabled && !keepUnusedImports - ? _getNonTypeIdentifiers.getNonTypeIdentifiers.call(void 0, tokens, options) - : new Set(); - this.declarationInfo = - isTypeScriptTransformEnabled && !keepUnusedImports - ? _getDeclarationInfo2.default.call(void 0, tokens) - : _getDeclarationInfo.EMPTY_DECLARATION_INFO; - this.injectCreateRequireForImportRequire = Boolean(options.injectCreateRequireForImportRequire); - } - - process() { - // TypeScript `import foo = require('foo');` should always just be translated to plain require. - if (this.tokens.matches3(_types.TokenType._import, _types.TokenType.name, _types.TokenType.eq)) { - return this.processImportEquals(); - } - if ( - this.tokens.matches4(_types.TokenType._import, _types.TokenType.name, _types.TokenType.name, _types.TokenType.eq) && - this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, _keywords.ContextualKeyword._type) - ) { - // import type T = require('T') - this.tokens.removeInitialToken(); - // This construct is always exactly 8 tokens long, so remove the 7 remaining tokens. - for (let i = 0; i < 7; i++) { - this.tokens.removeToken(); - } - return true; - } - if (this.tokens.matches2(_types.TokenType._export, _types.TokenType.eq)) { - this.tokens.replaceToken("module.exports"); - return true; - } - if ( - this.tokens.matches5(_types.TokenType._export, _types.TokenType._import, _types.TokenType.name, _types.TokenType.name, _types.TokenType.eq) && - this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, _keywords.ContextualKeyword._type) - ) { - // export import type T = require('T') - this.tokens.removeInitialToken(); - // This construct is always exactly 9 tokens long, so remove the 8 remaining tokens. - for (let i = 0; i < 8; i++) { - this.tokens.removeToken(); - } - return true; - } - if (this.tokens.matches1(_types.TokenType._import)) { - return this.processImport(); - } - if (this.tokens.matches2(_types.TokenType._export, _types.TokenType._default)) { - return this.processExportDefault(); - } - if (this.tokens.matches2(_types.TokenType._export, _types.TokenType.braceL)) { - return this.processNamedExports(); - } - if ( - this.tokens.matches2(_types.TokenType._export, _types.TokenType.name) && - this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, _keywords.ContextualKeyword._type) - ) { - // export type {a}; - // export type {a as b}; - // export type {a} from './b'; - // export type * from './b'; - // export type * as ns from './b'; - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - if (this.tokens.matches1(_types.TokenType.braceL)) { - while (!this.tokens.matches1(_types.TokenType.braceR)) { - this.tokens.removeToken(); - } - this.tokens.removeToken(); - } else { - // * - this.tokens.removeToken(); - if (this.tokens.matches1(_types.TokenType._as)) { - // as - this.tokens.removeToken(); - // ns - this.tokens.removeToken(); - } - } - // Remove type re-export `... } from './T'` - if ( - this.tokens.matchesContextual(_keywords.ContextualKeyword._from) && - this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, _types.TokenType.string) - ) { - this.tokens.removeToken(); - this.tokens.removeToken(); - _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); - } - return true; - } - return false; - } - - processImportEquals() { - const importName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); - if (this.shouldAutomaticallyElideImportedName(importName)) { - // If this name is only used as a type, elide the whole import. - _elideImportEquals2.default.call(void 0, this.tokens); - } else if (this.injectCreateRequireForImportRequire) { - // We're using require in an environment (Node ESM) that doesn't provide - // it as a global, so generate a helper to import it. - // import -> const - this.tokens.replaceToken("const"); - // Foo - this.tokens.copyToken(); - // = - this.tokens.copyToken(); - // require - this.tokens.replaceToken(this.helperManager.getHelperName("require")); - } else { - // Otherwise, just switch `import` to `const`. - this.tokens.replaceToken("const"); - } - return true; - } - - processImport() { - if (this.tokens.matches2(_types.TokenType._import, _types.TokenType.parenL)) { - // Dynamic imports don't need to be transformed. - return false; - } - - const snapshot = this.tokens.snapshot(); - const allImportsRemoved = this.removeImportTypeBindings(); - if (allImportsRemoved) { - this.tokens.restoreToSnapshot(snapshot); - while (!this.tokens.matches1(_types.TokenType.string)) { - this.tokens.removeToken(); - } - this.tokens.removeToken(); - _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); - if (this.tokens.matches1(_types.TokenType.semi)) { - this.tokens.removeToken(); - } - } - return true; - } - - /** - * Remove type bindings from this import, leaving the rest of the import intact. - * - * Return true if this import was ONLY types, and thus is eligible for removal. This will bail out - * of the replacement operation, so we can return early here. - */ - removeImportTypeBindings() { - this.tokens.copyExpectedToken(_types.TokenType._import); - if ( - this.tokens.matchesContextual(_keywords.ContextualKeyword._type) && - !this.tokens.matches1AtIndex(this.tokens.currentIndex() + 1, _types.TokenType.comma) && - !this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 1, _keywords.ContextualKeyword._from) - ) { - // This is an "import type" statement, so exit early. - return true; - } - - if (this.tokens.matches1(_types.TokenType.string)) { - // This is a bare import, so we should proceed with the import. - this.tokens.copyToken(); - return false; - } - - // Skip the "module" token in import reflection. - if ( - this.tokens.matchesContextual(_keywords.ContextualKeyword._module) && - this.tokens.matchesContextualAtIndex(this.tokens.currentIndex() + 2, _keywords.ContextualKeyword._from) - ) { - this.tokens.copyToken(); - } - - let foundNonTypeImport = false; - let foundAnyNamedImport = false; - let needsComma = false; - - // Handle default import. - if (this.tokens.matches1(_types.TokenType.name)) { - if (this.shouldAutomaticallyElideImportedName(this.tokens.identifierName())) { - this.tokens.removeToken(); - if (this.tokens.matches1(_types.TokenType.comma)) { - this.tokens.removeToken(); - } - } else { - foundNonTypeImport = true; - this.tokens.copyToken(); - if (this.tokens.matches1(_types.TokenType.comma)) { - // We're in a statement like: - // import A, * as B from './A'; - // or - // import A, {foo} from './A'; - // where the `A` is being kept. The comma should be removed if an only - // if the next part of the import statement is elided, but that's hard - // to determine at this point in the code. Instead, always remove it - // and set a flag to add it back if necessary. - needsComma = true; - this.tokens.removeToken(); - } - } - } - - if (this.tokens.matches1(_types.TokenType.star)) { - if (this.shouldAutomaticallyElideImportedName(this.tokens.identifierNameAtRelativeIndex(2))) { - this.tokens.removeToken(); - this.tokens.removeToken(); - this.tokens.removeToken(); - } else { - if (needsComma) { - this.tokens.appendCode(","); - } - foundNonTypeImport = true; - this.tokens.copyExpectedToken(_types.TokenType.star); - this.tokens.copyExpectedToken(_types.TokenType.name); - this.tokens.copyExpectedToken(_types.TokenType.name); - } - } else if (this.tokens.matches1(_types.TokenType.braceL)) { - if (needsComma) { - this.tokens.appendCode(","); - } - this.tokens.copyToken(); - while (!this.tokens.matches1(_types.TokenType.braceR)) { - foundAnyNamedImport = true; - const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, this.tokens); - if ( - specifierInfo.isType || - this.shouldAutomaticallyElideImportedName(specifierInfo.rightName) - ) { - while (this.tokens.currentIndex() < specifierInfo.endIndex) { - this.tokens.removeToken(); - } - if (this.tokens.matches1(_types.TokenType.comma)) { - this.tokens.removeToken(); - } - } else { - foundNonTypeImport = true; - while (this.tokens.currentIndex() < specifierInfo.endIndex) { - this.tokens.copyToken(); - } - if (this.tokens.matches1(_types.TokenType.comma)) { - this.tokens.copyToken(); - } - } - } - this.tokens.copyExpectedToken(_types.TokenType.braceR); - } - - if (this.keepUnusedImports) { - return false; - } - if (this.isTypeScriptTransformEnabled) { - return !foundNonTypeImport; - } else if (this.isFlowTransformEnabled) { - // In Flow, unlike TS, `import {} from 'foo';` preserves the import. - return foundAnyNamedImport && !foundNonTypeImport; - } else { - return false; - } - } - - shouldAutomaticallyElideImportedName(name) { - return ( - this.isTypeScriptTransformEnabled && - !this.keepUnusedImports && - !this.nonTypeIdentifiers.has(name) - ); - } - - processExportDefault() { - if ( - _shouldElideDefaultExport2.default.call(void 0, - this.isTypeScriptTransformEnabled, - this.keepUnusedImports, - this.tokens, - this.declarationInfo, - ) - ) { - // If the exported value is just an identifier and should be elided by TypeScript - // rules, then remove it entirely. It will always have the form `export default e`, - // where `e` is an identifier. - this.tokens.removeInitialToken(); - this.tokens.removeToken(); - this.tokens.removeToken(); - return true; - } - - const alreadyHasName = - this.tokens.matches4(_types.TokenType._export, _types.TokenType._default, _types.TokenType._function, _types.TokenType.name) || - // export default async function - (this.tokens.matches5(_types.TokenType._export, _types.TokenType._default, _types.TokenType.name, _types.TokenType._function, _types.TokenType.name) && - this.tokens.matchesContextualAtIndex( - this.tokens.currentIndex() + 2, - _keywords.ContextualKeyword._async, - )) || - this.tokens.matches4(_types.TokenType._export, _types.TokenType._default, _types.TokenType._class, _types.TokenType.name) || - this.tokens.matches5(_types.TokenType._export, _types.TokenType._default, _types.TokenType._abstract, _types.TokenType._class, _types.TokenType.name); - - if (!alreadyHasName && this.reactHotLoaderTransformer) { - // This is a plain "export default E" statement and we need to assign E to a variable. - // Change "export default E" to "let _default; export default _default = E" - const defaultVarName = this.nameManager.claimFreeName("_default"); - this.tokens.replaceToken(`let ${defaultVarName}; export`); - this.tokens.copyToken(); - this.tokens.appendCode(` ${defaultVarName} =`); - this.reactHotLoaderTransformer.setExtractedDefaultExportName(defaultVarName); - return true; - } - return false; - } - - /** - * Handle a statement with one of these forms: - * export {a, type b}; - * export {c, type d} from 'foo'; - * - * In both cases, any explicit type exports should be removed. In the first - * case, we also need to handle implicit export elision for names declared as - * types. In the second case, we must NOT do implicit named export elision, - * but we must remove the runtime import if all exports are type exports. - */ - processNamedExports() { - if (!this.isTypeScriptTransformEnabled) { - return false; - } - this.tokens.copyExpectedToken(_types.TokenType._export); - this.tokens.copyExpectedToken(_types.TokenType.braceL); - - const isReExport = _isExportFrom2.default.call(void 0, this.tokens); - let foundNonTypeExport = false; - while (!this.tokens.matches1(_types.TokenType.braceR)) { - const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, this.tokens); - if ( - specifierInfo.isType || - (!isReExport && this.shouldElideExportedName(specifierInfo.leftName)) - ) { - // Type export, so remove all tokens, including any comma. - while (this.tokens.currentIndex() < specifierInfo.endIndex) { - this.tokens.removeToken(); - } - if (this.tokens.matches1(_types.TokenType.comma)) { - this.tokens.removeToken(); - } - } else { - // Non-type export, so copy all tokens, including any comma. - foundNonTypeExport = true; - while (this.tokens.currentIndex() < specifierInfo.endIndex) { - this.tokens.copyToken(); - } - if (this.tokens.matches1(_types.TokenType.comma)) { - this.tokens.copyToken(); - } - } - } - this.tokens.copyExpectedToken(_types.TokenType.braceR); - - if (!this.keepUnusedImports && isReExport && !foundNonTypeExport) { - // This is a type-only re-export, so skip evaluating the other module. Technically this - // leaves the statement as `export {}`, but that's ok since that's a no-op. - this.tokens.removeToken(); - this.tokens.removeToken(); - _removeMaybeImportAttributes.removeMaybeImportAttributes.call(void 0, this.tokens); - } - - return true; - } - - /** - * ESM elides all imports with the rule that we only elide if we see that it's - * a type and never see it as a value. This is in contrast to CJS, which - * elides imports that are completely unknown. - */ - shouldElideExportedName(name) { - return ( - this.isTypeScriptTransformEnabled && - !this.keepUnusedImports && - this.declarationInfo.typeDeclarations.has(name) && - !this.declarationInfo.valueDeclarations.has(name) - ); - } -} exports.default = ESMImportTransformer; diff --git a/node_modules/sucrase/dist/transformers/FlowTransformer.js b/node_modules/sucrase/dist/transformers/FlowTransformer.js deleted file mode 100644 index 31c9744..0000000 --- a/node_modules/sucrase/dist/transformers/FlowTransformer.js +++ /dev/null @@ -1,182 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _keywords = require('../parser/tokenizer/keywords'); -var _types = require('../parser/tokenizer/types'); - - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - - class FlowTransformer extends _Transformer2.default { - constructor( - rootTransformer, - tokens, - isImportsTransformEnabled, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.isImportsTransformEnabled = isImportsTransformEnabled;; - } - - process() { - if ( - this.rootTransformer.processPossibleArrowParamEnd() || - this.rootTransformer.processPossibleAsyncArrowWithTypeParams() || - this.rootTransformer.processPossibleTypeRange() - ) { - return true; - } - if (this.tokens.matches1(_types.TokenType._enum)) { - this.processEnum(); - return true; - } - if (this.tokens.matches2(_types.TokenType._export, _types.TokenType._enum)) { - this.processNamedExportEnum(); - return true; - } - if (this.tokens.matches3(_types.TokenType._export, _types.TokenType._default, _types.TokenType._enum)) { - this.processDefaultExportEnum(); - return true; - } - return false; - } - - /** - * Handle a declaration like: - * export enum E ... - * - * With this imports transform, this becomes: - * const E = [[enum]]; exports.E = E; - * - * otherwise, it becomes: - * export const E = [[enum]]; - */ - processNamedExportEnum() { - if (this.isImportsTransformEnabled) { - // export - this.tokens.removeInitialToken(); - const enumName = this.tokens.identifierNameAtRelativeIndex(1); - this.processEnum(); - this.tokens.appendCode(` exports.${enumName} = ${enumName};`); - } else { - this.tokens.copyToken(); - this.processEnum(); - } - } - - /** - * Handle a declaration like: - * export default enum E - * - * With the imports transform, this becomes: - * const E = [[enum]]; exports.default = E; - * - * otherwise, it becomes: - * const E = [[enum]]; export default E; - */ - processDefaultExportEnum() { - // export - this.tokens.removeInitialToken(); - // default - this.tokens.removeToken(); - const enumName = this.tokens.identifierNameAtRelativeIndex(1); - this.processEnum(); - if (this.isImportsTransformEnabled) { - this.tokens.appendCode(` exports.default = ${enumName};`); - } else { - this.tokens.appendCode(` export default ${enumName};`); - } - } - - /** - * Transpile flow enums to invoke the "flow-enums-runtime" library. - * - * Currently, the transpiled code always uses `require("flow-enums-runtime")`, - * but if future flexibility is needed, we could expose a config option for - * this string (similar to configurable JSX). Even when targeting ESM, the - * default behavior of babel-plugin-transform-flow-enums is to use require - * rather than injecting an import. - * - * Flow enums are quite a bit simpler than TS enums and have some convenient - * constraints: - * - Element initializers must be either always present or always absent. That - * means that we can use fixed lookahead on the first element (if any) and - * assume that all elements are like that. - * - The right-hand side of an element initializer must be a literal value, - * not a complex expression and not referencing other elements. That means - * we can simply copy a single token. - * - * Enums can be broken up into three basic cases: - * - * Mirrored enums: - * enum E {A, B} - * -> - * const E = require("flow-enums-runtime").Mirrored(["A", "B"]); - * - * Initializer enums: - * enum E {A = 1, B = 2} - * -> - * const E = require("flow-enums-runtime")({A: 1, B: 2}); - * - * Symbol enums: - * enum E of symbol {A, B} - * -> - * const E = require("flow-enums-runtime")({A: Symbol("A"), B: Symbol("B")}); - * - * We can statically detect which of the three cases this is by looking at the - * "of" declaration (if any) and seeing if the first element has an initializer. - * Since the other transform details are so similar between the three cases, we - * use a single implementation and vary the transform within processEnumElement - * based on case. - */ - processEnum() { - // enum E -> const E - this.tokens.replaceToken("const"); - this.tokens.copyExpectedToken(_types.TokenType.name); - - let isSymbolEnum = false; - if (this.tokens.matchesContextual(_keywords.ContextualKeyword._of)) { - this.tokens.removeToken(); - isSymbolEnum = this.tokens.matchesContextual(_keywords.ContextualKeyword._symbol); - this.tokens.removeToken(); - } - const hasInitializers = this.tokens.matches3(_types.TokenType.braceL, _types.TokenType.name, _types.TokenType.eq); - this.tokens.appendCode(' = require("flow-enums-runtime")'); - - const isMirrored = !isSymbolEnum && !hasInitializers; - this.tokens.replaceTokenTrimmingLeftWhitespace(isMirrored ? ".Mirrored([" : "({"); - - while (!this.tokens.matches1(_types.TokenType.braceR)) { - // ... is allowed at the end and has no runtime behavior. - if (this.tokens.matches1(_types.TokenType.ellipsis)) { - this.tokens.removeToken(); - break; - } - this.processEnumElement(isSymbolEnum, hasInitializers); - if (this.tokens.matches1(_types.TokenType.comma)) { - this.tokens.copyToken(); - } - } - - this.tokens.replaceToken(isMirrored ? "]);" : "});"); - } - - /** - * Process an individual enum element, producing either an array element or an - * object element based on what type of enum this is. - */ - processEnumElement(isSymbolEnum, hasInitializers) { - if (isSymbolEnum) { - // Symbol enums never have initializers and are expanded to object elements. - // A, -> A: Symbol("A"), - const elementName = this.tokens.identifierName(); - this.tokens.copyToken(); - this.tokens.appendCode(`: Symbol("${elementName}")`); - } else if (hasInitializers) { - // Initializers are expanded to object elements. - // A = 1, -> A: 1, - this.tokens.copyToken(); - this.tokens.replaceTokenTrimmingLeftWhitespace(":"); - this.tokens.copyToken(); - } else { - // Enum elements without initializers become string literal array elements. - // A, -> "A", - this.tokens.replaceToken(`"${this.tokens.identifierName()}"`); - } - } -} exports.default = FlowTransformer; diff --git a/node_modules/sucrase/dist/transformers/JSXTransformer.js b/node_modules/sucrase/dist/transformers/JSXTransformer.js deleted file mode 100644 index df51be3..0000000 --- a/node_modules/sucrase/dist/transformers/JSXTransformer.js +++ /dev/null @@ -1,733 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - -var _xhtml = require('../parser/plugins/jsx/xhtml'); var _xhtml2 = _interopRequireDefault(_xhtml); -var _tokenizer = require('../parser/tokenizer'); -var _types = require('../parser/tokenizer/types'); -var _charcodes = require('../parser/util/charcodes'); - -var _getJSXPragmaInfo = require('../util/getJSXPragmaInfo'); var _getJSXPragmaInfo2 = _interopRequireDefault(_getJSXPragmaInfo); - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - - class JSXTransformer extends _Transformer2.default { - - - - - // State for calculating the line number of each JSX tag in development. - __init() {this.lastLineNumber = 1} - __init2() {this.lastIndex = 0} - - // In development, variable name holding the name of the current file. - __init3() {this.filenameVarName = null} - // Mapping of claimed names for imports in the automatic transform, e,g. - // {jsx: "_jsx"}. This determines which imports to generate in the prefix. - __init4() {this.esmAutomaticImportNameResolutions = {}} - // When automatically adding imports in CJS mode, we store the variable name - // holding the imported CJS module so we can require it in the prefix. - __init5() {this.cjsAutomaticModuleNameResolutions = {}} - - constructor( - rootTransformer, - tokens, - importProcessor, - nameManager, - options, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.nameManager = nameManager;this.options = options;JSXTransformer.prototype.__init.call(this);JSXTransformer.prototype.__init2.call(this);JSXTransformer.prototype.__init3.call(this);JSXTransformer.prototype.__init4.call(this);JSXTransformer.prototype.__init5.call(this);; - this.jsxPragmaInfo = _getJSXPragmaInfo2.default.call(void 0, options); - this.isAutomaticRuntime = options.jsxRuntime === "automatic"; - this.jsxImportSource = options.jsxImportSource || "react"; - } - - process() { - if (this.tokens.matches1(_types.TokenType.jsxTagStart)) { - this.processJSXTag(); - return true; - } - return false; - } - - getPrefixCode() { - let prefix = ""; - if (this.filenameVarName) { - prefix += `const ${this.filenameVarName} = ${JSON.stringify(this.options.filePath || "")};`; - } - if (this.isAutomaticRuntime) { - if (this.importProcessor) { - // CJS mode: emit require statements for all modules that were referenced. - for (const [path, resolvedName] of Object.entries(this.cjsAutomaticModuleNameResolutions)) { - prefix += `var ${resolvedName} = require("${path}");`; - } - } else { - // ESM mode: consolidate and emit import statements for referenced names. - const {createElement: createElementResolution, ...otherResolutions} = - this.esmAutomaticImportNameResolutions; - if (createElementResolution) { - prefix += `import {createElement as ${createElementResolution}} from "${this.jsxImportSource}";`; - } - const importSpecifiers = Object.entries(otherResolutions) - .map(([name, resolvedName]) => `${name} as ${resolvedName}`) - .join(", "); - if (importSpecifiers) { - const importPath = - this.jsxImportSource + (this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime"); - prefix += `import {${importSpecifiers}} from "${importPath}";`; - } - } - } - return prefix; - } - - processJSXTag() { - const {jsxRole, start} = this.tokens.currentToken(); - // Calculate line number information at the very start (if in development - // mode) so that the information is guaranteed to be queried in token order. - const elementLocationCode = this.options.production ? null : this.getElementLocationCode(start); - if (this.isAutomaticRuntime && jsxRole !== _tokenizer.JSXRole.KeyAfterPropSpread) { - this.transformTagToJSXFunc(elementLocationCode, jsxRole); - } else { - this.transformTagToCreateElement(elementLocationCode); - } - } - - getElementLocationCode(firstTokenStart) { - const lineNumber = this.getLineNumberForIndex(firstTokenStart); - return `lineNumber: ${lineNumber}`; - } - - /** - * Get the line number for this source position. This is calculated lazily and - * must be called in increasing order by index. - */ - getLineNumberForIndex(index) { - const code = this.tokens.code; - while (this.lastIndex < index && this.lastIndex < code.length) { - if (code[this.lastIndex] === "\n") { - this.lastLineNumber++; - } - this.lastIndex++; - } - return this.lastLineNumber; - } - - /** - * Convert the current JSX element to a call to jsx, jsxs, or jsxDEV. This is - * the primary transformation for the automatic transform. - * - * Example: - *
Hello{x}
- * becomes - * jsxs('div', {a: 1, children: ["Hello", x]}, 2) - */ - transformTagToJSXFunc(elementLocationCode, jsxRole) { - const isStatic = jsxRole === _tokenizer.JSXRole.StaticChildren; - // First tag is always jsxTagStart. - this.tokens.replaceToken(this.getJSXFuncInvocationCode(isStatic)); - - let keyCode = null; - if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) { - // Fragment syntax. - this.tokens.replaceToken(`${this.getFragmentCode()}, {`); - this.processAutomaticChildrenAndEndProps(jsxRole); - } else { - // Normal open tag or self-closing tag. - this.processTagIntro(); - this.tokens.appendCode(", {"); - keyCode = this.processProps(true); - - if (this.tokens.matches2(_types.TokenType.slash, _types.TokenType.jsxTagEnd)) { - // Self-closing tag, no children to add, so close the props. - this.tokens.appendCode("}"); - } else if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) { - // Tag with children. - this.tokens.removeToken(); - this.processAutomaticChildrenAndEndProps(jsxRole); - } else { - throw new Error("Expected either /> or > at the end of the tag."); - } - // If a key was present, move it to its own arg. Note that moving code - // like this will cause line numbers to get out of sync within the JSX - // element if the key expression has a newline in it. This is unfortunate, - // but hopefully should be rare. - if (keyCode) { - this.tokens.appendCode(`, ${keyCode}`); - } - } - if (!this.options.production) { - // If the key wasn't already added, add it now so we can correctly set - // positional args for jsxDEV. - if (keyCode === null) { - this.tokens.appendCode(", void 0"); - } - this.tokens.appendCode(`, ${isStatic}, ${this.getDevSource(elementLocationCode)}, this`); - } - // We're at the close-tag or the end of a self-closing tag, so remove - // everything else and close the function call. - this.tokens.removeInitialToken(); - while (!this.tokens.matches1(_types.TokenType.jsxTagEnd)) { - this.tokens.removeToken(); - } - this.tokens.replaceToken(")"); - } - - /** - * Convert the current JSX element to a createElement call. In the classic - * runtime, this is the only case. In the automatic runtime, this is called - * as a fallback in some situations. - * - * Example: - *
Hello{x}
- * becomes - * React.createElement('div', {a: 1, key: 2}, "Hello", x) - */ - transformTagToCreateElement(elementLocationCode) { - // First tag is always jsxTagStart. - this.tokens.replaceToken(this.getCreateElementInvocationCode()); - - if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) { - // Fragment syntax. - this.tokens.replaceToken(`${this.getFragmentCode()}, null`); - this.processChildren(true); - } else { - // Normal open tag or self-closing tag. - this.processTagIntro(); - this.processPropsObjectWithDevInfo(elementLocationCode); - - if (this.tokens.matches2(_types.TokenType.slash, _types.TokenType.jsxTagEnd)) { - // Self-closing tag; no children to process. - } else if (this.tokens.matches1(_types.TokenType.jsxTagEnd)) { - // Tag with children and a close-tag; process the children as args. - this.tokens.removeToken(); - this.processChildren(true); - } else { - throw new Error("Expected either /> or > at the end of the tag."); - } - } - // We're at the close-tag or the end of a self-closing tag, so remove - // everything else and close the function call. - this.tokens.removeInitialToken(); - while (!this.tokens.matches1(_types.TokenType.jsxTagEnd)) { - this.tokens.removeToken(); - } - this.tokens.replaceToken(")"); - } - - /** - * Get the code for the relevant function for this context: jsx, jsxs, - * or jsxDEV. The following open-paren is included as well. - * - * These functions are only used for the automatic runtime, so they are always - * auto-imported, but the auto-import will be either CJS or ESM based on the - * target module format. - */ - getJSXFuncInvocationCode(isStatic) { - if (this.options.production) { - if (isStatic) { - return this.claimAutoImportedFuncInvocation("jsxs", "/jsx-runtime"); - } else { - return this.claimAutoImportedFuncInvocation("jsx", "/jsx-runtime"); - } - } else { - return this.claimAutoImportedFuncInvocation("jsxDEV", "/jsx-dev-runtime"); - } - } - - /** - * Return the code to use for the createElement function, e.g. - * `React.createElement`, including the following open-paren. - * - * This is the main function to use for the classic runtime. For the - * automatic runtime, this function is used as a fallback function to - * preserve behavior when there is a prop spread followed by an explicit - * key. In that automatic runtime case, the function should be automatically - * imported. - */ - getCreateElementInvocationCode() { - if (this.isAutomaticRuntime) { - return this.claimAutoImportedFuncInvocation("createElement", ""); - } else { - const {jsxPragmaInfo} = this; - const resolvedPragmaBaseName = this.importProcessor - ? this.importProcessor.getIdentifierReplacement(jsxPragmaInfo.base) || jsxPragmaInfo.base - : jsxPragmaInfo.base; - return `${resolvedPragmaBaseName}${jsxPragmaInfo.suffix}(`; - } - } - - /** - * Return the code to use as the component when compiling a shorthand - * fragment, e.g. `React.Fragment`. - * - * This may be called from either the classic or automatic runtime, and - * the value should be auto-imported for the automatic runtime. - */ - getFragmentCode() { - if (this.isAutomaticRuntime) { - return this.claimAutoImportedName( - "Fragment", - this.options.production ? "/jsx-runtime" : "/jsx-dev-runtime", - ); - } else { - const {jsxPragmaInfo} = this; - const resolvedFragmentPragmaBaseName = this.importProcessor - ? this.importProcessor.getIdentifierReplacement(jsxPragmaInfo.fragmentBase) || - jsxPragmaInfo.fragmentBase - : jsxPragmaInfo.fragmentBase; - return resolvedFragmentPragmaBaseName + jsxPragmaInfo.fragmentSuffix; - } - } - - /** - * Return code that invokes the given function. - * - * When the imports transform is enabled, use the CJSImportTransformer - * strategy of using `.call(void 0, ...` to avoid passing a `this` value in a - * situation that would otherwise look like a method call. - */ - claimAutoImportedFuncInvocation(funcName, importPathSuffix) { - const funcCode = this.claimAutoImportedName(funcName, importPathSuffix); - if (this.importProcessor) { - return `${funcCode}.call(void 0, `; - } else { - return `${funcCode}(`; - } - } - - claimAutoImportedName(funcName, importPathSuffix) { - if (this.importProcessor) { - // CJS mode: claim a name for the module and mark it for import. - const path = this.jsxImportSource + importPathSuffix; - if (!this.cjsAutomaticModuleNameResolutions[path]) { - this.cjsAutomaticModuleNameResolutions[path] = - this.importProcessor.getFreeIdentifierForPath(path); - } - return `${this.cjsAutomaticModuleNameResolutions[path]}.${funcName}`; - } else { - // ESM mode: claim a name for this function and add it to the names that - // should be auto-imported when the prefix is generated. - if (!this.esmAutomaticImportNameResolutions[funcName]) { - this.esmAutomaticImportNameResolutions[funcName] = this.nameManager.claimFreeName( - `_${funcName}`, - ); - } - return this.esmAutomaticImportNameResolutions[funcName]; - } - } - - /** - * Process the first part of a tag, before any props. - */ - processTagIntro() { - // Walk forward until we see one of these patterns: - // jsxName to start the first prop, preceded by another jsxName to end the tag name. - // jsxName to start the first prop, preceded by greaterThan to end the type argument. - // [open brace] to start the first prop. - // [jsxTagEnd] to end the open-tag. - // [slash, jsxTagEnd] to end the self-closing tag. - let introEnd = this.tokens.currentIndex() + 1; - while ( - this.tokens.tokens[introEnd].isType || - (!this.tokens.matches2AtIndex(introEnd - 1, _types.TokenType.jsxName, _types.TokenType.jsxName) && - !this.tokens.matches2AtIndex(introEnd - 1, _types.TokenType.greaterThan, _types.TokenType.jsxName) && - !this.tokens.matches1AtIndex(introEnd, _types.TokenType.braceL) && - !this.tokens.matches1AtIndex(introEnd, _types.TokenType.jsxTagEnd) && - !this.tokens.matches2AtIndex(introEnd, _types.TokenType.slash, _types.TokenType.jsxTagEnd)) - ) { - introEnd++; - } - if (introEnd === this.tokens.currentIndex() + 1) { - const tagName = this.tokens.identifierName(); - if (startsWithLowerCase(tagName)) { - this.tokens.replaceToken(`'${tagName}'`); - } - } - while (this.tokens.currentIndex() < introEnd) { - this.rootTransformer.processToken(); - } - } - - /** - * Starting at the beginning of the props, add the props argument to - * React.createElement, including the comma before it. - */ - processPropsObjectWithDevInfo(elementLocationCode) { - const devProps = this.options.production - ? "" - : `__self: this, __source: ${this.getDevSource(elementLocationCode)}`; - if (!this.tokens.matches1(_types.TokenType.jsxName) && !this.tokens.matches1(_types.TokenType.braceL)) { - if (devProps) { - this.tokens.appendCode(`, {${devProps}}`); - } else { - this.tokens.appendCode(`, null`); - } - return; - } - this.tokens.appendCode(`, {`); - this.processProps(false); - if (devProps) { - this.tokens.appendCode(` ${devProps}}`); - } else { - this.tokens.appendCode("}"); - } - } - - /** - * Transform the core part of the props, assuming that a { has already been - * inserted before us and that a } will be inserted after us. - * - * If extractKeyCode is true (i.e. when using any jsx... function), any prop - * named "key" has its code captured and returned rather than being emitted to - * the output code. This shifts line numbers, and emitting the code later will - * correct line numbers again. If no key is found or if extractKeyCode is - * false, this function returns null. - */ - processProps(extractKeyCode) { - let keyCode = null; - while (true) { - if (this.tokens.matches2(_types.TokenType.jsxName, _types.TokenType.eq)) { - // This is a regular key={value} or key="value" prop. - const propName = this.tokens.identifierName(); - if (extractKeyCode && propName === "key") { - if (keyCode !== null) { - // The props list has multiple keys. Different implementations are - // inconsistent about what to do here: as of this writing, Babel and - // swc keep the *last* key and completely remove the rest, while - // TypeScript uses the *first* key and leaves the others as regular - // props. The React team collaborated with Babel on the - // implementation of this behavior, so presumably the Babel behavior - // is the one to use. - // Since we won't ever be emitting the previous key code, we need to - // at least emit its newlines here so that the line numbers match up - // in the long run. - this.tokens.appendCode(keyCode.replace(/[^\n]/g, "")); - } - // key - this.tokens.removeToken(); - // = - this.tokens.removeToken(); - const snapshot = this.tokens.snapshot(); - this.processPropValue(); - keyCode = this.tokens.dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot); - // Don't add a comma - continue; - } else { - this.processPropName(propName); - this.tokens.replaceToken(": "); - this.processPropValue(); - } - } else if (this.tokens.matches1(_types.TokenType.jsxName)) { - // This is a shorthand prop like . - const propName = this.tokens.identifierName(); - this.processPropName(propName); - this.tokens.appendCode(": true"); - } else if (this.tokens.matches1(_types.TokenType.braceL)) { - // This is prop spread, like
, which we can pass - // through fairly directly as an object spread. - this.tokens.replaceToken(""); - this.rootTransformer.processBalancedCode(); - this.tokens.replaceToken(""); - } else { - break; - } - this.tokens.appendCode(","); - } - return keyCode; - } - - processPropName(propName) { - if (propName.includes("-")) { - this.tokens.replaceToken(`'${propName}'`); - } else { - this.tokens.copyToken(); - } - } - - processPropValue() { - if (this.tokens.matches1(_types.TokenType.braceL)) { - this.tokens.replaceToken(""); - this.rootTransformer.processBalancedCode(); - this.tokens.replaceToken(""); - } else if (this.tokens.matches1(_types.TokenType.jsxTagStart)) { - this.processJSXTag(); - } else { - this.processStringPropValue(); - } - } - - processStringPropValue() { - const token = this.tokens.currentToken(); - const valueCode = this.tokens.code.slice(token.start + 1, token.end - 1); - const replacementCode = formatJSXTextReplacement(valueCode); - const literalCode = formatJSXStringValueLiteral(valueCode); - this.tokens.replaceToken(literalCode + replacementCode); - } - - /** - * Starting in the middle of the props object literal, produce an additional - * prop for the children and close the object literal. - */ - processAutomaticChildrenAndEndProps(jsxRole) { - if (jsxRole === _tokenizer.JSXRole.StaticChildren) { - this.tokens.appendCode(" children: ["); - this.processChildren(false); - this.tokens.appendCode("]}"); - } else { - // The parser information tells us whether we will see a real child or if - // all remaining children (if any) will resolve to empty. If there are no - // non-empty children, don't emit a children prop at all, but still - // process children so that we properly transform the code into nothing. - if (jsxRole === _tokenizer.JSXRole.OneChild) { - this.tokens.appendCode(" children: "); - } - this.processChildren(false); - this.tokens.appendCode("}"); - } - } - - /** - * Transform children into a comma-separated list, which will be either - * arguments to createElement or array elements of a children prop. - */ - processChildren(needsInitialComma) { - let needsComma = needsInitialComma; - while (true) { - if (this.tokens.matches2(_types.TokenType.jsxTagStart, _types.TokenType.slash)) { - // Closing tag, so no more children. - return; - } - let didEmitElement = false; - if (this.tokens.matches1(_types.TokenType.braceL)) { - if (this.tokens.matches2(_types.TokenType.braceL, _types.TokenType.braceR)) { - // Empty interpolations and comment-only interpolations are allowed - // and don't create an extra child arg. - this.tokens.replaceToken(""); - this.tokens.replaceToken(""); - } else { - // Interpolated expression. - this.tokens.replaceToken(needsComma ? ", " : ""); - this.rootTransformer.processBalancedCode(); - this.tokens.replaceToken(""); - didEmitElement = true; - } - } else if (this.tokens.matches1(_types.TokenType.jsxTagStart)) { - // Child JSX element - this.tokens.appendCode(needsComma ? ", " : ""); - this.processJSXTag(); - didEmitElement = true; - } else if (this.tokens.matches1(_types.TokenType.jsxText) || this.tokens.matches1(_types.TokenType.jsxEmptyText)) { - didEmitElement = this.processChildTextElement(needsComma); - } else { - throw new Error("Unexpected token when processing JSX children."); - } - if (didEmitElement) { - needsComma = true; - } - } - } - - /** - * Turn a JSX text element into a string literal, or nothing at all if the JSX - * text resolves to the empty string. - * - * Returns true if a string literal is emitted, false otherwise. - */ - processChildTextElement(needsComma) { - const token = this.tokens.currentToken(); - const valueCode = this.tokens.code.slice(token.start, token.end); - const replacementCode = formatJSXTextReplacement(valueCode); - const literalCode = formatJSXTextLiteral(valueCode); - if (literalCode === '""') { - this.tokens.replaceToken(replacementCode); - return false; - } else { - this.tokens.replaceToken(`${needsComma ? ", " : ""}${literalCode}${replacementCode}`); - return true; - } - } - - getDevSource(elementLocationCode) { - return `{fileName: ${this.getFilenameVarName()}, ${elementLocationCode}}`; - } - - getFilenameVarName() { - if (!this.filenameVarName) { - this.filenameVarName = this.nameManager.claimFreeName("_jsxFileName"); - } - return this.filenameVarName; - } -} exports.default = JSXTransformer; - -/** - * Spec for identifiers: https://tc39.github.io/ecma262/#prod-IdentifierStart. - * - * Really only treat anything starting with a-z as tag names. `_`, `$`, `é` - * should be treated as component names - */ - function startsWithLowerCase(s) { - const firstChar = s.charCodeAt(0); - return firstChar >= _charcodes.charCodes.lowercaseA && firstChar <= _charcodes.charCodes.lowercaseZ; -} exports.startsWithLowerCase = startsWithLowerCase; - -/** - * Turn the given jsxText string into a JS string literal. Leading and trailing - * whitespace on lines is removed, except immediately after the open-tag and - * before the close-tag. Empty lines are completely removed, and spaces are - * added between lines after that. - * - * We use JSON.stringify to introduce escape characters as necessary, and trim - * the start and end of each line and remove blank lines. - */ -function formatJSXTextLiteral(text) { - let result = ""; - let whitespace = ""; - - let isInInitialLineWhitespace = false; - let seenNonWhitespace = false; - for (let i = 0; i < text.length; i++) { - const c = text[i]; - if (c === " " || c === "\t" || c === "\r") { - if (!isInInitialLineWhitespace) { - whitespace += c; - } - } else if (c === "\n") { - whitespace = ""; - isInInitialLineWhitespace = true; - } else { - if (seenNonWhitespace && isInInitialLineWhitespace) { - result += " "; - } - result += whitespace; - whitespace = ""; - if (c === "&") { - const {entity, newI} = processEntity(text, i + 1); - i = newI - 1; - result += entity; - } else { - result += c; - } - seenNonWhitespace = true; - isInInitialLineWhitespace = false; - } - } - if (!isInInitialLineWhitespace) { - result += whitespace; - } - return JSON.stringify(result); -} - -/** - * Produce the code that should be printed after the JSX text string literal, - * with most content removed, but all newlines preserved and all spacing at the - * end preserved. - */ -function formatJSXTextReplacement(text) { - let numNewlines = 0; - let numSpaces = 0; - for (const c of text) { - if (c === "\n") { - numNewlines++; - numSpaces = 0; - } else if (c === " ") { - numSpaces++; - } - } - return "\n".repeat(numNewlines) + " ".repeat(numSpaces); -} - -/** - * Format a string in the value position of a JSX prop. - * - * Use the same implementation as convertAttribute from - * babel-helper-builder-react-jsx. - */ -function formatJSXStringValueLiteral(text) { - let result = ""; - for (let i = 0; i < text.length; i++) { - const c = text[i]; - if (c === "\n") { - if (/\s/.test(text[i + 1])) { - result += " "; - while (i < text.length && /\s/.test(text[i + 1])) { - i++; - } - } else { - result += "\n"; - } - } else if (c === "&") { - const {entity, newI} = processEntity(text, i + 1); - result += entity; - i = newI - 1; - } else { - result += c; - } - } - return JSON.stringify(result); -} - -/** - * Starting at a &, see if there's an HTML entity (specified by name, decimal - * char code, or hex char code) and return it if so. - * - * Modified from jsxReadString in babel-parser. - */ -function processEntity(text, indexAfterAmpersand) { - let str = ""; - let count = 0; - let entity; - let i = indexAfterAmpersand; - - if (text[i] === "#") { - let radix = 10; - i++; - let numStart; - if (text[i] === "x") { - radix = 16; - i++; - numStart = i; - while (i < text.length && isHexDigit(text.charCodeAt(i))) { - i++; - } - } else { - numStart = i; - while (i < text.length && isDecimalDigit(text.charCodeAt(i))) { - i++; - } - } - if (text[i] === ";") { - const numStr = text.slice(numStart, i); - if (numStr) { - i++; - entity = String.fromCodePoint(parseInt(numStr, radix)); - } - } - } else { - while (i < text.length && count++ < 10) { - const ch = text[i]; - i++; - if (ch === ";") { - entity = _xhtml2.default.get(str); - break; - } - str += ch; - } - } - - if (!entity) { - return {entity: "&", newI: indexAfterAmpersand}; - } - return {entity, newI: i}; -} - -function isDecimalDigit(code) { - return code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9; -} - -function isHexDigit(code) { - return ( - (code >= _charcodes.charCodes.digit0 && code <= _charcodes.charCodes.digit9) || - (code >= _charcodes.charCodes.lowercaseA && code <= _charcodes.charCodes.lowercaseF) || - (code >= _charcodes.charCodes.uppercaseA && code <= _charcodes.charCodes.uppercaseF) - ); -} diff --git a/node_modules/sucrase/dist/transformers/JestHoistTransformer.js b/node_modules/sucrase/dist/transformers/JestHoistTransformer.js deleted file mode 100644 index fb7f0fd..0000000 --- a/node_modules/sucrase/dist/transformers/JestHoistTransformer.js +++ /dev/null @@ -1,111 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } - -var _types = require('../parser/tokenizer/types'); - - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - -const JEST_GLOBAL_NAME = "jest"; -const HOISTED_METHODS = ["mock", "unmock", "enableAutomock", "disableAutomock"]; - -/** - * Implementation of babel-plugin-jest-hoist, which hoists up some jest method - * calls above the imports to allow them to override other imports. - * - * To preserve line numbers, rather than directly moving the jest.mock code, we - * wrap each invocation in a function statement and then call the function from - * the top of the file. - */ - class JestHoistTransformer extends _Transformer2.default { - __init() {this.hoistedFunctionNames = []} - - constructor( - rootTransformer, - tokens, - nameManager, - importProcessor, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.nameManager = nameManager;this.importProcessor = importProcessor;JestHoistTransformer.prototype.__init.call(this);; - } - - process() { - if ( - this.tokens.currentToken().scopeDepth === 0 && - this.tokens.matches4(_types.TokenType.name, _types.TokenType.dot, _types.TokenType.name, _types.TokenType.parenL) && - this.tokens.identifierName() === JEST_GLOBAL_NAME - ) { - // TODO: This only works if imports transform is active, which it will be for jest. - // But if jest adds module support and we no longer need the import transform, this needs fixing. - if (_optionalChain([this, 'access', _ => _.importProcessor, 'optionalAccess', _2 => _2.getGlobalNames, 'call', _3 => _3(), 'optionalAccess', _4 => _4.has, 'call', _5 => _5(JEST_GLOBAL_NAME)])) { - return false; - } - return this.extractHoistedCalls(); - } - - return false; - } - - getHoistedCode() { - if (this.hoistedFunctionNames.length > 0) { - // This will be placed before module interop code, but that's fine since - // imports aren't allowed in module mock factories. - return this.hoistedFunctionNames.map((name) => `${name}();`).join(""); - } - return ""; - } - - /** - * Extracts any methods calls on the jest-object that should be hoisted. - * - * According to the jest docs, https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options, - * mock, unmock, enableAutomock, disableAutomock, are the methods that should be hoisted. - * - * We do not apply the same checks of the arguments as babel-plugin-jest-hoist does. - */ - extractHoistedCalls() { - // We're handling a chain of calls where `jest` may or may not need to be inserted for each call - // in the chain, so remove the initial `jest` to make the loop implementation cleaner. - this.tokens.removeToken(); - // Track some state so that multiple non-hoisted chained calls in a row keep their chaining - // syntax. - let followsNonHoistedJestCall = false; - - // Iterate through all chained calls on the jest object. - while (this.tokens.matches3(_types.TokenType.dot, _types.TokenType.name, _types.TokenType.parenL)) { - const methodName = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); - const shouldHoist = HOISTED_METHODS.includes(methodName); - if (shouldHoist) { - // We've matched e.g. `.mock(...)` or similar call. - // Replace the initial `.` with `function __jestHoist(){jest.` - const hoistedFunctionName = this.nameManager.claimFreeName("__jestHoist"); - this.hoistedFunctionNames.push(hoistedFunctionName); - this.tokens.replaceToken(`function ${hoistedFunctionName}(){${JEST_GLOBAL_NAME}.`); - this.tokens.copyToken(); - this.tokens.copyToken(); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(_types.TokenType.parenR); - this.tokens.appendCode(";}"); - followsNonHoistedJestCall = false; - } else { - // This is a non-hoisted method, so just transform the code as usual. - if (followsNonHoistedJestCall) { - // If we didn't hoist the previous call, we can leave the code as-is to chain off of the - // previous method call. It's important to preserve the code here because we don't know - // for sure that the method actually returned the jest object for chaining. - this.tokens.copyToken(); - } else { - // If we hoisted the previous call, we know it returns the jest object back, so we insert - // the identifier `jest` to continue the chain. - this.tokens.replaceToken(`${JEST_GLOBAL_NAME}.`); - } - this.tokens.copyToken(); - this.tokens.copyToken(); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(_types.TokenType.parenR); - followsNonHoistedJestCall = true; - } - } - - return true; - } -} exports.default = JestHoistTransformer; diff --git a/node_modules/sucrase/dist/transformers/NumericSeparatorTransformer.js b/node_modules/sucrase/dist/transformers/NumericSeparatorTransformer.js deleted file mode 100644 index 7a30f09..0000000 --- a/node_modules/sucrase/dist/transformers/NumericSeparatorTransformer.js +++ /dev/null @@ -1,20 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _types = require('../parser/tokenizer/types'); - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - - class NumericSeparatorTransformer extends _Transformer2.default { - constructor( tokens) { - super();this.tokens = tokens;; - } - - process() { - if (this.tokens.matches1(_types.TokenType.num)) { - const code = this.tokens.currentTokenCode(); - if (code.includes("_")) { - this.tokens.replaceToken(code.replace(/_/g, "")); - return true; - } - } - return false; - } -} exports.default = NumericSeparatorTransformer; diff --git a/node_modules/sucrase/dist/transformers/OptionalCatchBindingTransformer.js b/node_modules/sucrase/dist/transformers/OptionalCatchBindingTransformer.js deleted file mode 100644 index 79ae8bc..0000000 --- a/node_modules/sucrase/dist/transformers/OptionalCatchBindingTransformer.js +++ /dev/null @@ -1,19 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _types = require('../parser/tokenizer/types'); - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - - class OptionalCatchBindingTransformer extends _Transformer2.default { - constructor( tokens, nameManager) { - super();this.tokens = tokens;this.nameManager = nameManager;; - } - - process() { - if (this.tokens.matches2(_types.TokenType._catch, _types.TokenType.braceL)) { - this.tokens.copyToken(); - this.tokens.appendCode(` (${this.nameManager.claimFreeName("e")})`); - return true; - } - return false; - } -} exports.default = OptionalCatchBindingTransformer; diff --git a/node_modules/sucrase/dist/transformers/OptionalChainingNullishTransformer.js b/node_modules/sucrase/dist/transformers/OptionalChainingNullishTransformer.js deleted file mode 100644 index 3a68a0a..0000000 --- a/node_modules/sucrase/dist/transformers/OptionalChainingNullishTransformer.js +++ /dev/null @@ -1,155 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _types = require('../parser/tokenizer/types'); - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - -/** - * Transformer supporting the optional chaining and nullish coalescing operators. - * - * Tech plan here: - * https://github.com/alangpierce/sucrase/wiki/Sucrase-Optional-Chaining-and-Nullish-Coalescing-Technical-Plan - * - * The prefix and suffix code snippets are handled by TokenProcessor, and this transformer handles - * the operators themselves. - */ - class OptionalChainingNullishTransformer extends _Transformer2.default { - constructor( tokens, nameManager) { - super();this.tokens = tokens;this.nameManager = nameManager;; - } - - process() { - if (this.tokens.matches1(_types.TokenType.nullishCoalescing)) { - const token = this.tokens.currentToken(); - if (this.tokens.tokens[token.nullishStartIndex].isAsyncOperation) { - this.tokens.replaceTokenTrimmingLeftWhitespace(", async () => ("); - } else { - this.tokens.replaceTokenTrimmingLeftWhitespace(", () => ("); - } - return true; - } - if (this.tokens.matches1(_types.TokenType._delete)) { - const nextToken = this.tokens.tokenAtRelativeIndex(1); - if (nextToken.isOptionalChainStart) { - this.tokens.removeInitialToken(); - return true; - } - } - const token = this.tokens.currentToken(); - const chainStart = token.subscriptStartIndex; - if ( - chainStart != null && - this.tokens.tokens[chainStart].isOptionalChainStart && - // Super subscripts can't be optional (since super is never null/undefined), and the syntax - // relies on the subscript being intact, so leave this token alone. - this.tokens.tokenAtRelativeIndex(-1).type !== _types.TokenType._super - ) { - const param = this.nameManager.claimFreeName("_"); - let arrowStartSnippet; - if ( - chainStart > 0 && - this.tokens.matches1AtIndex(chainStart - 1, _types.TokenType._delete) && - this.isLastSubscriptInChain() - ) { - // Delete operations are special: we already removed the delete keyword, and to still - // perform a delete, we need to insert a delete in the very last part of the chain, which - // in correct code will always be a property access. - arrowStartSnippet = `${param} => delete ${param}`; - } else { - arrowStartSnippet = `${param} => ${param}`; - } - if (this.tokens.tokens[chainStart].isAsyncOperation) { - arrowStartSnippet = `async ${arrowStartSnippet}`; - } - if ( - this.tokens.matches2(_types.TokenType.questionDot, _types.TokenType.parenL) || - this.tokens.matches2(_types.TokenType.questionDot, _types.TokenType.lessThan) - ) { - if (this.justSkippedSuper()) { - this.tokens.appendCode(".bind(this)"); - } - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalCall', ${arrowStartSnippet}`); - } else if (this.tokens.matches2(_types.TokenType.questionDot, _types.TokenType.bracketL)) { - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${arrowStartSnippet}`); - } else if (this.tokens.matches1(_types.TokenType.questionDot)) { - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'optionalAccess', ${arrowStartSnippet}.`); - } else if (this.tokens.matches1(_types.TokenType.dot)) { - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${arrowStartSnippet}.`); - } else if (this.tokens.matches1(_types.TokenType.bracketL)) { - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'access', ${arrowStartSnippet}[`); - } else if (this.tokens.matches1(_types.TokenType.parenL)) { - if (this.justSkippedSuper()) { - this.tokens.appendCode(".bind(this)"); - } - this.tokens.replaceTokenTrimmingLeftWhitespace(`, 'call', ${arrowStartSnippet}(`); - } else { - throw new Error("Unexpected subscript operator in optional chain."); - } - return true; - } - return false; - } - - /** - * Determine if the current token is the last of its chain, so that we know whether it's eligible - * to have a delete op inserted. - * - * We can do this by walking forward until we determine one way or another. Each - * isOptionalChainStart token must be paired with exactly one isOptionalChainEnd token after it in - * a nesting way, so we can track depth and walk to the end of the chain (the point where the - * depth goes negative) and see if any other subscript token is after us in the chain. - */ - isLastSubscriptInChain() { - let depth = 0; - for (let i = this.tokens.currentIndex() + 1; ; i++) { - if (i >= this.tokens.tokens.length) { - throw new Error("Reached the end of the code while finding the end of the access chain."); - } - if (this.tokens.tokens[i].isOptionalChainStart) { - depth++; - } else if (this.tokens.tokens[i].isOptionalChainEnd) { - depth--; - } - if (depth < 0) { - return true; - } - - // This subscript token is a later one in the same chain. - if (depth === 0 && this.tokens.tokens[i].subscriptStartIndex != null) { - return false; - } - } - } - - /** - * Determine if we are the open-paren in an expression like super.a()?.b. - * - * We can do this by walking backward to find the previous subscript. If that subscript was - * preceded by a super, then we must be the subscript after it, so if this is a call expression, - * we'll need to attach the right context. - */ - justSkippedSuper() { - let depth = 0; - let index = this.tokens.currentIndex() - 1; - while (true) { - if (index < 0) { - throw new Error( - "Reached the start of the code while finding the start of the access chain.", - ); - } - if (this.tokens.tokens[index].isOptionalChainStart) { - depth--; - } else if (this.tokens.tokens[index].isOptionalChainEnd) { - depth++; - } - if (depth < 0) { - return false; - } - - // This subscript token is a later one in the same chain. - if (depth === 0 && this.tokens.tokens[index].subscriptStartIndex != null) { - return this.tokens.tokens[index - 1].type === _types.TokenType._super; - } - index--; - } - } -} exports.default = OptionalChainingNullishTransformer; diff --git a/node_modules/sucrase/dist/transformers/ReactDisplayNameTransformer.js b/node_modules/sucrase/dist/transformers/ReactDisplayNameTransformer.js deleted file mode 100644 index faf6f65..0000000 --- a/node_modules/sucrase/dist/transformers/ReactDisplayNameTransformer.js +++ /dev/null @@ -1,160 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -var _tokenizer = require('../parser/tokenizer'); -var _types = require('../parser/tokenizer/types'); - - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - -/** - * Implementation of babel-plugin-transform-react-display-name, which adds a - * display name to usages of React.createClass and createReactClass. - */ - class ReactDisplayNameTransformer extends _Transformer2.default { - constructor( - rootTransformer, - tokens, - importProcessor, - options, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.importProcessor = importProcessor;this.options = options;; - } - - process() { - const startIndex = this.tokens.currentIndex(); - if (this.tokens.identifierName() === "createReactClass") { - const newName = - this.importProcessor && this.importProcessor.getIdentifierReplacement("createReactClass"); - if (newName) { - this.tokens.replaceToken(`(0, ${newName})`); - } else { - this.tokens.copyToken(); - } - this.tryProcessCreateClassCall(startIndex); - return true; - } - if ( - this.tokens.matches3(_types.TokenType.name, _types.TokenType.dot, _types.TokenType.name) && - this.tokens.identifierName() === "React" && - this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 2) === "createClass" - ) { - const newName = this.importProcessor - ? this.importProcessor.getIdentifierReplacement("React") || "React" - : "React"; - if (newName) { - this.tokens.replaceToken(newName); - this.tokens.copyToken(); - this.tokens.copyToken(); - } else { - this.tokens.copyToken(); - this.tokens.copyToken(); - this.tokens.copyToken(); - } - this.tryProcessCreateClassCall(startIndex); - return true; - } - return false; - } - - /** - * This is called with the token position at the open-paren. - */ - tryProcessCreateClassCall(startIndex) { - const displayName = this.findDisplayName(startIndex); - if (!displayName) { - return; - } - - if (this.classNeedsDisplayName()) { - this.tokens.copyExpectedToken(_types.TokenType.parenL); - this.tokens.copyExpectedToken(_types.TokenType.braceL); - this.tokens.appendCode(`displayName: '${displayName}',`); - this.rootTransformer.processBalancedCode(); - this.tokens.copyExpectedToken(_types.TokenType.braceR); - this.tokens.copyExpectedToken(_types.TokenType.parenR); - } - } - - findDisplayName(startIndex) { - if (startIndex < 2) { - return null; - } - if (this.tokens.matches2AtIndex(startIndex - 2, _types.TokenType.name, _types.TokenType.eq)) { - // This is an assignment (or declaration) and the LHS is either an identifier or a member - // expression ending in an identifier, so use that identifier name. - return this.tokens.identifierNameAtIndex(startIndex - 2); - } - if ( - startIndex >= 2 && - this.tokens.tokens[startIndex - 2].identifierRole === _tokenizer.IdentifierRole.ObjectKey - ) { - // This is an object literal value. - return this.tokens.identifierNameAtIndex(startIndex - 2); - } - if (this.tokens.matches2AtIndex(startIndex - 2, _types.TokenType._export, _types.TokenType._default)) { - return this.getDisplayNameFromFilename(); - } - return null; - } - - getDisplayNameFromFilename() { - const filePath = this.options.filePath || "unknown"; - const pathSegments = filePath.split("/"); - const filename = pathSegments[pathSegments.length - 1]; - const dotIndex = filename.lastIndexOf("."); - const baseFilename = dotIndex === -1 ? filename : filename.slice(0, dotIndex); - if (baseFilename === "index" && pathSegments[pathSegments.length - 2]) { - return pathSegments[pathSegments.length - 2]; - } else { - return baseFilename; - } - } - - /** - * We only want to add a display name when this is a function call containing - * one argument, which is an object literal without `displayName` as an - * existing key. - */ - classNeedsDisplayName() { - let index = this.tokens.currentIndex(); - if (!this.tokens.matches2(_types.TokenType.parenL, _types.TokenType.braceL)) { - return false; - } - // The block starts on the {, and we expect any displayName key to be in - // that context. We need to ignore other other contexts to avoid matching - // nested displayName keys. - const objectStartIndex = index + 1; - const objectContextId = this.tokens.tokens[objectStartIndex].contextId; - if (objectContextId == null) { - throw new Error("Expected non-null context ID on object open-brace."); - } - - for (; index < this.tokens.tokens.length; index++) { - const token = this.tokens.tokens[index]; - if (token.type === _types.TokenType.braceR && token.contextId === objectContextId) { - index++; - break; - } - - if ( - this.tokens.identifierNameAtIndex(index) === "displayName" && - this.tokens.tokens[index].identifierRole === _tokenizer.IdentifierRole.ObjectKey && - token.contextId === objectContextId - ) { - // We found a displayName key, so bail out. - return false; - } - } - - if (index === this.tokens.tokens.length) { - throw new Error("Unexpected end of input when processing React class."); - } - - // If we got this far, we know we have createClass with an object with no - // display name, so we want to proceed as long as that was the only argument. - return ( - this.tokens.matches1AtIndex(index, _types.TokenType.parenR) || - this.tokens.matches2AtIndex(index, _types.TokenType.comma, _types.TokenType.parenR) - ); - } -} exports.default = ReactDisplayNameTransformer; diff --git a/node_modules/sucrase/dist/transformers/ReactHotLoaderTransformer.js b/node_modules/sucrase/dist/transformers/ReactHotLoaderTransformer.js deleted file mode 100644 index 3657c49..0000000 --- a/node_modules/sucrase/dist/transformers/ReactHotLoaderTransformer.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _tokenizer = require('../parser/tokenizer'); - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - - class ReactHotLoaderTransformer extends _Transformer2.default { - __init() {this.extractedDefaultExportName = null} - - constructor( tokens, filePath) { - super();this.tokens = tokens;this.filePath = filePath;ReactHotLoaderTransformer.prototype.__init.call(this);; - } - - setExtractedDefaultExportName(extractedDefaultExportName) { - this.extractedDefaultExportName = extractedDefaultExportName; - } - - getPrefixCode() { - return ` - (function () { - var enterModule = require('react-hot-loader').enterModule; - enterModule && enterModule(module); - })();` - .replace(/\s+/g, " ") - .trim(); - } - - getSuffixCode() { - const topLevelNames = new Set(); - for (const token of this.tokens.tokens) { - if ( - !token.isType && - _tokenizer.isTopLevelDeclaration.call(void 0, token) && - token.identifierRole !== _tokenizer.IdentifierRole.ImportDeclaration - ) { - topLevelNames.add(this.tokens.identifierNameForToken(token)); - } - } - const namesToRegister = Array.from(topLevelNames).map((name) => ({ - variableName: name, - uniqueLocalName: name, - })); - if (this.extractedDefaultExportName) { - namesToRegister.push({ - variableName: this.extractedDefaultExportName, - uniqueLocalName: "default", - }); - } - return ` -;(function () { - var reactHotLoader = require('react-hot-loader').default; - var leaveModule = require('react-hot-loader').leaveModule; - if (!reactHotLoader) { - return; - } -${namesToRegister - .map( - ({variableName, uniqueLocalName}) => - ` reactHotLoader.register(${variableName}, "${uniqueLocalName}", ${JSON.stringify( - this.filePath || "", - )});`, - ) - .join("\n")} - leaveModule(module); -})();`; - } - - process() { - return false; - } -} exports.default = ReactHotLoaderTransformer; diff --git a/node_modules/sucrase/dist/transformers/RootTransformer.js b/node_modules/sucrase/dist/transformers/RootTransformer.js deleted file mode 100644 index 70b33c8..0000000 --- a/node_modules/sucrase/dist/transformers/RootTransformer.js +++ /dev/null @@ -1,462 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - -var _keywords = require('../parser/tokenizer/keywords'); -var _types = require('../parser/tokenizer/types'); - -var _getClassInfo = require('../util/getClassInfo'); var _getClassInfo2 = _interopRequireDefault(_getClassInfo); -var _CJSImportTransformer = require('./CJSImportTransformer'); var _CJSImportTransformer2 = _interopRequireDefault(_CJSImportTransformer); -var _ESMImportTransformer = require('./ESMImportTransformer'); var _ESMImportTransformer2 = _interopRequireDefault(_ESMImportTransformer); -var _FlowTransformer = require('./FlowTransformer'); var _FlowTransformer2 = _interopRequireDefault(_FlowTransformer); -var _JestHoistTransformer = require('./JestHoistTransformer'); var _JestHoistTransformer2 = _interopRequireDefault(_JestHoistTransformer); -var _JSXTransformer = require('./JSXTransformer'); var _JSXTransformer2 = _interopRequireDefault(_JSXTransformer); -var _NumericSeparatorTransformer = require('./NumericSeparatorTransformer'); var _NumericSeparatorTransformer2 = _interopRequireDefault(_NumericSeparatorTransformer); -var _OptionalCatchBindingTransformer = require('./OptionalCatchBindingTransformer'); var _OptionalCatchBindingTransformer2 = _interopRequireDefault(_OptionalCatchBindingTransformer); -var _OptionalChainingNullishTransformer = require('./OptionalChainingNullishTransformer'); var _OptionalChainingNullishTransformer2 = _interopRequireDefault(_OptionalChainingNullishTransformer); -var _ReactDisplayNameTransformer = require('./ReactDisplayNameTransformer'); var _ReactDisplayNameTransformer2 = _interopRequireDefault(_ReactDisplayNameTransformer); -var _ReactHotLoaderTransformer = require('./ReactHotLoaderTransformer'); var _ReactHotLoaderTransformer2 = _interopRequireDefault(_ReactHotLoaderTransformer); - -var _TypeScriptTransformer = require('./TypeScriptTransformer'); var _TypeScriptTransformer2 = _interopRequireDefault(_TypeScriptTransformer); - - - - - - - - - class RootTransformer { - __init() {this.transformers = []} - - - __init2() {this.generatedVariables = []} - - - - - - constructor( - sucraseContext, - transforms, - enableLegacyBabel5ModuleInterop, - options, - ) {;RootTransformer.prototype.__init.call(this);RootTransformer.prototype.__init2.call(this); - this.nameManager = sucraseContext.nameManager; - this.helperManager = sucraseContext.helperManager; - const {tokenProcessor, importProcessor} = sucraseContext; - this.tokens = tokenProcessor; - this.isImportsTransformEnabled = transforms.includes("imports"); - this.isReactHotLoaderTransformEnabled = transforms.includes("react-hot-loader"); - this.disableESTransforms = Boolean(options.disableESTransforms); - - if (!options.disableESTransforms) { - this.transformers.push( - new (0, _OptionalChainingNullishTransformer2.default)(tokenProcessor, this.nameManager), - ); - this.transformers.push(new (0, _NumericSeparatorTransformer2.default)(tokenProcessor)); - this.transformers.push(new (0, _OptionalCatchBindingTransformer2.default)(tokenProcessor, this.nameManager)); - } - - if (transforms.includes("jsx")) { - if (options.jsxRuntime !== "preserve") { - this.transformers.push( - new (0, _JSXTransformer2.default)(this, tokenProcessor, importProcessor, this.nameManager, options), - ); - } - this.transformers.push( - new (0, _ReactDisplayNameTransformer2.default)(this, tokenProcessor, importProcessor, options), - ); - } - - let reactHotLoaderTransformer = null; - if (transforms.includes("react-hot-loader")) { - if (!options.filePath) { - throw new Error("filePath is required when using the react-hot-loader transform."); - } - reactHotLoaderTransformer = new (0, _ReactHotLoaderTransformer2.default)(tokenProcessor, options.filePath); - this.transformers.push(reactHotLoaderTransformer); - } - - // Note that we always want to enable the imports transformer, even when the import transform - // itself isn't enabled, since we need to do type-only import pruning for both Flow and - // TypeScript. - if (transforms.includes("imports")) { - if (importProcessor === null) { - throw new Error("Expected non-null importProcessor with imports transform enabled."); - } - this.transformers.push( - new (0, _CJSImportTransformer2.default)( - this, - tokenProcessor, - importProcessor, - this.nameManager, - this.helperManager, - reactHotLoaderTransformer, - enableLegacyBabel5ModuleInterop, - Boolean(options.enableLegacyTypeScriptModuleInterop), - transforms.includes("typescript"), - transforms.includes("flow"), - Boolean(options.preserveDynamicImport), - Boolean(options.keepUnusedImports), - ), - ); - } else { - this.transformers.push( - new (0, _ESMImportTransformer2.default)( - tokenProcessor, - this.nameManager, - this.helperManager, - reactHotLoaderTransformer, - transforms.includes("typescript"), - transforms.includes("flow"), - Boolean(options.keepUnusedImports), - options, - ), - ); - } - - if (transforms.includes("flow")) { - this.transformers.push( - new (0, _FlowTransformer2.default)(this, tokenProcessor, transforms.includes("imports")), - ); - } - if (transforms.includes("typescript")) { - this.transformers.push( - new (0, _TypeScriptTransformer2.default)(this, tokenProcessor, transforms.includes("imports")), - ); - } - if (transforms.includes("jest")) { - this.transformers.push( - new (0, _JestHoistTransformer2.default)(this, tokenProcessor, this.nameManager, importProcessor), - ); - } - } - - transform() { - this.tokens.reset(); - this.processBalancedCode(); - const shouldAddUseStrict = this.isImportsTransformEnabled; - // "use strict" always needs to be first, so override the normal transformer order. - let prefix = shouldAddUseStrict ? '"use strict";' : ""; - for (const transformer of this.transformers) { - prefix += transformer.getPrefixCode(); - } - prefix += this.helperManager.emitHelpers(); - prefix += this.generatedVariables.map((v) => ` var ${v};`).join(""); - for (const transformer of this.transformers) { - prefix += transformer.getHoistedCode(); - } - let suffix = ""; - for (const transformer of this.transformers) { - suffix += transformer.getSuffixCode(); - } - const result = this.tokens.finish(); - let {code} = result; - if (code.startsWith("#!")) { - let newlineIndex = code.indexOf("\n"); - if (newlineIndex === -1) { - newlineIndex = code.length; - code += "\n"; - } - return { - code: code.slice(0, newlineIndex + 1) + prefix + code.slice(newlineIndex + 1) + suffix, - // The hashbang line has no tokens, so shifting the tokens to account - // for prefix can happen normally. - mappings: this.shiftMappings(result.mappings, prefix.length), - }; - } else { - return { - code: prefix + code + suffix, - mappings: this.shiftMappings(result.mappings, prefix.length), - }; - } - } - - processBalancedCode() { - let braceDepth = 0; - let parenDepth = 0; - while (!this.tokens.isAtEnd()) { - if (this.tokens.matches1(_types.TokenType.braceL) || this.tokens.matches1(_types.TokenType.dollarBraceL)) { - braceDepth++; - } else if (this.tokens.matches1(_types.TokenType.braceR)) { - if (braceDepth === 0) { - return; - } - braceDepth--; - } - if (this.tokens.matches1(_types.TokenType.parenL)) { - parenDepth++; - } else if (this.tokens.matches1(_types.TokenType.parenR)) { - if (parenDepth === 0) { - return; - } - parenDepth--; - } - this.processToken(); - } - } - - processToken() { - if (this.tokens.matches1(_types.TokenType._class)) { - this.processClass(); - return; - } - for (const transformer of this.transformers) { - const wasProcessed = transformer.process(); - if (wasProcessed) { - return; - } - } - this.tokens.copyToken(); - } - - /** - * Skip past a class with a name and return that name. - */ - processNamedClass() { - if (!this.tokens.matches2(_types.TokenType._class, _types.TokenType.name)) { - throw new Error("Expected identifier for exported class name."); - } - const name = this.tokens.identifierNameAtIndex(this.tokens.currentIndex() + 1); - this.processClass(); - return name; - } - - processClass() { - const classInfo = _getClassInfo2.default.call(void 0, this, this.tokens, this.nameManager, this.disableESTransforms); - - // Both static and instance initializers need a class name to use to invoke the initializer, so - // assign to one if necessary. - const needsCommaExpression = - (classInfo.headerInfo.isExpression || !classInfo.headerInfo.className) && - classInfo.staticInitializerNames.length + classInfo.instanceInitializerNames.length > 0; - - let className = classInfo.headerInfo.className; - if (needsCommaExpression) { - className = this.nameManager.claimFreeName("_class"); - this.generatedVariables.push(className); - this.tokens.appendCode(` (${className} =`); - } - - const classToken = this.tokens.currentToken(); - const contextId = classToken.contextId; - if (contextId == null) { - throw new Error("Expected class to have a context ID."); - } - this.tokens.copyExpectedToken(_types.TokenType._class); - while (!this.tokens.matchesContextIdAndLabel(_types.TokenType.braceL, contextId)) { - this.processToken(); - } - - this.processClassBody(classInfo, className); - - const staticInitializerStatements = classInfo.staticInitializerNames.map( - (name) => `${className}.${name}()`, - ); - if (needsCommaExpression) { - this.tokens.appendCode( - `, ${staticInitializerStatements.map((s) => `${s}, `).join("")}${className})`, - ); - } else if (classInfo.staticInitializerNames.length > 0) { - this.tokens.appendCode(` ${staticInitializerStatements.map((s) => `${s};`).join(" ")}`); - } - } - - /** - * We want to just handle class fields in all contexts, since TypeScript supports them. Later, - * when some JS implementations support class fields, this should be made optional. - */ - processClassBody(classInfo, className) { - const { - headerInfo, - constructorInsertPos, - constructorInitializerStatements, - fields, - instanceInitializerNames, - rangesToRemove, - } = classInfo; - let fieldIndex = 0; - let rangeToRemoveIndex = 0; - const classContextId = this.tokens.currentToken().contextId; - if (classContextId == null) { - throw new Error("Expected non-null context ID on class."); - } - this.tokens.copyExpectedToken(_types.TokenType.braceL); - if (this.isReactHotLoaderTransformEnabled) { - this.tokens.appendCode( - "__reactstandin__regenerateByEval(key, code) {this[key] = eval(code);}", - ); - } - - const needsConstructorInit = - constructorInitializerStatements.length + instanceInitializerNames.length > 0; - - if (constructorInsertPos === null && needsConstructorInit) { - const constructorInitializersCode = this.makeConstructorInitCode( - constructorInitializerStatements, - instanceInitializerNames, - className, - ); - if (headerInfo.hasSuperclass) { - const argsName = this.nameManager.claimFreeName("args"); - this.tokens.appendCode( - `constructor(...${argsName}) { super(...${argsName}); ${constructorInitializersCode}; }`, - ); - } else { - this.tokens.appendCode(`constructor() { ${constructorInitializersCode}; }`); - } - } - - while (!this.tokens.matchesContextIdAndLabel(_types.TokenType.braceR, classContextId)) { - if (fieldIndex < fields.length && this.tokens.currentIndex() === fields[fieldIndex].start) { - let needsCloseBrace = false; - if (this.tokens.matches1(_types.TokenType.bracketL)) { - this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this`); - } else if (this.tokens.matches1(_types.TokenType.string) || this.tokens.matches1(_types.TokenType.num)) { - this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this[`); - needsCloseBrace = true; - } else { - this.tokens.copyTokenWithPrefix(`${fields[fieldIndex].initializerName}() {this.`); - } - while (this.tokens.currentIndex() < fields[fieldIndex].end) { - if (needsCloseBrace && this.tokens.currentIndex() === fields[fieldIndex].equalsIndex) { - this.tokens.appendCode("]"); - } - this.processToken(); - } - this.tokens.appendCode("}"); - fieldIndex++; - } else if ( - rangeToRemoveIndex < rangesToRemove.length && - this.tokens.currentIndex() >= rangesToRemove[rangeToRemoveIndex].start - ) { - if (this.tokens.currentIndex() < rangesToRemove[rangeToRemoveIndex].end) { - this.tokens.removeInitialToken(); - } - while (this.tokens.currentIndex() < rangesToRemove[rangeToRemoveIndex].end) { - this.tokens.removeToken(); - } - rangeToRemoveIndex++; - } else if (this.tokens.currentIndex() === constructorInsertPos) { - this.tokens.copyToken(); - if (needsConstructorInit) { - this.tokens.appendCode( - `;${this.makeConstructorInitCode( - constructorInitializerStatements, - instanceInitializerNames, - className, - )};`, - ); - } - this.processToken(); - } else { - this.processToken(); - } - } - this.tokens.copyExpectedToken(_types.TokenType.braceR); - } - - makeConstructorInitCode( - constructorInitializerStatements, - instanceInitializerNames, - className, - ) { - return [ - ...constructorInitializerStatements, - ...instanceInitializerNames.map((name) => `${className}.prototype.${name}.call(this)`), - ].join(";"); - } - - /** - * Normally it's ok to simply remove type tokens, but we need to be more careful when dealing with - * arrow function return types since they can confuse the parser. In that case, we want to move - * the close-paren to the same line as the arrow. - * - * See https://github.com/alangpierce/sucrase/issues/391 for more details. - */ - processPossibleArrowParamEnd() { - if (this.tokens.matches2(_types.TokenType.parenR, _types.TokenType.colon) && this.tokens.tokenAtRelativeIndex(1).isType) { - let nextNonTypeIndex = this.tokens.currentIndex() + 1; - // Look ahead to see if this is an arrow function or something else. - while (this.tokens.tokens[nextNonTypeIndex].isType) { - nextNonTypeIndex++; - } - if (this.tokens.matches1AtIndex(nextNonTypeIndex, _types.TokenType.arrow)) { - this.tokens.removeInitialToken(); - while (this.tokens.currentIndex() < nextNonTypeIndex) { - this.tokens.removeToken(); - } - this.tokens.replaceTokenTrimmingLeftWhitespace(") =>"); - return true; - } - } - return false; - } - - /** - * An async arrow function might be of the form: - * - * async < - * T - * >() => {} - * - * in which case, removing the type parameters will cause a syntax error. Detect this case and - * move the open-paren earlier. - */ - processPossibleAsyncArrowWithTypeParams() { - if ( - !this.tokens.matchesContextual(_keywords.ContextualKeyword._async) && - !this.tokens.matches1(_types.TokenType._async) - ) { - return false; - } - const nextToken = this.tokens.tokenAtRelativeIndex(1); - if (nextToken.type !== _types.TokenType.lessThan || !nextToken.isType) { - return false; - } - - let nextNonTypeIndex = this.tokens.currentIndex() + 1; - // Look ahead to see if this is an arrow function or something else. - while (this.tokens.tokens[nextNonTypeIndex].isType) { - nextNonTypeIndex++; - } - if (this.tokens.matches1AtIndex(nextNonTypeIndex, _types.TokenType.parenL)) { - this.tokens.replaceToken("async ("); - this.tokens.removeInitialToken(); - while (this.tokens.currentIndex() < nextNonTypeIndex) { - this.tokens.removeToken(); - } - this.tokens.removeToken(); - // We ate a ( token, so we need to process the tokens in between and then the ) token so that - // we remain balanced. - this.processBalancedCode(); - this.processToken(); - return true; - } - return false; - } - - processPossibleTypeRange() { - if (this.tokens.currentToken().isType) { - this.tokens.removeInitialToken(); - while (this.tokens.currentToken().isType) { - this.tokens.removeToken(); - } - return true; - } - return false; - } - - shiftMappings( - mappings, - prefixLength, - ) { - for (let i = 0; i < mappings.length; i++) { - const mapping = mappings[i]; - if (mapping !== undefined) { - mappings[i] = mapping + prefixLength; - } - } - return mappings; - } -} exports.default = RootTransformer; diff --git a/node_modules/sucrase/dist/transformers/Transformer.js b/node_modules/sucrase/dist/transformers/Transformer.js deleted file mode 100644 index 991d363..0000000 --- a/node_modules/sucrase/dist/transformers/Transformer.js +++ /dev/null @@ -1,16 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); class Transformer { - // Return true if anything was processed, false otherwise. - - - getPrefixCode() { - return ""; - } - - getHoistedCode() { - return ""; - } - - getSuffixCode() { - return ""; - } -} exports.default = Transformer; diff --git a/node_modules/sucrase/dist/transformers/TypeScriptTransformer.js b/node_modules/sucrase/dist/transformers/TypeScriptTransformer.js deleted file mode 100644 index 9fe5c6e..0000000 --- a/node_modules/sucrase/dist/transformers/TypeScriptTransformer.js +++ /dev/null @@ -1,279 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _types = require('../parser/tokenizer/types'); - -var _isIdentifier = require('../util/isIdentifier'); var _isIdentifier2 = _interopRequireDefault(_isIdentifier); - -var _Transformer = require('./Transformer'); var _Transformer2 = _interopRequireDefault(_Transformer); - - class TypeScriptTransformer extends _Transformer2.default { - constructor( - rootTransformer, - tokens, - isImportsTransformEnabled, - ) { - super();this.rootTransformer = rootTransformer;this.tokens = tokens;this.isImportsTransformEnabled = isImportsTransformEnabled;; - } - - process() { - if ( - this.rootTransformer.processPossibleArrowParamEnd() || - this.rootTransformer.processPossibleAsyncArrowWithTypeParams() || - this.rootTransformer.processPossibleTypeRange() - ) { - return true; - } - if ( - this.tokens.matches1(_types.TokenType._public) || - this.tokens.matches1(_types.TokenType._protected) || - this.tokens.matches1(_types.TokenType._private) || - this.tokens.matches1(_types.TokenType._abstract) || - this.tokens.matches1(_types.TokenType._readonly) || - this.tokens.matches1(_types.TokenType._override) || - this.tokens.matches1(_types.TokenType.nonNullAssertion) - ) { - this.tokens.removeInitialToken(); - return true; - } - if (this.tokens.matches1(_types.TokenType._enum) || this.tokens.matches2(_types.TokenType._const, _types.TokenType._enum)) { - this.processEnum(); - return true; - } - if ( - this.tokens.matches2(_types.TokenType._export, _types.TokenType._enum) || - this.tokens.matches3(_types.TokenType._export, _types.TokenType._const, _types.TokenType._enum) - ) { - this.processEnum(true); - return true; - } - return false; - } - - processEnum(isExport = false) { - // We might have "export const enum", so just remove all relevant tokens. - this.tokens.removeInitialToken(); - while (this.tokens.matches1(_types.TokenType._const) || this.tokens.matches1(_types.TokenType._enum)) { - this.tokens.removeToken(); - } - const enumName = this.tokens.identifierName(); - this.tokens.removeToken(); - if (isExport && !this.isImportsTransformEnabled) { - this.tokens.appendCode("export "); - } - this.tokens.appendCode(`var ${enumName}; (function (${enumName})`); - this.tokens.copyExpectedToken(_types.TokenType.braceL); - this.processEnumBody(enumName); - this.tokens.copyExpectedToken(_types.TokenType.braceR); - if (isExport && this.isImportsTransformEnabled) { - this.tokens.appendCode(`)(${enumName} || (exports.${enumName} = ${enumName} = {}));`); - } else { - this.tokens.appendCode(`)(${enumName} || (${enumName} = {}));`); - } - } - - /** - * Transform an enum into equivalent JS. This has complexity in a few places: - * - TS allows string enums, numeric enums, and a mix of the two styles within an enum. - * - Enum keys are allowed to be referenced in later enum values. - * - Enum keys are allowed to be strings. - * - When enum values are omitted, they should follow an auto-increment behavior. - */ - processEnumBody(enumName) { - // Code that can be used to reference the previous enum member, or null if this is the first - // enum member. - let previousValueCode = null; - while (true) { - if (this.tokens.matches1(_types.TokenType.braceR)) { - break; - } - const {nameStringCode, variableName} = this.extractEnumKeyInfo(this.tokens.currentToken()); - this.tokens.removeInitialToken(); - - if ( - this.tokens.matches3(_types.TokenType.eq, _types.TokenType.string, _types.TokenType.comma) || - this.tokens.matches3(_types.TokenType.eq, _types.TokenType.string, _types.TokenType.braceR) - ) { - this.processStringLiteralEnumMember(enumName, nameStringCode, variableName); - } else if (this.tokens.matches1(_types.TokenType.eq)) { - this.processExplicitValueEnumMember(enumName, nameStringCode, variableName); - } else { - this.processImplicitValueEnumMember( - enumName, - nameStringCode, - variableName, - previousValueCode, - ); - } - if (this.tokens.matches1(_types.TokenType.comma)) { - this.tokens.removeToken(); - } - - if (variableName != null) { - previousValueCode = variableName; - } else { - previousValueCode = `${enumName}[${nameStringCode}]`; - } - } - } - - /** - * Detect name information about this enum key, which will be used to determine which code to emit - * and whether we should declare a variable as part of this declaration. - * - * Some cases to keep in mind: - * - Enum keys can be implicitly referenced later, e.g. `X = 1, Y = X`. In Sucrase, we implement - * this by declaring a variable `X` so that later expressions can use it. - * - In addition to the usual identifier key syntax, enum keys are allowed to be string literals, - * e.g. `"hello world" = 3,`. Template literal syntax is NOT allowed. - * - Even if the enum key is defined as a string literal, it may still be referenced by identifier - * later, e.g. `"X" = 1, Y = X`. That means that we need to detect whether or not a string - * literal is identifier-like and emit a variable if so, even if the declaration did not use an - * identifier. - * - Reserved keywords like `break` are valid enum keys, but are not valid to be referenced later - * and would be a syntax error if we emitted a variable, so we need to skip the variable - * declaration in those cases. - * - * The variableName return value captures these nuances: if non-null, we can and must emit a - * variable declaration, and if null, we can't and shouldn't. - */ - extractEnumKeyInfo(nameToken) { - if (nameToken.type === _types.TokenType.name) { - const name = this.tokens.identifierNameForToken(nameToken); - return { - nameStringCode: `"${name}"`, - variableName: _isIdentifier2.default.call(void 0, name) ? name : null, - }; - } else if (nameToken.type === _types.TokenType.string) { - const name = this.tokens.stringValueForToken(nameToken); - return { - nameStringCode: this.tokens.code.slice(nameToken.start, nameToken.end), - variableName: _isIdentifier2.default.call(void 0, name) ? name : null, - }; - } else { - throw new Error("Expected name or string at beginning of enum element."); - } - } - - /** - * Handle an enum member where the RHS is just a string literal (not omitted, not a number, and - * not a complex expression). This is the typical form for TS string enums, and in this case, we - * do *not* create a reverse mapping. - * - * This is called after deleting the key token, when the token processor is at the equals sign. - * - * Example 1: - * someKey = "some value" - * -> - * const someKey = "some value"; MyEnum["someKey"] = someKey; - * - * Example 2: - * "some key" = "some value" - * -> - * MyEnum["some key"] = "some value"; - */ - processStringLiteralEnumMember( - enumName, - nameStringCode, - variableName, - ) { - if (variableName != null) { - this.tokens.appendCode(`const ${variableName}`); - // = - this.tokens.copyToken(); - // value string - this.tokens.copyToken(); - this.tokens.appendCode(`; ${enumName}[${nameStringCode}] = ${variableName};`); - } else { - this.tokens.appendCode(`${enumName}[${nameStringCode}]`); - // = - this.tokens.copyToken(); - // value string - this.tokens.copyToken(); - this.tokens.appendCode(";"); - } - } - - /** - * Handle an enum member initialized with an expression on the right-hand side (other than a - * string literal). In these cases, we should transform the expression and emit code that sets up - * a reverse mapping. - * - * The TypeScript implementation of this operation distinguishes between expressions that can be - * "constant folded" at compile time (i.e. consist of number literals and simple math operations - * on those numbers) and ones that are dynamic. For constant expressions, it emits the resolved - * numeric value, and auto-incrementing is only allowed in that case. Evaluating expressions at - * compile time would add significant complexity to Sucrase, so Sucrase instead leaves the - * expression as-is, and will later emit something like `MyEnum["previousKey"] + 1` to implement - * auto-incrementing. - * - * This is called after deleting the key token, when the token processor is at the equals sign. - * - * Example 1: - * someKey = 1 + 1 - * -> - * const someKey = 1 + 1; MyEnum[MyEnum["someKey"] = someKey] = "someKey"; - * - * Example 2: - * "some key" = 1 + 1 - * -> - * MyEnum[MyEnum["some key"] = 1 + 1] = "some key"; - */ - processExplicitValueEnumMember( - enumName, - nameStringCode, - variableName, - ) { - const rhsEndIndex = this.tokens.currentToken().rhsEndIndex; - if (rhsEndIndex == null) { - throw new Error("Expected rhsEndIndex on enum assign."); - } - - if (variableName != null) { - this.tokens.appendCode(`const ${variableName}`); - this.tokens.copyToken(); - while (this.tokens.currentIndex() < rhsEndIndex) { - this.rootTransformer.processToken(); - } - this.tokens.appendCode( - `; ${enumName}[${enumName}[${nameStringCode}] = ${variableName}] = ${nameStringCode};`, - ); - } else { - this.tokens.appendCode(`${enumName}[${enumName}[${nameStringCode}]`); - this.tokens.copyToken(); - while (this.tokens.currentIndex() < rhsEndIndex) { - this.rootTransformer.processToken(); - } - this.tokens.appendCode(`] = ${nameStringCode};`); - } - } - - /** - * Handle an enum member with no right-hand side expression. In this case, the value is the - * previous value plus 1, or 0 if there was no previous value. We should also always emit a - * reverse mapping. - * - * Example 1: - * someKey2 - * -> - * const someKey2 = someKey1 + 1; MyEnum[MyEnum["someKey2"] = someKey2] = "someKey2"; - * - * Example 2: - * "some key 2" - * -> - * MyEnum[MyEnum["some key 2"] = someKey1 + 1] = "some key 2"; - */ - processImplicitValueEnumMember( - enumName, - nameStringCode, - variableName, - previousValueCode, - ) { - let valueCode = previousValueCode != null ? `${previousValueCode} + 1` : "0"; - if (variableName != null) { - this.tokens.appendCode(`const ${variableName} = ${valueCode}; `); - valueCode = variableName; - } - this.tokens.appendCode( - `${enumName}[${enumName}[${nameStringCode}] = ${valueCode}] = ${nameStringCode};`, - ); - } -} exports.default = TypeScriptTransformer; diff --git a/node_modules/sucrase/dist/types/CJSImportProcessor.d.ts b/node_modules/sucrase/dist/types/CJSImportProcessor.d.ts deleted file mode 100644 index 265db0e..0000000 --- a/node_modules/sucrase/dist/types/CJSImportProcessor.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -import type { HelperManager } from "./HelperManager"; -import type { Options } from "./index"; -import type NameManager from "./NameManager"; -import type TokenProcessor from "./TokenProcessor"; -/** - * Class responsible for preprocessing and bookkeeping import and export declarations within the - * file. - * - * TypeScript uses a simpler mechanism that does not use functions like interopRequireDefault and - * interopRequireWildcard, so we also allow that mode for compatibility. - */ -export default class CJSImportProcessor { - readonly nameManager: NameManager; - readonly tokens: TokenProcessor; - readonly enableLegacyTypeScriptModuleInterop: boolean; - readonly options: Options; - readonly isTypeScriptTransformEnabled: boolean; - readonly keepUnusedImports: boolean; - readonly helperManager: HelperManager; - private nonTypeIdentifiers; - private importInfoByPath; - private importsToReplace; - private identifierReplacements; - private exportBindingsByLocalName; - constructor(nameManager: NameManager, tokens: TokenProcessor, enableLegacyTypeScriptModuleInterop: boolean, options: Options, isTypeScriptTransformEnabled: boolean, keepUnusedImports: boolean, helperManager: HelperManager); - preprocessTokens(): void; - /** - * In TypeScript, import statements that only import types should be removed. - * This includes `import {} from 'foo';`, but not `import 'foo';`. - */ - pruneTypeOnlyImports(): void; - shouldAutomaticallyElideImportedName(name: string): boolean; - private generateImportReplacements; - getFreeIdentifierForPath(path: string): string; - private preprocessImportAtIndex; - private preprocessExportAtIndex; - private preprocessVarExportAtIndex; - /** - * Walk this export statement just in case it's an export...from statement. - * If it is, combine it into the import info for that path. Otherwise, just - * bail out; it'll be handled later. - */ - private preprocessNamedExportAtIndex; - private preprocessExportStarAtIndex; - private getNamedImports; - /** - * Get a mutable import info object for this path, creating one if it doesn't - * exist yet. - */ - private getImportInfo; - private addExportBinding; - /** - * Return the code to use for the import for this path, or the empty string if - * the code has already been "claimed" by a previous import. - */ - claimImportCode(importPath: string): string; - getIdentifierReplacement(identifierName: string): string | null; - /** - * Return a string like `exports.foo = exports.bar`. - */ - resolveExportBinding(assignedName: string): string | null; - /** - * Return all imported/exported names where we might be interested in whether usages of those - * names are shadowed. - */ - getGlobalNames(): Set; -} diff --git a/node_modules/sucrase/dist/types/HelperManager.d.ts b/node_modules/sucrase/dist/types/HelperManager.d.ts deleted file mode 100644 index 8ec724d..0000000 --- a/node_modules/sucrase/dist/types/HelperManager.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type NameManager from "./NameManager"; -declare const HELPERS: { - [name: string]: string; -}; -export declare class HelperManager { - readonly nameManager: NameManager; - helperNames: { - [baseName in keyof typeof HELPERS]?: string; - }; - createRequireName: string | null; - constructor(nameManager: NameManager); - getHelperName(baseName: keyof typeof HELPERS): string; - emitHelpers(): string; -} -export {}; diff --git a/node_modules/sucrase/dist/types/NameManager.d.ts b/node_modules/sucrase/dist/types/NameManager.d.ts deleted file mode 100644 index 7485bf0..0000000 --- a/node_modules/sucrase/dist/types/NameManager.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Token } from "./parser/tokenizer"; -export default class NameManager { - private readonly usedNames; - constructor(code: string, tokens: Array); - claimFreeName(name: string): string; - findFreeName(name: string): string; -} diff --git a/node_modules/sucrase/dist/types/Options-gen-types.d.ts b/node_modules/sucrase/dist/types/Options-gen-types.d.ts deleted file mode 100644 index 22996e8..0000000 --- a/node_modules/sucrase/dist/types/Options-gen-types.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This module was automatically generated by `ts-interface-builder` - */ -import * as t from "ts-interface-checker"; -export declare const Transform: t.TUnion; -export declare const SourceMapOptions: t.TIface; -export declare const Options: t.TIface; -declare const exportedTypeSuite: t.ITypeSuite; -export default exportedTypeSuite; diff --git a/node_modules/sucrase/dist/types/Options.d.ts b/node_modules/sucrase/dist/types/Options.d.ts deleted file mode 100644 index c182ed9..0000000 --- a/node_modules/sucrase/dist/types/Options.d.ts +++ /dev/null @@ -1,90 +0,0 @@ -export type Transform = "jsx" | "typescript" | "flow" | "imports" | "react-hot-loader" | "jest"; -export interface SourceMapOptions { - /** - * The name to use in the "file" field of the source map. This should be the name of the compiled - * file. - */ - compiledFilename: string; -} -export interface Options { - /** - * Unordered array of transform names describing both the allowed syntax - * (where applicable) and the transformation behavior. - */ - transforms: Array; - /** - * Opts out of all ES syntax transformations: optional chaining, nullish - * coalescing, class fields, numeric separators, optional catch binding. - */ - disableESTransforms?: boolean; - /** - * Transformation mode for the JSX transform. - * - "classic" refers to the original behavior using `React.createElement`. - * - "automatic" refers to the transform behavior released with React 17, - * where the `jsx` function (or a variation) is automatically imported. - * - "preserve" leaves the JSX as-is. - * - * Default value: "classic". - */ - jsxRuntime?: "classic" | "automatic" | "preserve"; - /** - * Compile code for production use. Currently only applies to the JSX - * transform. - */ - production?: boolean; - /** - * If specified, import path prefix to use in place of "react" when compiling - * JSX with the automatic runtime. - */ - jsxImportSource?: string; - /** - * If specified, function name to use in place of React.createClass when - * compiling JSX with the classic runtime. - */ - jsxPragma?: string; - /** - * If specified, function name to use in place of React.Fragment when - * compiling JSX with the classic runtime. - */ - jsxFragmentPragma?: string; - /** - * If specified, disable automatic removal of type-only import and export - * statements and names. Only statements and names that explicitly use the - * `type` keyword are removed. - */ - keepUnusedImports?: boolean; - /** - * If specified, the imports transform does not attempt to change dynamic - * import() expressions into require() calls. - */ - preserveDynamicImport?: boolean; - /** - * Only relevant when targeting ESM (i.e. when the imports transform is *not* - * specified). This flag changes the behavior of TS require imports: - * - * import Foo = require("foo"); - * - * to import createRequire, create a require function, and use that function. - * This is the TS behavior with module: nodenext and makes it easier for the - * same code to target ESM and CJS. - */ - injectCreateRequireForImportRequire?: boolean; - /** - * If true, replicate the import behavior of TypeScript's esModuleInterop: false. - */ - enableLegacyTypeScriptModuleInterop?: boolean; - /** - * If true, replicate the import behavior Babel 5 and babel-plugin-add-module-exports. - */ - enableLegacyBabel5ModuleInterop?: boolean; - /** - * If specified, we also return a RawSourceMap object alongside the code. - * filePath must be specified if this option is enabled. - */ - sourceMapOptions?: SourceMapOptions; - /** - * File path to use in error messages, React display names, and source maps. - */ - filePath?: string; -} -export declare function validateOptions(options: Options): void; diff --git a/node_modules/sucrase/dist/types/TokenProcessor.d.ts b/node_modules/sucrase/dist/types/TokenProcessor.d.ts deleted file mode 100644 index 9492aed..0000000 --- a/node_modules/sucrase/dist/types/TokenProcessor.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -import type { HelperManager } from "./HelperManager"; -import type { Token } from "./parser/tokenizer"; -import type { ContextualKeyword } from "./parser/tokenizer/keywords"; -import { type TokenType } from "./parser/tokenizer/types"; -export interface TokenProcessorSnapshot { - resultCode: string; - tokenIndex: number; -} -export interface TokenProcessorResult { - code: string; - mappings: Array; -} -export default class TokenProcessor { - readonly code: string; - readonly tokens: Array; - readonly isFlowEnabled: boolean; - readonly disableESTransforms: boolean; - readonly helperManager: HelperManager; - private resultCode; - private resultMappings; - private tokenIndex; - constructor(code: string, tokens: Array, isFlowEnabled: boolean, disableESTransforms: boolean, helperManager: HelperManager); - /** - * Snapshot the token state in a way that can be restored later, useful for - * things like lookahead. - * - * resultMappings do not need to be copied since in all use cases, they will - * be overwritten anyway after restore. - */ - snapshot(): TokenProcessorSnapshot; - restoreToSnapshot(snapshot: TokenProcessorSnapshot): void; - /** - * Remove and return the code generated since the snapshot, leaving the - * current token position in-place. Unlike most TokenProcessor operations, - * this operation can result in input/output line number mismatches because - * the removed code may contain newlines, so this operation should be used - * sparingly. - */ - dangerouslyGetAndRemoveCodeSinceSnapshot(snapshot: TokenProcessorSnapshot): string; - reset(): void; - matchesContextualAtIndex(index: number, contextualKeyword: ContextualKeyword): boolean; - identifierNameAtIndex(index: number): string; - identifierNameAtRelativeIndex(relativeIndex: number): string; - identifierName(): string; - identifierNameForToken(token: Token): string; - rawCodeForToken(token: Token): string; - stringValueAtIndex(index: number): string; - stringValue(): string; - stringValueForToken(token: Token): string; - matches1AtIndex(index: number, t1: TokenType): boolean; - matches2AtIndex(index: number, t1: TokenType, t2: TokenType): boolean; - matches3AtIndex(index: number, t1: TokenType, t2: TokenType, t3: TokenType): boolean; - matches1(t1: TokenType): boolean; - matches2(t1: TokenType, t2: TokenType): boolean; - matches3(t1: TokenType, t2: TokenType, t3: TokenType): boolean; - matches4(t1: TokenType, t2: TokenType, t3: TokenType, t4: TokenType): boolean; - matches5(t1: TokenType, t2: TokenType, t3: TokenType, t4: TokenType, t5: TokenType): boolean; - matchesContextual(contextualKeyword: ContextualKeyword): boolean; - matchesContextIdAndLabel(type: TokenType, contextId: number): boolean; - previousWhitespaceAndComments(): string; - replaceToken(newCode: string): void; - replaceTokenTrimmingLeftWhitespace(newCode: string): void; - removeInitialToken(): void; - removeToken(): void; - /** - * Remove all code until the next }, accounting for balanced braces. - */ - removeBalancedCode(): void; - copyExpectedToken(tokenType: TokenType): void; - copyToken(): void; - copyTokenWithPrefix(prefix: string): void; - private appendTokenPrefix; - private appendTokenSuffix; - appendCode(code: string): void; - currentToken(): Token; - currentTokenCode(): string; - tokenAtRelativeIndex(relativeIndex: number): Token; - currentIndex(): number; - /** - * Move to the next token. Only suitable in preprocessing steps. When - * generating new code, you should use copyToken or removeToken. - */ - nextToken(): void; - previousToken(): void; - finish(): TokenProcessorResult; - isAtEnd(): boolean; -} diff --git a/node_modules/sucrase/dist/types/cli.d.ts b/node_modules/sucrase/dist/types/cli.d.ts deleted file mode 100644 index 238c75f..0000000 --- a/node_modules/sucrase/dist/types/cli.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function run(): void; diff --git a/node_modules/sucrase/dist/types/computeSourceMap.d.ts b/node_modules/sucrase/dist/types/computeSourceMap.d.ts deleted file mode 100644 index 1277847..0000000 --- a/node_modules/sucrase/dist/types/computeSourceMap.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { SourceMapOptions } from "./index"; -import type { Token } from "./parser/tokenizer"; -import type { RootTransformerResult } from "./transformers/RootTransformer"; -export interface RawSourceMap { - version: number; - file: string; - sources: Array; - sourceRoot?: string; - sourcesContent?: Array; - mappings: string; - names: Array; -} -/** - * Generate a source map indicating that each line maps directly to the original line, - * with the tokens in their new positions. - */ -export default function computeSourceMap({ code: generatedCode, mappings: rawMappings }: RootTransformerResult, filePath: string, options: SourceMapOptions, source: string, tokens: Array): RawSourceMap; diff --git a/node_modules/sucrase/dist/types/identifyShadowedGlobals.d.ts b/node_modules/sucrase/dist/types/identifyShadowedGlobals.d.ts deleted file mode 100644 index a9222d8..0000000 --- a/node_modules/sucrase/dist/types/identifyShadowedGlobals.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Scope } from "./parser/tokenizer/state"; -import type TokenProcessor from "./TokenProcessor"; -/** - * Traverse the given tokens and modify them if necessary to indicate that some names shadow global - * variables. - */ -export default function identifyShadowedGlobals(tokens: TokenProcessor, scopes: Array, globalNames: Set): void; -/** - * We can do a fast up-front check to see if there are any declarations to global names. If not, - * then there's no point in computing scope assignments. - */ -export declare function hasShadowedGlobals(tokens: TokenProcessor, globalNames: Set): boolean; diff --git a/node_modules/sucrase/dist/types/index.d.ts b/node_modules/sucrase/dist/types/index.d.ts deleted file mode 100644 index bfc4a9c..0000000 --- a/node_modules/sucrase/dist/types/index.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -import CJSImportProcessor from "./CJSImportProcessor"; -import { type RawSourceMap } from "./computeSourceMap"; -import { HelperManager } from "./HelperManager"; -import NameManager from "./NameManager"; -import type { Options, SourceMapOptions, Transform } from "./Options"; -import type { Scope } from "./parser/tokenizer/state"; -import TokenProcessor from "./TokenProcessor"; -export interface TransformResult { - code: string; - sourceMap?: RawSourceMap; -} -export interface SucraseContext { - tokenProcessor: TokenProcessor; - scopes: Array; - nameManager: NameManager; - importProcessor: CJSImportProcessor | null; - helperManager: HelperManager; -} -export type { Options, SourceMapOptions, Transform }; -export declare function getVersion(): string; -export declare function transform(code: string, options: Options): TransformResult; -/** - * Return a string representation of the sucrase tokens, mostly useful for - * diagnostic purposes. - */ -export declare function getFormattedTokens(code: string, options: Options): string; diff --git a/node_modules/sucrase/dist/types/parser/index.d.ts b/node_modules/sucrase/dist/types/parser/index.d.ts deleted file mode 100644 index 8d082c0..0000000 --- a/node_modules/sucrase/dist/types/parser/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Token } from "./tokenizer/index"; -import type { Scope } from "./tokenizer/state"; -export declare class File { - tokens: Array; - scopes: Array; - constructor(tokens: Array, scopes: Array); -} -export declare function parse(input: string, isJSXEnabled: boolean, isTypeScriptEnabled: boolean, isFlowEnabled: boolean): File; diff --git a/node_modules/sucrase/dist/types/parser/plugins/flow.d.ts b/node_modules/sucrase/dist/types/parser/plugins/flow.d.ts deleted file mode 100644 index fe83776..0000000 --- a/node_modules/sucrase/dist/types/parser/plugins/flow.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ContextualKeyword } from "../tokenizer/keywords"; -import { type StopState } from "../traverser/expression"; -export declare function flowParseTypeParameterDeclaration(): void; -export declare function flowParseTypeAnnotation(): void; -export declare function flowParseVariance(): void; -export declare function flowParseFunctionBodyAndFinish(funcContextId: number): void; -export declare function flowParseSubscript(startTokenIndex: number, noCalls: boolean, stopState: StopState): void; -export declare function flowStartParseNewArguments(): void; -export declare function flowTryParseStatement(): boolean; -export declare function flowTryParseExportDefaultExpression(): boolean; -export declare function flowParseIdentifierStatement(contextualKeyword: ContextualKeyword): void; -export declare function flowShouldParseExportDeclaration(): boolean; -export declare function flowShouldDisallowExportDefaultSpecifier(): boolean; -export declare function flowParseExportDeclaration(): void; -export declare function flowShouldParseExportStar(): boolean; -export declare function flowParseExportStar(): void; -export declare function flowAfterParseClassSuper(hasSuper: boolean): void; -export declare function flowStartParseObjPropValue(): void; -export declare function flowParseAssignableListItemTypes(): void; -export declare function flowStartParseImportSpecifiers(): void; -export declare function flowParseImportSpecifier(): void; -export declare function flowStartParseFunctionParams(): void; -export declare function flowAfterParseVarHead(): void; -export declare function flowStartParseAsyncArrowFromCallExpression(): void; -export declare function flowParseMaybeAssign(noIn: boolean, isWithinParens: boolean): boolean; -export declare function flowParseArrow(): boolean; -export declare function flowParseSubscripts(startTokenIndex: number, noCalls?: boolean): void; diff --git a/node_modules/sucrase/dist/types/parser/plugins/jsx/index.d.ts b/node_modules/sucrase/dist/types/parser/plugins/jsx/index.d.ts deleted file mode 100644 index 2600d0f..0000000 --- a/node_modules/sucrase/dist/types/parser/plugins/jsx/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function jsxParseElement(): void; -export declare function nextJSXTagToken(): void; diff --git a/node_modules/sucrase/dist/types/parser/plugins/jsx/xhtml.d.ts b/node_modules/sucrase/dist/types/parser/plugins/jsx/xhtml.d.ts deleted file mode 100644 index 1190776..0000000 --- a/node_modules/sucrase/dist/types/parser/plugins/jsx/xhtml.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: Map; -export default _default; diff --git a/node_modules/sucrase/dist/types/parser/plugins/types.d.ts b/node_modules/sucrase/dist/types/parser/plugins/types.d.ts deleted file mode 100644 index fce6440..0000000 --- a/node_modules/sucrase/dist/types/parser/plugins/types.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Common parser code for TypeScript and Flow. - */ -export declare function typedParseConditional(noIn: boolean): void; -export declare function typedParseParenItem(): void; diff --git a/node_modules/sucrase/dist/types/parser/plugins/typescript.d.ts b/node_modules/sucrase/dist/types/parser/plugins/typescript.d.ts deleted file mode 100644 index adf9a13..0000000 --- a/node_modules/sucrase/dist/types/parser/plugins/typescript.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -import { ContextualKeyword } from "../tokenizer/keywords"; -import { type StopState } from "../traverser/expression"; -export declare function tsParseModifiers(allowedModifiers: Array): void; -/** Parses a modifier matching one the given modifier names. */ -export declare function tsParseModifier(allowedModifiers: Array): ContextualKeyword | null; -export declare function tsTryParseTypeParameters(): void; -export declare function tsTryParseTypeAnnotation(): void; -export declare function tsParseTypeAnnotation(): void; -export declare function tsParseType(): void; -export declare function tsParseNonConditionalType(): void; -export declare function tsParseTypeAssertion(): void; -export declare function tsTryParseJSXTypeArgument(): void; -export declare function tsParseImportEqualsDeclaration(): void; -export declare function tsIsDeclarationStart(): boolean; -export declare function tsParseFunctionBodyAndFinish(functionStart: number, funcContextId: number): void; -export declare function tsParseSubscript(startTokenIndex: number, noCalls: boolean, stopState: StopState): void; -export declare function tsTryParseExport(): boolean; -/** - * Parse a TS import specifier, which may be prefixed with "type" and may be of - * the form `foo as bar`. - * - * The number of identifier-like tokens we see happens to be enough to uniquely - * identify the form, so simply count the number of identifiers rather than - * matching the words `type` or `as`. This is particularly important because - * `type` and `as` could each actually be plain identifiers rather than - * keywords. - */ -export declare function tsParseImportSpecifier(): void; -/** - * Just like named import specifiers, export specifiers can have from 1 to 4 - * tokens, inclusive, and the number of tokens determines the role of each token. - */ -export declare function tsParseExportSpecifier(): void; -export declare function tsTryParseExportDefaultExpression(): boolean; -export declare function tsTryParseStatementContent(): boolean; -export declare function tsTryParseClassMemberWithIsStatic(isStatic: boolean): boolean; -export declare function tsParseIdentifierStatement(contextualKeyword: ContextualKeyword): void; -export declare function tsParseExportDeclaration(): void; -export declare function tsAfterParseClassSuper(hasSuper: boolean): void; -export declare function tsStartParseObjPropValue(): void; -export declare function tsStartParseFunctionParams(): void; -export declare function tsAfterParseVarHead(): void; -export declare function tsStartParseAsyncArrowFromCallExpression(): void; -export declare function tsParseMaybeAssign(noIn: boolean, isWithinParens: boolean): boolean; -export declare function tsParseMaybeAssignWithJSX(noIn: boolean, isWithinParens: boolean): boolean; -export declare function tsParseMaybeAssignWithoutJSX(noIn: boolean, isWithinParens: boolean): boolean; -export declare function tsParseArrow(): boolean; -export declare function tsParseAssignableListItemTypes(): void; -export declare function tsParseMaybeDecoratorArguments(): void; diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/index.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/index.d.ts deleted file mode 100644 index 45cd799..0000000 --- a/node_modules/sucrase/dist/types/parser/tokenizer/index.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { ContextualKeyword } from "./keywords"; -import { type TokenType } from "./types"; -export declare enum IdentifierRole { - Access = 0, - ExportAccess = 1, - TopLevelDeclaration = 2, - FunctionScopedDeclaration = 3, - BlockScopedDeclaration = 4, - ObjectShorthandTopLevelDeclaration = 5, - ObjectShorthandFunctionScopedDeclaration = 6, - ObjectShorthandBlockScopedDeclaration = 7, - ObjectShorthand = 8, - ImportDeclaration = 9, - ObjectKey = 10, - ImportAccess = 11 -} -/** - * Extra information on jsxTagStart tokens, used to determine which of the three - * jsx functions are called in the automatic transform. - */ -export declare enum JSXRole { - NoChildren = 0, - OneChild = 1, - StaticChildren = 2, - KeyAfterPropSpread = 3 -} -export declare function isDeclaration(token: Token): boolean; -export declare function isNonTopLevelDeclaration(token: Token): boolean; -export declare function isTopLevelDeclaration(token: Token): boolean; -export declare function isBlockScopedDeclaration(token: Token): boolean; -export declare function isFunctionScopedDeclaration(token: Token): boolean; -export declare function isObjectShorthandDeclaration(token: Token): boolean; -export declare class Token { - constructor(); - type: TokenType; - contextualKeyword: ContextualKeyword; - start: number; - end: number; - scopeDepth: number; - isType: boolean; - identifierRole: IdentifierRole | null; - jsxRole: JSXRole | null; - shadowsGlobal: boolean; - isAsyncOperation: boolean; - contextId: number | null; - rhsEndIndex: number | null; - isExpression: boolean; - numNullishCoalesceStarts: number; - numNullishCoalesceEnds: number; - isOptionalChainStart: boolean; - isOptionalChainEnd: boolean; - subscriptStartIndex: number | null; - nullishStartIndex: number | null; -} -export declare function next(): void; -export declare function nextTemplateToken(): void; -export declare function retokenizeSlashAsRegex(): void; -export declare function pushTypeContext(existingTokensInType: number): boolean; -export declare function popTypeContext(oldIsType: boolean): void; -export declare function eat(type: TokenType): boolean; -export declare function eatTypeToken(tokenType: TokenType): void; -export declare function match(type: TokenType): boolean; -export declare function lookaheadType(): TokenType; -export declare class TypeAndKeyword { - type: TokenType; - contextualKeyword: ContextualKeyword; - constructor(type: TokenType, contextualKeyword: ContextualKeyword); -} -export declare function lookaheadTypeAndKeyword(): TypeAndKeyword; -export declare function nextTokenStart(): number; -export declare function nextTokenStartSince(pos: number): number; -export declare function lookaheadCharCode(): number; -export declare function nextToken(): void; -export declare function skipLineComment(startSkip: number): void; -export declare function skipSpace(): void; -export declare function finishToken(type: TokenType, contextualKeyword?: ContextualKeyword): void; -/** - * Reinterpret a possible > token when transitioning from a type to a non-type - * context. - * - * This comes up in two situations where >= needs to be treated as one token: - * - After an `as` expression, like in the code `a as T >= 1`. - * - In a type argument in an expression context, e.g. `f(a < b, c >= d)`, we - * need to see the token as >= so that we get an error and backtrack to - * normal expression parsing. - * - * Other situations require >= to be seen as two tokens, e.g. - * `const x: Array=[];`, so it's important to treat > as its own token in - * typical type parsing situations. - */ -export declare function rescan_gt(): void; -export declare function getTokenFromCode(code: number): void; -export declare function skipWord(): void; diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/keywords.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/keywords.d.ts deleted file mode 100644 index e0e7cd0..0000000 --- a/node_modules/sucrase/dist/types/parser/tokenizer/keywords.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -export declare enum ContextualKeyword { - NONE = 0, - _abstract = 1, - _accessor = 2, - _as = 3, - _assert = 4, - _asserts = 5, - _async = 6, - _await = 7, - _checks = 8, - _constructor = 9, - _declare = 10, - _enum = 11, - _exports = 12, - _from = 13, - _get = 14, - _global = 15, - _implements = 16, - _infer = 17, - _interface = 18, - _is = 19, - _keyof = 20, - _mixins = 21, - _module = 22, - _namespace = 23, - _of = 24, - _opaque = 25, - _out = 26, - _override = 27, - _private = 28, - _protected = 29, - _proto = 30, - _public = 31, - _readonly = 32, - _require = 33, - _satisfies = 34, - _set = 35, - _static = 36, - _symbol = 37, - _type = 38, - _unique = 39, - _using = 40 -} diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/readWord.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/readWord.d.ts deleted file mode 100644 index 6fdfe90..0000000 --- a/node_modules/sucrase/dist/types/parser/tokenizer/readWord.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Read an identifier, producing either a name token or matching on one of the existing keywords. - * For performance, we pre-generate big decision tree that we traverse. Each node represents a - * prefix and has 27 values, where the first value is the token or contextual token, if any (-1 if - * not), and the other 26 values are the transitions to other nodes, or -1 to stop. - */ -export default function readWord(): void; diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/readWordTree.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/readWordTree.d.ts deleted file mode 100644 index f6fb9b2..0000000 --- a/node_modules/sucrase/dist/types/parser/tokenizer/readWordTree.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const READ_WORD_TREE: Int32Array; diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/state.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/state.d.ts deleted file mode 100644 index e010c18..0000000 --- a/node_modules/sucrase/dist/types/parser/tokenizer/state.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import type { Token } from "./index"; -import { ContextualKeyword } from "./keywords"; -import { type TokenType } from "./types"; -export declare class Scope { - startTokenIndex: number; - endTokenIndex: number; - isFunctionScope: boolean; - constructor(startTokenIndex: number, endTokenIndex: number, isFunctionScope: boolean); -} -export declare class StateSnapshot { - readonly potentialArrowAt: number; - readonly noAnonFunctionType: boolean; - readonly inDisallowConditionalTypesContext: boolean; - readonly tokensLength: number; - readonly scopesLength: number; - readonly pos: number; - readonly type: TokenType; - readonly contextualKeyword: ContextualKeyword; - readonly start: number; - readonly end: number; - readonly isType: boolean; - readonly scopeDepth: number; - readonly error: Error | null; - constructor(potentialArrowAt: number, noAnonFunctionType: boolean, inDisallowConditionalTypesContext: boolean, tokensLength: number, scopesLength: number, pos: number, type: TokenType, contextualKeyword: ContextualKeyword, start: number, end: number, isType: boolean, scopeDepth: number, error: Error | null); -} -export default class State { - potentialArrowAt: number; - noAnonFunctionType: boolean; - inDisallowConditionalTypesContext: boolean; - tokens: Array; - scopes: Array; - pos: number; - type: TokenType; - contextualKeyword: ContextualKeyword; - start: number; - end: number; - isType: boolean; - scopeDepth: number; - /** - * If the parser is in an error state, then the token is always tt.eof and all functions can - * keep executing but should be written so they don't get into an infinite loop in this situation. - * - * This approach, combined with the ability to snapshot and restore state, allows us to implement - * backtracking without exceptions and without needing to explicitly propagate error states - * everywhere. - */ - error: Error | null; - snapshot(): StateSnapshot; - restoreFromSnapshot(snapshot: StateSnapshot): void; -} diff --git a/node_modules/sucrase/dist/types/parser/tokenizer/types.d.ts b/node_modules/sucrase/dist/types/parser/tokenizer/types.d.ts deleted file mode 100644 index d778d5d..0000000 --- a/node_modules/sucrase/dist/types/parser/tokenizer/types.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Enum of all token types, with bit fields to signify meaningful properties. - */ -export declare enum TokenType { - PRECEDENCE_MASK = 15, - IS_KEYWORD = 16, - IS_ASSIGN = 32, - IS_RIGHT_ASSOCIATIVE = 64, - IS_PREFIX = 128, - IS_POSTFIX = 256, - IS_EXPRESSION_START = 512, - num = 512, - bigint = 1536, - decimal = 2560, - regexp = 3584, - string = 4608, - name = 5632, - eof = 6144, - bracketL = 7680, - bracketR = 8192, - braceL = 9728, - braceBarL = 10752, - braceR = 11264, - braceBarR = 12288, - parenL = 13824, - parenR = 14336, - comma = 15360, - semi = 16384, - colon = 17408, - doubleColon = 18432, - dot = 19456, - question = 20480, - questionDot = 21504, - arrow = 22528, - template = 23552, - ellipsis = 24576, - backQuote = 25600, - dollarBraceL = 27136, - at = 27648, - hash = 29184, - eq = 29728, - assign = 30752, - preIncDec = 32640, - postIncDec = 33664, - bang = 34432, - tilde = 35456, - pipeline = 35841, - nullishCoalescing = 36866, - logicalOR = 37890, - logicalAND = 38915, - bitwiseOR = 39940, - bitwiseXOR = 40965, - bitwiseAND = 41990, - equality = 43015, - lessThan = 44040, - greaterThan = 45064, - relationalOrEqual = 46088, - bitShiftL = 47113, - bitShiftR = 48137, - plus = 49802, - minus = 50826, - modulo = 51723, - star = 52235, - slash = 53259, - exponent = 54348, - jsxName = 55296, - jsxText = 56320, - jsxEmptyText = 57344, - jsxTagStart = 58880, - jsxTagEnd = 59392, - typeParameterStart = 60928, - nonNullAssertion = 61440, - _break = 62480, - _case = 63504, - _catch = 64528, - _continue = 65552, - _debugger = 66576, - _default = 67600, - _do = 68624, - _else = 69648, - _finally = 70672, - _for = 71696, - _function = 73232, - _if = 73744, - _return = 74768, - _switch = 75792, - _throw = 77456, - _try = 77840, - _var = 78864, - _let = 79888, - _const = 80912, - _while = 81936, - _with = 82960, - _new = 84496, - _this = 85520, - _super = 86544, - _class = 87568, - _extends = 88080, - _export = 89104, - _import = 90640, - _yield = 91664, - _null = 92688, - _true = 93712, - _false = 94736, - _in = 95256, - _instanceof = 96280, - _typeof = 97936, - _void = 98960, - _delete = 99984, - _async = 100880, - _get = 101904, - _set = 102928, - _declare = 103952, - _readonly = 104976, - _abstract = 106000, - _static = 107024, - _public = 107536, - _private = 108560, - _protected = 109584, - _override = 110608, - _as = 112144, - _enum = 113168, - _type = 114192, - _implements = 115216 -} -export declare function formatTokenType(tokenType: TokenType): string; diff --git a/node_modules/sucrase/dist/types/parser/traverser/base.d.ts b/node_modules/sucrase/dist/types/parser/traverser/base.d.ts deleted file mode 100644 index e15e892..0000000 --- a/node_modules/sucrase/dist/types/parser/traverser/base.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import State from "../tokenizer/state"; -export declare let isJSXEnabled: boolean; -export declare let isTypeScriptEnabled: boolean; -export declare let isFlowEnabled: boolean; -export declare let state: State; -export declare let input: string; -export declare let nextContextId: number; -export declare function getNextContextId(): number; -export declare function augmentError(error: any): any; -export declare class Loc { - line: number; - column: number; - constructor(line: number, column: number); -} -export declare function locationForIndex(pos: number): Loc; -export declare function initParser(inputCode: string, isJSXEnabledArg: boolean, isTypeScriptEnabledArg: boolean, isFlowEnabledArg: boolean): void; diff --git a/node_modules/sucrase/dist/types/parser/traverser/expression.d.ts b/node_modules/sucrase/dist/types/parser/traverser/expression.d.ts deleted file mode 100644 index 52e29fb..0000000 --- a/node_modules/sucrase/dist/types/parser/traverser/expression.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -export declare class StopState { - stop: boolean; - constructor(stop: boolean); -} -export declare function parseExpression(noIn?: boolean): void; -/** - * noIn is used when parsing a for loop so that we don't interpret a following "in" as the binary - * operatior. - * isWithinParens is used to indicate that we're parsing something that might be a comma expression - * or might be an arrow function or might be a Flow type assertion (which requires explicit parens). - * In these cases, we should allow : and ?: after the initial "left" part. - */ -export declare function parseMaybeAssign(noIn?: boolean, isWithinParens?: boolean): boolean; -export declare function baseParseMaybeAssign(noIn: boolean, isWithinParens: boolean): boolean; -export declare function baseParseConditional(noIn: boolean): void; -export declare function parseMaybeUnary(): boolean; -export declare function parseExprSubscripts(): boolean; -export declare function baseParseSubscripts(startTokenIndex: number, noCalls?: boolean): void; -/** Set 'state.stop = true' to indicate that we should stop parsing subscripts. */ -export declare function baseParseSubscript(startTokenIndex: number, noCalls: boolean, stopState: StopState): void; -export declare function atPossibleAsync(): boolean; -export declare function parseCallExpressionArguments(): void; -export declare function parseExprAtom(): boolean; -export declare function parseLiteral(): void; -export declare function parseParenExpression(): void; -export declare function parseArrow(): boolean; -export declare function parseTemplate(): void; -export declare function parseObj(isPattern: boolean, isBlockScope: boolean): void; -export declare function parsePropertyName(objectContextId: number): void; -export declare function parseMethod(functionStart: number, isConstructor: boolean): void; -export declare function parseArrowExpression(startTokenIndex: number): void; -export declare function parseFunctionBodyAndFinish(functionStart: number, funcContextId?: number): void; -export declare function parseFunctionBody(allowExpression: boolean, funcContextId?: number): void; -export declare function parseIdentifier(): void; diff --git a/node_modules/sucrase/dist/types/parser/traverser/index.d.ts b/node_modules/sucrase/dist/types/parser/traverser/index.d.ts deleted file mode 100644 index 9f9127d..0000000 --- a/node_modules/sucrase/dist/types/parser/traverser/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { File } from "../index"; -export declare function parseFile(): File; diff --git a/node_modules/sucrase/dist/types/parser/traverser/lval.d.ts b/node_modules/sucrase/dist/types/parser/traverser/lval.d.ts deleted file mode 100644 index eb17756..0000000 --- a/node_modules/sucrase/dist/types/parser/traverser/lval.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { TokenType } from "../tokenizer/types"; -export declare function parseSpread(): void; -export declare function parseRest(isBlockScope: boolean): void; -export declare function parseBindingIdentifier(isBlockScope: boolean): void; -export declare function parseImportedIdentifier(): void; -export declare function markPriorBindingIdentifier(isBlockScope: boolean): void; -export declare function parseBindingAtom(isBlockScope: boolean): void; -export declare function parseBindingList(close: TokenType, isBlockScope: boolean, allowEmpty?: boolean, allowModifiers?: boolean, contextId?: number): void; -export declare function parseMaybeDefault(isBlockScope: boolean, leftAlreadyParsed?: boolean): void; diff --git a/node_modules/sucrase/dist/types/parser/traverser/statement.d.ts b/node_modules/sucrase/dist/types/parser/traverser/statement.d.ts deleted file mode 100644 index 508b20a..0000000 --- a/node_modules/sucrase/dist/types/parser/traverser/statement.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { File } from "../index"; -import { type TokenType } from "../tokenizer/types"; -export declare function parseTopLevel(): File; -export declare function parseStatement(declaration: boolean): void; -export declare function parseDecorators(): void; -export declare function baseParseMaybeDecoratorArguments(): void; -export declare function parseVarStatement(isBlockScope: boolean): void; -export declare function parseBlock(isFunctionScope?: boolean, contextId?: number): void; -export declare function parseBlockBody(end: TokenType): void; -export declare function parseFunction(functionStart: number, isStatement: boolean, optionalId?: boolean): void; -export declare function parseFunctionParams(allowModifiers?: boolean, funcContextId?: number): void; -export declare function parseClass(isStatement: boolean, optionalId?: boolean): void; -export declare function parseClassPropertyName(classContextId: number): void; -export declare function parsePostMemberNameModifiers(): void; -export declare function parseClassProperty(): void; -export declare function parseExport(): void; -export declare function parseExportFrom(): void; -export declare function baseParseExportStar(): void; -export declare function parseExportSpecifiers(): void; -export declare function parseImport(): void; diff --git a/node_modules/sucrase/dist/types/parser/traverser/util.d.ts b/node_modules/sucrase/dist/types/parser/traverser/util.d.ts deleted file mode 100644 index 6ec2a55..0000000 --- a/node_modules/sucrase/dist/types/parser/traverser/util.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { ContextualKeyword } from "../tokenizer/keywords"; -import { type TokenType } from "../tokenizer/types"; -export declare function isContextual(contextualKeyword: ContextualKeyword): boolean; -export declare function isLookaheadContextual(contextualKeyword: ContextualKeyword): boolean; -export declare function eatContextual(contextualKeyword: ContextualKeyword): boolean; -export declare function expectContextual(contextualKeyword: ContextualKeyword): void; -export declare function canInsertSemicolon(): boolean; -export declare function hasPrecedingLineBreak(): boolean; -export declare function hasFollowingLineBreak(): boolean; -export declare function isLineTerminator(): boolean; -export declare function semicolon(): void; -export declare function expect(type: TokenType): void; -/** - * Transition the parser to an error state. All code needs to be written to naturally unwind in this - * state, which allows us to backtrack without exceptions and without error plumbing everywhere. - */ -export declare function unexpected(message?: string, pos?: number): void; diff --git a/node_modules/sucrase/dist/types/parser/util/charcodes.d.ts b/node_modules/sucrase/dist/types/parser/util/charcodes.d.ts deleted file mode 100644 index 19bba1f..0000000 --- a/node_modules/sucrase/dist/types/parser/util/charcodes.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -export declare enum charCodes { - backSpace = 8, - lineFeed = 10, - tab = 9, - carriageReturn = 13, - shiftOut = 14, - space = 32, - exclamationMark = 33, - quotationMark = 34, - numberSign = 35, - dollarSign = 36, - percentSign = 37, - ampersand = 38, - apostrophe = 39, - leftParenthesis = 40, - rightParenthesis = 41, - asterisk = 42, - plusSign = 43, - comma = 44, - dash = 45, - dot = 46, - slash = 47, - digit0 = 48, - digit1 = 49, - digit2 = 50, - digit3 = 51, - digit4 = 52, - digit5 = 53, - digit6 = 54, - digit7 = 55, - digit8 = 56, - digit9 = 57, - colon = 58, - semicolon = 59, - lessThan = 60, - equalsTo = 61, - greaterThan = 62, - questionMark = 63, - atSign = 64, - uppercaseA = 65, - uppercaseB = 66, - uppercaseC = 67, - uppercaseD = 68, - uppercaseE = 69, - uppercaseF = 70, - uppercaseG = 71, - uppercaseH = 72, - uppercaseI = 73, - uppercaseJ = 74, - uppercaseK = 75, - uppercaseL = 76, - uppercaseM = 77, - uppercaseN = 78, - uppercaseO = 79, - uppercaseP = 80, - uppercaseQ = 81, - uppercaseR = 82, - uppercaseS = 83, - uppercaseT = 84, - uppercaseU = 85, - uppercaseV = 86, - uppercaseW = 87, - uppercaseX = 88, - uppercaseY = 89, - uppercaseZ = 90, - leftSquareBracket = 91, - backslash = 92, - rightSquareBracket = 93, - caret = 94, - underscore = 95, - graveAccent = 96, - lowercaseA = 97, - lowercaseB = 98, - lowercaseC = 99, - lowercaseD = 100, - lowercaseE = 101, - lowercaseF = 102, - lowercaseG = 103, - lowercaseH = 104, - lowercaseI = 105, - lowercaseJ = 106, - lowercaseK = 107, - lowercaseL = 108, - lowercaseM = 109, - lowercaseN = 110, - lowercaseO = 111, - lowercaseP = 112, - lowercaseQ = 113, - lowercaseR = 114, - lowercaseS = 115, - lowercaseT = 116, - lowercaseU = 117, - lowercaseV = 118, - lowercaseW = 119, - lowercaseX = 120, - lowercaseY = 121, - lowercaseZ = 122, - leftCurlyBrace = 123, - verticalBar = 124, - rightCurlyBrace = 125, - tilde = 126, - nonBreakingSpace = 160, - oghamSpaceMark = 5760, - lineSeparator = 8232, - paragraphSeparator = 8233 -} -export declare function isDigit(code: number): boolean; diff --git a/node_modules/sucrase/dist/types/parser/util/identifier.d.ts b/node_modules/sucrase/dist/types/parser/util/identifier.d.ts deleted file mode 100644 index 5c2eaeb..0000000 --- a/node_modules/sucrase/dist/types/parser/util/identifier.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const IS_IDENTIFIER_CHAR: Uint8Array; -export declare const IS_IDENTIFIER_START: Uint8Array; diff --git a/node_modules/sucrase/dist/types/parser/util/whitespace.d.ts b/node_modules/sucrase/dist/types/parser/util/whitespace.d.ts deleted file mode 100644 index dca5425..0000000 --- a/node_modules/sucrase/dist/types/parser/util/whitespace.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const WHITESPACE_CHARS: Array; -export declare const skipWhiteSpace: RegExp; -export declare const IS_WHITESPACE: Uint8Array; diff --git a/node_modules/sucrase/dist/types/register.d.ts b/node_modules/sucrase/dist/types/register.d.ts deleted file mode 100644 index 8a7ebd5..0000000 --- a/node_modules/sucrase/dist/types/register.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { type Options } from "./index"; -export interface HookOptions { - matcher?: (code: string) => boolean; - ignoreNodeModules?: boolean; -} -export type RevertFunction = () => void; -export declare function addHook(extension: string, sucraseOptions: Options, hookOptions?: HookOptions): RevertFunction; -export declare function registerJS(hookOptions?: HookOptions): RevertFunction; -export declare function registerJSX(hookOptions?: HookOptions): RevertFunction; -export declare function registerTS(hookOptions?: HookOptions): RevertFunction; -export declare function registerTSX(hookOptions?: HookOptions): RevertFunction; -export declare function registerTSLegacyModuleInterop(hookOptions?: HookOptions): RevertFunction; -export declare function registerTSXLegacyModuleInterop(hookOptions?: HookOptions): RevertFunction; -export declare function registerAll(hookOptions?: HookOptions): RevertFunction; diff --git a/node_modules/sucrase/dist/types/transformers/CJSImportTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/CJSImportTransformer.d.ts deleted file mode 100644 index 6a65621..0000000 --- a/node_modules/sucrase/dist/types/transformers/CJSImportTransformer.d.ts +++ /dev/null @@ -1,149 +0,0 @@ -import type CJSImportProcessor from "../CJSImportProcessor"; -import type { HelperManager } from "../HelperManager"; -import type NameManager from "../NameManager"; -import type TokenProcessor from "../TokenProcessor"; -import type ReactHotLoaderTransformer from "./ReactHotLoaderTransformer"; -import type RootTransformer from "./RootTransformer"; -import Transformer from "./Transformer"; -/** - * Class for editing import statements when we are transforming to commonjs. - */ -export default class CJSImportTransformer extends Transformer { - readonly rootTransformer: RootTransformer; - readonly tokens: TokenProcessor; - readonly importProcessor: CJSImportProcessor; - readonly nameManager: NameManager; - readonly helperManager: HelperManager; - readonly reactHotLoaderTransformer: ReactHotLoaderTransformer | null; - readonly enableLegacyBabel5ModuleInterop: boolean; - readonly enableLegacyTypeScriptModuleInterop: boolean; - readonly isTypeScriptTransformEnabled: boolean; - readonly isFlowTransformEnabled: boolean; - readonly preserveDynamicImport: boolean; - readonly keepUnusedImports: boolean; - private hadExport; - private hadNamedExport; - private hadDefaultExport; - private declarationInfo; - constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, importProcessor: CJSImportProcessor, nameManager: NameManager, helperManager: HelperManager, reactHotLoaderTransformer: ReactHotLoaderTransformer | null, enableLegacyBabel5ModuleInterop: boolean, enableLegacyTypeScriptModuleInterop: boolean, isTypeScriptTransformEnabled: boolean, isFlowTransformEnabled: boolean, preserveDynamicImport: boolean, keepUnusedImports: boolean); - getPrefixCode(): string; - getSuffixCode(): string; - process(): boolean; - private processImportEquals; - /** - * Transform this: - * import foo, {bar} from 'baz'; - * into - * var _baz = require('baz'); var _baz2 = _interopRequireDefault(_baz); - * - * The import code was already generated in the import preprocessing step, so - * we just need to look it up. - */ - private processImport; - /** - * Erase this import (since any CJS output would be completely different), and - * return true if this import is should be elided due to being a type-only - * import. Such imports will not be emitted at all to avoid side effects. - * - * Import elision only happens with the TypeScript or Flow transforms enabled. - * - * TODO: This function has some awkward overlap with - * CJSImportProcessor.pruneTypeOnlyImports , and the two should be unified. - * That function handles TypeScript implicit import name elision, and removes - * an import if all typical imported names (without `type`) are removed due - * to being type-only imports. This function handles Flow import removal and - * properly distinguishes `import 'foo'` from `import {} from 'foo'` for TS - * purposes. - * - * The position should end at the import string. - */ - private removeImportAndDetectIfShouldElide; - private removeRemainingImport; - private processIdentifier; - processObjectShorthand(): boolean; - processExport(): boolean; - private processAssignment; - /** - * Process something like `a += 3`, where `a` might be an exported value. - */ - private processComplexAssignment; - /** - * Process something like `++a`, where `a` might be an exported value. - */ - private processPreIncDec; - /** - * Process something like `a++`, where `a` might be an exported value. - * This starts at the `a`, not at the `++`. - */ - private processPostIncDec; - private processExportDefault; - private copyDecorators; - /** - * Transform a declaration like `export var`, `export let`, or `export const`. - */ - private processExportVar; - /** - * Determine if the export is of the form: - * export var/let/const [varName] = [expr]; - * In other words, determine if function name inference might apply. - */ - private isSimpleExportVar; - /** - * Transform an `export var` declaration initializing a single variable. - * - * For example, this: - * export const f = () => {}; - * becomes this: - * const f = () => {}; exports.f = f; - * - * The variable is unused (e.g. exports.f has the true value of the export). - * We need to produce an assignment of this form so that the function will - * have an inferred name of "f", which wouldn't happen in the more general - * case below. - */ - private processSimpleExportVar; - /** - * Transform normal declaration exports, including handling destructuring. - * For example, this: - * export const {x: [a = 2, b], c} = d; - * becomes this: - * ({x: [exports.a = 2, exports.b], c: exports.c} = d;) - */ - private processComplexExportVar; - /** - * Transform this: - * export function foo() {} - * into this: - * function foo() {} exports.foo = foo; - */ - private processExportFunction; - /** - * Skip past a function with a name and return that name. - */ - private processNamedFunction; - /** - * Transform this: - * export class A {} - * into this: - * class A {} exports.A = A; - */ - private processExportClass; - /** - * Transform this: - * export {a, b as c}; - * into this: - * exports.a = a; exports.c = b; - * - * OR - * - * Transform this: - * export {a, b as c} from './foo'; - * into the pre-generated Object.defineProperty code from the ImportProcessor. - * - * For the first case, if the TypeScript transform is enabled, we need to skip - * exports that are only defined as types. - */ - private processExportBindings; - private processExportStar; - private shouldElideExportedIdentifier; -} diff --git a/node_modules/sucrase/dist/types/transformers/ESMImportTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/ESMImportTransformer.d.ts deleted file mode 100644 index 5caf082..0000000 --- a/node_modules/sucrase/dist/types/transformers/ESMImportTransformer.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { HelperManager } from "../HelperManager"; -import type { Options } from "../index"; -import type NameManager from "../NameManager"; -import type TokenProcessor from "../TokenProcessor"; -import type ReactHotLoaderTransformer from "./ReactHotLoaderTransformer"; -import Transformer from "./Transformer"; -/** - * Class for editing import statements when we are keeping the code as ESM. We still need to remove - * type-only imports in TypeScript and Flow. - */ -export default class ESMImportTransformer extends Transformer { - readonly tokens: TokenProcessor; - readonly nameManager: NameManager; - readonly helperManager: HelperManager; - readonly reactHotLoaderTransformer: ReactHotLoaderTransformer | null; - readonly isTypeScriptTransformEnabled: boolean; - readonly isFlowTransformEnabled: boolean; - readonly keepUnusedImports: boolean; - private nonTypeIdentifiers; - private declarationInfo; - private injectCreateRequireForImportRequire; - constructor(tokens: TokenProcessor, nameManager: NameManager, helperManager: HelperManager, reactHotLoaderTransformer: ReactHotLoaderTransformer | null, isTypeScriptTransformEnabled: boolean, isFlowTransformEnabled: boolean, keepUnusedImports: boolean, options: Options); - process(): boolean; - private processImportEquals; - private processImport; - /** - * Remove type bindings from this import, leaving the rest of the import intact. - * - * Return true if this import was ONLY types, and thus is eligible for removal. This will bail out - * of the replacement operation, so we can return early here. - */ - private removeImportTypeBindings; - private shouldAutomaticallyElideImportedName; - private processExportDefault; - /** - * Handle a statement with one of these forms: - * export {a, type b}; - * export {c, type d} from 'foo'; - * - * In both cases, any explicit type exports should be removed. In the first - * case, we also need to handle implicit export elision for names declared as - * types. In the second case, we must NOT do implicit named export elision, - * but we must remove the runtime import if all exports are type exports. - */ - private processNamedExports; - /** - * ESM elides all imports with the rule that we only elide if we see that it's - * a type and never see it as a value. This is in contrast to CJS, which - * elides imports that are completely unknown. - */ - private shouldElideExportedName; -} diff --git a/node_modules/sucrase/dist/types/transformers/FlowTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/FlowTransformer.d.ts deleted file mode 100644 index 8a85ac4..0000000 --- a/node_modules/sucrase/dist/types/transformers/FlowTransformer.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -import type RootTransformer from "./RootTransformer"; -import Transformer from "./Transformer"; -export default class FlowTransformer extends Transformer { - readonly rootTransformer: RootTransformer; - readonly tokens: TokenProcessor; - readonly isImportsTransformEnabled: boolean; - constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, isImportsTransformEnabled: boolean); - process(): boolean; - /** - * Handle a declaration like: - * export enum E ... - * - * With this imports transform, this becomes: - * const E = [[enum]]; exports.E = E; - * - * otherwise, it becomes: - * export const E = [[enum]]; - */ - processNamedExportEnum(): void; - /** - * Handle a declaration like: - * export default enum E - * - * With the imports transform, this becomes: - * const E = [[enum]]; exports.default = E; - * - * otherwise, it becomes: - * const E = [[enum]]; export default E; - */ - processDefaultExportEnum(): void; - /** - * Transpile flow enums to invoke the "flow-enums-runtime" library. - * - * Currently, the transpiled code always uses `require("flow-enums-runtime")`, - * but if future flexibility is needed, we could expose a config option for - * this string (similar to configurable JSX). Even when targeting ESM, the - * default behavior of babel-plugin-transform-flow-enums is to use require - * rather than injecting an import. - * - * Flow enums are quite a bit simpler than TS enums and have some convenient - * constraints: - * - Element initializers must be either always present or always absent. That - * means that we can use fixed lookahead on the first element (if any) and - * assume that all elements are like that. - * - The right-hand side of an element initializer must be a literal value, - * not a complex expression and not referencing other elements. That means - * we can simply copy a single token. - * - * Enums can be broken up into three basic cases: - * - * Mirrored enums: - * enum E {A, B} - * -> - * const E = require("flow-enums-runtime").Mirrored(["A", "B"]); - * - * Initializer enums: - * enum E {A = 1, B = 2} - * -> - * const E = require("flow-enums-runtime")({A: 1, B: 2}); - * - * Symbol enums: - * enum E of symbol {A, B} - * -> - * const E = require("flow-enums-runtime")({A: Symbol("A"), B: Symbol("B")}); - * - * We can statically detect which of the three cases this is by looking at the - * "of" declaration (if any) and seeing if the first element has an initializer. - * Since the other transform details are so similar between the three cases, we - * use a single implementation and vary the transform within processEnumElement - * based on case. - */ - processEnum(): void; - /** - * Process an individual enum element, producing either an array element or an - * object element based on what type of enum this is. - */ - processEnumElement(isSymbolEnum: boolean, hasInitializers: boolean): void; -} diff --git a/node_modules/sucrase/dist/types/transformers/JSXTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/JSXTransformer.d.ts deleted file mode 100644 index ca7228b..0000000 --- a/node_modules/sucrase/dist/types/transformers/JSXTransformer.d.ts +++ /dev/null @@ -1,144 +0,0 @@ -import type CJSImportProcessor from "../CJSImportProcessor"; -import type { Options } from "../index"; -import type NameManager from "../NameManager"; -import { JSXRole } from "../parser/tokenizer"; -import type TokenProcessor from "../TokenProcessor"; -import { type JSXPragmaInfo } from "../util/getJSXPragmaInfo"; -import type RootTransformer from "./RootTransformer"; -import Transformer from "./Transformer"; -export default class JSXTransformer extends Transformer { - readonly rootTransformer: RootTransformer; - readonly tokens: TokenProcessor; - readonly importProcessor: CJSImportProcessor | null; - readonly nameManager: NameManager; - readonly options: Options; - jsxPragmaInfo: JSXPragmaInfo; - jsxImportSource: string; - isAutomaticRuntime: boolean; - lastLineNumber: number; - lastIndex: number; - filenameVarName: string | null; - esmAutomaticImportNameResolutions: { - [name: string]: string; - }; - cjsAutomaticModuleNameResolutions: { - [path: string]: string; - }; - constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, importProcessor: CJSImportProcessor | null, nameManager: NameManager, options: Options); - process(): boolean; - getPrefixCode(): string; - processJSXTag(): void; - getElementLocationCode(firstTokenStart: number): string; - /** - * Get the line number for this source position. This is calculated lazily and - * must be called in increasing order by index. - */ - getLineNumberForIndex(index: number): number; - /** - * Convert the current JSX element to a call to jsx, jsxs, or jsxDEV. This is - * the primary transformation for the automatic transform. - * - * Example: - *
Hello{x}
- * becomes - * jsxs('div', {a: 1, children: ["Hello", x]}, 2) - */ - transformTagToJSXFunc(elementLocationCode: string | null, jsxRole: JSXRole): void; - /** - * Convert the current JSX element to a createElement call. In the classic - * runtime, this is the only case. In the automatic runtime, this is called - * as a fallback in some situations. - * - * Example: - *
Hello{x}
- * becomes - * React.createElement('div', {a: 1, key: 2}, "Hello", x) - */ - transformTagToCreateElement(elementLocationCode: string | null): void; - /** - * Get the code for the relevant function for this context: jsx, jsxs, - * or jsxDEV. The following open-paren is included as well. - * - * These functions are only used for the automatic runtime, so they are always - * auto-imported, but the auto-import will be either CJS or ESM based on the - * target module format. - */ - getJSXFuncInvocationCode(isStatic: boolean): string; - /** - * Return the code to use for the createElement function, e.g. - * `React.createElement`, including the following open-paren. - * - * This is the main function to use for the classic runtime. For the - * automatic runtime, this function is used as a fallback function to - * preserve behavior when there is a prop spread followed by an explicit - * key. In that automatic runtime case, the function should be automatically - * imported. - */ - getCreateElementInvocationCode(): string; - /** - * Return the code to use as the component when compiling a shorthand - * fragment, e.g. `React.Fragment`. - * - * This may be called from either the classic or automatic runtime, and - * the value should be auto-imported for the automatic runtime. - */ - getFragmentCode(): string; - /** - * Return code that invokes the given function. - * - * When the imports transform is enabled, use the CJSImportTransformer - * strategy of using `.call(void 0, ...` to avoid passing a `this` value in a - * situation that would otherwise look like a method call. - */ - claimAutoImportedFuncInvocation(funcName: string, importPathSuffix: string): string; - claimAutoImportedName(funcName: string, importPathSuffix: string): string; - /** - * Process the first part of a tag, before any props. - */ - processTagIntro(): void; - /** - * Starting at the beginning of the props, add the props argument to - * React.createElement, including the comma before it. - */ - processPropsObjectWithDevInfo(elementLocationCode: string | null): void; - /** - * Transform the core part of the props, assuming that a { has already been - * inserted before us and that a } will be inserted after us. - * - * If extractKeyCode is true (i.e. when using any jsx... function), any prop - * named "key" has its code captured and returned rather than being emitted to - * the output code. This shifts line numbers, and emitting the code later will - * correct line numbers again. If no key is found or if extractKeyCode is - * false, this function returns null. - */ - processProps(extractKeyCode: boolean): string | null; - processPropName(propName: string): void; - processPropValue(): void; - processStringPropValue(): void; - /** - * Starting in the middle of the props object literal, produce an additional - * prop for the children and close the object literal. - */ - processAutomaticChildrenAndEndProps(jsxRole: JSXRole): void; - /** - * Transform children into a comma-separated list, which will be either - * arguments to createElement or array elements of a children prop. - */ - processChildren(needsInitialComma: boolean): void; - /** - * Turn a JSX text element into a string literal, or nothing at all if the JSX - * text resolves to the empty string. - * - * Returns true if a string literal is emitted, false otherwise. - */ - processChildTextElement(needsComma: boolean): boolean; - getDevSource(elementLocationCode: string): string; - getFilenameVarName(): string; -} -/** - * Spec for identifiers: https://tc39.github.io/ecma262/#prod-IdentifierStart. - * - * Really only treat anything starting with a-z as tag names. `_`, `$`, `é` - * should be treated as component names - */ -export declare function startsWithLowerCase(s: string): boolean; diff --git a/node_modules/sucrase/dist/types/transformers/JestHoistTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/JestHoistTransformer.d.ts deleted file mode 100644 index 6a8b9df..0000000 --- a/node_modules/sucrase/dist/types/transformers/JestHoistTransformer.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import type CJSImportProcessor from "../CJSImportProcessor"; -import type NameManager from "../NameManager"; -import type TokenProcessor from "../TokenProcessor"; -import type RootTransformer from "./RootTransformer"; -import Transformer from "./Transformer"; -/** - * Implementation of babel-plugin-jest-hoist, which hoists up some jest method - * calls above the imports to allow them to override other imports. - * - * To preserve line numbers, rather than directly moving the jest.mock code, we - * wrap each invocation in a function statement and then call the function from - * the top of the file. - */ -export default class JestHoistTransformer extends Transformer { - readonly rootTransformer: RootTransformer; - readonly tokens: TokenProcessor; - readonly nameManager: NameManager; - readonly importProcessor: CJSImportProcessor | null; - private readonly hoistedFunctionNames; - constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, nameManager: NameManager, importProcessor: CJSImportProcessor | null); - process(): boolean; - getHoistedCode(): string; - /** - * Extracts any methods calls on the jest-object that should be hoisted. - * - * According to the jest docs, https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options, - * mock, unmock, enableAutomock, disableAutomock, are the methods that should be hoisted. - * - * We do not apply the same checks of the arguments as babel-plugin-jest-hoist does. - */ - private extractHoistedCalls; -} diff --git a/node_modules/sucrase/dist/types/transformers/NumericSeparatorTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/NumericSeparatorTransformer.d.ts deleted file mode 100644 index 69a1cf5..0000000 --- a/node_modules/sucrase/dist/types/transformers/NumericSeparatorTransformer.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -import Transformer from "./Transformer"; -export default class NumericSeparatorTransformer extends Transformer { - readonly tokens: TokenProcessor; - constructor(tokens: TokenProcessor); - process(): boolean; -} diff --git a/node_modules/sucrase/dist/types/transformers/OptionalCatchBindingTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/OptionalCatchBindingTransformer.d.ts deleted file mode 100644 index d381e5a..0000000 --- a/node_modules/sucrase/dist/types/transformers/OptionalCatchBindingTransformer.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type NameManager from "../NameManager"; -import type TokenProcessor from "../TokenProcessor"; -import Transformer from "./Transformer"; -export default class OptionalCatchBindingTransformer extends Transformer { - readonly tokens: TokenProcessor; - readonly nameManager: NameManager; - constructor(tokens: TokenProcessor, nameManager: NameManager); - process(): boolean; -} diff --git a/node_modules/sucrase/dist/types/transformers/OptionalChainingNullishTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/OptionalChainingNullishTransformer.d.ts deleted file mode 100644 index d468029..0000000 --- a/node_modules/sucrase/dist/types/transformers/OptionalChainingNullishTransformer.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type NameManager from "../NameManager"; -import type TokenProcessor from "../TokenProcessor"; -import Transformer from "./Transformer"; -/** - * Transformer supporting the optional chaining and nullish coalescing operators. - * - * Tech plan here: - * https://github.com/alangpierce/sucrase/wiki/Sucrase-Optional-Chaining-and-Nullish-Coalescing-Technical-Plan - * - * The prefix and suffix code snippets are handled by TokenProcessor, and this transformer handles - * the operators themselves. - */ -export default class OptionalChainingNullishTransformer extends Transformer { - readonly tokens: TokenProcessor; - readonly nameManager: NameManager; - constructor(tokens: TokenProcessor, nameManager: NameManager); - process(): boolean; - /** - * Determine if the current token is the last of its chain, so that we know whether it's eligible - * to have a delete op inserted. - * - * We can do this by walking forward until we determine one way or another. Each - * isOptionalChainStart token must be paired with exactly one isOptionalChainEnd token after it in - * a nesting way, so we can track depth and walk to the end of the chain (the point where the - * depth goes negative) and see if any other subscript token is after us in the chain. - */ - isLastSubscriptInChain(): boolean; - /** - * Determine if we are the open-paren in an expression like super.a()?.b. - * - * We can do this by walking backward to find the previous subscript. If that subscript was - * preceded by a super, then we must be the subscript after it, so if this is a call expression, - * we'll need to attach the right context. - */ - justSkippedSuper(): boolean; -} diff --git a/node_modules/sucrase/dist/types/transformers/ReactDisplayNameTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/ReactDisplayNameTransformer.d.ts deleted file mode 100644 index 56ed86e..0000000 --- a/node_modules/sucrase/dist/types/transformers/ReactDisplayNameTransformer.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type CJSImportProcessor from "../CJSImportProcessor"; -import type { Options } from "../index"; -import type TokenProcessor from "../TokenProcessor"; -import type RootTransformer from "./RootTransformer"; -import Transformer from "./Transformer"; -/** - * Implementation of babel-plugin-transform-react-display-name, which adds a - * display name to usages of React.createClass and createReactClass. - */ -export default class ReactDisplayNameTransformer extends Transformer { - readonly rootTransformer: RootTransformer; - readonly tokens: TokenProcessor; - readonly importProcessor: CJSImportProcessor | null; - readonly options: Options; - constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, importProcessor: CJSImportProcessor | null, options: Options); - process(): boolean; - /** - * This is called with the token position at the open-paren. - */ - private tryProcessCreateClassCall; - private findDisplayName; - private getDisplayNameFromFilename; - /** - * We only want to add a display name when this is a function call containing - * one argument, which is an object literal without `displayName` as an - * existing key. - */ - private classNeedsDisplayName; -} diff --git a/node_modules/sucrase/dist/types/transformers/ReactHotLoaderTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/ReactHotLoaderTransformer.d.ts deleted file mode 100644 index 0221216..0000000 --- a/node_modules/sucrase/dist/types/transformers/ReactHotLoaderTransformer.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -import Transformer from "./Transformer"; -export default class ReactHotLoaderTransformer extends Transformer { - readonly tokens: TokenProcessor; - readonly filePath: string; - private extractedDefaultExportName; - constructor(tokens: TokenProcessor, filePath: string); - setExtractedDefaultExportName(extractedDefaultExportName: string): void; - getPrefixCode(): string; - getSuffixCode(): string; - process(): boolean; -} diff --git a/node_modules/sucrase/dist/types/transformers/RootTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/RootTransformer.d.ts deleted file mode 100644 index 07a0173..0000000 --- a/node_modules/sucrase/dist/types/transformers/RootTransformer.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -import type { Options, SucraseContext, Transform } from "../index"; -import { type ClassInfo } from "../util/getClassInfo"; -export interface RootTransformerResult { - code: string; - mappings: Array; -} -export default class RootTransformer { - private transformers; - private nameManager; - private tokens; - private generatedVariables; - private isImportsTransformEnabled; - private isReactHotLoaderTransformEnabled; - private disableESTransforms; - private helperManager; - constructor(sucraseContext: SucraseContext, transforms: Array, enableLegacyBabel5ModuleInterop: boolean, options: Options); - transform(): RootTransformerResult; - processBalancedCode(): void; - processToken(): void; - /** - * Skip past a class with a name and return that name. - */ - processNamedClass(): string; - processClass(): void; - /** - * We want to just handle class fields in all contexts, since TypeScript supports them. Later, - * when some JS implementations support class fields, this should be made optional. - */ - processClassBody(classInfo: ClassInfo, className: string | null): void; - makeConstructorInitCode(constructorInitializerStatements: Array, instanceInitializerNames: Array, className: string): string; - /** - * Normally it's ok to simply remove type tokens, but we need to be more careful when dealing with - * arrow function return types since they can confuse the parser. In that case, we want to move - * the close-paren to the same line as the arrow. - * - * See https://github.com/alangpierce/sucrase/issues/391 for more details. - */ - processPossibleArrowParamEnd(): boolean; - /** - * An async arrow function might be of the form: - * - * async < - * T - * >() => {} - * - * in which case, removing the type parameters will cause a syntax error. Detect this case and - * move the open-paren earlier. - */ - processPossibleAsyncArrowWithTypeParams(): boolean; - processPossibleTypeRange(): boolean; - shiftMappings(mappings: Array, prefixLength: number): Array; -} diff --git a/node_modules/sucrase/dist/types/transformers/Transformer.d.ts b/node_modules/sucrase/dist/types/transformers/Transformer.d.ts deleted file mode 100644 index 35c18b1..0000000 --- a/node_modules/sucrase/dist/types/transformers/Transformer.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export default abstract class Transformer { - abstract process(): boolean; - getPrefixCode(): string; - getHoistedCode(): string; - getSuffixCode(): string; -} diff --git a/node_modules/sucrase/dist/types/transformers/TypeScriptTransformer.d.ts b/node_modules/sucrase/dist/types/transformers/TypeScriptTransformer.d.ts deleted file mode 100644 index 6e9c9d3..0000000 --- a/node_modules/sucrase/dist/types/transformers/TypeScriptTransformer.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -import type { Token } from "../parser/tokenizer"; -import type TokenProcessor from "../TokenProcessor"; -import type RootTransformer from "./RootTransformer"; -import Transformer from "./Transformer"; -export default class TypeScriptTransformer extends Transformer { - readonly rootTransformer: RootTransformer; - readonly tokens: TokenProcessor; - readonly isImportsTransformEnabled: boolean; - constructor(rootTransformer: RootTransformer, tokens: TokenProcessor, isImportsTransformEnabled: boolean); - process(): boolean; - processEnum(isExport?: boolean): void; - /** - * Transform an enum into equivalent JS. This has complexity in a few places: - * - TS allows string enums, numeric enums, and a mix of the two styles within an enum. - * - Enum keys are allowed to be referenced in later enum values. - * - Enum keys are allowed to be strings. - * - When enum values are omitted, they should follow an auto-increment behavior. - */ - processEnumBody(enumName: string): void; - /** - * Detect name information about this enum key, which will be used to determine which code to emit - * and whether we should declare a variable as part of this declaration. - * - * Some cases to keep in mind: - * - Enum keys can be implicitly referenced later, e.g. `X = 1, Y = X`. In Sucrase, we implement - * this by declaring a variable `X` so that later expressions can use it. - * - In addition to the usual identifier key syntax, enum keys are allowed to be string literals, - * e.g. `"hello world" = 3,`. Template literal syntax is NOT allowed. - * - Even if the enum key is defined as a string literal, it may still be referenced by identifier - * later, e.g. `"X" = 1, Y = X`. That means that we need to detect whether or not a string - * literal is identifier-like and emit a variable if so, even if the declaration did not use an - * identifier. - * - Reserved keywords like `break` are valid enum keys, but are not valid to be referenced later - * and would be a syntax error if we emitted a variable, so we need to skip the variable - * declaration in those cases. - * - * The variableName return value captures these nuances: if non-null, we can and must emit a - * variable declaration, and if null, we can't and shouldn't. - */ - extractEnumKeyInfo(nameToken: Token): { - nameStringCode: string; - variableName: string | null; - }; - /** - * Handle an enum member where the RHS is just a string literal (not omitted, not a number, and - * not a complex expression). This is the typical form for TS string enums, and in this case, we - * do *not* create a reverse mapping. - * - * This is called after deleting the key token, when the token processor is at the equals sign. - * - * Example 1: - * someKey = "some value" - * -> - * const someKey = "some value"; MyEnum["someKey"] = someKey; - * - * Example 2: - * "some key" = "some value" - * -> - * MyEnum["some key"] = "some value"; - */ - processStringLiteralEnumMember(enumName: string, nameStringCode: string, variableName: string | null): void; - /** - * Handle an enum member initialized with an expression on the right-hand side (other than a - * string literal). In these cases, we should transform the expression and emit code that sets up - * a reverse mapping. - * - * The TypeScript implementation of this operation distinguishes between expressions that can be - * "constant folded" at compile time (i.e. consist of number literals and simple math operations - * on those numbers) and ones that are dynamic. For constant expressions, it emits the resolved - * numeric value, and auto-incrementing is only allowed in that case. Evaluating expressions at - * compile time would add significant complexity to Sucrase, so Sucrase instead leaves the - * expression as-is, and will later emit something like `MyEnum["previousKey"] + 1` to implement - * auto-incrementing. - * - * This is called after deleting the key token, when the token processor is at the equals sign. - * - * Example 1: - * someKey = 1 + 1 - * -> - * const someKey = 1 + 1; MyEnum[MyEnum["someKey"] = someKey] = "someKey"; - * - * Example 2: - * "some key" = 1 + 1 - * -> - * MyEnum[MyEnum["some key"] = 1 + 1] = "some key"; - */ - processExplicitValueEnumMember(enumName: string, nameStringCode: string, variableName: string | null): void; - /** - * Handle an enum member with no right-hand side expression. In this case, the value is the - * previous value plus 1, or 0 if there was no previous value. We should also always emit a - * reverse mapping. - * - * Example 1: - * someKey2 - * -> - * const someKey2 = someKey1 + 1; MyEnum[MyEnum["someKey2"] = someKey2] = "someKey2"; - * - * Example 2: - * "some key 2" - * -> - * MyEnum[MyEnum["some key 2"] = someKey1 + 1] = "some key 2"; - */ - processImplicitValueEnumMember(enumName: string, nameStringCode: string, variableName: string | null, previousValueCode: string | null): void; -} diff --git a/node_modules/sucrase/dist/types/util/elideImportEquals.d.ts b/node_modules/sucrase/dist/types/util/elideImportEquals.d.ts deleted file mode 100644 index d04bb71..0000000 --- a/node_modules/sucrase/dist/types/util/elideImportEquals.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -export default function elideImportEquals(tokens: TokenProcessor): void; diff --git a/node_modules/sucrase/dist/types/util/formatTokens.d.ts b/node_modules/sucrase/dist/types/util/formatTokens.d.ts deleted file mode 100644 index fe5fb1e..0000000 --- a/node_modules/sucrase/dist/types/util/formatTokens.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Token } from "../parser/tokenizer"; -export default function formatTokens(code: string, tokens: Array): string; diff --git a/node_modules/sucrase/dist/types/util/getClassInfo.d.ts b/node_modules/sucrase/dist/types/util/getClassInfo.d.ts deleted file mode 100644 index f4309cb..0000000 --- a/node_modules/sucrase/dist/types/util/getClassInfo.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type NameManager from "../NameManager"; -import type TokenProcessor from "../TokenProcessor"; -import type RootTransformer from "../transformers/RootTransformer"; -export interface ClassHeaderInfo { - isExpression: boolean; - className: string | null; - hasSuperclass: boolean; -} -export interface TokenRange { - start: number; - end: number; -} -export interface FieldInfo extends TokenRange { - equalsIndex: number; - initializerName: string; -} -/** - * Information about a class returned to inform the implementation of class fields and constructor - * initializers. - */ -export interface ClassInfo { - headerInfo: ClassHeaderInfo; - constructorInitializerStatements: Array; - instanceInitializerNames: Array; - staticInitializerNames: Array; - constructorInsertPos: number | null; - fields: Array; - rangesToRemove: Array; -} -/** - * Get information about the class fields for this class, given a token processor pointing to the - * open-brace at the start of the class. - */ -export default function getClassInfo(rootTransformer: RootTransformer, tokens: TokenProcessor, nameManager: NameManager, disableESTransforms: boolean): ClassInfo; diff --git a/node_modules/sucrase/dist/types/util/getDeclarationInfo.d.ts b/node_modules/sucrase/dist/types/util/getDeclarationInfo.d.ts deleted file mode 100644 index 04122ba..0000000 --- a/node_modules/sucrase/dist/types/util/getDeclarationInfo.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -export interface DeclarationInfo { - typeDeclarations: Set; - valueDeclarations: Set; -} -export declare const EMPTY_DECLARATION_INFO: DeclarationInfo; -/** - * Get all top-level identifiers that should be preserved when exported in TypeScript. - * - * Examples: - * - If an identifier is declared as `const x`, then `export {x}` should be preserved. - * - If it's declared as `type x`, then `export {x}` should be removed. - * - If it's declared as both `const x` and `type x`, then the export should be preserved. - * - Classes and enums should be preserved (even though they also introduce types). - * - Imported identifiers should be preserved since we don't have enough information to - * rule them out. --isolatedModules disallows re-exports, which catches errors here. - */ -export default function getDeclarationInfo(tokens: TokenProcessor): DeclarationInfo; diff --git a/node_modules/sucrase/dist/types/util/getIdentifierNames.d.ts b/node_modules/sucrase/dist/types/util/getIdentifierNames.d.ts deleted file mode 100644 index 9e0d5a2..0000000 --- a/node_modules/sucrase/dist/types/util/getIdentifierNames.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Token } from "../parser/tokenizer"; -/** - * Get all identifier names in the code, in order, including duplicates. - */ -export default function getIdentifierNames(code: string, tokens: Array): Array; diff --git a/node_modules/sucrase/dist/types/util/getImportExportSpecifierInfo.d.ts b/node_modules/sucrase/dist/types/util/getImportExportSpecifierInfo.d.ts deleted file mode 100644 index 44d53fc..0000000 --- a/node_modules/sucrase/dist/types/util/getImportExportSpecifierInfo.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -export type ImportExportSpecifierInfo = { - isType: false; - leftName: string; - rightName: string; - endIndex: number; -} | { - isType: true; - leftName: null; - rightName: null; - endIndex: number; -}; -/** - * Determine information about this named import or named export specifier. - * - * This syntax is the `a` from statements like these: - * import {A} from "./foo"; - * export {A}; - * export {A} from "./foo"; - * - * As it turns out, we can exactly characterize the syntax meaning by simply - * counting the number of tokens, which can be from 1 to 4: - * {A} - * {type A} - * {A as B} - * {type A as B} - * - * In the type case, we never actually need the names in practice, so don't get - * them. - * - * TODO: There's some redundancy with the type detection here and the isType - * flag that's already present on tokens in TS mode. This function could - * potentially be simplified and/or pushed to the call sites to avoid the object - * allocation. - */ -export default function getImportExportSpecifierInfo(tokens: TokenProcessor, index?: number): ImportExportSpecifierInfo; diff --git a/node_modules/sucrase/dist/types/util/getJSXPragmaInfo.d.ts b/node_modules/sucrase/dist/types/util/getJSXPragmaInfo.d.ts deleted file mode 100644 index fec9a48..0000000 --- a/node_modules/sucrase/dist/types/util/getJSXPragmaInfo.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Options } from "../index"; -export interface JSXPragmaInfo { - base: string; - suffix: string; - fragmentBase: string; - fragmentSuffix: string; -} -export default function getJSXPragmaInfo(options: Options): JSXPragmaInfo; diff --git a/node_modules/sucrase/dist/types/util/getNonTypeIdentifiers.d.ts b/node_modules/sucrase/dist/types/util/getNonTypeIdentifiers.d.ts deleted file mode 100644 index 3e40768..0000000 --- a/node_modules/sucrase/dist/types/util/getNonTypeIdentifiers.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Options } from "../index"; -import type TokenProcessor from "../TokenProcessor"; -export declare function getNonTypeIdentifiers(tokens: TokenProcessor, options: Options): Set; diff --git a/node_modules/sucrase/dist/types/util/getTSImportedNames.d.ts b/node_modules/sucrase/dist/types/util/getTSImportedNames.d.ts deleted file mode 100644 index bc236e4..0000000 --- a/node_modules/sucrase/dist/types/util/getTSImportedNames.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -/** - * Special case code to scan for imported names in ESM TypeScript. We need to do this so we can - * properly get globals so we can compute shadowed globals. - * - * This is similar to logic in CJSImportProcessor, but trimmed down to avoid logic with CJS - * replacement and flow type imports. - */ -export default function getTSImportedNames(tokens: TokenProcessor): Set; diff --git a/node_modules/sucrase/dist/types/util/isAsyncOperation.d.ts b/node_modules/sucrase/dist/types/util/isAsyncOperation.d.ts deleted file mode 100644 index 3ad0036..0000000 --- a/node_modules/sucrase/dist/types/util/isAsyncOperation.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -/** - * Determine whether this optional chain or nullish coalescing operation has any await statements in - * it. If so, we'll need to transpile to an async operation. - * - * We compute this by walking the length of the operation and returning true if we see an await - * keyword used as a real await (rather than an object key or property access). Nested optional - * chain/nullish operations need to be tracked but don't silence await, but a nested async function - * (or any other nested scope) will make the await not count. - */ -export default function isAsyncOperation(tokens: TokenProcessor): boolean; diff --git a/node_modules/sucrase/dist/types/util/isExportFrom.d.ts b/node_modules/sucrase/dist/types/util/isExportFrom.d.ts deleted file mode 100644 index abf0b4d..0000000 --- a/node_modules/sucrase/dist/types/util/isExportFrom.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -/** - * Starting at `export {`, look ahead and return `true` if this is an - * `export {...} from` statement and `false` if this is a plain multi-export. - */ -export default function isExportFrom(tokens: TokenProcessor): boolean; diff --git a/node_modules/sucrase/dist/types/util/isIdentifier.d.ts b/node_modules/sucrase/dist/types/util/isIdentifier.d.ts deleted file mode 100644 index b39af27..0000000 --- a/node_modules/sucrase/dist/types/util/isIdentifier.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Determine if the given name is a legal variable name. - * - * This is needed when transforming TypeScript enums; if an enum key is a valid - * variable name, it might be referenced later in the enum, so we need to - * declare a variable. - */ -export default function isIdentifier(name: string): boolean; diff --git a/node_modules/sucrase/dist/types/util/removeMaybeImportAttributes.d.ts b/node_modules/sucrase/dist/types/util/removeMaybeImportAttributes.d.ts deleted file mode 100644 index 0d7ca6e..0000000 --- a/node_modules/sucrase/dist/types/util/removeMaybeImportAttributes.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -/** - * Starting at a potential `with` or (legacy) `assert` token, remove the import - * attributes if they exist. - */ -export declare function removeMaybeImportAttributes(tokens: TokenProcessor): void; diff --git a/node_modules/sucrase/dist/types/util/shouldElideDefaultExport.d.ts b/node_modules/sucrase/dist/types/util/shouldElideDefaultExport.d.ts deleted file mode 100644 index f774c14..0000000 --- a/node_modules/sucrase/dist/types/util/shouldElideDefaultExport.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type TokenProcessor from "../TokenProcessor"; -import type { DeclarationInfo } from "./getDeclarationInfo"; -/** - * Common method sharing code between CJS and ESM cases, since they're the same here. - */ -export default function shouldElideDefaultExport(isTypeScriptTransformEnabled: boolean, keepUnusedImports: boolean, tokens: TokenProcessor, declarationInfo: DeclarationInfo): boolean; diff --git a/node_modules/sucrase/dist/util/elideImportEquals.js b/node_modules/sucrase/dist/util/elideImportEquals.js deleted file mode 100644 index c6ef30f..0000000 --- a/node_modules/sucrase/dist/util/elideImportEquals.js +++ /dev/null @@ -1,29 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _types = require('../parser/tokenizer/types'); - - - function elideImportEquals(tokens) { - // import - tokens.removeInitialToken(); - // name - tokens.removeToken(); - // = - tokens.removeToken(); - // name or require - tokens.removeToken(); - // Handle either `import A = require('A')` or `import A = B.C.D`. - if (tokens.matches1(_types.TokenType.parenL)) { - // ( - tokens.removeToken(); - // path string - tokens.removeToken(); - // ) - tokens.removeToken(); - } else { - while (tokens.matches1(_types.TokenType.dot)) { - // . - tokens.removeToken(); - // name - tokens.removeToken(); - } - } -} exports.default = elideImportEquals; diff --git a/node_modules/sucrase/dist/util/formatTokens.js b/node_modules/sucrase/dist/util/formatTokens.js deleted file mode 100644 index c663633..0000000 --- a/node_modules/sucrase/dist/util/formatTokens.js +++ /dev/null @@ -1,74 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _linesandcolumns = require('lines-and-columns'); var _linesandcolumns2 = _interopRequireDefault(_linesandcolumns); - - -var _types = require('../parser/tokenizer/types'); - - function formatTokens(code, tokens) { - if (tokens.length === 0) { - return ""; - } - - const tokenKeys = Object.keys(tokens[0]).filter( - (k) => k !== "type" && k !== "value" && k !== "start" && k !== "end" && k !== "loc", - ); - const typeKeys = Object.keys(tokens[0].type).filter((k) => k !== "label" && k !== "keyword"); - - const headings = ["Location", "Label", "Raw", ...tokenKeys, ...typeKeys]; - - const lines = new (0, _linesandcolumns2.default)(code); - const rows = [headings, ...tokens.map(getTokenComponents)]; - const padding = headings.map(() => 0); - for (const components of rows) { - for (let i = 0; i < components.length; i++) { - padding[i] = Math.max(padding[i], components[i].length); - } - } - return rows - .map((components) => components.map((component, i) => component.padEnd(padding[i])).join(" ")) - .join("\n"); - - function getTokenComponents(token) { - const raw = code.slice(token.start, token.end); - return [ - formatRange(token.start, token.end), - _types.formatTokenType.call(void 0, token.type), - truncate(String(raw), 14), - // @ts-ignore: Intentional dynamic access by key. - ...tokenKeys.map((key) => formatValue(token[key], key)), - // @ts-ignore: Intentional dynamic access by key. - ...typeKeys.map((key) => formatValue(token.type[key], key)), - ]; - } - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - function formatValue(value, key) { - if (value === true) { - return key; - } else if (value === false || value === null) { - return ""; - } else { - return String(value); - } - } - - function formatRange(start, end) { - return `${formatPos(start)}-${formatPos(end)}`; - } - - function formatPos(pos) { - const location = lines.locationForIndex(pos); - if (!location) { - return "Unknown"; - } else { - return `${location.line + 1}:${location.column + 1}`; - } - } -} exports.default = formatTokens; - -function truncate(s, length) { - if (s.length > length) { - return `${s.slice(0, length - 3)}...`; - } else { - return s; - } -} diff --git a/node_modules/sucrase/dist/util/getClassInfo.js b/node_modules/sucrase/dist/util/getClassInfo.js deleted file mode 100644 index 510a771..0000000 --- a/node_modules/sucrase/dist/util/getClassInfo.js +++ /dev/null @@ -1,352 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); - -var _keywords = require('../parser/tokenizer/keywords'); -var _types = require('../parser/tokenizer/types'); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/** - * Get information about the class fields for this class, given a token processor pointing to the - * open-brace at the start of the class. - */ - function getClassInfo( - rootTransformer, - tokens, - nameManager, - disableESTransforms, -) { - const snapshot = tokens.snapshot(); - - const headerInfo = processClassHeader(tokens); - - let constructorInitializerStatements = []; - const instanceInitializerNames = []; - const staticInitializerNames = []; - let constructorInsertPos = null; - const fields = []; - const rangesToRemove = []; - - const classContextId = tokens.currentToken().contextId; - if (classContextId == null) { - throw new Error("Expected non-null class context ID on class open-brace."); - } - - tokens.nextToken(); - while (!tokens.matchesContextIdAndLabel(_types.TokenType.braceR, classContextId)) { - if (tokens.matchesContextual(_keywords.ContextualKeyword._constructor) && !tokens.currentToken().isType) { - ({constructorInitializerStatements, constructorInsertPos} = processConstructor(tokens)); - } else if (tokens.matches1(_types.TokenType.semi)) { - if (!disableESTransforms) { - rangesToRemove.push({start: tokens.currentIndex(), end: tokens.currentIndex() + 1}); - } - tokens.nextToken(); - } else if (tokens.currentToken().isType) { - tokens.nextToken(); - } else { - // Either a method or a field. Skip to the identifier part. - const statementStartIndex = tokens.currentIndex(); - let isStatic = false; - let isESPrivate = false; - let isDeclareOrAbstract = false; - while (isAccessModifier(tokens.currentToken())) { - if (tokens.matches1(_types.TokenType._static)) { - isStatic = true; - } - if (tokens.matches1(_types.TokenType.hash)) { - isESPrivate = true; - } - if (tokens.matches1(_types.TokenType._declare) || tokens.matches1(_types.TokenType._abstract)) { - isDeclareOrAbstract = true; - } - tokens.nextToken(); - } - if (isStatic && tokens.matches1(_types.TokenType.braceL)) { - // This is a static block, so don't process it in any special way. - skipToNextClassElement(tokens, classContextId); - continue; - } - if (isESPrivate) { - // Sucrase doesn't attempt to transpile private fields; just leave them as-is. - skipToNextClassElement(tokens, classContextId); - continue; - } - if ( - tokens.matchesContextual(_keywords.ContextualKeyword._constructor) && - !tokens.currentToken().isType - ) { - ({constructorInitializerStatements, constructorInsertPos} = processConstructor(tokens)); - continue; - } - - const nameStartIndex = tokens.currentIndex(); - skipFieldName(tokens); - if (tokens.matches1(_types.TokenType.lessThan) || tokens.matches1(_types.TokenType.parenL)) { - // This is a method, so nothing to process. - skipToNextClassElement(tokens, classContextId); - continue; - } - // There might be a type annotation that we need to skip. - while (tokens.currentToken().isType) { - tokens.nextToken(); - } - if (tokens.matches1(_types.TokenType.eq)) { - const equalsIndex = tokens.currentIndex(); - // This is an initializer, so we need to wrap in an initializer method. - const valueEnd = tokens.currentToken().rhsEndIndex; - if (valueEnd == null) { - throw new Error("Expected rhsEndIndex on class field assignment."); - } - tokens.nextToken(); - while (tokens.currentIndex() < valueEnd) { - rootTransformer.processToken(); - } - let initializerName; - if (isStatic) { - initializerName = nameManager.claimFreeName("__initStatic"); - staticInitializerNames.push(initializerName); - } else { - initializerName = nameManager.claimFreeName("__init"); - instanceInitializerNames.push(initializerName); - } - // Fields start at the name, so `static x = 1;` has a field range of `x = 1;`. - fields.push({ - initializerName, - equalsIndex, - start: nameStartIndex, - end: tokens.currentIndex(), - }); - } else if (!disableESTransforms || isDeclareOrAbstract) { - // This is a regular field declaration, like `x;`. With the class transform enabled, we just - // remove the line so that no output is produced. With the class transform disabled, we - // usually want to preserve the declaration (but still strip types), but if the `declare` - // or `abstract` keyword is specified, we should remove the line to avoid initializing the - // value to undefined. - rangesToRemove.push({start: statementStartIndex, end: tokens.currentIndex()}); - } - } - } - - tokens.restoreToSnapshot(snapshot); - if (disableESTransforms) { - // With ES transforms disabled, we don't want to transform regular class - // field declarations, and we don't need to do any additional tricks to - // reference the constructor for static init, but we still need to transform - // TypeScript field initializers defined as constructor parameters and we - // still need to remove `declare` fields. For now, we run the same code - // path but omit any field information, as if the class had no field - // declarations. In the future, when we fully drop the class fields - // transform, we can simplify this code significantly. - return { - headerInfo, - constructorInitializerStatements, - instanceInitializerNames: [], - staticInitializerNames: [], - constructorInsertPos, - fields: [], - rangesToRemove, - }; - } else { - return { - headerInfo, - constructorInitializerStatements, - instanceInitializerNames, - staticInitializerNames, - constructorInsertPos, - fields, - rangesToRemove, - }; - } -} exports.default = getClassInfo; - -/** - * Move the token processor to the next method/field in the class. - * - * To do that, we seek forward to the next start of a class name (either an open - * bracket or an identifier, or the closing curly brace), then seek backward to - * include any access modifiers. - */ -function skipToNextClassElement(tokens, classContextId) { - tokens.nextToken(); - while (tokens.currentToken().contextId !== classContextId) { - tokens.nextToken(); - } - while (isAccessModifier(tokens.tokenAtRelativeIndex(-1))) { - tokens.previousToken(); - } -} - -function processClassHeader(tokens) { - const classToken = tokens.currentToken(); - const contextId = classToken.contextId; - if (contextId == null) { - throw new Error("Expected context ID on class token."); - } - const isExpression = classToken.isExpression; - if (isExpression == null) { - throw new Error("Expected isExpression on class token."); - } - let className = null; - let hasSuperclass = false; - tokens.nextToken(); - if (tokens.matches1(_types.TokenType.name)) { - className = tokens.identifierName(); - } - while (!tokens.matchesContextIdAndLabel(_types.TokenType.braceL, contextId)) { - // If this has a superclass, there will always be an `extends` token. If it doesn't have a - // superclass, only type parameters and `implements` clauses can show up here, all of which - // consist only of type tokens. A declaration like `class A {` should *not* count - // as having a superclass. - if (tokens.matches1(_types.TokenType._extends) && !tokens.currentToken().isType) { - hasSuperclass = true; - } - tokens.nextToken(); - } - return {isExpression, className, hasSuperclass}; -} - -/** - * Extract useful information out of a constructor, starting at the "constructor" name. - */ -function processConstructor(tokens) - - - { - const constructorInitializerStatements = []; - - tokens.nextToken(); - const constructorContextId = tokens.currentToken().contextId; - if (constructorContextId == null) { - throw new Error("Expected context ID on open-paren starting constructor params."); - } - // Advance through parameters looking for access modifiers. - while (!tokens.matchesContextIdAndLabel(_types.TokenType.parenR, constructorContextId)) { - if (tokens.currentToken().contextId === constructorContextId) { - // Current token is an open paren or comma just before a param, so check - // that param for access modifiers. - tokens.nextToken(); - if (isAccessModifier(tokens.currentToken())) { - tokens.nextToken(); - while (isAccessModifier(tokens.currentToken())) { - tokens.nextToken(); - } - const token = tokens.currentToken(); - if (token.type !== _types.TokenType.name) { - throw new Error("Expected identifier after access modifiers in constructor arg."); - } - const name = tokens.identifierNameForToken(token); - constructorInitializerStatements.push(`this.${name} = ${name}`); - } - } else { - tokens.nextToken(); - } - } - // ) - tokens.nextToken(); - // Constructor type annotations are invalid, but skip them anyway since - // they're easy to skip. - while (tokens.currentToken().isType) { - tokens.nextToken(); - } - let constructorInsertPos = tokens.currentIndex(); - - // Advance through body looking for a super call. - let foundSuperCall = false; - while (!tokens.matchesContextIdAndLabel(_types.TokenType.braceR, constructorContextId)) { - if (!foundSuperCall && tokens.matches2(_types.TokenType._super, _types.TokenType.parenL)) { - tokens.nextToken(); - const superCallContextId = tokens.currentToken().contextId; - if (superCallContextId == null) { - throw new Error("Expected a context ID on the super call"); - } - while (!tokens.matchesContextIdAndLabel(_types.TokenType.parenR, superCallContextId)) { - tokens.nextToken(); - } - constructorInsertPos = tokens.currentIndex(); - foundSuperCall = true; - } - tokens.nextToken(); - } - // } - tokens.nextToken(); - - return {constructorInitializerStatements, constructorInsertPos}; -} - -/** - * Determine if this is any token that can go before the name in a method/field. - */ -function isAccessModifier(token) { - return [ - _types.TokenType._async, - _types.TokenType._get, - _types.TokenType._set, - _types.TokenType.plus, - _types.TokenType.minus, - _types.TokenType._readonly, - _types.TokenType._static, - _types.TokenType._public, - _types.TokenType._private, - _types.TokenType._protected, - _types.TokenType._override, - _types.TokenType._abstract, - _types.TokenType.star, - _types.TokenType._declare, - _types.TokenType.hash, - ].includes(token.type); -} - -/** - * The next token or set of tokens is either an identifier or an expression in square brackets, for - * a method or field name. - */ -function skipFieldName(tokens) { - if (tokens.matches1(_types.TokenType.bracketL)) { - const startToken = tokens.currentToken(); - const classContextId = startToken.contextId; - if (classContextId == null) { - throw new Error("Expected class context ID on computed name open bracket."); - } - while (!tokens.matchesContextIdAndLabel(_types.TokenType.bracketR, classContextId)) { - tokens.nextToken(); - } - tokens.nextToken(); - } else { - tokens.nextToken(); - } -} diff --git a/node_modules/sucrase/dist/util/getDeclarationInfo.js b/node_modules/sucrase/dist/util/getDeclarationInfo.js deleted file mode 100644 index 465fc06..0000000 --- a/node_modules/sucrase/dist/util/getDeclarationInfo.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _tokenizer = require('../parser/tokenizer'); -var _types = require('../parser/tokenizer/types'); - - - - - - - - const EMPTY_DECLARATION_INFO = { - typeDeclarations: new Set(), - valueDeclarations: new Set(), -}; exports.EMPTY_DECLARATION_INFO = EMPTY_DECLARATION_INFO; - -/** - * Get all top-level identifiers that should be preserved when exported in TypeScript. - * - * Examples: - * - If an identifier is declared as `const x`, then `export {x}` should be preserved. - * - If it's declared as `type x`, then `export {x}` should be removed. - * - If it's declared as both `const x` and `type x`, then the export should be preserved. - * - Classes and enums should be preserved (even though they also introduce types). - * - Imported identifiers should be preserved since we don't have enough information to - * rule them out. --isolatedModules disallows re-exports, which catches errors here. - */ - function getDeclarationInfo(tokens) { - const typeDeclarations = new Set(); - const valueDeclarations = new Set(); - for (let i = 0; i < tokens.tokens.length; i++) { - const token = tokens.tokens[i]; - if (token.type === _types.TokenType.name && _tokenizer.isTopLevelDeclaration.call(void 0, token)) { - if (token.isType) { - typeDeclarations.add(tokens.identifierNameForToken(token)); - } else { - valueDeclarations.add(tokens.identifierNameForToken(token)); - } - } - } - return {typeDeclarations, valueDeclarations}; -} exports.default = getDeclarationInfo; diff --git a/node_modules/sucrase/dist/util/getIdentifierNames.js b/node_modules/sucrase/dist/util/getIdentifierNames.js deleted file mode 100644 index c0195ca..0000000 --- a/node_modules/sucrase/dist/util/getIdentifierNames.js +++ /dev/null @@ -1,15 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); -var _types = require('../parser/tokenizer/types'); - -/** - * Get all identifier names in the code, in order, including duplicates. - */ - function getIdentifierNames(code, tokens) { - const names = []; - for (const token of tokens) { - if (token.type === _types.TokenType.name) { - names.push(code.slice(token.start, token.end)); - } - } - return names; -} exports.default = getIdentifierNames; diff --git a/node_modules/sucrase/dist/util/getImportExportSpecifierInfo.js b/node_modules/sucrase/dist/util/getImportExportSpecifierInfo.js deleted file mode 100644 index 45edb74..0000000 --- a/node_modules/sucrase/dist/util/getImportExportSpecifierInfo.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _types = require('../parser/tokenizer/types'); - - - - - - - - - - - - - - - - -/** - * Determine information about this named import or named export specifier. - * - * This syntax is the `a` from statements like these: - * import {A} from "./foo"; - * export {A}; - * export {A} from "./foo"; - * - * As it turns out, we can exactly characterize the syntax meaning by simply - * counting the number of tokens, which can be from 1 to 4: - * {A} - * {type A} - * {A as B} - * {type A as B} - * - * In the type case, we never actually need the names in practice, so don't get - * them. - * - * TODO: There's some redundancy with the type detection here and the isType - * flag that's already present on tokens in TS mode. This function could - * potentially be simplified and/or pushed to the call sites to avoid the object - * allocation. - */ - function getImportExportSpecifierInfo( - tokens, - index = tokens.currentIndex(), -) { - let endIndex = index + 1; - if (isSpecifierEnd(tokens, endIndex)) { - // import {A} - const name = tokens.identifierNameAtIndex(index); - return { - isType: false, - leftName: name, - rightName: name, - endIndex, - }; - } - endIndex++; - if (isSpecifierEnd(tokens, endIndex)) { - // import {type A} - return { - isType: true, - leftName: null, - rightName: null, - endIndex, - }; - } - endIndex++; - if (isSpecifierEnd(tokens, endIndex)) { - // import {A as B} - return { - isType: false, - leftName: tokens.identifierNameAtIndex(index), - rightName: tokens.identifierNameAtIndex(index + 2), - endIndex, - }; - } - endIndex++; - if (isSpecifierEnd(tokens, endIndex)) { - // import {type A as B} - return { - isType: true, - leftName: null, - rightName: null, - endIndex, - }; - } - throw new Error(`Unexpected import/export specifier at ${index}`); -} exports.default = getImportExportSpecifierInfo; - -function isSpecifierEnd(tokens, index) { - const token = tokens.tokens[index]; - return token.type === _types.TokenType.braceR || token.type === _types.TokenType.comma; -} diff --git a/node_modules/sucrase/dist/util/getJSXPragmaInfo.js b/node_modules/sucrase/dist/util/getJSXPragmaInfo.js deleted file mode 100644 index 67513db..0000000 --- a/node_modules/sucrase/dist/util/getJSXPragmaInfo.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); - - - - - - - - - function getJSXPragmaInfo(options) { - const [base, suffix] = splitPragma(options.jsxPragma || "React.createElement"); - const [fragmentBase, fragmentSuffix] = splitPragma(options.jsxFragmentPragma || "React.Fragment"); - return {base, suffix, fragmentBase, fragmentSuffix}; -} exports.default = getJSXPragmaInfo; - -function splitPragma(pragma) { - let dotIndex = pragma.indexOf("."); - if (dotIndex === -1) { - dotIndex = pragma.length; - } - return [pragma.slice(0, dotIndex), pragma.slice(dotIndex)]; -} diff --git a/node_modules/sucrase/dist/util/getNonTypeIdentifiers.js b/node_modules/sucrase/dist/util/getNonTypeIdentifiers.js deleted file mode 100644 index 86d9daf..0000000 --- a/node_modules/sucrase/dist/util/getNonTypeIdentifiers.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _tokenizer = require('../parser/tokenizer'); -var _types = require('../parser/tokenizer/types'); - -var _JSXTransformer = require('../transformers/JSXTransformer'); -var _getJSXPragmaInfo = require('./getJSXPragmaInfo'); var _getJSXPragmaInfo2 = _interopRequireDefault(_getJSXPragmaInfo); - - function getNonTypeIdentifiers(tokens, options) { - const jsxPragmaInfo = _getJSXPragmaInfo2.default.call(void 0, options); - const nonTypeIdentifiers = new Set(); - for (let i = 0; i < tokens.tokens.length; i++) { - const token = tokens.tokens[i]; - if ( - token.type === _types.TokenType.name && - !token.isType && - (token.identifierRole === _tokenizer.IdentifierRole.Access || - token.identifierRole === _tokenizer.IdentifierRole.ObjectShorthand || - token.identifierRole === _tokenizer.IdentifierRole.ExportAccess) && - !token.shadowsGlobal - ) { - nonTypeIdentifiers.add(tokens.identifierNameForToken(token)); - } - if (token.type === _types.TokenType.jsxTagStart) { - nonTypeIdentifiers.add(jsxPragmaInfo.base); - } - if ( - token.type === _types.TokenType.jsxTagStart && - i + 1 < tokens.tokens.length && - tokens.tokens[i + 1].type === _types.TokenType.jsxTagEnd - ) { - nonTypeIdentifiers.add(jsxPragmaInfo.base); - nonTypeIdentifiers.add(jsxPragmaInfo.fragmentBase); - } - if (token.type === _types.TokenType.jsxName && token.identifierRole === _tokenizer.IdentifierRole.Access) { - const identifierName = tokens.identifierNameForToken(token); - // Lower-case single-component tag names like "div" don't count. - if (!_JSXTransformer.startsWithLowerCase.call(void 0, identifierName) || tokens.tokens[i + 1].type === _types.TokenType.dot) { - nonTypeIdentifiers.add(tokens.identifierNameForToken(token)); - } - } - } - return nonTypeIdentifiers; -} exports.getNonTypeIdentifiers = getNonTypeIdentifiers; diff --git a/node_modules/sucrase/dist/util/getTSImportedNames.js b/node_modules/sucrase/dist/util/getTSImportedNames.js deleted file mode 100644 index 5c5362c..0000000 --- a/node_modules/sucrase/dist/util/getTSImportedNames.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _types = require('../parser/tokenizer/types'); - -var _getImportExportSpecifierInfo = require('./getImportExportSpecifierInfo'); var _getImportExportSpecifierInfo2 = _interopRequireDefault(_getImportExportSpecifierInfo); - -/** - * Special case code to scan for imported names in ESM TypeScript. We need to do this so we can - * properly get globals so we can compute shadowed globals. - * - * This is similar to logic in CJSImportProcessor, but trimmed down to avoid logic with CJS - * replacement and flow type imports. - */ - function getTSImportedNames(tokens) { - const importedNames = new Set(); - for (let i = 0; i < tokens.tokens.length; i++) { - if ( - tokens.matches1AtIndex(i, _types.TokenType._import) && - !tokens.matches3AtIndex(i, _types.TokenType._import, _types.TokenType.name, _types.TokenType.eq) - ) { - collectNamesForImport(tokens, i, importedNames); - } - } - return importedNames; -} exports.default = getTSImportedNames; - -function collectNamesForImport( - tokens, - index, - importedNames, -) { - index++; - - if (tokens.matches1AtIndex(index, _types.TokenType.parenL)) { - // Dynamic import, so nothing to do - return; - } - - if (tokens.matches1AtIndex(index, _types.TokenType.name)) { - importedNames.add(tokens.identifierNameAtIndex(index)); - index++; - if (tokens.matches1AtIndex(index, _types.TokenType.comma)) { - index++; - } - } - - if (tokens.matches1AtIndex(index, _types.TokenType.star)) { - // * as - index += 2; - importedNames.add(tokens.identifierNameAtIndex(index)); - index++; - } - - if (tokens.matches1AtIndex(index, _types.TokenType.braceL)) { - index++; - collectNamesForNamedImport(tokens, index, importedNames); - } -} - -function collectNamesForNamedImport( - tokens, - index, - importedNames, -) { - while (true) { - if (tokens.matches1AtIndex(index, _types.TokenType.braceR)) { - return; - } - - const specifierInfo = _getImportExportSpecifierInfo2.default.call(void 0, tokens, index); - index = specifierInfo.endIndex; - if (!specifierInfo.isType) { - importedNames.add(specifierInfo.rightName); - } - - if (tokens.matches2AtIndex(index, _types.TokenType.comma, _types.TokenType.braceR)) { - return; - } else if (tokens.matches1AtIndex(index, _types.TokenType.braceR)) { - return; - } else if (tokens.matches1AtIndex(index, _types.TokenType.comma)) { - index++; - } else { - throw new Error(`Unexpected token: ${JSON.stringify(tokens.tokens[index])}`); - } - } -} diff --git a/node_modules/sucrase/dist/util/isAsyncOperation.js b/node_modules/sucrase/dist/util/isAsyncOperation.js deleted file mode 100644 index c02023a..0000000 --- a/node_modules/sucrase/dist/util/isAsyncOperation.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _keywords = require('../parser/tokenizer/keywords'); - - -/** - * Determine whether this optional chain or nullish coalescing operation has any await statements in - * it. If so, we'll need to transpile to an async operation. - * - * We compute this by walking the length of the operation and returning true if we see an await - * keyword used as a real await (rather than an object key or property access). Nested optional - * chain/nullish operations need to be tracked but don't silence await, but a nested async function - * (or any other nested scope) will make the await not count. - */ - function isAsyncOperation(tokens) { - let index = tokens.currentIndex(); - let depth = 0; - const startToken = tokens.currentToken(); - do { - const token = tokens.tokens[index]; - if (token.isOptionalChainStart) { - depth++; - } - if (token.isOptionalChainEnd) { - depth--; - } - depth += token.numNullishCoalesceStarts; - depth -= token.numNullishCoalesceEnds; - - if ( - token.contextualKeyword === _keywords.ContextualKeyword._await && - token.identifierRole == null && - token.scopeDepth === startToken.scopeDepth - ) { - return true; - } - index += 1; - } while (depth > 0 && index < tokens.tokens.length); - return false; -} exports.default = isAsyncOperation; diff --git a/node_modules/sucrase/dist/util/isExportFrom.js b/node_modules/sucrase/dist/util/isExportFrom.js deleted file mode 100644 index 830a0fe..0000000 --- a/node_modules/sucrase/dist/util/isExportFrom.js +++ /dev/null @@ -1,18 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _keywords = require('../parser/tokenizer/keywords'); -var _types = require('../parser/tokenizer/types'); - - -/** - * Starting at `export {`, look ahead and return `true` if this is an - * `export {...} from` statement and `false` if this is a plain multi-export. - */ - function isExportFrom(tokens) { - let closeBraceIndex = tokens.currentIndex(); - while (!tokens.matches1AtIndex(closeBraceIndex, _types.TokenType.braceR)) { - closeBraceIndex++; - } - return ( - tokens.matchesContextualAtIndex(closeBraceIndex + 1, _keywords.ContextualKeyword._from) && - tokens.matches1AtIndex(closeBraceIndex + 2, _types.TokenType.string) - ); -} exports.default = isExportFrom; diff --git a/node_modules/sucrase/dist/util/isIdentifier.js b/node_modules/sucrase/dist/util/isIdentifier.js deleted file mode 100644 index 8be8cf4..0000000 --- a/node_modules/sucrase/dist/util/isIdentifier.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _identifier = require('../parser/util/identifier'); - -// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar -// Hard-code a list of reserved words rather than trying to use keywords or contextual keywords -// from the parser, since currently there are various exceptions, like `package` being reserved -// but unused and various contextual keywords being reserved. Note that we assume that all code -// compiled by Sucrase is in a module, so strict mode words and await are all considered reserved -// here. -const RESERVED_WORDS = new Set([ - // Reserved keywords as of ECMAScript 2015 - "break", - "case", - "catch", - "class", - "const", - "continue", - "debugger", - "default", - "delete", - "do", - "else", - "export", - "extends", - "finally", - "for", - "function", - "if", - "import", - "in", - "instanceof", - "new", - "return", - "super", - "switch", - "this", - "throw", - "try", - "typeof", - "var", - "void", - "while", - "with", - "yield", - // Future reserved keywords - "enum", - "implements", - "interface", - "let", - "package", - "private", - "protected", - "public", - "static", - "await", - // Literals that cannot be used as identifiers - "false", - "null", - "true", -]); - -/** - * Determine if the given name is a legal variable name. - * - * This is needed when transforming TypeScript enums; if an enum key is a valid - * variable name, it might be referenced later in the enum, so we need to - * declare a variable. - */ - function isIdentifier(name) { - if (name.length === 0) { - return false; - } - if (!_identifier.IS_IDENTIFIER_START[name.charCodeAt(0)]) { - return false; - } - for (let i = 1; i < name.length; i++) { - if (!_identifier.IS_IDENTIFIER_CHAR[name.charCodeAt(i)]) { - return false; - } - } - return !RESERVED_WORDS.has(name); -} exports.default = isIdentifier; diff --git a/node_modules/sucrase/dist/util/removeMaybeImportAttributes.js b/node_modules/sucrase/dist/util/removeMaybeImportAttributes.js deleted file mode 100644 index fd0b142..0000000 --- a/node_modules/sucrase/dist/util/removeMaybeImportAttributes.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _keywords = require('../parser/tokenizer/keywords'); -var _types = require('../parser/tokenizer/types'); - - -/** - * Starting at a potential `with` or (legacy) `assert` token, remove the import - * attributes if they exist. - */ - function removeMaybeImportAttributes(tokens) { - if ( - tokens.matches2(_types.TokenType._with, _types.TokenType.braceL) || - (tokens.matches2(_types.TokenType.name, _types.TokenType.braceL) && tokens.matchesContextual(_keywords.ContextualKeyword._assert)) - ) { - // assert - tokens.removeToken(); - // { - tokens.removeToken(); - tokens.removeBalancedCode(); - // } - tokens.removeToken(); - } -} exports.removeMaybeImportAttributes = removeMaybeImportAttributes; diff --git a/node_modules/sucrase/dist/util/shouldElideDefaultExport.js b/node_modules/sucrase/dist/util/shouldElideDefaultExport.js deleted file mode 100644 index 3525feb..0000000 --- a/node_modules/sucrase/dist/util/shouldElideDefaultExport.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _types = require('../parser/tokenizer/types'); - - - -/** - * Common method sharing code between CJS and ESM cases, since they're the same here. - */ - function shouldElideDefaultExport( - isTypeScriptTransformEnabled, - keepUnusedImports, - tokens, - declarationInfo, -) { - if (!isTypeScriptTransformEnabled || keepUnusedImports) { - return false; - } - const exportToken = tokens.currentToken(); - if (exportToken.rhsEndIndex == null) { - throw new Error("Expected non-null rhsEndIndex on export token."); - } - // The export must be of the form `export default a` or `export default a;`. - const numTokens = exportToken.rhsEndIndex - tokens.currentIndex(); - if ( - numTokens !== 3 && - !(numTokens === 4 && tokens.matches1AtIndex(exportToken.rhsEndIndex - 1, _types.TokenType.semi)) - ) { - return false; - } - const identifierToken = tokens.tokenAtRelativeIndex(2); - if (identifierToken.type !== _types.TokenType.name) { - return false; - } - const exportedName = tokens.identifierNameForToken(identifierToken); - return ( - declarationInfo.typeDeclarations.has(exportedName) && - !declarationInfo.valueDeclarations.has(exportedName) - ); -} exports.default = shouldElideDefaultExport; diff --git a/node_modules/sucrase/package.json b/node_modules/sucrase/package.json deleted file mode 100644 index 7bccf70..0000000 --- a/node_modules/sucrase/package.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "name": "sucrase", - "version": "3.35.1", - "description": "Super-fast alternative to Babel for when you can target modern JS runtimes", - "author": "Alan Pierce ", - "license": "MIT", - "main": "dist/index.js", - "module": "dist/esm/index.js", - "types": "dist/types/index.d.ts", - "bin": { - "sucrase": "./bin/sucrase", - "sucrase-node": "./bin/sucrase-node" - }, - "scripts": { - "build": "sucrase-node script/build.ts", - "fast-build": "sucrase-node script/build.ts --fast", - "clean": "rm -rf ./build ./dist ./dist-self-build ./dist-types ./example-runner/example-repos ./spec-compliance-tests/test262/test262-checkout ./spec-compliance-tests/babel-tests/babel-tests-checkout", - "generate": "sucrase-node generator/generate.ts", - "benchmark": "cd benchmark && yarn && sucrase-node ./benchmark.ts", - "benchmark-compare": "sucrase-node ./benchmark/compare-performance.ts", - "microbenchmark": "sucrase-node benchmark/microbenchmark.ts", - "lint": "sucrase-node script/lint.ts", - "lint-fix": "sucrase-node script/lint.ts --fix", - "profile": "node --inspect-brk ./node_modules/.bin/sucrase-node ./benchmark/profile", - "profile-project": "node --inspect-brk ./node_modules/.bin/sucrase-node ./benchmark/benchmark-project.ts --profile", - "prepublishOnly": "yarn clean && yarn build", - "release": "sucrase-node script/release.ts", - "run-examples": "sucrase-node example-runner/example-runner.ts", - "test": "yarn lint && yarn test-only", - "test-only": "mocha './test/**/*.ts'", - "integration-test": "cd integration-test && yarn && yarn link @sucrase/jest-plugin && mocha --timeout 10000 ./integration-tests.ts", - "test262": "sucrase-node spec-compliance-tests/test262/run-test262.ts", - "check-babel-tests": "sucrase-node spec-compliance-tests/babel-tests/check-babel-tests.ts", - "test-with-coverage": "nyc mocha './test/**/*.ts'", - "report-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov" - }, - "repository": { - "type": "git", - "url": "https://github.com/alangpierce/sucrase.git" - }, - "keywords": [ - "babel", - "jsx", - "typescript", - "flow" - ], - "bugs": { - "url": "https://github.com/alangpierce/sucrase/issues" - }, - "devDependencies": { - "@babel/core": "^7.22.5", - "@jridgewell/trace-mapping": "^0.3.18", - "@types/mocha": "^9.1.1", - "@types/mz": "^2.7.4", - "@types/node": "^20.3.2", - "@typescript-eslint/eslint-plugin": "^5.60.1", - "@typescript-eslint/parser": "^5.60.1", - "chalk": "^4", - "codecov": "^3.8.3", - "eslint": "^8.43.0", - "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-import": "~2.26", - "eslint-plugin-prettier": "^4.2.1", - "mocha": "^10.2.0", - "nyc": "^15.1.0", - "prettier": "^2.8.8", - "sucrase": "^3.35.0", - "test262-harness": "^10.0.0", - "ts-interface-builder": "^0.3.3", - "typescript": "~5.0" - }, - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.2", - "commander": "^4.0.0", - "lines-and-columns": "^1.1.6", - "mz": "^2.7.0", - "pirates": "^4.0.1", - "tinyglobby": "^0.2.11", - "ts-interface-checker": "^0.1.9" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "resolutions": { - "**/eshost/socket.io": "4.7.0" - } -} diff --git a/node_modules/sucrase/register/index.js b/node_modules/sucrase/register/index.js deleted file mode 100644 index f6eb814..0000000 --- a/node_modules/sucrase/register/index.js +++ /dev/null @@ -1 +0,0 @@ -require("../dist/register").registerAll(); diff --git a/node_modules/sucrase/register/js.js b/node_modules/sucrase/register/js.js deleted file mode 100644 index 4891896..0000000 --- a/node_modules/sucrase/register/js.js +++ /dev/null @@ -1 +0,0 @@ -require("../dist/register").registerJS(); diff --git a/node_modules/sucrase/register/jsx.js b/node_modules/sucrase/register/jsx.js deleted file mode 100644 index 4bd476e..0000000 --- a/node_modules/sucrase/register/jsx.js +++ /dev/null @@ -1 +0,0 @@ -require("../dist/register").registerJSX(); diff --git a/node_modules/sucrase/register/ts-legacy-module-interop.js b/node_modules/sucrase/register/ts-legacy-module-interop.js deleted file mode 100644 index 1ec5a6d..0000000 --- a/node_modules/sucrase/register/ts-legacy-module-interop.js +++ /dev/null @@ -1 +0,0 @@ -require("../dist/register").registerTSLegacyModuleInterop(); diff --git a/node_modules/sucrase/register/ts.js b/node_modules/sucrase/register/ts.js deleted file mode 100644 index 23b8c88..0000000 --- a/node_modules/sucrase/register/ts.js +++ /dev/null @@ -1 +0,0 @@ -require("../dist/register").registerTS(); diff --git a/node_modules/sucrase/register/tsx-legacy-module-interop.js b/node_modules/sucrase/register/tsx-legacy-module-interop.js deleted file mode 100644 index a883680..0000000 --- a/node_modules/sucrase/register/tsx-legacy-module-interop.js +++ /dev/null @@ -1 +0,0 @@ -require("../dist/register").registerTSXLegacyModuleInterop(); diff --git a/node_modules/sucrase/register/tsx.js b/node_modules/sucrase/register/tsx.js deleted file mode 100644 index deb8b34..0000000 --- a/node_modules/sucrase/register/tsx.js +++ /dev/null @@ -1 +0,0 @@ -require("../dist/register").registerTSX(); diff --git a/node_modules/sucrase/ts-node-plugin/index.js b/node_modules/sucrase/ts-node-plugin/index.js deleted file mode 100644 index b523fb3..0000000 --- a/node_modules/sucrase/ts-node-plugin/index.js +++ /dev/null @@ -1,83 +0,0 @@ -const {transform} = require("../dist"); - -// Enum constants taken from the TypeScript codebase. -const ModuleKindCommonJS = 1; - -const JsxEmitReactJSX = 4; -const JsxEmitReactJSXDev = 5; - -/** - * ts-node transpiler plugin - * - * This plugin hooks into ts-node so that Sucrase can handle all TS-to-JS - * conversion while ts-node handles the ESM loader, require hook, REPL - * integration, etc. ts-node automatically discovers the relevant tsconfig file, - * so the main logic in this integration is translating tsconfig options to the - * corresponding Sucrase options. - * - * Any tsconfig options relevant to Sucrase are translated, but some config - * options outside the scope of Sucrase are ignored. For example, we assume the - * isolatedModules option, and we ignore target because Sucrase doesn't provide - * JS syntax downleveling (at least not in a way that is useful for Node). - * - * One notable caveat is that importsNotUsedAsValues and preserveValueImports - * are ignored right now, since they are deprecated and don't have exact Sucrase - * equivalents. To preserve imports and exports, use verbatimModuleSyntax. - */ -function create(createOptions) { - const {nodeModuleEmitKind} = createOptions; - const { - module, - jsx, - jsxFactory, - jsxFragmentFactory, - jsxImportSource, - esModuleInterop, - verbatimModuleSyntax, - } = createOptions.service.config.options; - - return { - transpile(input, transpileOptions) { - const {fileName} = transpileOptions; - const transforms = []; - // Detect JS rather than TS so we bias toward including the typescript - // transform, since almost always it doesn't hurt to include. - const isJS = - fileName.endsWith(".js") || - fileName.endsWith(".jsx") || - fileName.endsWith(".mjs") || - fileName.endsWith(".cjs"); - if (!isJS) { - transforms.push("typescript"); - } - if (module === ModuleKindCommonJS || nodeModuleEmitKind === "nodecjs") { - transforms.push("imports"); - } - if (fileName.endsWith(".tsx") || fileName.endsWith(".jsx")) { - transforms.push("jsx"); - } - - const {code, sourceMap} = transform(input, { - transforms, - disableESTransforms: true, - jsxRuntime: jsx === JsxEmitReactJSX || jsx === JsxEmitReactJSXDev ? "automatic" : "classic", - production: jsx === JsxEmitReactJSX, - jsxImportSource, - jsxPragma: jsxFactory, - jsxFragmentPragma: jsxFragmentFactory, - keepUnusedImports: verbatimModuleSyntax, - preserveDynamicImport: nodeModuleEmitKind === "nodecjs", - injectCreateRequireForImportRequire: nodeModuleEmitKind === "nodeesm", - enableLegacyTypeScriptModuleInterop: !esModuleInterop, - sourceMapOptions: {compiledFilename: fileName}, - filePath: fileName, - }); - return { - outputText: code, - sourceMapText: JSON.stringify(sourceMap), - }; - }, - }; -} - -exports.create = create; 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/tailwindcss/LICENSE b/node_modules/tailwindcss/LICENSE deleted file mode 100644 index d6a8229..0000000 --- a/node_modules/tailwindcss/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) Tailwind Labs, 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/tailwindcss/README.md b/node_modules/tailwindcss/README.md deleted file mode 100644 index 14c29a3..0000000 --- a/node_modules/tailwindcss/README.md +++ /dev/null @@ -1,40 +0,0 @@ -

- - - - - Tailwind CSS - - -

- -

- A utility-first CSS framework for rapidly building custom user interfaces. -

- -

- Build Status - Total Downloads - Latest Release - License -

- ---- - -## Documentation - -For full documentation, visit [tailwindcss.com](https://tailwindcss.com/). - -## Community - -For help, discussion about best practices, or any other conversation that would benefit from being searchable: - -[Discuss Tailwind CSS on GitHub](https://github.com/tailwindcss/tailwindcss/discussions) - -For casual chit-chat with others using the framework: - -[Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe) - -## Contributing - -If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindcss/tailwindcss/blob/main/.github/CONTRIBUTING.md) **before submitting a pull request**. diff --git a/node_modules/tailwindcss/base.css b/node_modules/tailwindcss/base.css deleted file mode 100644 index 2f02db5..0000000 --- a/node_modules/tailwindcss/base.css +++ /dev/null @@ -1 +0,0 @@ -@tailwind base; diff --git a/node_modules/tailwindcss/colors.d.ts b/node_modules/tailwindcss/colors.d.ts deleted file mode 100644 index d85ab86..0000000 --- a/node_modules/tailwindcss/colors.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { DefaultColors } from './types/generated/colors' -declare const colors: DefaultColors -export = colors diff --git a/node_modules/tailwindcss/colors.js b/node_modules/tailwindcss/colors.js deleted file mode 100644 index c6f9149..0000000 --- a/node_modules/tailwindcss/colors.js +++ /dev/null @@ -1,2 +0,0 @@ -let colors = require('./lib/public/colors') -module.exports = (colors.__esModule ? colors : { default: colors }).default diff --git a/node_modules/tailwindcss/components.css b/node_modules/tailwindcss/components.css deleted file mode 100644 index 020aaba..0000000 --- a/node_modules/tailwindcss/components.css +++ /dev/null @@ -1 +0,0 @@ -@tailwind components; diff --git a/node_modules/tailwindcss/defaultConfig.d.ts b/node_modules/tailwindcss/defaultConfig.d.ts deleted file mode 100644 index 2c2bccf..0000000 --- a/node_modules/tailwindcss/defaultConfig.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Config } from './types/config' -declare const config: Config -export = config diff --git a/node_modules/tailwindcss/defaultConfig.js b/node_modules/tailwindcss/defaultConfig.js deleted file mode 100644 index 7b63587..0000000 --- a/node_modules/tailwindcss/defaultConfig.js +++ /dev/null @@ -1,2 +0,0 @@ -let defaultConfig = require('./lib/public/default-config') -module.exports = (defaultConfig.__esModule ? defaultConfig : { default: defaultConfig }).default diff --git a/node_modules/tailwindcss/defaultTheme.d.ts b/node_modules/tailwindcss/defaultTheme.d.ts deleted file mode 100644 index 2bc9dc7..0000000 --- a/node_modules/tailwindcss/defaultTheme.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Config } from './types/config' -import { DefaultTheme } from './types/generated/default-theme' -declare const theme: Config['theme'] & DefaultTheme -export = theme diff --git a/node_modules/tailwindcss/defaultTheme.js b/node_modules/tailwindcss/defaultTheme.js deleted file mode 100644 index 991526d..0000000 --- a/node_modules/tailwindcss/defaultTheme.js +++ /dev/null @@ -1,2 +0,0 @@ -let defaultTheme = require('./lib/public/default-theme') -module.exports = (defaultTheme.__esModule ? defaultTheme : { default: defaultTheme }).default diff --git a/node_modules/tailwindcss/lib/cli-peer-dependencies.js b/node_modules/tailwindcss/lib/cli-peer-dependencies.js deleted file mode 100644 index 4b64be2..0000000 --- a/node_modules/tailwindcss/lib/cli-peer-dependencies.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] - }); -} -_export(exports, { - lazyPostcss: function() { - return lazyPostcss; - }, - lazyPostcssImport: function() { - return lazyPostcssImport; - }, - lazyAutoprefixer: function() { - return lazyAutoprefixer; - }, - lazyCssnano: function() { - return lazyCssnano; - } -}); -function lazyPostcss() { - return require("postcss"); -} -function lazyPostcssImport() { - return require("postcss-import"); -} -function lazyAutoprefixer() { - return require("autoprefixer"); -} -function lazyCssnano() { - return require("cssnano"); -} diff --git a/node_modules/tailwindcss/lib/cli.js b/node_modules/tailwindcss/lib/cli.js deleted file mode 100755 index 1cdfd6e..0000000 --- a/node_modules/tailwindcss/lib/cli.js +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env node -"use strict"; -module.exports = require("./cli/index"); diff --git a/node_modules/tailwindcss/lib/cli/build/deps.js b/node_modules/tailwindcss/lib/cli/build/deps.js deleted file mode 100644 index 1aa8116..0000000 --- a/node_modules/tailwindcss/lib/cli/build/deps.js +++ /dev/null @@ -1,62 +0,0 @@ -// @ts-check -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] - }); -} -_export(exports, { - loadPostcss: function() { - return loadPostcss; - }, - loadPostcssImport: function() { - return loadPostcssImport; - }, - loadCssNano: function() { - return loadCssNano; - }, - loadAutoprefixer: function() { - return loadAutoprefixer; - } -}); -const _index = require("../../../peers/index.js"); -function loadPostcss() { - // Try to load a local `postcss` version first - try { - return require("postcss"); - } catch {} - return (0, _index.lazyPostcss)(); -} -function loadPostcssImport() { - // Try to load a local `postcss-import` version first - try { - return require("postcss-import"); - } catch {} - return (0, _index.lazyPostcssImport)(); -} -function loadCssNano() { - let options = { - preset: [ - "default", - { - cssDeclarationSorter: false - } - ] - }; - // Try to load a local `cssnano` version first - try { - return require("cssnano"); - } catch {} - return (0, _index.lazyCssnano)()(options); -} -function loadAutoprefixer() { - // Try to load a local `autoprefixer` version first - try { - return require("autoprefixer"); - } catch {} - return (0, _index.lazyAutoprefixer)(); -} diff --git a/node_modules/tailwindcss/lib/cli/build/index.js b/node_modules/tailwindcss/lib/cli/build/index.js deleted file mode 100644 index 60304f6..0000000 --- a/node_modules/tailwindcss/lib/cli/build/index.js +++ /dev/null @@ -1,54 +0,0 @@ -// @ts-check -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "build", { - enumerable: true, - get: function() { - return build; - } -}); -const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); -const _path = /*#__PURE__*/ _interop_require_default(require("path")); -const _resolveConfigPath = require("../../util/resolveConfigPath.js"); -const _plugin = require("./plugin.js"); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -async function build(args) { - let input = args["--input"]; - let shouldWatch = args["--watch"]; - // TODO: Deprecate this in future versions - if (!input && args["_"][1]) { - console.error("[deprecation] Running tailwindcss without -i, please provide an input file."); - input = args["--input"] = args["_"][1]; - } - if (input && input !== "-" && !_fs.default.existsSync(input = _path.default.resolve(input))) { - console.error(`Specified input file ${args["--input"]} does not exist.`); - process.exit(9); - } - if (args["--config"] && !_fs.default.existsSync(args["--config"] = _path.default.resolve(args["--config"]))) { - console.error(`Specified config file ${args["--config"]} does not exist.`); - process.exit(9); - } - // TODO: Reference the @config path here if exists - let configPath = args["--config"] ? args["--config"] : (0, _resolveConfigPath.resolveDefaultConfigPath)(); - let processor = await (0, _plugin.createProcessor)(args, configPath); - if (shouldWatch) { - // Abort the watcher if stdin is closed to avoid zombie processes - // You can disable this behavior with --watch=always - if (args["--watch"] !== "always") { - process.stdin.on("end", ()=>process.exit(0)); - } - process.stdin.resume(); - await processor.watch(); - } else { - await processor.build().catch((e)=>{ - console.error(e); - process.exit(1); - }); - } -} diff --git a/node_modules/tailwindcss/lib/cli/build/plugin.js b/node_modules/tailwindcss/lib/cli/build/plugin.js deleted file mode 100644 index 5714067..0000000 --- a/node_modules/tailwindcss/lib/cli/build/plugin.js +++ /dev/null @@ -1,376 +0,0 @@ -// @ts-check -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "createProcessor", { - enumerable: true, - get: function() { - return createProcessor; - } -}); -const _path = /*#__PURE__*/ _interop_require_default(require("path")); -const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); -const _postcssloadconfig = /*#__PURE__*/ _interop_require_default(require("postcss-load-config")); -const _lilconfig = require("lilconfig"); -const _plugins = /*#__PURE__*/ _interop_require_default(require("postcss-load-config/src/plugins" // Little bit scary, looking at private/internal API -)); -const _options = /*#__PURE__*/ _interop_require_default(require("postcss-load-config/src/options" // Little bit scary, looking at private/internal API -)); -const _processTailwindFeatures = /*#__PURE__*/ _interop_require_default(require("../../processTailwindFeatures")); -const _deps = require("./deps"); -const _utils = require("./utils"); -const _sharedState = require("../../lib/sharedState"); -const _resolveConfig = /*#__PURE__*/ _interop_require_default(require("../../../resolveConfig.js")); -const _content = require("../../lib/content.js"); -const _watching = require("./watching.js"); -const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob")); -const _findAtConfigPath = require("../../lib/findAtConfigPath.js"); -const _log = /*#__PURE__*/ _interop_require_default(require("../../util/log")); -const _loadconfig = require("../../lib/load-config"); -const _getModuleDependencies = /*#__PURE__*/ _interop_require_default(require("../../lib/getModuleDependencies")); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -/** - * - * @param {string} [customPostCssPath ] - * @returns - */ async function loadPostCssPlugins(customPostCssPath) { - let config = customPostCssPath ? await (async ()=>{ - let file = _path.default.resolve(customPostCssPath); - // Implementation, see: https://unpkg.com/browse/postcss-load-config@3.1.0/src/index.js - // @ts-ignore - let { config ={} } = await (0, _lilconfig.lilconfig)("postcss").load(file); - if (typeof config === "function") { - config = config(); - } else { - config = Object.assign({}, config); - } - if (!config.plugins) { - config.plugins = []; - } - // We have to await these because in v5 and v6 of postcss-load-config - // these functions return promises while they don't in v4. Awaiting a - // non-promise is basically a no-op so this is safe to do. - return { - file, - plugins: await (0, _plugins.default)(config, file), - options: await (0, _options.default)(config, file) - }; - })() : await (0, _postcssloadconfig.default)(); - let configPlugins = config.plugins; - let configPluginTailwindIdx = configPlugins.findIndex((plugin)=>{ - if (typeof plugin === "function" && plugin.name === "tailwindcss") { - return true; - } - if (typeof plugin === "object" && plugin !== null && plugin.postcssPlugin === "tailwindcss") { - return true; - } - return false; - }); - let beforePlugins = configPluginTailwindIdx === -1 ? [] : configPlugins.slice(0, configPluginTailwindIdx); - let afterPlugins = configPluginTailwindIdx === -1 ? configPlugins : configPlugins.slice(configPluginTailwindIdx + 1); - return [ - beforePlugins, - afterPlugins, - config.options - ]; -} -function loadBuiltinPostcssPlugins() { - let postcss = (0, _deps.loadPostcss)(); - let IMPORT_COMMENT = "__TAILWIND_RESTORE_IMPORT__: "; - return [ - [ - (root)=>{ - root.walkAtRules("import", (rule)=>{ - if (rule.params.slice(1).startsWith("tailwindcss/")) { - rule.after(postcss.comment({ - text: IMPORT_COMMENT + rule.params - })); - rule.remove(); - } - }); - }, - (0, _deps.loadPostcssImport)(), - (root)=>{ - root.walkComments((rule)=>{ - if (rule.text.startsWith(IMPORT_COMMENT)) { - rule.after(postcss.atRule({ - name: "import", - params: rule.text.replace(IMPORT_COMMENT, "") - })); - rule.remove(); - } - }); - } - ], - [], - {} - ]; -} -let state = { - /** @type {any} */ context: null, - /** @type {ReturnType | null} */ watcher: null, - /** @type {{content: string, extension: string}[]} */ changedContent: [], - /** @type {ReturnType | null} */ configBag: null, - contextDependencies: new Set(), - /** @type {import('../../lib/content.js').ContentPath[]} */ contentPaths: [], - refreshContentPaths () { - var _this_context; - this.contentPaths = (0, _content.parseCandidateFiles)(this.context, (_this_context = this.context) === null || _this_context === void 0 ? void 0 : _this_context.tailwindConfig); - }, - get config () { - return this.context.tailwindConfig; - }, - get contentPatterns () { - return { - all: this.contentPaths.map((contentPath)=>contentPath.pattern), - dynamic: this.contentPaths.filter((contentPath)=>contentPath.glob !== undefined).map((contentPath)=>contentPath.pattern) - }; - }, - loadConfig (configPath, content) { - if (this.watcher && configPath) { - this.refreshConfigDependencies(); - } - let config = (0, _loadconfig.loadConfig)(configPath); - let dependencies = (0, _getModuleDependencies.default)(configPath); - this.configBag = { - config, - dependencies, - dispose () { - for (let file of dependencies){ - delete require.cache[require.resolve(file)]; - } - } - }; - // @ts-ignore - this.configBag.config = (0, _resolveConfig.default)(this.configBag.config, { - content: { - files: [] - } - }); - // Override content files if `--content` has been passed explicitly - if ((content === null || content === void 0 ? void 0 : content.length) > 0) { - this.configBag.config.content.files = content; - } - return this.configBag.config; - }, - refreshConfigDependencies () { - var _this_configBag; - _sharedState.env.DEBUG && console.time("Module dependencies"); - (_this_configBag = this.configBag) === null || _this_configBag === void 0 ? void 0 : _this_configBag.dispose(); - _sharedState.env.DEBUG && console.timeEnd("Module dependencies"); - }, - readContentPaths () { - let content = []; - // Resolve globs from the content config - // TODO: When we make the postcss plugin async-capable this can become async - let files = _fastglob.default.sync(this.contentPatterns.all); - let checkBroadPattern = (0, _content.createBroadPatternCheck)(this.contentPatterns.all); - for (let file of files){ - checkBroadPattern(file); - content.push({ - content: _fs.default.readFileSync(_path.default.resolve(file), "utf8"), - extension: _path.default.extname(file).slice(1) - }); - } - // Resolve raw content in the tailwind config - let rawContent = this.config.content.files.filter((file)=>{ - return file !== null && typeof file === "object"; - }); - for (let { raw: htmlContent , extension ="html" } of rawContent){ - content.push({ - content: htmlContent, - extension - }); - } - return content; - }, - getContext ({ createContext , cliConfigPath , root , result , content }) { - _sharedState.env.DEBUG && console.time("Searching for config"); - var _findAtConfigPath1; - let configPath = (_findAtConfigPath1 = (0, _findAtConfigPath.findAtConfigPath)(root, result)) !== null && _findAtConfigPath1 !== void 0 ? _findAtConfigPath1 : cliConfigPath; - _sharedState.env.DEBUG && console.timeEnd("Searching for config"); - if (this.context) { - this.context.changedContent = this.changedContent.splice(0); - return this.context; - } - _sharedState.env.DEBUG && console.time("Loading config"); - let config = this.loadConfig(configPath, content); - _sharedState.env.DEBUG && console.timeEnd("Loading config"); - _sharedState.env.DEBUG && console.time("Creating context"); - this.context = createContext(config, []); - Object.assign(this.context, { - userConfigPath: configPath - }); - _sharedState.env.DEBUG && console.timeEnd("Creating context"); - _sharedState.env.DEBUG && console.time("Resolving content paths"); - this.refreshContentPaths(); - _sharedState.env.DEBUG && console.timeEnd("Resolving content paths"); - if (this.watcher) { - _sharedState.env.DEBUG && console.time("Watch new files"); - this.watcher.refreshWatchedFiles(); - _sharedState.env.DEBUG && console.timeEnd("Watch new files"); - } - for (let file of this.readContentPaths()){ - this.context.changedContent.push(file); - } - return this.context; - } -}; -async function createProcessor(args, cliConfigPath) { - var _args_content; - let postcss = (0, _deps.loadPostcss)(); - let input = args["--input"]; - let output = args["--output"]; - let includePostCss = args["--postcss"]; - let customPostCssPath = typeof args["--postcss"] === "string" ? args["--postcss"] : undefined; - let [beforePlugins, afterPlugins, postcssOptions] = includePostCss ? await loadPostCssPlugins(customPostCssPath) : loadBuiltinPostcssPlugins(); - if (args["--purge"]) { - _log.default.warn("purge-flag-deprecated", [ - "The `--purge` flag has been deprecated.", - "Please use `--content` instead." - ]); - if (!args["--content"]) { - args["--content"] = args["--purge"]; - } - } - var _args_content_split; - let content = (_args_content_split = (_args_content = args["--content"]) === null || _args_content === void 0 ? void 0 : _args_content.split(/(?{ - return { - postcssPlugin: "tailwindcss", - async Once (root, { result }) { - _sharedState.env.DEBUG && console.time("Compiling CSS"); - await (0, _processTailwindFeatures.default)(({ createContext })=>{ - console.error(); - console.error("Rebuilding..."); - return ()=>{ - return state.getContext({ - createContext, - cliConfigPath, - root, - result, - content - }); - }; - })(root, result); - _sharedState.env.DEBUG && console.timeEnd("Compiling CSS"); - } - }; - }; - tailwindPlugin.postcss = true; - let plugins = [ - ...beforePlugins, - tailwindPlugin, - !args["--minify"] && _utils.formatNodes, - ...afterPlugins, - !args["--no-autoprefixer"] && (0, _deps.loadAutoprefixer)(), - args["--minify"] && (0, _deps.loadCssNano)() - ].filter(Boolean); - /** @type {import('postcss').Processor} */ // @ts-ignore - let processor = postcss(plugins); - async function readInput() { - // Piping in data, let's drain the stdin - if (input === "-") { - return (0, _utils.drainStdin)(); - } - // Input file has been provided - if (input) { - return _fs.default.promises.readFile(_path.default.resolve(input), "utf8"); - } - // No input file provided, fallback to default at-rules - return "@tailwind base; @tailwind components; @tailwind utilities"; - } - async function build() { - let start = process.hrtime.bigint(); - return readInput().then((css)=>processor.process(css, { - ...postcssOptions, - from: input, - to: output - })).then((result)=>{ - if (!state.watcher) { - return result; - } - _sharedState.env.DEBUG && console.time("Recording PostCSS dependencies"); - for (let message of result.messages){ - if (message.type === "dependency") { - state.contextDependencies.add(message.file); - } - } - _sharedState.env.DEBUG && console.timeEnd("Recording PostCSS dependencies"); - // TODO: This needs to be in a different spot - _sharedState.env.DEBUG && console.time("Watch new files"); - state.watcher.refreshWatchedFiles(); - _sharedState.env.DEBUG && console.timeEnd("Watch new files"); - return result; - }).then((result)=>{ - if (!output) { - process.stdout.write(result.css); - return; - } - return Promise.all([ - (0, _utils.outputFile)(result.opts.to, result.css), - result.map && (0, _utils.outputFile)(result.opts.to + ".map", result.map.toString()) - ]); - }).then(()=>{ - let end = process.hrtime.bigint(); - console.error(); - console.error("Done in", (end - start) / BigInt(1e6) + "ms."); - }).then(()=>{}, (err)=>{ - // TODO: If an initial build fails we can't easily pick up any PostCSS dependencies - // that were collected before the error occurred - // The result is not stored on the error so we have to store it externally - // and pull the messages off of it here somehow - // This results in a less than ideal DX because the watcher will not pick up - // changes to imported CSS if one of them caused an error during the initial build - // If you fix it and then save the main CSS file so there's no error - // The watcher will start watching the imported CSS files and will be - // resilient to future errors. - if (state.watcher) { - console.error(err); - } else { - return Promise.reject(err); - } - }); - } - /** - * @param {{file: string, content(): Promise, extension: string}[]} changes - */ async function parseChanges(changes) { - return Promise.all(changes.map(async (change)=>({ - content: await change.content(), - extension: change.extension - }))); - } - if (input !== undefined && input !== "-") { - state.contextDependencies.add(_path.default.resolve(input)); - } - return { - build, - watch: async ()=>{ - state.watcher = (0, _watching.createWatcher)(args, { - state, - /** - * @param {{file: string, content(): Promise, extension: string}[]} changes - */ async rebuild (changes) { - let needsNewContext = changes.some((change)=>{ - var _state_configBag; - return ((_state_configBag = state.configBag) === null || _state_configBag === void 0 ? void 0 : _state_configBag.dependencies.has(change.file)) || state.contextDependencies.has(change.file); - }); - if (needsNewContext) { - state.context = null; - } else { - for (let change of (await parseChanges(changes))){ - state.changedContent.push(change); - } - } - return build(); - } - }); - await build(); - } - }; -} diff --git a/node_modules/tailwindcss/lib/cli/build/utils.js b/node_modules/tailwindcss/lib/cli/build/utils.js deleted file mode 100644 index 3bed060..0000000 --- a/node_modules/tailwindcss/lib/cli/build/utils.js +++ /dev/null @@ -1,88 +0,0 @@ -// @ts-check -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] - }); -} -_export(exports, { - indentRecursive: function() { - return indentRecursive; - }, - formatNodes: function() { - return formatNodes; - }, - readFileWithRetries: function() { - return readFileWithRetries; - }, - drainStdin: function() { - return drainStdin; - }, - outputFile: function() { - return outputFile; - } -}); -const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); -const _path = /*#__PURE__*/ _interop_require_default(require("path")); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -function indentRecursive(node, indent = 0) { - node.each && node.each((child, i)=>{ - if (!child.raws.before || !child.raws.before.trim() || child.raws.before.includes("\n")) { - child.raws.before = `\n${node.type !== "rule" && i > 0 ? "\n" : ""}${" ".repeat(indent)}`; - } - child.raws.after = `\n${" ".repeat(indent)}`; - indentRecursive(child, indent + 1); - }); -} -function formatNodes(root) { - indentRecursive(root); - if (root.first) { - root.first.raws.before = ""; - } -} -async function readFileWithRetries(path, tries = 5) { - for(let n = 0; n <= tries; n++){ - try { - return await _fs.default.promises.readFile(path, "utf8"); - } catch (err) { - if (n !== tries) { - if (err.code === "ENOENT" || err.code === "EBUSY") { - await new Promise((resolve)=>setTimeout(resolve, 10)); - continue; - } - } - throw err; - } - } -} -function drainStdin() { - return new Promise((resolve, reject)=>{ - let result = ""; - process.stdin.on("data", (chunk)=>{ - result += chunk; - }); - process.stdin.on("end", ()=>resolve(result)); - process.stdin.on("error", (err)=>reject(err)); - }); -} -async function outputFile(file, newContents) { - try { - let currentContents = await _fs.default.promises.readFile(file, "utf8"); - if (currentContents === newContents) { - return; // Skip writing the file - } - } catch {} - // Write the file - await _fs.default.promises.mkdir(_path.default.dirname(file), { - recursive: true - }); - await _fs.default.promises.writeFile(file, newContents, "utf8"); -} diff --git a/node_modules/tailwindcss/lib/cli/build/watching.js b/node_modules/tailwindcss/lib/cli/build/watching.js deleted file mode 100644 index 83639bd..0000000 --- a/node_modules/tailwindcss/lib/cli/build/watching.js +++ /dev/null @@ -1,182 +0,0 @@ -// @ts-check -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "createWatcher", { - enumerable: true, - get: function() { - return createWatcher; - } -}); -const _chokidar = /*#__PURE__*/ _interop_require_default(require("chokidar")); -const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); -const _micromatch = /*#__PURE__*/ _interop_require_default(require("micromatch")); -const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path")); -const _path = /*#__PURE__*/ _interop_require_default(require("path")); -const _utils = require("./utils.js"); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -function createWatcher(args, { state , rebuild }) { - let shouldPoll = args["--poll"]; - let shouldCoalesceWriteEvents = shouldPoll || process.platform === "win32"; - // Polling interval in milliseconds - // Used only when polling or coalescing add/change events on Windows - let pollInterval = 10; - let watcher = _chokidar.default.watch([], { - // Force checking for atomic writes in all situations - // This causes chokidar to wait up to 100ms for a file to re-added after it's been unlinked - // This only works when watching directories though - atomic: true, - usePolling: shouldPoll, - interval: shouldPoll ? pollInterval : undefined, - ignoreInitial: true, - awaitWriteFinish: shouldCoalesceWriteEvents ? { - stabilityThreshold: 50, - pollInterval: pollInterval - } : false - }); - // A queue of rebuilds, file reads, etc… to run - let chain = Promise.resolve(); - /** - * A list of files that have been changed since the last rebuild - * - * @type {{file: string, content: () => Promise, extension: string}[]} - */ let changedContent = []; - /** - * A list of files for which a rebuild has already been queued. - * This is used to prevent duplicate rebuilds when multiple events are fired for the same file. - * The rebuilt file is cleared from this list when it's associated rebuild has _started_ - * This is because if the file is changed during a rebuild it won't trigger a new rebuild which it should - **/ let pendingRebuilds = new Set(); - let _timer; - let _reject; - /** - * Rebuilds the changed files and resolves when the rebuild is - * complete regardless of whether it was successful or not - */ async function rebuildAndContinue() { - let changes = changedContent.splice(0); - // There are no changes to rebuild so we can just do nothing - if (changes.length === 0) { - return Promise.resolve(); - } - // Clear all pending rebuilds for the about-to-be-built files - changes.forEach((change)=>pendingRebuilds.delete(change.file)); - // Resolve the promise even when the rebuild fails - return rebuild(changes).then(()=>{}, (e)=>{ - console.error(e.toString()); - }); - } - /** - * - * @param {*} file - * @param {(() => Promise) | null} content - * @param {boolean} skipPendingCheck - * @returns {Promise} - */ function recordChangedFile(file, content = null, skipPendingCheck = false) { - file = _path.default.resolve(file); - // Applications like Vim/Neovim fire both rename and change events in succession for atomic writes - // In that case rebuild has already been queued by rename, so can be skipped in change - if (pendingRebuilds.has(file) && !skipPendingCheck) { - return Promise.resolve(); - } - // Mark that a rebuild of this file is going to happen - // It MUST happen synchronously before the rebuild is queued for this to be effective - pendingRebuilds.add(file); - changedContent.push({ - file, - content: content !== null && content !== void 0 ? content : ()=>_fs.default.promises.readFile(file, "utf8"), - extension: _path.default.extname(file).slice(1) - }); - if (_timer) { - clearTimeout(_timer); - _reject(); - } - // If a rebuild is already in progress we don't want to start another one until the 10ms timer has expired - chain = chain.then(()=>new Promise((resolve, reject)=>{ - _timer = setTimeout(resolve, 10); - _reject = reject; - })); - // Resolves once this file has been rebuilt (or the rebuild for this file has failed) - // This queues as many rebuilds as there are changed files - // But those rebuilds happen after some delay - // And will immediately resolve if there are no changes - chain = chain.then(rebuildAndContinue, rebuildAndContinue); - return chain; - } - watcher.on("change", (file)=>recordChangedFile(file)); - watcher.on("add", (file)=>recordChangedFile(file)); - // Restore watching any files that are "removed" - // This can happen when a file is pseudo-atomically replaced (a copy is created, overwritten, the old one is unlinked, and the new one is renamed) - // TODO: An an optimization we should allow removal when the config changes - watcher.on("unlink", (file)=>{ - file = (0, _normalizepath.default)(file); - // Only re-add the file if it's not covered by a dynamic pattern - if (!_micromatch.default.some([ - file - ], state.contentPatterns.dynamic)) { - watcher.add(file); - } - }); - // Some applications such as Visual Studio (but not VS Code) - // will only fire a rename event for atomic writes and not a change event - // This is very likely a chokidar bug but it's one we need to work around - // We treat this as a change event and rebuild the CSS - watcher.on("raw", (evt, filePath, meta)=>{ - if (evt !== "rename" || filePath === null) { - return; - } - let watchedPath = meta.watchedPath; - // Watched path might be the file itself - // Or the directory it is in - filePath = watchedPath.endsWith(filePath) ? watchedPath : _path.default.join(watchedPath, filePath); - // Skip this event since the files it is for does not match any of the registered content globs - if (!_micromatch.default.some([ - filePath - ], state.contentPatterns.all)) { - return; - } - // Skip since we've already queued a rebuild for this file that hasn't happened yet - if (pendingRebuilds.has(filePath)) { - return; - } - // We'll go ahead and add the file to the pending rebuilds list here - // It'll be removed when the rebuild starts unless the read fails - // which will be taken care of as well - pendingRebuilds.add(filePath); - async function enqueue() { - try { - // We need to read the file as early as possible outside of the chain - // because it may be gone by the time we get to it. doing the read - // immediately increases the chance that the file is still there - let content = await (0, _utils.readFileWithRetries)(_path.default.resolve(filePath)); - if (content === undefined) { - return; - } - // This will push the rebuild onto the chain - // We MUST skip the rebuild check here otherwise the rebuild will never happen on Linux - // This is because the order of events and timing is different on Linux - // @ts-ignore: TypeScript isn't picking up that content is a string here - await recordChangedFile(filePath, ()=>content, true); - } catch { - // If reading the file fails, it's was probably a deleted temporary file - // So we can ignore it and no rebuild is needed - } - } - enqueue().then(()=>{ - // If the file read fails we still need to make sure the file isn't stuck in the pending rebuilds list - pendingRebuilds.delete(filePath); - }); - }); - return { - fswatcher: watcher, - refreshWatchedFiles () { - watcher.add(Array.from(state.contextDependencies)); - watcher.add(Array.from(state.configBag.dependencies)); - watcher.add(state.contentPatterns.all); - } - }; -} diff --git a/node_modules/tailwindcss/lib/cli/help/index.js b/node_modules/tailwindcss/lib/cli/help/index.js deleted file mode 100644 index 030997f..0000000 --- a/node_modules/tailwindcss/lib/cli/help/index.js +++ /dev/null @@ -1,73 +0,0 @@ -// @ts-check -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "help", { - enumerable: true, - get: function() { - return help; - } -}); -const _packagejson = /*#__PURE__*/ _interop_require_default(require("../../../package.json")); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -function help({ message , usage , commands , options }) { - let indent = 2; - // Render header - console.log(); - console.log(`${_packagejson.default.name} v${_packagejson.default.version}`); - // Render message - if (message) { - console.log(); - for (let msg of message.split("\n")){ - console.log(msg); - } - } - // Render usage - if (usage && usage.length > 0) { - console.log(); - console.log("Usage:"); - for (let example of usage){ - console.log(" ".repeat(indent), example); - } - } - // Render commands - if (commands && commands.length > 0) { - console.log(); - console.log("Commands:"); - for (let command of commands){ - console.log(" ".repeat(indent), command); - } - } - // Render options - if (options) { - let groupedOptions = {}; - for (let [key, value] of Object.entries(options)){ - if (typeof value === "object") { - groupedOptions[key] = { - ...value, - flags: [ - key - ] - }; - } else { - groupedOptions[value].flags.push(key); - } - } - console.log(); - console.log("Options:"); - for (let { flags , description , deprecated } of Object.values(groupedOptions)){ - if (deprecated) continue; - if (flags.length === 1) { - console.log(" ".repeat(indent + 4 /* 4 = "-i, ".length */ ), flags.slice().reverse().join(", ").padEnd(20, " "), description); - } else { - console.log(" ".repeat(indent), flags.slice().reverse().join(", ").padEnd(24, " "), description); - } - } - } - console.log(); -} diff --git a/node_modules/tailwindcss/lib/cli/index.js b/node_modules/tailwindcss/lib/cli/index.js deleted file mode 100644 index e6e2e27..0000000 --- a/node_modules/tailwindcss/lib/cli/index.js +++ /dev/null @@ -1,230 +0,0 @@ -#!/usr/bin/env node -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -const _path = /*#__PURE__*/ _interop_require_default(require("path")); -const _arg = /*#__PURE__*/ _interop_require_default(require("arg")); -const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); -const _build = require("./build"); -const _help = require("./help"); -const _init = require("./init"); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -function oneOf(...options) { - return Object.assign((value = true)=>{ - for (let option of options){ - let parsed = option(value); - if (parsed === value) { - return parsed; - } - } - throw new Error("..."); - }, { - manualParsing: true - }); -} -let commands = { - init: { - run: _init.init, - args: { - "--esm": { - type: Boolean, - description: `Initialize configuration file as ESM` - }, - "--ts": { - type: Boolean, - description: `Initialize configuration file as TypeScript` - }, - "--postcss": { - type: Boolean, - description: `Initialize a \`postcss.config.js\` file` - }, - "--full": { - type: Boolean, - description: `Include the default values for all options in the generated configuration file` - }, - "-f": "--full", - "-p": "--postcss" - } - }, - build: { - run: _build.build, - args: { - "--input": { - type: String, - description: "Input file" - }, - "--output": { - type: String, - description: "Output file" - }, - "--watch": { - type: oneOf(String, Boolean), - description: "Watch for changes and rebuild as needed" - }, - "--poll": { - type: Boolean, - description: "Use polling instead of filesystem events when watching" - }, - "--content": { - type: String, - description: "Content paths to use for removing unused classes" - }, - "--purge": { - type: String, - deprecated: true - }, - "--postcss": { - type: oneOf(String, Boolean), - description: "Load custom PostCSS configuration" - }, - "--minify": { - type: Boolean, - description: "Minify the output" - }, - "--config": { - type: String, - description: "Path to a custom config file" - }, - "--no-autoprefixer": { - type: Boolean, - description: "Disable autoprefixer" - }, - "-c": "--config", - "-i": "--input", - "-o": "--output", - "-m": "--minify", - "-w": "--watch", - "-p": "--poll" - } - } -}; -let sharedFlags = { - "--help": { - type: Boolean, - description: "Display usage information" - }, - "-h": "--help" -}; -if (process.stdout.isTTY /* Detect redirecting output to a file */ && (process.argv[2] === undefined || process.argv.slice(2).every((flag)=>sharedFlags[flag] !== undefined))) { - (0, _help.help)({ - usage: [ - "tailwindcss [--input input.css] [--output output.css] [--watch] [options...]", - "tailwindcss init [--full] [--postcss] [options...]" - ], - commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`), - options: { - ...commands.build.args, - ...sharedFlags - } - }); - process.exit(0); -} -let command = ((arg = "")=>arg.startsWith("-") ? undefined : arg)(process.argv[2]) || "build"; -if (commands[command] === undefined) { - if (_fs.default.existsSync(_path.default.resolve(command))) { - // TODO: Deprecate this in future versions - // Check if non-existing command, might be a file. - command = "build"; - } else { - (0, _help.help)({ - message: `Invalid command: ${command}`, - usage: [ - "tailwindcss [options]" - ], - commands: Object.keys(commands).filter((command)=>command !== "build").map((command)=>`${command} [options]`), - options: sharedFlags - }); - process.exit(1); - } -} -// Execute command -let { args: flags , run } = commands[command]; -let args = (()=>{ - try { - let result = (0, _arg.default)(Object.fromEntries(Object.entries({ - ...flags, - ...sharedFlags - }).filter(([_key, value])=>{ - var _value_type; - return !(value === null || value === void 0 ? void 0 : (_value_type = value.type) === null || _value_type === void 0 ? void 0 : _value_type.manualParsing); - }).map(([key, value])=>[ - key, - typeof value === "object" ? value.type : value - ])), { - permissive: true - }); - // Manual parsing of flags to allow for special flags like oneOf(Boolean, String) - for(let i = result["_"].length - 1; i >= 0; --i){ - let flag = result["_"][i]; - if (!flag.startsWith("-")) continue; - let [flagName, flagValue] = flag.split("="); - let handler = flags[flagName]; - // Resolve flagName & handler - while(typeof handler === "string"){ - flagName = handler; - handler = flags[handler]; - } - if (!handler) continue; - let args = []; - let offset = i + 1; - // --flag value syntax was used so we need to pull `value` from `args` - if (flagValue === undefined) { - // Parse args for current flag - while(result["_"][offset] && !result["_"][offset].startsWith("-")){ - args.push(result["_"][offset++]); - } - // Cleanup manually parsed flags + args - result["_"].splice(i, 1 + args.length); - // No args were provided, use default value defined in handler - // One arg was provided, use that directly - // Multiple args were provided so pass them all in an array - flagValue = args.length === 0 ? undefined : args.length === 1 ? args[0] : args; - } else { - // Remove the whole flag from the args array - result["_"].splice(i, 1); - } - // Set the resolved value in the `result` object - result[flagName] = handler.type(flagValue, flagName); - } - // Ensure that the `command` is always the first argument in the `args`. - // This is important so that we don't have to check if a default command - // (build) was used or not from within each plugin. - // - // E.g.: tailwindcss input.css -> _: ['build', 'input.css'] - // E.g.: tailwindcss build input.css -> _: ['build', 'input.css'] - if (result["_"][0] !== command) { - result["_"].unshift(command); - } - return result; - } catch (err) { - if (err.code === "ARG_UNKNOWN_OPTION") { - (0, _help.help)({ - message: err.message, - usage: [ - "tailwindcss [options]" - ], - options: sharedFlags - }); - process.exit(1); - } - throw err; - } -})(); -if (args["--help"]) { - (0, _help.help)({ - options: { - ...flags, - ...sharedFlags - }, - usage: [ - `tailwindcss ${command} [options]` - ] - }); - process.exit(0); -} -run(args); diff --git a/node_modules/tailwindcss/lib/cli/init/index.js b/node_modules/tailwindcss/lib/cli/init/index.js deleted file mode 100644 index 47caf30..0000000 --- a/node_modules/tailwindcss/lib/cli/init/index.js +++ /dev/null @@ -1,63 +0,0 @@ -// @ts-check -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "init", { - enumerable: true, - get: function() { - return init; - } -}); -const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); -const _path = /*#__PURE__*/ _interop_require_default(require("path")); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -function isESM() { - const pkgPath = _path.default.resolve("./package.json"); - try { - let pkg = JSON.parse(_fs.default.readFileSync(pkgPath, "utf8")); - return pkg.type && pkg.type === "module"; - } catch (err) { - return false; - } -} -function init(args) { - let messages = []; - let isProjectESM = args["--ts"] || args["--esm"] || isESM(); - let syntax = args["--ts"] ? "ts" : isProjectESM ? "js" : "cjs"; - let extension = args["--ts"] ? "ts" : "js"; - var _args___; - let tailwindConfigLocation = _path.default.resolve((_args___ = args["_"][1]) !== null && _args___ !== void 0 ? _args___ : `./tailwind.config.${extension}`); - if (_fs.default.existsSync(tailwindConfigLocation)) { - messages.push(`${_path.default.basename(tailwindConfigLocation)} already exists.`); - } else { - let stubContentsFile = _fs.default.readFileSync(args["--full"] ? _path.default.resolve(__dirname, "../../../stubs/config.full.js") : _path.default.resolve(__dirname, "../../../stubs/config.simple.js"), "utf8"); - let stubFile = _fs.default.readFileSync(_path.default.resolve(__dirname, `../../../stubs/tailwind.config.${syntax}`), "utf8"); - // Change colors import - stubContentsFile = stubContentsFile.replace("../colors", "tailwindcss/colors"); - // Replace contents of {ts,js,cjs} file with the stub {simple,full}. - stubFile = stubFile.replace("__CONFIG__", stubContentsFile.replace("module.exports =", "").trim()).trim() + "\n\n"; - _fs.default.writeFileSync(tailwindConfigLocation, stubFile, "utf8"); - messages.push(`Created Tailwind CSS config file: ${_path.default.basename(tailwindConfigLocation)}`); - } - if (args["--postcss"]) { - let postcssConfigLocation = _path.default.resolve("./postcss.config.js"); - if (_fs.default.existsSync(postcssConfigLocation)) { - messages.push(`${_path.default.basename(postcssConfigLocation)} already exists.`); - } else { - let stubFile = _fs.default.readFileSync(isProjectESM ? _path.default.resolve(__dirname, "../../../stubs/postcss.config.js") : _path.default.resolve(__dirname, "../../../stubs/postcss.config.cjs"), "utf8"); - _fs.default.writeFileSync(postcssConfigLocation, stubFile, "utf8"); - messages.push(`Created PostCSS config file: ${_path.default.basename(postcssConfigLocation)}`); - } - } - if (messages.length > 0) { - console.log(); - for (let message of messages){ - console.log(message); - } - } -} diff --git a/node_modules/tailwindcss/lib/corePluginList.js b/node_modules/tailwindcss/lib/corePluginList.js deleted file mode 100644 index 552934b..0000000 --- a/node_modules/tailwindcss/lib/corePluginList.js +++ /dev/null @@ -1,191 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _default = [ - "preflight", - "container", - "accessibility", - "pointerEvents", - "visibility", - "position", - "inset", - "isolation", - "zIndex", - "order", - "gridColumn", - "gridColumnStart", - "gridColumnEnd", - "gridRow", - "gridRowStart", - "gridRowEnd", - "float", - "clear", - "margin", - "boxSizing", - "lineClamp", - "display", - "aspectRatio", - "size", - "height", - "maxHeight", - "minHeight", - "width", - "minWidth", - "maxWidth", - "flex", - "flexShrink", - "flexGrow", - "flexBasis", - "tableLayout", - "captionSide", - "borderCollapse", - "borderSpacing", - "transformOrigin", - "translate", - "rotate", - "skew", - "scale", - "transform", - "animation", - "cursor", - "touchAction", - "userSelect", - "resize", - "scrollSnapType", - "scrollSnapAlign", - "scrollSnapStop", - "scrollMargin", - "scrollPadding", - "listStylePosition", - "listStyleType", - "listStyleImage", - "appearance", - "columns", - "breakBefore", - "breakInside", - "breakAfter", - "gridAutoColumns", - "gridAutoFlow", - "gridAutoRows", - "gridTemplateColumns", - "gridTemplateRows", - "flexDirection", - "flexWrap", - "placeContent", - "placeItems", - "alignContent", - "alignItems", - "justifyContent", - "justifyItems", - "gap", - "space", - "divideWidth", - "divideStyle", - "divideColor", - "divideOpacity", - "placeSelf", - "alignSelf", - "justifySelf", - "overflow", - "overscrollBehavior", - "scrollBehavior", - "textOverflow", - "hyphens", - "whitespace", - "textWrap", - "wordBreak", - "borderRadius", - "borderWidth", - "borderStyle", - "borderColor", - "borderOpacity", - "backgroundColor", - "backgroundOpacity", - "backgroundImage", - "gradientColorStops", - "boxDecorationBreak", - "backgroundSize", - "backgroundAttachment", - "backgroundClip", - "backgroundPosition", - "backgroundRepeat", - "backgroundOrigin", - "fill", - "stroke", - "strokeWidth", - "objectFit", - "objectPosition", - "padding", - "textAlign", - "textIndent", - "verticalAlign", - "fontFamily", - "fontSize", - "fontWeight", - "textTransform", - "fontStyle", - "fontVariantNumeric", - "lineHeight", - "letterSpacing", - "textColor", - "textOpacity", - "textDecoration", - "textDecorationColor", - "textDecorationStyle", - "textDecorationThickness", - "textUnderlineOffset", - "fontSmoothing", - "placeholderColor", - "placeholderOpacity", - "caretColor", - "accentColor", - "opacity", - "backgroundBlendMode", - "mixBlendMode", - "boxShadow", - "boxShadowColor", - "outlineStyle", - "outlineWidth", - "outlineOffset", - "outlineColor", - "ringWidth", - "ringColor", - "ringOpacity", - "ringOffsetWidth", - "ringOffsetColor", - "blur", - "brightness", - "contrast", - "dropShadow", - "grayscale", - "hueRotate", - "invert", - "saturate", - "sepia", - "filter", - "backdropBlur", - "backdropBrightness", - "backdropContrast", - "backdropGrayscale", - "backdropHueRotate", - "backdropInvert", - "backdropOpacity", - "backdropSaturate", - "backdropSepia", - "backdropFilter", - "transitionProperty", - "transitionDelay", - "transitionDuration", - "transitionTimingFunction", - "willChange", - "contain", - "content", - "forcedColorAdjust" -]; diff --git a/node_modules/tailwindcss/lib/corePlugins.js b/node_modules/tailwindcss/lib/corePlugins.js deleted file mode 100644 index bf5d083..0000000 --- a/node_modules/tailwindcss/lib/corePlugins.js +++ /dev/null @@ -1,4339 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] - }); -} -_export(exports, { - variantPlugins: function() { - return variantPlugins; - }, - corePlugins: function() { - return corePlugins; - } -}); -const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); -const _path = /*#__PURE__*/ _interop_require_wildcard(require("path")); -const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss")); -const _createUtilityPlugin = /*#__PURE__*/ _interop_require_default(require("./util/createUtilityPlugin")); -const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("./util/buildMediaQuery")); -const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("./util/escapeClassName")); -const _parseAnimationValue = /*#__PURE__*/ _interop_require_default(require("./util/parseAnimationValue")); -const _flattenColorPalette = /*#__PURE__*/ _interop_require_default(require("./util/flattenColorPalette")); -const _withAlphaVariable = /*#__PURE__*/ _interop_require_wildcard(require("./util/withAlphaVariable")); -const _toColorValue = /*#__PURE__*/ _interop_require_default(require("./util/toColorValue")); -const _isPlainObject = /*#__PURE__*/ _interop_require_default(require("./util/isPlainObject")); -const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("./util/transformThemeValue")); -const _packagejson = require("../package.json"); -const _log = /*#__PURE__*/ _interop_require_default(require("./util/log")); -const _normalizeScreens = require("./util/normalizeScreens"); -const _parseBoxShadowValue = require("./util/parseBoxShadowValue"); -const _removeAlphaVariables = require("./util/removeAlphaVariables"); -const _featureFlags = require("./featureFlags"); -const _dataTypes = require("./util/dataTypes"); -const _setupContextUtils = require("./lib/setupContextUtils"); -function _interop_require_default(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 _interop_require_wildcard(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; -} -let variantPlugins = { - childVariant: ({ addVariant })=>{ - addVariant("*", "& > *"); - }, - pseudoElementVariants: ({ addVariant })=>{ - addVariant("first-letter", "&::first-letter"); - addVariant("first-line", "&::first-line"); - addVariant("marker", [ - ({ container })=>{ - (0, _removeAlphaVariables.removeAlphaVariables)(container, [ - "--tw-text-opacity" - ]); - return "& *::marker"; - }, - ({ container })=>{ - (0, _removeAlphaVariables.removeAlphaVariables)(container, [ - "--tw-text-opacity" - ]); - return "&::marker"; - } - ]); - addVariant("selection", [ - "& *::selection", - "&::selection" - ]); - addVariant("file", "&::file-selector-button"); - addVariant("placeholder", "&::placeholder"); - addVariant("backdrop", "&::backdrop"); - addVariant("before", ({ container })=>{ - container.walkRules((rule)=>{ - let foundContent = false; - rule.walkDecls("content", ()=>{ - foundContent = true; - }); - if (!foundContent) { - rule.prepend(_postcss.default.decl({ - prop: "content", - value: "var(--tw-content)" - })); - } - }); - return "&::before"; - }); - addVariant("after", ({ container })=>{ - container.walkRules((rule)=>{ - let foundContent = false; - rule.walkDecls("content", ()=>{ - foundContent = true; - }); - if (!foundContent) { - rule.prepend(_postcss.default.decl({ - prop: "content", - value: "var(--tw-content)" - })); - } - }); - return "&::after"; - }); - }, - pseudoClassVariants: ({ addVariant , matchVariant , config , prefix })=>{ - let pseudoVariants = [ - // Positional - [ - "first", - "&:first-child" - ], - [ - "last", - "&:last-child" - ], - [ - "only", - "&:only-child" - ], - [ - "odd", - "&:nth-child(odd)" - ], - [ - "even", - "&:nth-child(even)" - ], - "first-of-type", - "last-of-type", - "only-of-type", - // State - [ - "visited", - ({ container })=>{ - (0, _removeAlphaVariables.removeAlphaVariables)(container, [ - "--tw-text-opacity", - "--tw-border-opacity", - "--tw-bg-opacity" - ]); - return "&:visited"; - } - ], - "target", - [ - "open", - "&[open]" - ], - // Forms - "default", - "checked", - "indeterminate", - "placeholder-shown", - "autofill", - "optional", - "required", - "valid", - "invalid", - "in-range", - "out-of-range", - "read-only", - // Content - "empty", - // Interactive - "focus-within", - [ - "hover", - !(0, _featureFlags.flagEnabled)(config(), "hoverOnlyWhenSupported") ? "&:hover" : "@media (hover: hover) and (pointer: fine) { &:hover }" - ], - "focus", - "focus-visible", - "active", - "enabled", - "disabled" - ].map((variant)=>Array.isArray(variant) ? variant : [ - variant, - `&:${variant}` - ]); - for (let [variantName, state] of pseudoVariants){ - addVariant(variantName, (ctx)=>{ - let result = typeof state === "function" ? state(ctx) : state; - return result; - }); - } - let variants = { - group: (_, { modifier })=>modifier ? [ - `:merge(${prefix(".group")}\\/${(0, _escapeClassName.default)(modifier)})`, - " &" - ] : [ - `:merge(${prefix(".group")})`, - " &" - ], - peer: (_, { modifier })=>modifier ? [ - `:merge(${prefix(".peer")}\\/${(0, _escapeClassName.default)(modifier)})`, - " ~ &" - ] : [ - `:merge(${prefix(".peer")})`, - " ~ &" - ] - }; - for (let [name, fn] of Object.entries(variants)){ - matchVariant(name, (value = "", extra)=>{ - let result = (0, _dataTypes.normalize)(typeof value === "function" ? value(extra) : value); - if (!result.includes("&")) result = "&" + result; - let [a, b] = fn("", extra); - let start = null; - let end = null; - let quotes = 0; - for(let i = 0; i < result.length; ++i){ - let c = result[i]; - if (c === "&") { - start = i; - } else if (c === "'" || c === '"') { - quotes += 1; - } else if (start !== null && c === " " && !quotes) { - end = i; - } - } - if (start !== null && end === null) { - end = result.length; - } - // Basically this but can handle quotes: - // result.replace(/&(\S+)?/g, (_, pseudo = '') => a + pseudo + b) - return result.slice(0, start) + a + result.slice(start + 1, end) + b + result.slice(end); - }, { - values: Object.fromEntries(pseudoVariants), - [_setupContextUtils.INTERNAL_FEATURES]: { - respectPrefix: false - } - }); - } - }, - directionVariants: ({ addVariant })=>{ - addVariant("ltr", '&:where([dir="ltr"], [dir="ltr"] *)'); - addVariant("rtl", '&:where([dir="rtl"], [dir="rtl"] *)'); - }, - reducedMotionVariants: ({ addVariant })=>{ - addVariant("motion-safe", "@media (prefers-reduced-motion: no-preference)"); - addVariant("motion-reduce", "@media (prefers-reduced-motion: reduce)"); - }, - darkVariants: ({ config , addVariant })=>{ - let [mode, selector = ".dark"] = [].concat(config("darkMode", "media")); - if (mode === false) { - mode = "media"; - _log.default.warn("darkmode-false", [ - "The `darkMode` option in your Tailwind CSS configuration is set to `false`, which now behaves the same as `media`.", - "Change `darkMode` to `media` or remove it entirely.", - "https://tailwindcss.com/docs/upgrade-guide#remove-dark-mode-configuration" - ]); - } - if (mode === "variant") { - let formats; - if (Array.isArray(selector)) { - formats = selector; - } else if (typeof selector === "function") { - formats = selector; - } else if (typeof selector === "string") { - formats = [ - selector - ]; - } - // TODO: We could also add these warnings if the user passes a function that returns string | string[] - // But this is an advanced enough use case that it's probably not necessary - if (Array.isArray(formats)) { - for (let format of formats){ - if (format === ".dark") { - mode = false; - _log.default.warn("darkmode-variant-without-selector", [ - "When using `variant` for `darkMode`, you must provide a selector.", - 'Example: `darkMode: ["variant", ".your-selector &"]`' - ]); - } else if (!format.includes("&")) { - mode = false; - _log.default.warn("darkmode-variant-without-ampersand", [ - "When using `variant` for `darkMode`, your selector must contain `&`.", - 'Example `darkMode: ["variant", ".your-selector &"]`' - ]); - } - } - } - selector = formats; - } - if (mode === "selector") { - // New preferred behavior - addVariant("dark", `&:where(${selector}, ${selector} *)`); - } else if (mode === "media") { - addVariant("dark", "@media (prefers-color-scheme: dark)"); - } else if (mode === "variant") { - addVariant("dark", selector); - } else if (mode === "class") { - // Old behavior - addVariant("dark", `&:is(${selector} *)`); - } - }, - printVariant: ({ addVariant })=>{ - addVariant("print", "@media print"); - }, - screenVariants: ({ theme , addVariant , matchVariant })=>{ - var _theme; - let rawScreens = (_theme = theme("screens")) !== null && _theme !== void 0 ? _theme : {}; - let areSimpleScreens = Object.values(rawScreens).every((v)=>typeof v === "string"); - let screens = (0, _normalizeScreens.normalizeScreens)(theme("screens")); - /** @type {Set} */ let unitCache = new Set([]); - /** @param {string} value */ function units(value) { - var _value_match; - var _value_match_; - return (_value_match_ = (_value_match = value.match(/(\D+)$/)) === null || _value_match === void 0 ? void 0 : _value_match[1]) !== null && _value_match_ !== void 0 ? _value_match_ : "(none)"; - } - /** @param {string} value */ function recordUnits(value) { - if (value !== undefined) { - unitCache.add(units(value)); - } - } - /** @param {string} value */ function canUseUnits(value) { - recordUnits(value); - // If the cache was empty it'll become 1 because we've just added the current unit - // If the cache was not empty and the units are the same the size doesn't change - // Otherwise, if the units are different from what is already known the size will always be > 1 - return unitCache.size === 1; - } - for (const screen of screens){ - for (const value of screen.values){ - recordUnits(value.min); - recordUnits(value.max); - } - } - let screensUseConsistentUnits = unitCache.size <= 1; - /** - * @typedef {import('./util/normalizeScreens').Screen} Screen - */ /** - * @param {'min' | 'max'} type - * @returns {Record} - */ function buildScreenValues(type) { - return Object.fromEntries(screens.filter((screen)=>(0, _normalizeScreens.isScreenSortable)(screen).result).map((screen)=>{ - let { min , max } = screen.values[0]; - if (type === "min" && min !== undefined) { - return screen; - } else if (type === "min" && max !== undefined) { - return { - ...screen, - not: !screen.not - }; - } else if (type === "max" && max !== undefined) { - return screen; - } else if (type === "max" && min !== undefined) { - return { - ...screen, - not: !screen.not - }; - } - }).map((screen)=>[ - screen.name, - screen - ])); - } - /** - * @param {'min' | 'max'} type - * @returns {(a: { value: string | Screen }, z: { value: string | Screen }) => number} - */ function buildSort(type) { - return (a, z)=>(0, _normalizeScreens.compareScreens)(type, a.value, z.value); - } - let maxSort = buildSort("max"); - let minSort = buildSort("min"); - /** @param {'min'|'max'} type */ function buildScreenVariant(type) { - return (value)=>{ - if (!areSimpleScreens) { - _log.default.warn("complex-screen-config", [ - "The `min-*` and `max-*` variants are not supported with a `screens` configuration containing objects." - ]); - return []; - } else if (!screensUseConsistentUnits) { - _log.default.warn("mixed-screen-units", [ - "The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units." - ]); - return []; - } else if (typeof value === "string" && !canUseUnits(value)) { - _log.default.warn("minmax-have-mixed-units", [ - "The `min-*` and `max-*` variants are not supported with a `screens` configuration containing mixed units." - ]); - return []; - } - return [ - `@media ${(0, _buildMediaQuery.default)((0, _normalizeScreens.toScreen)(value, type))}` - ]; - }; - } - matchVariant("max", buildScreenVariant("max"), { - sort: maxSort, - values: areSimpleScreens ? buildScreenValues("max") : {} - }); - // screens and min-* are sorted together when they can be - let id = "min-screens"; - for (let screen of screens){ - addVariant(screen.name, `@media ${(0, _buildMediaQuery.default)(screen)}`, { - id, - sort: areSimpleScreens && screensUseConsistentUnits ? minSort : undefined, - value: screen - }); - } - matchVariant("min", buildScreenVariant("min"), { - id, - sort: minSort - }); - }, - supportsVariants: ({ matchVariant , theme })=>{ - var _theme; - matchVariant("supports", (value = "")=>{ - let check = value.startsWith("--") ? value : (0, _dataTypes.normalize)(value); - let isRaw = /^[\w-]*\s*\(/.test(check); - // Chrome has a bug where `(condition1)or(condition2)` is not valid - // But `(condition1) or (condition2)` is supported. - check = isRaw ? check.replace(/\b(and|or|not)\b/g, " $1 ") : check; - if (isRaw) { - return `@supports ${check}`; - } - if (!check.includes(":")) { - check = `${check}: var(--tw)`; - } - if (!(check.startsWith("(") && check.endsWith(")"))) { - check = `(${check})`; - } - return `@supports ${check}`; - }, { - values: (_theme = theme("supports")) !== null && _theme !== void 0 ? _theme : {} - }); - }, - hasVariants: ({ matchVariant , prefix })=>{ - matchVariant("has", (value)=>`&:has(${(0, _dataTypes.normalize)(value)})`, { - values: {}, - [_setupContextUtils.INTERNAL_FEATURES]: { - respectPrefix: false - } - }); - matchVariant("group-has", (value, { modifier })=>modifier ? `:merge(${prefix(".group")}\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) &` : `:merge(${prefix(".group")}):has(${(0, _dataTypes.normalize)(value)}) &`, { - values: {}, - [_setupContextUtils.INTERNAL_FEATURES]: { - respectPrefix: false - } - }); - matchVariant("peer-has", (value, { modifier })=>modifier ? `:merge(${prefix(".peer")}\\/${modifier}):has(${(0, _dataTypes.normalize)(value)}) ~ &` : `:merge(${prefix(".peer")}):has(${(0, _dataTypes.normalize)(value)}) ~ &`, { - values: {}, - [_setupContextUtils.INTERNAL_FEATURES]: { - respectPrefix: false - } - }); - }, - ariaVariants: ({ matchVariant , theme })=>{ - var _theme; - matchVariant("aria", (value)=>`&[aria-${(0, _dataTypes.normalizeAttributeSelectors)((0, _dataTypes.normalize)(value))}]`, { - values: (_theme = theme("aria")) !== null && _theme !== void 0 ? _theme : {} - }); - var _theme1; - matchVariant("group-aria", (value, { modifier })=>modifier ? `:merge(.group\\/${modifier})[aria-${(0, _dataTypes.normalizeAttributeSelectors)((0, _dataTypes.normalize)(value))}] &` : `:merge(.group)[aria-${(0, _dataTypes.normalizeAttributeSelectors)((0, _dataTypes.normalize)(value))}] &`, { - values: (_theme1 = theme("aria")) !== null && _theme1 !== void 0 ? _theme1 : {} - }); - var _theme2; - matchVariant("peer-aria", (value, { modifier })=>modifier ? `:merge(.peer\\/${modifier})[aria-${(0, _dataTypes.normalizeAttributeSelectors)((0, _dataTypes.normalize)(value))}] ~ &` : `:merge(.peer)[aria-${(0, _dataTypes.normalizeAttributeSelectors)((0, _dataTypes.normalize)(value))}] ~ &`, { - values: (_theme2 = theme("aria")) !== null && _theme2 !== void 0 ? _theme2 : {} - }); - }, - dataVariants: ({ matchVariant , theme })=>{ - var _theme; - matchVariant("data", (value)=>`&[data-${(0, _dataTypes.normalizeAttributeSelectors)((0, _dataTypes.normalize)(value))}]`, { - values: (_theme = theme("data")) !== null && _theme !== void 0 ? _theme : {} - }); - var _theme1; - matchVariant("group-data", (value, { modifier })=>modifier ? `:merge(.group\\/${modifier})[data-${(0, _dataTypes.normalizeAttributeSelectors)((0, _dataTypes.normalize)(value))}] &` : `:merge(.group)[data-${(0, _dataTypes.normalizeAttributeSelectors)((0, _dataTypes.normalize)(value))}] &`, { - values: (_theme1 = theme("data")) !== null && _theme1 !== void 0 ? _theme1 : {} - }); - var _theme2; - matchVariant("peer-data", (value, { modifier })=>modifier ? `:merge(.peer\\/${modifier})[data-${(0, _dataTypes.normalizeAttributeSelectors)((0, _dataTypes.normalize)(value))}] ~ &` : `:merge(.peer)[data-${(0, _dataTypes.normalizeAttributeSelectors)((0, _dataTypes.normalize)(value))}] ~ &`, { - values: (_theme2 = theme("data")) !== null && _theme2 !== void 0 ? _theme2 : {} - }); - }, - orientationVariants: ({ addVariant })=>{ - addVariant("portrait", "@media (orientation: portrait)"); - addVariant("landscape", "@media (orientation: landscape)"); - }, - prefersContrastVariants: ({ addVariant })=>{ - addVariant("contrast-more", "@media (prefers-contrast: more)"); - addVariant("contrast-less", "@media (prefers-contrast: less)"); - }, - forcedColorsVariants: ({ addVariant })=>{ - addVariant("forced-colors", "@media (forced-colors: active)"); - } -}; -let cssTransformValue = [ - "translate(var(--tw-translate-x), var(--tw-translate-y))", - "rotate(var(--tw-rotate))", - "skewX(var(--tw-skew-x))", - "skewY(var(--tw-skew-y))", - "scaleX(var(--tw-scale-x))", - "scaleY(var(--tw-scale-y))" -].join(" "); -let cssFilterValue = [ - "var(--tw-blur)", - "var(--tw-brightness)", - "var(--tw-contrast)", - "var(--tw-grayscale)", - "var(--tw-hue-rotate)", - "var(--tw-invert)", - "var(--tw-saturate)", - "var(--tw-sepia)", - "var(--tw-drop-shadow)" -].join(" "); -let cssBackdropFilterValue = [ - "var(--tw-backdrop-blur)", - "var(--tw-backdrop-brightness)", - "var(--tw-backdrop-contrast)", - "var(--tw-backdrop-grayscale)", - "var(--tw-backdrop-hue-rotate)", - "var(--tw-backdrop-invert)", - "var(--tw-backdrop-opacity)", - "var(--tw-backdrop-saturate)", - "var(--tw-backdrop-sepia)" -].join(" "); -let corePlugins = { - preflight: ({ addBase })=>{ - let preflightStyles = _postcss.default.parse(_fs.default.readFileSync(_path.join(__dirname, "./css/preflight.css"), "utf8")); - addBase([ - _postcss.default.comment({ - text: `! tailwindcss v${_packagejson.version} | MIT License | https://tailwindcss.com` - }), - ...preflightStyles.nodes - ]); - }, - container: (()=>{ - function extractMinWidths(breakpoints = []) { - return breakpoints.flatMap((breakpoint)=>breakpoint.values.map((breakpoint)=>breakpoint.min)).filter((v)=>v !== undefined); - } - function mapMinWidthsToPadding(minWidths, screens, paddings) { - if (typeof paddings === "undefined") { - return []; - } - if (!(typeof paddings === "object" && paddings !== null)) { - return [ - { - screen: "DEFAULT", - minWidth: 0, - padding: paddings - } - ]; - } - let mapping = []; - if (paddings.DEFAULT) { - mapping.push({ - screen: "DEFAULT", - minWidth: 0, - padding: paddings.DEFAULT - }); - } - for (let minWidth of minWidths){ - for (let screen of screens){ - for (let { min } of screen.values){ - if (min === minWidth) { - mapping.push({ - minWidth, - padding: paddings[screen.name] - }); - } - } - } - } - return mapping; - } - return function({ addComponents , theme }) { - let screens = (0, _normalizeScreens.normalizeScreens)(theme("container.screens", theme("screens"))); - let minWidths = extractMinWidths(screens); - let paddings = mapMinWidthsToPadding(minWidths, screens, theme("container.padding")); - let generatePaddingFor = (minWidth)=>{ - let paddingConfig = paddings.find((padding)=>padding.minWidth === minWidth); - if (!paddingConfig) { - return {}; - } - return { - paddingRight: paddingConfig.padding, - paddingLeft: paddingConfig.padding - }; - }; - let atRules = Array.from(new Set(minWidths.slice().sort((a, z)=>parseInt(a) - parseInt(z)))).map((minWidth)=>({ - [`@media (min-width: ${minWidth})`]: { - ".container": { - "max-width": minWidth, - ...generatePaddingFor(minWidth) - } - } - })); - addComponents([ - { - ".container": Object.assign({ - width: "100%" - }, theme("container.center", false) ? { - marginRight: "auto", - marginLeft: "auto" - } : {}, generatePaddingFor(0)) - }, - ...atRules - ]); - }; - })(), - accessibility: ({ addUtilities })=>{ - addUtilities({ - ".sr-only": { - position: "absolute", - width: "1px", - height: "1px", - padding: "0", - margin: "-1px", - overflow: "hidden", - clip: "rect(0, 0, 0, 0)", - whiteSpace: "nowrap", - borderWidth: "0" - }, - ".not-sr-only": { - position: "static", - width: "auto", - height: "auto", - padding: "0", - margin: "0", - overflow: "visible", - clip: "auto", - whiteSpace: "normal" - } - }); - }, - pointerEvents: ({ addUtilities })=>{ - addUtilities({ - ".pointer-events-none": { - "pointer-events": "none" - }, - ".pointer-events-auto": { - "pointer-events": "auto" - } - }); - }, - visibility: ({ addUtilities })=>{ - addUtilities({ - ".visible": { - visibility: "visible" - }, - ".invisible": { - visibility: "hidden" - }, - ".collapse": { - visibility: "collapse" - } - }); - }, - position: ({ addUtilities })=>{ - addUtilities({ - ".static": { - position: "static" - }, - ".fixed": { - position: "fixed" - }, - ".absolute": { - position: "absolute" - }, - ".relative": { - position: "relative" - }, - ".sticky": { - position: "sticky" - } - }); - }, - inset: (0, _createUtilityPlugin.default)("inset", [ - [ - "inset", - [ - "inset" - ] - ], - [ - [ - "inset-x", - [ - "left", - "right" - ] - ], - [ - "inset-y", - [ - "top", - "bottom" - ] - ] - ], - [ - [ - "start", - [ - "inset-inline-start" - ] - ], - [ - "end", - [ - "inset-inline-end" - ] - ], - [ - "top", - [ - "top" - ] - ], - [ - "right", - [ - "right" - ] - ], - [ - "bottom", - [ - "bottom" - ] - ], - [ - "left", - [ - "left" - ] - ] - ] - ], { - supportsNegativeValues: true - }), - isolation: ({ addUtilities })=>{ - addUtilities({ - ".isolate": { - isolation: "isolate" - }, - ".isolation-auto": { - isolation: "auto" - } - }); - }, - zIndex: (0, _createUtilityPlugin.default)("zIndex", [ - [ - "z", - [ - "zIndex" - ] - ] - ], { - supportsNegativeValues: true - }), - order: (0, _createUtilityPlugin.default)("order", undefined, { - supportsNegativeValues: true - }), - gridColumn: (0, _createUtilityPlugin.default)("gridColumn", [ - [ - "col", - [ - "gridColumn" - ] - ] - ]), - gridColumnStart: (0, _createUtilityPlugin.default)("gridColumnStart", [ - [ - "col-start", - [ - "gridColumnStart" - ] - ] - ], { - supportsNegativeValues: true - }), - gridColumnEnd: (0, _createUtilityPlugin.default)("gridColumnEnd", [ - [ - "col-end", - [ - "gridColumnEnd" - ] - ] - ], { - supportsNegativeValues: true - }), - gridRow: (0, _createUtilityPlugin.default)("gridRow", [ - [ - "row", - [ - "gridRow" - ] - ] - ]), - gridRowStart: (0, _createUtilityPlugin.default)("gridRowStart", [ - [ - "row-start", - [ - "gridRowStart" - ] - ] - ], { - supportsNegativeValues: true - }), - gridRowEnd: (0, _createUtilityPlugin.default)("gridRowEnd", [ - [ - "row-end", - [ - "gridRowEnd" - ] - ] - ], { - supportsNegativeValues: true - }), - float: ({ addUtilities })=>{ - addUtilities({ - ".float-start": { - float: "inline-start" - }, - ".float-end": { - float: "inline-end" - }, - ".float-right": { - float: "right" - }, - ".float-left": { - float: "left" - }, - ".float-none": { - float: "none" - } - }); - }, - clear: ({ addUtilities })=>{ - addUtilities({ - ".clear-start": { - clear: "inline-start" - }, - ".clear-end": { - clear: "inline-end" - }, - ".clear-left": { - clear: "left" - }, - ".clear-right": { - clear: "right" - }, - ".clear-both": { - clear: "both" - }, - ".clear-none": { - clear: "none" - } - }); - }, - margin: (0, _createUtilityPlugin.default)("margin", [ - [ - "m", - [ - "margin" - ] - ], - [ - [ - "mx", - [ - "margin-left", - "margin-right" - ] - ], - [ - "my", - [ - "margin-top", - "margin-bottom" - ] - ] - ], - [ - [ - "ms", - [ - "margin-inline-start" - ] - ], - [ - "me", - [ - "margin-inline-end" - ] - ], - [ - "mt", - [ - "margin-top" - ] - ], - [ - "mr", - [ - "margin-right" - ] - ], - [ - "mb", - [ - "margin-bottom" - ] - ], - [ - "ml", - [ - "margin-left" - ] - ] - ] - ], { - supportsNegativeValues: true - }), - boxSizing: ({ addUtilities })=>{ - addUtilities({ - ".box-border": { - "box-sizing": "border-box" - }, - ".box-content": { - "box-sizing": "content-box" - } - }); - }, - lineClamp: ({ matchUtilities , addUtilities , theme })=>{ - matchUtilities({ - "line-clamp": (value)=>({ - overflow: "hidden", - display: "-webkit-box", - "-webkit-box-orient": "vertical", - "-webkit-line-clamp": `${value}` - }) - }, { - values: theme("lineClamp") - }); - addUtilities({ - ".line-clamp-none": { - overflow: "visible", - display: "block", - "-webkit-box-orient": "horizontal", - "-webkit-line-clamp": "none" - } - }); - }, - display: ({ addUtilities })=>{ - addUtilities({ - ".block": { - display: "block" - }, - ".inline-block": { - display: "inline-block" - }, - ".inline": { - display: "inline" - }, - ".flex": { - display: "flex" - }, - ".inline-flex": { - display: "inline-flex" - }, - ".table": { - display: "table" - }, - ".inline-table": { - display: "inline-table" - }, - ".table-caption": { - display: "table-caption" - }, - ".table-cell": { - display: "table-cell" - }, - ".table-column": { - display: "table-column" - }, - ".table-column-group": { - display: "table-column-group" - }, - ".table-footer-group": { - display: "table-footer-group" - }, - ".table-header-group": { - display: "table-header-group" - }, - ".table-row-group": { - display: "table-row-group" - }, - ".table-row": { - display: "table-row" - }, - ".flow-root": { - display: "flow-root" - }, - ".grid": { - display: "grid" - }, - ".inline-grid": { - display: "inline-grid" - }, - ".contents": { - display: "contents" - }, - ".list-item": { - display: "list-item" - }, - ".hidden": { - display: "none" - } - }); - }, - aspectRatio: (0, _createUtilityPlugin.default)("aspectRatio", [ - [ - "aspect", - [ - "aspect-ratio" - ] - ] - ]), - size: (0, _createUtilityPlugin.default)("size", [ - [ - "size", - [ - "width", - "height" - ] - ] - ]), - height: (0, _createUtilityPlugin.default)("height", [ - [ - "h", - [ - "height" - ] - ] - ]), - maxHeight: (0, _createUtilityPlugin.default)("maxHeight", [ - [ - "max-h", - [ - "maxHeight" - ] - ] - ]), - minHeight: (0, _createUtilityPlugin.default)("minHeight", [ - [ - "min-h", - [ - "minHeight" - ] - ] - ]), - width: (0, _createUtilityPlugin.default)("width", [ - [ - "w", - [ - "width" - ] - ] - ]), - minWidth: (0, _createUtilityPlugin.default)("minWidth", [ - [ - "min-w", - [ - "minWidth" - ] - ] - ]), - maxWidth: (0, _createUtilityPlugin.default)("maxWidth", [ - [ - "max-w", - [ - "maxWidth" - ] - ] - ]), - flex: (0, _createUtilityPlugin.default)("flex"), - flexShrink: (0, _createUtilityPlugin.default)("flexShrink", [ - [ - "flex-shrink", - [ - "flex-shrink" - ] - ], - [ - "shrink", - [ - "flex-shrink" - ] - ] - ]), - flexGrow: (0, _createUtilityPlugin.default)("flexGrow", [ - [ - "flex-grow", - [ - "flex-grow" - ] - ], - [ - "grow", - [ - "flex-grow" - ] - ] - ]), - flexBasis: (0, _createUtilityPlugin.default)("flexBasis", [ - [ - "basis", - [ - "flex-basis" - ] - ] - ]), - tableLayout: ({ addUtilities })=>{ - addUtilities({ - ".table-auto": { - "table-layout": "auto" - }, - ".table-fixed": { - "table-layout": "fixed" - } - }); - }, - captionSide: ({ addUtilities })=>{ - addUtilities({ - ".caption-top": { - "caption-side": "top" - }, - ".caption-bottom": { - "caption-side": "bottom" - } - }); - }, - borderCollapse: ({ addUtilities })=>{ - addUtilities({ - ".border-collapse": { - "border-collapse": "collapse" - }, - ".border-separate": { - "border-collapse": "separate" - } - }); - }, - borderSpacing: ({ addDefaults , matchUtilities , theme })=>{ - addDefaults("border-spacing", { - "--tw-border-spacing-x": 0, - "--tw-border-spacing-y": 0 - }); - matchUtilities({ - "border-spacing": (value)=>{ - return { - "--tw-border-spacing-x": value, - "--tw-border-spacing-y": value, - "@defaults border-spacing": {}, - "border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)" - }; - }, - "border-spacing-x": (value)=>{ - return { - "--tw-border-spacing-x": value, - "@defaults border-spacing": {}, - "border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)" - }; - }, - "border-spacing-y": (value)=>{ - return { - "--tw-border-spacing-y": value, - "@defaults border-spacing": {}, - "border-spacing": "var(--tw-border-spacing-x) var(--tw-border-spacing-y)" - }; - } - }, { - values: theme("borderSpacing") - }); - }, - transformOrigin: (0, _createUtilityPlugin.default)("transformOrigin", [ - [ - "origin", - [ - "transformOrigin" - ] - ] - ]), - translate: (0, _createUtilityPlugin.default)("translate", [ - [ - [ - "translate-x", - [ - [ - "@defaults transform", - {} - ], - "--tw-translate-x", - [ - "transform", - cssTransformValue - ] - ] - ], - [ - "translate-y", - [ - [ - "@defaults transform", - {} - ], - "--tw-translate-y", - [ - "transform", - cssTransformValue - ] - ] - ] - ] - ], { - supportsNegativeValues: true - }), - rotate: (0, _createUtilityPlugin.default)("rotate", [ - [ - "rotate", - [ - [ - "@defaults transform", - {} - ], - "--tw-rotate", - [ - "transform", - cssTransformValue - ] - ] - ] - ], { - supportsNegativeValues: true - }), - skew: (0, _createUtilityPlugin.default)("skew", [ - [ - [ - "skew-x", - [ - [ - "@defaults transform", - {} - ], - "--tw-skew-x", - [ - "transform", - cssTransformValue - ] - ] - ], - [ - "skew-y", - [ - [ - "@defaults transform", - {} - ], - "--tw-skew-y", - [ - "transform", - cssTransformValue - ] - ] - ] - ] - ], { - supportsNegativeValues: true - }), - scale: (0, _createUtilityPlugin.default)("scale", [ - [ - "scale", - [ - [ - "@defaults transform", - {} - ], - "--tw-scale-x", - "--tw-scale-y", - [ - "transform", - cssTransformValue - ] - ] - ], - [ - [ - "scale-x", - [ - [ - "@defaults transform", - {} - ], - "--tw-scale-x", - [ - "transform", - cssTransformValue - ] - ] - ], - [ - "scale-y", - [ - [ - "@defaults transform", - {} - ], - "--tw-scale-y", - [ - "transform", - cssTransformValue - ] - ] - ] - ] - ], { - supportsNegativeValues: true - }), - transform: ({ addDefaults , addUtilities })=>{ - addDefaults("transform", { - "--tw-translate-x": "0", - "--tw-translate-y": "0", - "--tw-rotate": "0", - "--tw-skew-x": "0", - "--tw-skew-y": "0", - "--tw-scale-x": "1", - "--tw-scale-y": "1" - }); - addUtilities({ - ".transform": { - "@defaults transform": {}, - transform: cssTransformValue - }, - ".transform-cpu": { - transform: cssTransformValue - }, - ".transform-gpu": { - transform: cssTransformValue.replace("translate(var(--tw-translate-x), var(--tw-translate-y))", "translate3d(var(--tw-translate-x), var(--tw-translate-y), 0)") - }, - ".transform-none": { - transform: "none" - } - }); - }, - animation: ({ matchUtilities , theme , config })=>{ - let prefixName = (name)=>(0, _escapeClassName.default)(config("prefix") + name); - var _theme; - let keyframes = Object.fromEntries(Object.entries((_theme = theme("keyframes")) !== null && _theme !== void 0 ? _theme : {}).map(([key, value])=>{ - return [ - key, - { - [`@keyframes ${prefixName(key)}`]: value - } - ]; - })); - matchUtilities({ - animate: (value)=>{ - let animations = (0, _parseAnimationValue.default)(value); - return [ - ...animations.flatMap((animation)=>keyframes[animation.name]), - { - animation: animations.map(({ name , value })=>{ - if (name === undefined || keyframes[name] === undefined) { - return value; - } - return value.replace(name, prefixName(name)); - }).join(", ") - } - ]; - } - }, { - values: theme("animation") - }); - }, - cursor: (0, _createUtilityPlugin.default)("cursor"), - touchAction: ({ addDefaults , addUtilities })=>{ - addDefaults("touch-action", { - "--tw-pan-x": " ", - "--tw-pan-y": " ", - "--tw-pinch-zoom": " " - }); - let cssTouchActionValue = "var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"; - addUtilities({ - ".touch-auto": { - "touch-action": "auto" - }, - ".touch-none": { - "touch-action": "none" - }, - ".touch-pan-x": { - "@defaults touch-action": {}, - "--tw-pan-x": "pan-x", - "touch-action": cssTouchActionValue - }, - ".touch-pan-left": { - "@defaults touch-action": {}, - "--tw-pan-x": "pan-left", - "touch-action": cssTouchActionValue - }, - ".touch-pan-right": { - "@defaults touch-action": {}, - "--tw-pan-x": "pan-right", - "touch-action": cssTouchActionValue - }, - ".touch-pan-y": { - "@defaults touch-action": {}, - "--tw-pan-y": "pan-y", - "touch-action": cssTouchActionValue - }, - ".touch-pan-up": { - "@defaults touch-action": {}, - "--tw-pan-y": "pan-up", - "touch-action": cssTouchActionValue - }, - ".touch-pan-down": { - "@defaults touch-action": {}, - "--tw-pan-y": "pan-down", - "touch-action": cssTouchActionValue - }, - ".touch-pinch-zoom": { - "@defaults touch-action": {}, - "--tw-pinch-zoom": "pinch-zoom", - "touch-action": cssTouchActionValue - }, - ".touch-manipulation": { - "touch-action": "manipulation" - } - }); - }, - userSelect: ({ addUtilities })=>{ - addUtilities({ - ".select-none": { - "user-select": "none" - }, - ".select-text": { - "user-select": "text" - }, - ".select-all": { - "user-select": "all" - }, - ".select-auto": { - "user-select": "auto" - } - }); - }, - resize: ({ addUtilities })=>{ - addUtilities({ - ".resize-none": { - resize: "none" - }, - ".resize-y": { - resize: "vertical" - }, - ".resize-x": { - resize: "horizontal" - }, - ".resize": { - resize: "both" - } - }); - }, - scrollSnapType: ({ addDefaults , addUtilities })=>{ - addDefaults("scroll-snap-type", { - "--tw-scroll-snap-strictness": "proximity" - }); - addUtilities({ - ".snap-none": { - "scroll-snap-type": "none" - }, - ".snap-x": { - "@defaults scroll-snap-type": {}, - "scroll-snap-type": "x var(--tw-scroll-snap-strictness)" - }, - ".snap-y": { - "@defaults scroll-snap-type": {}, - "scroll-snap-type": "y var(--tw-scroll-snap-strictness)" - }, - ".snap-both": { - "@defaults scroll-snap-type": {}, - "scroll-snap-type": "both var(--tw-scroll-snap-strictness)" - }, - ".snap-mandatory": { - "--tw-scroll-snap-strictness": "mandatory" - }, - ".snap-proximity": { - "--tw-scroll-snap-strictness": "proximity" - } - }); - }, - scrollSnapAlign: ({ addUtilities })=>{ - addUtilities({ - ".snap-start": { - "scroll-snap-align": "start" - }, - ".snap-end": { - "scroll-snap-align": "end" - }, - ".snap-center": { - "scroll-snap-align": "center" - }, - ".snap-align-none": { - "scroll-snap-align": "none" - } - }); - }, - scrollSnapStop: ({ addUtilities })=>{ - addUtilities({ - ".snap-normal": { - "scroll-snap-stop": "normal" - }, - ".snap-always": { - "scroll-snap-stop": "always" - } - }); - }, - scrollMargin: (0, _createUtilityPlugin.default)("scrollMargin", [ - [ - "scroll-m", - [ - "scroll-margin" - ] - ], - [ - [ - "scroll-mx", - [ - "scroll-margin-left", - "scroll-margin-right" - ] - ], - [ - "scroll-my", - [ - "scroll-margin-top", - "scroll-margin-bottom" - ] - ] - ], - [ - [ - "scroll-ms", - [ - "scroll-margin-inline-start" - ] - ], - [ - "scroll-me", - [ - "scroll-margin-inline-end" - ] - ], - [ - "scroll-mt", - [ - "scroll-margin-top" - ] - ], - [ - "scroll-mr", - [ - "scroll-margin-right" - ] - ], - [ - "scroll-mb", - [ - "scroll-margin-bottom" - ] - ], - [ - "scroll-ml", - [ - "scroll-margin-left" - ] - ] - ] - ], { - supportsNegativeValues: true - }), - scrollPadding: (0, _createUtilityPlugin.default)("scrollPadding", [ - [ - "scroll-p", - [ - "scroll-padding" - ] - ], - [ - [ - "scroll-px", - [ - "scroll-padding-left", - "scroll-padding-right" - ] - ], - [ - "scroll-py", - [ - "scroll-padding-top", - "scroll-padding-bottom" - ] - ] - ], - [ - [ - "scroll-ps", - [ - "scroll-padding-inline-start" - ] - ], - [ - "scroll-pe", - [ - "scroll-padding-inline-end" - ] - ], - [ - "scroll-pt", - [ - "scroll-padding-top" - ] - ], - [ - "scroll-pr", - [ - "scroll-padding-right" - ] - ], - [ - "scroll-pb", - [ - "scroll-padding-bottom" - ] - ], - [ - "scroll-pl", - [ - "scroll-padding-left" - ] - ] - ] - ]), - listStylePosition: ({ addUtilities })=>{ - addUtilities({ - ".list-inside": { - "list-style-position": "inside" - }, - ".list-outside": { - "list-style-position": "outside" - } - }); - }, - listStyleType: (0, _createUtilityPlugin.default)("listStyleType", [ - [ - "list", - [ - "listStyleType" - ] - ] - ]), - listStyleImage: (0, _createUtilityPlugin.default)("listStyleImage", [ - [ - "list-image", - [ - "listStyleImage" - ] - ] - ]), - appearance: ({ addUtilities })=>{ - addUtilities({ - ".appearance-none": { - appearance: "none" - }, - ".appearance-auto": { - appearance: "auto" - } - }); - }, - columns: (0, _createUtilityPlugin.default)("columns", [ - [ - "columns", - [ - "columns" - ] - ] - ]), - breakBefore: ({ addUtilities })=>{ - addUtilities({ - ".break-before-auto": { - "break-before": "auto" - }, - ".break-before-avoid": { - "break-before": "avoid" - }, - ".break-before-all": { - "break-before": "all" - }, - ".break-before-avoid-page": { - "break-before": "avoid-page" - }, - ".break-before-page": { - "break-before": "page" - }, - ".break-before-left": { - "break-before": "left" - }, - ".break-before-right": { - "break-before": "right" - }, - ".break-before-column": { - "break-before": "column" - } - }); - }, - breakInside: ({ addUtilities })=>{ - addUtilities({ - ".break-inside-auto": { - "break-inside": "auto" - }, - ".break-inside-avoid": { - "break-inside": "avoid" - }, - ".break-inside-avoid-page": { - "break-inside": "avoid-page" - }, - ".break-inside-avoid-column": { - "break-inside": "avoid-column" - } - }); - }, - breakAfter: ({ addUtilities })=>{ - addUtilities({ - ".break-after-auto": { - "break-after": "auto" - }, - ".break-after-avoid": { - "break-after": "avoid" - }, - ".break-after-all": { - "break-after": "all" - }, - ".break-after-avoid-page": { - "break-after": "avoid-page" - }, - ".break-after-page": { - "break-after": "page" - }, - ".break-after-left": { - "break-after": "left" - }, - ".break-after-right": { - "break-after": "right" - }, - ".break-after-column": { - "break-after": "column" - } - }); - }, - gridAutoColumns: (0, _createUtilityPlugin.default)("gridAutoColumns", [ - [ - "auto-cols", - [ - "gridAutoColumns" - ] - ] - ]), - gridAutoFlow: ({ addUtilities })=>{ - addUtilities({ - ".grid-flow-row": { - gridAutoFlow: "row" - }, - ".grid-flow-col": { - gridAutoFlow: "column" - }, - ".grid-flow-dense": { - gridAutoFlow: "dense" - }, - ".grid-flow-row-dense": { - gridAutoFlow: "row dense" - }, - ".grid-flow-col-dense": { - gridAutoFlow: "column dense" - } - }); - }, - gridAutoRows: (0, _createUtilityPlugin.default)("gridAutoRows", [ - [ - "auto-rows", - [ - "gridAutoRows" - ] - ] - ]), - gridTemplateColumns: (0, _createUtilityPlugin.default)("gridTemplateColumns", [ - [ - "grid-cols", - [ - "gridTemplateColumns" - ] - ] - ]), - gridTemplateRows: (0, _createUtilityPlugin.default)("gridTemplateRows", [ - [ - "grid-rows", - [ - "gridTemplateRows" - ] - ] - ]), - flexDirection: ({ addUtilities })=>{ - addUtilities({ - ".flex-row": { - "flex-direction": "row" - }, - ".flex-row-reverse": { - "flex-direction": "row-reverse" - }, - ".flex-col": { - "flex-direction": "column" - }, - ".flex-col-reverse": { - "flex-direction": "column-reverse" - } - }); - }, - flexWrap: ({ addUtilities })=>{ - addUtilities({ - ".flex-wrap": { - "flex-wrap": "wrap" - }, - ".flex-wrap-reverse": { - "flex-wrap": "wrap-reverse" - }, - ".flex-nowrap": { - "flex-wrap": "nowrap" - } - }); - }, - placeContent: ({ addUtilities })=>{ - addUtilities({ - ".place-content-center": { - "place-content": "center" - }, - ".place-content-start": { - "place-content": "start" - }, - ".place-content-end": { - "place-content": "end" - }, - ".place-content-between": { - "place-content": "space-between" - }, - ".place-content-around": { - "place-content": "space-around" - }, - ".place-content-evenly": { - "place-content": "space-evenly" - }, - ".place-content-baseline": { - "place-content": "baseline" - }, - ".place-content-stretch": { - "place-content": "stretch" - } - }); - }, - placeItems: ({ addUtilities })=>{ - addUtilities({ - ".place-items-start": { - "place-items": "start" - }, - ".place-items-end": { - "place-items": "end" - }, - ".place-items-center": { - "place-items": "center" - }, - ".place-items-baseline": { - "place-items": "baseline" - }, - ".place-items-stretch": { - "place-items": "stretch" - } - }); - }, - alignContent: ({ addUtilities })=>{ - addUtilities({ - ".content-normal": { - "align-content": "normal" - }, - ".content-center": { - "align-content": "center" - }, - ".content-start": { - "align-content": "flex-start" - }, - ".content-end": { - "align-content": "flex-end" - }, - ".content-between": { - "align-content": "space-between" - }, - ".content-around": { - "align-content": "space-around" - }, - ".content-evenly": { - "align-content": "space-evenly" - }, - ".content-baseline": { - "align-content": "baseline" - }, - ".content-stretch": { - "align-content": "stretch" - } - }); - }, - alignItems: ({ addUtilities })=>{ - addUtilities({ - ".items-start": { - "align-items": "flex-start" - }, - ".items-end": { - "align-items": "flex-end" - }, - ".items-center": { - "align-items": "center" - }, - ".items-baseline": { - "align-items": "baseline" - }, - ".items-stretch": { - "align-items": "stretch" - } - }); - }, - justifyContent: ({ addUtilities })=>{ - addUtilities({ - ".justify-normal": { - "justify-content": "normal" - }, - ".justify-start": { - "justify-content": "flex-start" - }, - ".justify-end": { - "justify-content": "flex-end" - }, - ".justify-center": { - "justify-content": "center" - }, - ".justify-between": { - "justify-content": "space-between" - }, - ".justify-around": { - "justify-content": "space-around" - }, - ".justify-evenly": { - "justify-content": "space-evenly" - }, - ".justify-stretch": { - "justify-content": "stretch" - } - }); - }, - justifyItems: ({ addUtilities })=>{ - addUtilities({ - ".justify-items-start": { - "justify-items": "start" - }, - ".justify-items-end": { - "justify-items": "end" - }, - ".justify-items-center": { - "justify-items": "center" - }, - ".justify-items-stretch": { - "justify-items": "stretch" - } - }); - }, - gap: (0, _createUtilityPlugin.default)("gap", [ - [ - "gap", - [ - "gap" - ] - ], - [ - [ - "gap-x", - [ - "columnGap" - ] - ], - [ - "gap-y", - [ - "rowGap" - ] - ] - ] - ]), - space: ({ matchUtilities , addUtilities , theme })=>{ - matchUtilities({ - "space-x": (value)=>{ - value = value === "0" ? "0px" : value; - return { - "& > :not([hidden]) ~ :not([hidden])": { - "--tw-space-x-reverse": "0", - "margin-right": `calc(${value} * var(--tw-space-x-reverse))`, - "margin-left": `calc(${value} * calc(1 - var(--tw-space-x-reverse)))` - } - }; - }, - "space-y": (value)=>{ - value = value === "0" ? "0px" : value; - return { - "& > :not([hidden]) ~ :not([hidden])": { - "--tw-space-y-reverse": "0", - "margin-top": `calc(${value} * calc(1 - var(--tw-space-y-reverse)))`, - "margin-bottom": `calc(${value} * var(--tw-space-y-reverse))` - } - }; - } - }, { - values: theme("space"), - supportsNegativeValues: true - }); - addUtilities({ - ".space-y-reverse > :not([hidden]) ~ :not([hidden])": { - "--tw-space-y-reverse": "1" - }, - ".space-x-reverse > :not([hidden]) ~ :not([hidden])": { - "--tw-space-x-reverse": "1" - } - }); - }, - divideWidth: ({ matchUtilities , addUtilities , theme })=>{ - matchUtilities({ - "divide-x": (value)=>{ - value = value === "0" ? "0px" : value; - return { - "& > :not([hidden]) ~ :not([hidden])": { - "@defaults border-width": {}, - "--tw-divide-x-reverse": "0", - "border-right-width": `calc(${value} * var(--tw-divide-x-reverse))`, - "border-left-width": `calc(${value} * calc(1 - var(--tw-divide-x-reverse)))` - } - }; - }, - "divide-y": (value)=>{ - value = value === "0" ? "0px" : value; - return { - "& > :not([hidden]) ~ :not([hidden])": { - "@defaults border-width": {}, - "--tw-divide-y-reverse": "0", - "border-top-width": `calc(${value} * calc(1 - var(--tw-divide-y-reverse)))`, - "border-bottom-width": `calc(${value} * var(--tw-divide-y-reverse))` - } - }; - } - }, { - values: theme("divideWidth"), - type: [ - "line-width", - "length", - "any" - ] - }); - addUtilities({ - ".divide-y-reverse > :not([hidden]) ~ :not([hidden])": { - "@defaults border-width": {}, - "--tw-divide-y-reverse": "1" - }, - ".divide-x-reverse > :not([hidden]) ~ :not([hidden])": { - "@defaults border-width": {}, - "--tw-divide-x-reverse": "1" - } - }); - }, - divideStyle: ({ addUtilities })=>{ - addUtilities({ - ".divide-solid > :not([hidden]) ~ :not([hidden])": { - "border-style": "solid" - }, - ".divide-dashed > :not([hidden]) ~ :not([hidden])": { - "border-style": "dashed" - }, - ".divide-dotted > :not([hidden]) ~ :not([hidden])": { - "border-style": "dotted" - }, - ".divide-double > :not([hidden]) ~ :not([hidden])": { - "border-style": "double" - }, - ".divide-none > :not([hidden]) ~ :not([hidden])": { - "border-style": "none" - } - }); - }, - divideColor: ({ matchUtilities , theme , corePlugins })=>{ - matchUtilities({ - divide: (value)=>{ - if (!corePlugins("divideOpacity")) { - return { - ["& > :not([hidden]) ~ :not([hidden])"]: { - "border-color": (0, _toColorValue.default)(value) - } - }; - } - return { - ["& > :not([hidden]) ~ :not([hidden])"]: (0, _withAlphaVariable.default)({ - color: value, - property: "border-color", - variable: "--tw-divide-opacity" - }) - }; - } - }, { - values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette.default)(theme("divideColor"))), - type: [ - "color", - "any" - ] - }); - }, - divideOpacity: ({ matchUtilities , theme })=>{ - matchUtilities({ - "divide-opacity": (value)=>{ - return { - [`& > :not([hidden]) ~ :not([hidden])`]: { - "--tw-divide-opacity": value - } - }; - } - }, { - values: theme("divideOpacity") - }); - }, - placeSelf: ({ addUtilities })=>{ - addUtilities({ - ".place-self-auto": { - "place-self": "auto" - }, - ".place-self-start": { - "place-self": "start" - }, - ".place-self-end": { - "place-self": "end" - }, - ".place-self-center": { - "place-self": "center" - }, - ".place-self-stretch": { - "place-self": "stretch" - } - }); - }, - alignSelf: ({ addUtilities })=>{ - addUtilities({ - ".self-auto": { - "align-self": "auto" - }, - ".self-start": { - "align-self": "flex-start" - }, - ".self-end": { - "align-self": "flex-end" - }, - ".self-center": { - "align-self": "center" - }, - ".self-stretch": { - "align-self": "stretch" - }, - ".self-baseline": { - "align-self": "baseline" - } - }); - }, - justifySelf: ({ addUtilities })=>{ - addUtilities({ - ".justify-self-auto": { - "justify-self": "auto" - }, - ".justify-self-start": { - "justify-self": "start" - }, - ".justify-self-end": { - "justify-self": "end" - }, - ".justify-self-center": { - "justify-self": "center" - }, - ".justify-self-stretch": { - "justify-self": "stretch" - } - }); - }, - overflow: ({ addUtilities })=>{ - addUtilities({ - ".overflow-auto": { - overflow: "auto" - }, - ".overflow-hidden": { - overflow: "hidden" - }, - ".overflow-clip": { - overflow: "clip" - }, - ".overflow-visible": { - overflow: "visible" - }, - ".overflow-scroll": { - overflow: "scroll" - }, - ".overflow-x-auto": { - "overflow-x": "auto" - }, - ".overflow-y-auto": { - "overflow-y": "auto" - }, - ".overflow-x-hidden": { - "overflow-x": "hidden" - }, - ".overflow-y-hidden": { - "overflow-y": "hidden" - }, - ".overflow-x-clip": { - "overflow-x": "clip" - }, - ".overflow-y-clip": { - "overflow-y": "clip" - }, - ".overflow-x-visible": { - "overflow-x": "visible" - }, - ".overflow-y-visible": { - "overflow-y": "visible" - }, - ".overflow-x-scroll": { - "overflow-x": "scroll" - }, - ".overflow-y-scroll": { - "overflow-y": "scroll" - } - }); - }, - overscrollBehavior: ({ addUtilities })=>{ - addUtilities({ - ".overscroll-auto": { - "overscroll-behavior": "auto" - }, - ".overscroll-contain": { - "overscroll-behavior": "contain" - }, - ".overscroll-none": { - "overscroll-behavior": "none" - }, - ".overscroll-y-auto": { - "overscroll-behavior-y": "auto" - }, - ".overscroll-y-contain": { - "overscroll-behavior-y": "contain" - }, - ".overscroll-y-none": { - "overscroll-behavior-y": "none" - }, - ".overscroll-x-auto": { - "overscroll-behavior-x": "auto" - }, - ".overscroll-x-contain": { - "overscroll-behavior-x": "contain" - }, - ".overscroll-x-none": { - "overscroll-behavior-x": "none" - } - }); - }, - scrollBehavior: ({ addUtilities })=>{ - addUtilities({ - ".scroll-auto": { - "scroll-behavior": "auto" - }, - ".scroll-smooth": { - "scroll-behavior": "smooth" - } - }); - }, - textOverflow: ({ addUtilities })=>{ - addUtilities({ - ".truncate": { - overflow: "hidden", - "text-overflow": "ellipsis", - "white-space": "nowrap" - }, - ".overflow-ellipsis": { - "text-overflow": "ellipsis" - }, - ".text-ellipsis": { - "text-overflow": "ellipsis" - }, - ".text-clip": { - "text-overflow": "clip" - } - }); - }, - hyphens: ({ addUtilities })=>{ - addUtilities({ - ".hyphens-none": { - hyphens: "none" - }, - ".hyphens-manual": { - hyphens: "manual" - }, - ".hyphens-auto": { - hyphens: "auto" - } - }); - }, - whitespace: ({ addUtilities })=>{ - addUtilities({ - ".whitespace-normal": { - "white-space": "normal" - }, - ".whitespace-nowrap": { - "white-space": "nowrap" - }, - ".whitespace-pre": { - "white-space": "pre" - }, - ".whitespace-pre-line": { - "white-space": "pre-line" - }, - ".whitespace-pre-wrap": { - "white-space": "pre-wrap" - }, - ".whitespace-break-spaces": { - "white-space": "break-spaces" - } - }); - }, - textWrap: ({ addUtilities })=>{ - addUtilities({ - ".text-wrap": { - "text-wrap": "wrap" - }, - ".text-nowrap": { - "text-wrap": "nowrap" - }, - ".text-balance": { - "text-wrap": "balance" - }, - ".text-pretty": { - "text-wrap": "pretty" - } - }); - }, - wordBreak: ({ addUtilities })=>{ - addUtilities({ - ".break-normal": { - "overflow-wrap": "normal", - "word-break": "normal" - }, - ".break-words": { - "overflow-wrap": "break-word" - }, - ".break-all": { - "word-break": "break-all" - }, - ".break-keep": { - "word-break": "keep-all" - } - }); - }, - borderRadius: (0, _createUtilityPlugin.default)("borderRadius", [ - [ - "rounded", - [ - "border-radius" - ] - ], - [ - [ - "rounded-s", - [ - "border-start-start-radius", - "border-end-start-radius" - ] - ], - [ - "rounded-e", - [ - "border-start-end-radius", - "border-end-end-radius" - ] - ], - [ - "rounded-t", - [ - "border-top-left-radius", - "border-top-right-radius" - ] - ], - [ - "rounded-r", - [ - "border-top-right-radius", - "border-bottom-right-radius" - ] - ], - [ - "rounded-b", - [ - "border-bottom-right-radius", - "border-bottom-left-radius" - ] - ], - [ - "rounded-l", - [ - "border-top-left-radius", - "border-bottom-left-radius" - ] - ] - ], - [ - [ - "rounded-ss", - [ - "border-start-start-radius" - ] - ], - [ - "rounded-se", - [ - "border-start-end-radius" - ] - ], - [ - "rounded-ee", - [ - "border-end-end-radius" - ] - ], - [ - "rounded-es", - [ - "border-end-start-radius" - ] - ], - [ - "rounded-tl", - [ - "border-top-left-radius" - ] - ], - [ - "rounded-tr", - [ - "border-top-right-radius" - ] - ], - [ - "rounded-br", - [ - "border-bottom-right-radius" - ] - ], - [ - "rounded-bl", - [ - "border-bottom-left-radius" - ] - ] - ] - ]), - borderWidth: (0, _createUtilityPlugin.default)("borderWidth", [ - [ - "border", - [ - [ - "@defaults border-width", - {} - ], - "border-width" - ] - ], - [ - [ - "border-x", - [ - [ - "@defaults border-width", - {} - ], - "border-left-width", - "border-right-width" - ] - ], - [ - "border-y", - [ - [ - "@defaults border-width", - {} - ], - "border-top-width", - "border-bottom-width" - ] - ] - ], - [ - [ - "border-s", - [ - [ - "@defaults border-width", - {} - ], - "border-inline-start-width" - ] - ], - [ - "border-e", - [ - [ - "@defaults border-width", - {} - ], - "border-inline-end-width" - ] - ], - [ - "border-t", - [ - [ - "@defaults border-width", - {} - ], - "border-top-width" - ] - ], - [ - "border-r", - [ - [ - "@defaults border-width", - {} - ], - "border-right-width" - ] - ], - [ - "border-b", - [ - [ - "@defaults border-width", - {} - ], - "border-bottom-width" - ] - ], - [ - "border-l", - [ - [ - "@defaults border-width", - {} - ], - "border-left-width" - ] - ] - ] - ], { - type: [ - "line-width", - "length" - ] - }), - borderStyle: ({ addUtilities })=>{ - addUtilities({ - ".border-solid": { - "border-style": "solid" - }, - ".border-dashed": { - "border-style": "dashed" - }, - ".border-dotted": { - "border-style": "dotted" - }, - ".border-double": { - "border-style": "double" - }, - ".border-hidden": { - "border-style": "hidden" - }, - ".border-none": { - "border-style": "none" - } - }); - }, - borderColor: ({ matchUtilities , theme , corePlugins })=>{ - matchUtilities({ - border: (value)=>{ - if (!corePlugins("borderOpacity")) { - return { - "border-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: "border-color", - variable: "--tw-border-opacity" - }); - } - }, { - values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette.default)(theme("borderColor"))), - type: [ - "color", - "any" - ] - }); - matchUtilities({ - "border-x": (value)=>{ - if (!corePlugins("borderOpacity")) { - return { - "border-left-color": (0, _toColorValue.default)(value), - "border-right-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: [ - "border-left-color", - "border-right-color" - ], - variable: "--tw-border-opacity" - }); - }, - "border-y": (value)=>{ - if (!corePlugins("borderOpacity")) { - return { - "border-top-color": (0, _toColorValue.default)(value), - "border-bottom-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: [ - "border-top-color", - "border-bottom-color" - ], - variable: "--tw-border-opacity" - }); - } - }, { - values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette.default)(theme("borderColor"))), - type: [ - "color", - "any" - ] - }); - matchUtilities({ - "border-s": (value)=>{ - if (!corePlugins("borderOpacity")) { - return { - "border-inline-start-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: "border-inline-start-color", - variable: "--tw-border-opacity" - }); - }, - "border-e": (value)=>{ - if (!corePlugins("borderOpacity")) { - return { - "border-inline-end-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: "border-inline-end-color", - variable: "--tw-border-opacity" - }); - }, - "border-t": (value)=>{ - if (!corePlugins("borderOpacity")) { - return { - "border-top-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: "border-top-color", - variable: "--tw-border-opacity" - }); - }, - "border-r": (value)=>{ - if (!corePlugins("borderOpacity")) { - return { - "border-right-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: "border-right-color", - variable: "--tw-border-opacity" - }); - }, - "border-b": (value)=>{ - if (!corePlugins("borderOpacity")) { - return { - "border-bottom-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: "border-bottom-color", - variable: "--tw-border-opacity" - }); - }, - "border-l": (value)=>{ - if (!corePlugins("borderOpacity")) { - return { - "border-left-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: "border-left-color", - variable: "--tw-border-opacity" - }); - } - }, { - values: (({ DEFAULT: _ , ...colors })=>colors)((0, _flattenColorPalette.default)(theme("borderColor"))), - type: [ - "color", - "any" - ] - }); - }, - borderOpacity: (0, _createUtilityPlugin.default)("borderOpacity", [ - [ - "border-opacity", - [ - "--tw-border-opacity" - ] - ] - ]), - backgroundColor: ({ matchUtilities , theme , corePlugins })=>{ - matchUtilities({ - bg: (value)=>{ - if (!corePlugins("backgroundOpacity")) { - return { - "background-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: "background-color", - variable: "--tw-bg-opacity" - }); - } - }, { - values: (0, _flattenColorPalette.default)(theme("backgroundColor")), - type: [ - "color", - "any" - ] - }); - }, - backgroundOpacity: (0, _createUtilityPlugin.default)("backgroundOpacity", [ - [ - "bg-opacity", - [ - "--tw-bg-opacity" - ] - ] - ]), - backgroundImage: (0, _createUtilityPlugin.default)("backgroundImage", [ - [ - "bg", - [ - "background-image" - ] - ] - ], { - type: [ - "lookup", - "image", - "url" - ] - }), - gradientColorStops: (()=>{ - function transparentTo(value) { - return (0, _withAlphaVariable.withAlphaValue)(value, 0, "rgb(255 255 255 / 0)"); - } - return function({ matchUtilities , theme , addDefaults }) { - addDefaults("gradient-color-stops", { - "--tw-gradient-from-position": " ", - "--tw-gradient-via-position": " ", - "--tw-gradient-to-position": " " - }); - let options = { - values: (0, _flattenColorPalette.default)(theme("gradientColorStops")), - type: [ - "color", - "any" - ] - }; - let positionOptions = { - values: theme("gradientColorStopPositions"), - type: [ - "length", - "percentage" - ] - }; - matchUtilities({ - from: (value)=>{ - let transparentToValue = transparentTo(value); - return { - "@defaults gradient-color-stops": {}, - "--tw-gradient-from": `${(0, _toColorValue.default)(value)} var(--tw-gradient-from-position)`, - "--tw-gradient-to": `${transparentToValue} var(--tw-gradient-to-position)`, - "--tw-gradient-stops": `var(--tw-gradient-from), var(--tw-gradient-to)` - }; - } - }, options); - matchUtilities({ - from: (value)=>{ - return { - "--tw-gradient-from-position": value - }; - } - }, positionOptions); - matchUtilities({ - via: (value)=>{ - let transparentToValue = transparentTo(value); - return { - "@defaults gradient-color-stops": {}, - "--tw-gradient-to": `${transparentToValue} var(--tw-gradient-to-position)`, - "--tw-gradient-stops": `var(--tw-gradient-from), ${(0, _toColorValue.default)(value)} var(--tw-gradient-via-position), var(--tw-gradient-to)` - }; - } - }, options); - matchUtilities({ - via: (value)=>{ - return { - "--tw-gradient-via-position": value - }; - } - }, positionOptions); - matchUtilities({ - to: (value)=>({ - "@defaults gradient-color-stops": {}, - "--tw-gradient-to": `${(0, _toColorValue.default)(value)} var(--tw-gradient-to-position)` - }) - }, options); - matchUtilities({ - to: (value)=>{ - return { - "--tw-gradient-to-position": value - }; - } - }, positionOptions); - }; - })(), - boxDecorationBreak: ({ addUtilities })=>{ - addUtilities({ - ".decoration-slice": { - "box-decoration-break": "slice" - }, - ".decoration-clone": { - "box-decoration-break": "clone" - }, - ".box-decoration-slice": { - "box-decoration-break": "slice" - }, - ".box-decoration-clone": { - "box-decoration-break": "clone" - } - }); - }, - backgroundSize: (0, _createUtilityPlugin.default)("backgroundSize", [ - [ - "bg", - [ - "background-size" - ] - ] - ], { - type: [ - "lookup", - "length", - "percentage", - "size" - ] - }), - backgroundAttachment: ({ addUtilities })=>{ - addUtilities({ - ".bg-fixed": { - "background-attachment": "fixed" - }, - ".bg-local": { - "background-attachment": "local" - }, - ".bg-scroll": { - "background-attachment": "scroll" - } - }); - }, - backgroundClip: ({ addUtilities })=>{ - addUtilities({ - ".bg-clip-border": { - "background-clip": "border-box" - }, - ".bg-clip-padding": { - "background-clip": "padding-box" - }, - ".bg-clip-content": { - "background-clip": "content-box" - }, - ".bg-clip-text": { - "background-clip": "text" - } - }); - }, - backgroundPosition: (0, _createUtilityPlugin.default)("backgroundPosition", [ - [ - "bg", - [ - "background-position" - ] - ] - ], { - type: [ - "lookup", - [ - "position", - { - preferOnConflict: true - } - ] - ] - }), - backgroundRepeat: ({ addUtilities })=>{ - addUtilities({ - ".bg-repeat": { - "background-repeat": "repeat" - }, - ".bg-no-repeat": { - "background-repeat": "no-repeat" - }, - ".bg-repeat-x": { - "background-repeat": "repeat-x" - }, - ".bg-repeat-y": { - "background-repeat": "repeat-y" - }, - ".bg-repeat-round": { - "background-repeat": "round" - }, - ".bg-repeat-space": { - "background-repeat": "space" - } - }); - }, - backgroundOrigin: ({ addUtilities })=>{ - addUtilities({ - ".bg-origin-border": { - "background-origin": "border-box" - }, - ".bg-origin-padding": { - "background-origin": "padding-box" - }, - ".bg-origin-content": { - "background-origin": "content-box" - } - }); - }, - fill: ({ matchUtilities , theme })=>{ - matchUtilities({ - fill: (value)=>{ - return { - fill: (0, _toColorValue.default)(value) - }; - } - }, { - values: (0, _flattenColorPalette.default)(theme("fill")), - type: [ - "color", - "any" - ] - }); - }, - stroke: ({ matchUtilities , theme })=>{ - matchUtilities({ - stroke: (value)=>{ - return { - stroke: (0, _toColorValue.default)(value) - }; - } - }, { - values: (0, _flattenColorPalette.default)(theme("stroke")), - type: [ - "color", - "url", - "any" - ] - }); - }, - strokeWidth: (0, _createUtilityPlugin.default)("strokeWidth", [ - [ - "stroke", - [ - "stroke-width" - ] - ] - ], { - type: [ - "length", - "number", - "percentage" - ] - }), - objectFit: ({ addUtilities })=>{ - addUtilities({ - ".object-contain": { - "object-fit": "contain" - }, - ".object-cover": { - "object-fit": "cover" - }, - ".object-fill": { - "object-fit": "fill" - }, - ".object-none": { - "object-fit": "none" - }, - ".object-scale-down": { - "object-fit": "scale-down" - } - }); - }, - objectPosition: (0, _createUtilityPlugin.default)("objectPosition", [ - [ - "object", - [ - "object-position" - ] - ] - ]), - padding: (0, _createUtilityPlugin.default)("padding", [ - [ - "p", - [ - "padding" - ] - ], - [ - [ - "px", - [ - "padding-left", - "padding-right" - ] - ], - [ - "py", - [ - "padding-top", - "padding-bottom" - ] - ] - ], - [ - [ - "ps", - [ - "padding-inline-start" - ] - ], - [ - "pe", - [ - "padding-inline-end" - ] - ], - [ - "pt", - [ - "padding-top" - ] - ], - [ - "pr", - [ - "padding-right" - ] - ], - [ - "pb", - [ - "padding-bottom" - ] - ], - [ - "pl", - [ - "padding-left" - ] - ] - ] - ]), - textAlign: ({ addUtilities })=>{ - addUtilities({ - ".text-left": { - "text-align": "left" - }, - ".text-center": { - "text-align": "center" - }, - ".text-right": { - "text-align": "right" - }, - ".text-justify": { - "text-align": "justify" - }, - ".text-start": { - "text-align": "start" - }, - ".text-end": { - "text-align": "end" - } - }); - }, - textIndent: (0, _createUtilityPlugin.default)("textIndent", [ - [ - "indent", - [ - "text-indent" - ] - ] - ], { - supportsNegativeValues: true - }), - verticalAlign: ({ addUtilities , matchUtilities })=>{ - addUtilities({ - ".align-baseline": { - "vertical-align": "baseline" - }, - ".align-top": { - "vertical-align": "top" - }, - ".align-middle": { - "vertical-align": "middle" - }, - ".align-bottom": { - "vertical-align": "bottom" - }, - ".align-text-top": { - "vertical-align": "text-top" - }, - ".align-text-bottom": { - "vertical-align": "text-bottom" - }, - ".align-sub": { - "vertical-align": "sub" - }, - ".align-super": { - "vertical-align": "super" - } - }); - matchUtilities({ - align: (value)=>({ - "vertical-align": value - }) - }); - }, - fontFamily: ({ matchUtilities , theme })=>{ - matchUtilities({ - font: (value)=>{ - let [families, options = {}] = Array.isArray(value) && (0, _isPlainObject.default)(value[1]) ? value : [ - value - ]; - let { fontFeatureSettings , fontVariationSettings } = options; - return { - "font-family": Array.isArray(families) ? families.join(", ") : families, - ...fontFeatureSettings === undefined ? {} : { - "font-feature-settings": fontFeatureSettings - }, - ...fontVariationSettings === undefined ? {} : { - "font-variation-settings": fontVariationSettings - } - }; - } - }, { - values: theme("fontFamily"), - type: [ - "lookup", - "generic-name", - "family-name" - ] - }); - }, - fontSize: ({ matchUtilities , theme })=>{ - matchUtilities({ - text: (value, { modifier })=>{ - let [fontSize, options] = Array.isArray(value) ? value : [ - value - ]; - if (modifier) { - return { - "font-size": fontSize, - "line-height": modifier - }; - } - let { lineHeight , letterSpacing , fontWeight } = (0, _isPlainObject.default)(options) ? options : { - lineHeight: options - }; - return { - "font-size": fontSize, - ...lineHeight === undefined ? {} : { - "line-height": lineHeight - }, - ...letterSpacing === undefined ? {} : { - "letter-spacing": letterSpacing - }, - ...fontWeight === undefined ? {} : { - "font-weight": fontWeight - } - }; - } - }, { - values: theme("fontSize"), - modifiers: theme("lineHeight"), - type: [ - "absolute-size", - "relative-size", - "length", - "percentage" - ] - }); - }, - fontWeight: (0, _createUtilityPlugin.default)("fontWeight", [ - [ - "font", - [ - "fontWeight" - ] - ] - ], { - type: [ - "lookup", - "number", - "any" - ] - }), - textTransform: ({ addUtilities })=>{ - addUtilities({ - ".uppercase": { - "text-transform": "uppercase" - }, - ".lowercase": { - "text-transform": "lowercase" - }, - ".capitalize": { - "text-transform": "capitalize" - }, - ".normal-case": { - "text-transform": "none" - } - }); - }, - fontStyle: ({ addUtilities })=>{ - addUtilities({ - ".italic": { - "font-style": "italic" - }, - ".not-italic": { - "font-style": "normal" - } - }); - }, - fontVariantNumeric: ({ addDefaults , addUtilities })=>{ - let cssFontVariantNumericValue = "var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)"; - addDefaults("font-variant-numeric", { - "--tw-ordinal": " ", - "--tw-slashed-zero": " ", - "--tw-numeric-figure": " ", - "--tw-numeric-spacing": " ", - "--tw-numeric-fraction": " " - }); - addUtilities({ - ".normal-nums": { - "font-variant-numeric": "normal" - }, - ".ordinal": { - "@defaults font-variant-numeric": {}, - "--tw-ordinal": "ordinal", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".slashed-zero": { - "@defaults font-variant-numeric": {}, - "--tw-slashed-zero": "slashed-zero", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".lining-nums": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-figure": "lining-nums", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".oldstyle-nums": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-figure": "oldstyle-nums", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".proportional-nums": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-spacing": "proportional-nums", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".tabular-nums": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-spacing": "tabular-nums", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".diagonal-fractions": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-fraction": "diagonal-fractions", - "font-variant-numeric": cssFontVariantNumericValue - }, - ".stacked-fractions": { - "@defaults font-variant-numeric": {}, - "--tw-numeric-fraction": "stacked-fractions", - "font-variant-numeric": cssFontVariantNumericValue - } - }); - }, - lineHeight: (0, _createUtilityPlugin.default)("lineHeight", [ - [ - "leading", - [ - "lineHeight" - ] - ] - ]), - letterSpacing: (0, _createUtilityPlugin.default)("letterSpacing", [ - [ - "tracking", - [ - "letterSpacing" - ] - ] - ], { - supportsNegativeValues: true - }), - textColor: ({ matchUtilities , theme , corePlugins })=>{ - matchUtilities({ - text: (value)=>{ - if (!corePlugins("textOpacity")) { - return { - color: (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: "color", - variable: "--tw-text-opacity" - }); - } - }, { - values: (0, _flattenColorPalette.default)(theme("textColor")), - type: [ - "color", - "any" - ] - }); - }, - textOpacity: (0, _createUtilityPlugin.default)("textOpacity", [ - [ - "text-opacity", - [ - "--tw-text-opacity" - ] - ] - ]), - textDecoration: ({ addUtilities })=>{ - addUtilities({ - ".underline": { - "text-decoration-line": "underline" - }, - ".overline": { - "text-decoration-line": "overline" - }, - ".line-through": { - "text-decoration-line": "line-through" - }, - ".no-underline": { - "text-decoration-line": "none" - } - }); - }, - textDecorationColor: ({ matchUtilities , theme })=>{ - matchUtilities({ - decoration: (value)=>{ - return { - "text-decoration-color": (0, _toColorValue.default)(value) - }; - } - }, { - values: (0, _flattenColorPalette.default)(theme("textDecorationColor")), - type: [ - "color", - "any" - ] - }); - }, - textDecorationStyle: ({ addUtilities })=>{ - addUtilities({ - ".decoration-solid": { - "text-decoration-style": "solid" - }, - ".decoration-double": { - "text-decoration-style": "double" - }, - ".decoration-dotted": { - "text-decoration-style": "dotted" - }, - ".decoration-dashed": { - "text-decoration-style": "dashed" - }, - ".decoration-wavy": { - "text-decoration-style": "wavy" - } - }); - }, - textDecorationThickness: (0, _createUtilityPlugin.default)("textDecorationThickness", [ - [ - "decoration", - [ - "text-decoration-thickness" - ] - ] - ], { - type: [ - "length", - "percentage" - ] - }), - textUnderlineOffset: (0, _createUtilityPlugin.default)("textUnderlineOffset", [ - [ - "underline-offset", - [ - "text-underline-offset" - ] - ] - ], { - type: [ - "length", - "percentage", - "any" - ] - }), - fontSmoothing: ({ addUtilities })=>{ - addUtilities({ - ".antialiased": { - "-webkit-font-smoothing": "antialiased", - "-moz-osx-font-smoothing": "grayscale" - }, - ".subpixel-antialiased": { - "-webkit-font-smoothing": "auto", - "-moz-osx-font-smoothing": "auto" - } - }); - }, - placeholderColor: ({ matchUtilities , theme , corePlugins })=>{ - matchUtilities({ - placeholder: (value)=>{ - if (!corePlugins("placeholderOpacity")) { - return { - "&::placeholder": { - color: (0, _toColorValue.default)(value) - } - }; - } - return { - "&::placeholder": (0, _withAlphaVariable.default)({ - color: value, - property: "color", - variable: "--tw-placeholder-opacity" - }) - }; - } - }, { - values: (0, _flattenColorPalette.default)(theme("placeholderColor")), - type: [ - "color", - "any" - ] - }); - }, - placeholderOpacity: ({ matchUtilities , theme })=>{ - matchUtilities({ - "placeholder-opacity": (value)=>{ - return { - ["&::placeholder"]: { - "--tw-placeholder-opacity": value - } - }; - } - }, { - values: theme("placeholderOpacity") - }); - }, - caretColor: ({ matchUtilities , theme })=>{ - matchUtilities({ - caret: (value)=>{ - return { - "caret-color": (0, _toColorValue.default)(value) - }; - } - }, { - values: (0, _flattenColorPalette.default)(theme("caretColor")), - type: [ - "color", - "any" - ] - }); - }, - accentColor: ({ matchUtilities , theme })=>{ - matchUtilities({ - accent: (value)=>{ - return { - "accent-color": (0, _toColorValue.default)(value) - }; - } - }, { - values: (0, _flattenColorPalette.default)(theme("accentColor")), - type: [ - "color", - "any" - ] - }); - }, - opacity: (0, _createUtilityPlugin.default)("opacity", [ - [ - "opacity", - [ - "opacity" - ] - ] - ]), - backgroundBlendMode: ({ addUtilities })=>{ - addUtilities({ - ".bg-blend-normal": { - "background-blend-mode": "normal" - }, - ".bg-blend-multiply": { - "background-blend-mode": "multiply" - }, - ".bg-blend-screen": { - "background-blend-mode": "screen" - }, - ".bg-blend-overlay": { - "background-blend-mode": "overlay" - }, - ".bg-blend-darken": { - "background-blend-mode": "darken" - }, - ".bg-blend-lighten": { - "background-blend-mode": "lighten" - }, - ".bg-blend-color-dodge": { - "background-blend-mode": "color-dodge" - }, - ".bg-blend-color-burn": { - "background-blend-mode": "color-burn" - }, - ".bg-blend-hard-light": { - "background-blend-mode": "hard-light" - }, - ".bg-blend-soft-light": { - "background-blend-mode": "soft-light" - }, - ".bg-blend-difference": { - "background-blend-mode": "difference" - }, - ".bg-blend-exclusion": { - "background-blend-mode": "exclusion" - }, - ".bg-blend-hue": { - "background-blend-mode": "hue" - }, - ".bg-blend-saturation": { - "background-blend-mode": "saturation" - }, - ".bg-blend-color": { - "background-blend-mode": "color" - }, - ".bg-blend-luminosity": { - "background-blend-mode": "luminosity" - } - }); - }, - mixBlendMode: ({ addUtilities })=>{ - addUtilities({ - ".mix-blend-normal": { - "mix-blend-mode": "normal" - }, - ".mix-blend-multiply": { - "mix-blend-mode": "multiply" - }, - ".mix-blend-screen": { - "mix-blend-mode": "screen" - }, - ".mix-blend-overlay": { - "mix-blend-mode": "overlay" - }, - ".mix-blend-darken": { - "mix-blend-mode": "darken" - }, - ".mix-blend-lighten": { - "mix-blend-mode": "lighten" - }, - ".mix-blend-color-dodge": { - "mix-blend-mode": "color-dodge" - }, - ".mix-blend-color-burn": { - "mix-blend-mode": "color-burn" - }, - ".mix-blend-hard-light": { - "mix-blend-mode": "hard-light" - }, - ".mix-blend-soft-light": { - "mix-blend-mode": "soft-light" - }, - ".mix-blend-difference": { - "mix-blend-mode": "difference" - }, - ".mix-blend-exclusion": { - "mix-blend-mode": "exclusion" - }, - ".mix-blend-hue": { - "mix-blend-mode": "hue" - }, - ".mix-blend-saturation": { - "mix-blend-mode": "saturation" - }, - ".mix-blend-color": { - "mix-blend-mode": "color" - }, - ".mix-blend-luminosity": { - "mix-blend-mode": "luminosity" - }, - ".mix-blend-plus-darker": { - "mix-blend-mode": "plus-darker" - }, - ".mix-blend-plus-lighter": { - "mix-blend-mode": "plus-lighter" - } - }); - }, - boxShadow: (()=>{ - let transformValue = (0, _transformThemeValue.default)("boxShadow"); - let defaultBoxShadow = [ - `var(--tw-ring-offset-shadow, 0 0 #0000)`, - `var(--tw-ring-shadow, 0 0 #0000)`, - `var(--tw-shadow)` - ].join(", "); - return function({ matchUtilities , addDefaults , theme }) { - addDefaults("box-shadow", { - "--tw-ring-offset-shadow": "0 0 #0000", - "--tw-ring-shadow": "0 0 #0000", - "--tw-shadow": "0 0 #0000", - "--tw-shadow-colored": "0 0 #0000" - }); - matchUtilities({ - shadow: (value)=>{ - value = transformValue(value); - let ast = (0, _parseBoxShadowValue.parseBoxShadowValue)(value); - for (let shadow of ast){ - // Don't override color if the whole shadow is a variable - if (!shadow.valid) { - continue; - } - shadow.color = "var(--tw-shadow-color)"; - } - return { - "@defaults box-shadow": {}, - "--tw-shadow": value === "none" ? "0 0 #0000" : value, - "--tw-shadow-colored": value === "none" ? "0 0 #0000" : (0, _parseBoxShadowValue.formatBoxShadowValue)(ast), - "box-shadow": defaultBoxShadow - }; - } - }, { - values: theme("boxShadow"), - type: [ - "shadow" - ] - }); - }; - })(), - boxShadowColor: ({ matchUtilities , theme })=>{ - matchUtilities({ - shadow: (value)=>{ - return { - "--tw-shadow-color": (0, _toColorValue.default)(value), - "--tw-shadow": "var(--tw-shadow-colored)" - }; - } - }, { - values: (0, _flattenColorPalette.default)(theme("boxShadowColor")), - type: [ - "color", - "any" - ] - }); - }, - outlineStyle: ({ addUtilities })=>{ - addUtilities({ - ".outline-none": { - outline: "2px solid transparent", - "outline-offset": "2px" - }, - ".outline": { - "outline-style": "solid" - }, - ".outline-dashed": { - "outline-style": "dashed" - }, - ".outline-dotted": { - "outline-style": "dotted" - }, - ".outline-double": { - "outline-style": "double" - } - }); - }, - outlineWidth: (0, _createUtilityPlugin.default)("outlineWidth", [ - [ - "outline", - [ - "outline-width" - ] - ] - ], { - type: [ - "length", - "number", - "percentage" - ] - }), - outlineOffset: (0, _createUtilityPlugin.default)("outlineOffset", [ - [ - "outline-offset", - [ - "outline-offset" - ] - ] - ], { - type: [ - "length", - "number", - "percentage", - "any" - ], - supportsNegativeValues: true - }), - outlineColor: ({ matchUtilities , theme })=>{ - matchUtilities({ - outline: (value)=>{ - return { - "outline-color": (0, _toColorValue.default)(value) - }; - } - }, { - values: (0, _flattenColorPalette.default)(theme("outlineColor")), - type: [ - "color", - "any" - ] - }); - }, - ringWidth: ({ matchUtilities , addDefaults , addUtilities , theme , config })=>{ - let ringColorDefault = (()=>{ - var _theme, _theme1; - if ((0, _featureFlags.flagEnabled)(config(), "respectDefaultRingColorOpacity")) { - return theme("ringColor.DEFAULT"); - } - let ringOpacityDefault = theme("ringOpacity.DEFAULT", "0.5"); - if (!((_theme = theme("ringColor")) === null || _theme === void 0 ? void 0 : _theme.DEFAULT)) { - return `rgb(147 197 253 / ${ringOpacityDefault})`; - } - return (0, _withAlphaVariable.withAlphaValue)((_theme1 = theme("ringColor")) === null || _theme1 === void 0 ? void 0 : _theme1.DEFAULT, ringOpacityDefault, `rgb(147 197 253 / ${ringOpacityDefault})`); - })(); - addDefaults("ring-width", { - "--tw-ring-inset": " ", - "--tw-ring-offset-width": theme("ringOffsetWidth.DEFAULT", "0px"), - "--tw-ring-offset-color": theme("ringOffsetColor.DEFAULT", "#fff"), - "--tw-ring-color": ringColorDefault, - "--tw-ring-offset-shadow": "0 0 #0000", - "--tw-ring-shadow": "0 0 #0000", - "--tw-shadow": "0 0 #0000", - "--tw-shadow-colored": "0 0 #0000" - }); - matchUtilities({ - ring: (value)=>{ - return { - "@defaults ring-width": {}, - "--tw-ring-offset-shadow": `var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)`, - "--tw-ring-shadow": `var(--tw-ring-inset) 0 0 0 calc(${value} + var(--tw-ring-offset-width)) var(--tw-ring-color)`, - "box-shadow": [ - `var(--tw-ring-offset-shadow)`, - `var(--tw-ring-shadow)`, - `var(--tw-shadow, 0 0 #0000)` - ].join(", ") - }; - } - }, { - values: theme("ringWidth"), - type: "length" - }); - addUtilities({ - ".ring-inset": { - "@defaults ring-width": {}, - "--tw-ring-inset": "inset" - } - }); - }, - ringColor: ({ matchUtilities , theme , corePlugins })=>{ - matchUtilities({ - ring: (value)=>{ - if (!corePlugins("ringOpacity")) { - return { - "--tw-ring-color": (0, _toColorValue.default)(value) - }; - } - return (0, _withAlphaVariable.default)({ - color: value, - property: "--tw-ring-color", - variable: "--tw-ring-opacity" - }); - } - }, { - values: Object.fromEntries(Object.entries((0, _flattenColorPalette.default)(theme("ringColor"))).filter(([modifier])=>modifier !== "DEFAULT")), - type: [ - "color", - "any" - ] - }); - }, - ringOpacity: (helpers)=>{ - let { config } = helpers; - return (0, _createUtilityPlugin.default)("ringOpacity", [ - [ - "ring-opacity", - [ - "--tw-ring-opacity" - ] - ] - ], { - filterDefault: !(0, _featureFlags.flagEnabled)(config(), "respectDefaultRingColorOpacity") - })(helpers); - }, - ringOffsetWidth: (0, _createUtilityPlugin.default)("ringOffsetWidth", [ - [ - "ring-offset", - [ - "--tw-ring-offset-width" - ] - ] - ], { - type: "length" - }), - ringOffsetColor: ({ matchUtilities , theme })=>{ - matchUtilities({ - "ring-offset": (value)=>{ - return { - "--tw-ring-offset-color": (0, _toColorValue.default)(value) - }; - } - }, { - values: (0, _flattenColorPalette.default)(theme("ringOffsetColor")), - type: [ - "color", - "any" - ] - }); - }, - blur: ({ matchUtilities , theme })=>{ - matchUtilities({ - blur: (value)=>{ - return { - "--tw-blur": value.trim() === "" ? " " : `blur(${value})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, { - values: theme("blur") - }); - }, - brightness: ({ matchUtilities , theme })=>{ - matchUtilities({ - brightness: (value)=>{ - return { - "--tw-brightness": `brightness(${value})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, { - values: theme("brightness") - }); - }, - contrast: ({ matchUtilities , theme })=>{ - matchUtilities({ - contrast: (value)=>{ - return { - "--tw-contrast": `contrast(${value})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, { - values: theme("contrast") - }); - }, - dropShadow: ({ matchUtilities , theme })=>{ - matchUtilities({ - "drop-shadow": (value)=>{ - return { - "--tw-drop-shadow": Array.isArray(value) ? value.map((v)=>`drop-shadow(${v})`).join(" ") : `drop-shadow(${value})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, { - values: theme("dropShadow") - }); - }, - grayscale: ({ matchUtilities , theme })=>{ - matchUtilities({ - grayscale: (value)=>{ - return { - "--tw-grayscale": `grayscale(${value})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, { - values: theme("grayscale") - }); - }, - hueRotate: ({ matchUtilities , theme })=>{ - matchUtilities({ - "hue-rotate": (value)=>{ - return { - "--tw-hue-rotate": `hue-rotate(${value})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, { - values: theme("hueRotate"), - supportsNegativeValues: true - }); - }, - invert: ({ matchUtilities , theme })=>{ - matchUtilities({ - invert: (value)=>{ - return { - "--tw-invert": `invert(${value})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, { - values: theme("invert") - }); - }, - saturate: ({ matchUtilities , theme })=>{ - matchUtilities({ - saturate: (value)=>{ - return { - "--tw-saturate": `saturate(${value})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, { - values: theme("saturate") - }); - }, - sepia: ({ matchUtilities , theme })=>{ - matchUtilities({ - sepia: (value)=>{ - return { - "--tw-sepia": `sepia(${value})`, - "@defaults filter": {}, - filter: cssFilterValue - }; - } - }, { - values: theme("sepia") - }); - }, - filter: ({ addDefaults , addUtilities })=>{ - addDefaults("filter", { - "--tw-blur": " ", - "--tw-brightness": " ", - "--tw-contrast": " ", - "--tw-grayscale": " ", - "--tw-hue-rotate": " ", - "--tw-invert": " ", - "--tw-saturate": " ", - "--tw-sepia": " ", - "--tw-drop-shadow": " " - }); - addUtilities({ - ".filter": { - "@defaults filter": {}, - filter: cssFilterValue - }, - ".filter-none": { - filter: "none" - } - }); - }, - backdropBlur: ({ matchUtilities , theme })=>{ - matchUtilities({ - "backdrop-blur": (value)=>{ - return { - "--tw-backdrop-blur": value.trim() === "" ? " " : `blur(${value})`, - "@defaults backdrop-filter": {}, - "-webkit-backdrop-filter": cssBackdropFilterValue, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, { - values: theme("backdropBlur") - }); - }, - backdropBrightness: ({ matchUtilities , theme })=>{ - matchUtilities({ - "backdrop-brightness": (value)=>{ - return { - "--tw-backdrop-brightness": `brightness(${value})`, - "@defaults backdrop-filter": {}, - "-webkit-backdrop-filter": cssBackdropFilterValue, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, { - values: theme("backdropBrightness") - }); - }, - backdropContrast: ({ matchUtilities , theme })=>{ - matchUtilities({ - "backdrop-contrast": (value)=>{ - return { - "--tw-backdrop-contrast": `contrast(${value})`, - "@defaults backdrop-filter": {}, - "-webkit-backdrop-filter": cssBackdropFilterValue, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, { - values: theme("backdropContrast") - }); - }, - backdropGrayscale: ({ matchUtilities , theme })=>{ - matchUtilities({ - "backdrop-grayscale": (value)=>{ - return { - "--tw-backdrop-grayscale": `grayscale(${value})`, - "@defaults backdrop-filter": {}, - "-webkit-backdrop-filter": cssBackdropFilterValue, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, { - values: theme("backdropGrayscale") - }); - }, - backdropHueRotate: ({ matchUtilities , theme })=>{ - matchUtilities({ - "backdrop-hue-rotate": (value)=>{ - return { - "--tw-backdrop-hue-rotate": `hue-rotate(${value})`, - "@defaults backdrop-filter": {}, - "-webkit-backdrop-filter": cssBackdropFilterValue, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, { - values: theme("backdropHueRotate"), - supportsNegativeValues: true - }); - }, - backdropInvert: ({ matchUtilities , theme })=>{ - matchUtilities({ - "backdrop-invert": (value)=>{ - return { - "--tw-backdrop-invert": `invert(${value})`, - "@defaults backdrop-filter": {}, - "-webkit-backdrop-filter": cssBackdropFilterValue, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, { - values: theme("backdropInvert") - }); - }, - backdropOpacity: ({ matchUtilities , theme })=>{ - matchUtilities({ - "backdrop-opacity": (value)=>{ - return { - "--tw-backdrop-opacity": `opacity(${value})`, - "@defaults backdrop-filter": {}, - "-webkit-backdrop-filter": cssBackdropFilterValue, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, { - values: theme("backdropOpacity") - }); - }, - backdropSaturate: ({ matchUtilities , theme })=>{ - matchUtilities({ - "backdrop-saturate": (value)=>{ - return { - "--tw-backdrop-saturate": `saturate(${value})`, - "@defaults backdrop-filter": {}, - "-webkit-backdrop-filter": cssBackdropFilterValue, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, { - values: theme("backdropSaturate") - }); - }, - backdropSepia: ({ matchUtilities , theme })=>{ - matchUtilities({ - "backdrop-sepia": (value)=>{ - return { - "--tw-backdrop-sepia": `sepia(${value})`, - "@defaults backdrop-filter": {}, - "-webkit-backdrop-filter": cssBackdropFilterValue, - "backdrop-filter": cssBackdropFilterValue - }; - } - }, { - values: theme("backdropSepia") - }); - }, - backdropFilter: ({ addDefaults , addUtilities })=>{ - addDefaults("backdrop-filter", { - "--tw-backdrop-blur": " ", - "--tw-backdrop-brightness": " ", - "--tw-backdrop-contrast": " ", - "--tw-backdrop-grayscale": " ", - "--tw-backdrop-hue-rotate": " ", - "--tw-backdrop-invert": " ", - "--tw-backdrop-opacity": " ", - "--tw-backdrop-saturate": " ", - "--tw-backdrop-sepia": " " - }); - addUtilities({ - ".backdrop-filter": { - "@defaults backdrop-filter": {}, - "-webkit-backdrop-filter": cssBackdropFilterValue, - "backdrop-filter": cssBackdropFilterValue - }, - ".backdrop-filter-none": { - "-webkit-backdrop-filter": "none", - "backdrop-filter": "none" - } - }); - }, - transitionProperty: ({ matchUtilities , theme })=>{ - let defaultTimingFunction = theme("transitionTimingFunction.DEFAULT"); - let defaultDuration = theme("transitionDuration.DEFAULT"); - matchUtilities({ - transition: (value)=>{ - return { - "transition-property": value, - ...value === "none" ? {} : { - "transition-timing-function": defaultTimingFunction, - "transition-duration": defaultDuration - } - }; - } - }, { - values: theme("transitionProperty") - }); - }, - transitionDelay: (0, _createUtilityPlugin.default)("transitionDelay", [ - [ - "delay", - [ - "transitionDelay" - ] - ] - ]), - transitionDuration: (0, _createUtilityPlugin.default)("transitionDuration", [ - [ - "duration", - [ - "transitionDuration" - ] - ] - ], { - filterDefault: true - }), - transitionTimingFunction: (0, _createUtilityPlugin.default)("transitionTimingFunction", [ - [ - "ease", - [ - "transitionTimingFunction" - ] - ] - ], { - filterDefault: true - }), - willChange: (0, _createUtilityPlugin.default)("willChange", [ - [ - "will-change", - [ - "will-change" - ] - ] - ]), - contain: ({ addDefaults , addUtilities })=>{ - let cssContainValue = "var(--tw-contain-size) var(--tw-contain-layout) var(--tw-contain-paint) var(--tw-contain-style)"; - addDefaults("contain", { - "--tw-contain-size": " ", - "--tw-contain-layout": " ", - "--tw-contain-paint": " ", - "--tw-contain-style": " " - }); - addUtilities({ - ".contain-none": { - contain: "none" - }, - ".contain-content": { - contain: "content" - }, - ".contain-strict": { - contain: "strict" - }, - ".contain-size": { - "@defaults contain": {}, - "--tw-contain-size": "size", - contain: cssContainValue - }, - ".contain-inline-size": { - "@defaults contain": {}, - "--tw-contain-size": "inline-size", - contain: cssContainValue - }, - ".contain-layout": { - "@defaults contain": {}, - "--tw-contain-layout": "layout", - contain: cssContainValue - }, - ".contain-paint": { - "@defaults contain": {}, - "--tw-contain-paint": "paint", - contain: cssContainValue - }, - ".contain-style": { - "@defaults contain": {}, - "--tw-contain-style": "style", - contain: cssContainValue - } - }); - }, - content: (0, _createUtilityPlugin.default)("content", [ - [ - "content", - [ - "--tw-content", - [ - "content", - "var(--tw-content)" - ] - ] - ] - ]), - forcedColorAdjust: ({ addUtilities })=>{ - addUtilities({ - ".forced-color-adjust-auto": { - "forced-color-adjust": "auto" - }, - ".forced-color-adjust-none": { - "forced-color-adjust": "none" - } - }); - } -}; diff --git a/node_modules/tailwindcss/lib/css/LICENSE b/node_modules/tailwindcss/lib/css/LICENSE deleted file mode 100644 index a1fb039..0000000 --- a/node_modules/tailwindcss/lib/css/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -MIT License - -Copyright (c) Nicolas Gallagher -Copyright (c) Jonathan Neal -Copyright (c) Sindre Sorhus (sindresorhus.com) -Copyright (c) Adam Wathan -Copyright (c) Jonathan Reinink - -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/tailwindcss/lib/css/preflight.css b/node_modules/tailwindcss/lib/css/preflight.css deleted file mode 100644 index 04b9d14..0000000 --- a/node_modules/tailwindcss/lib/css/preflight.css +++ /dev/null @@ -1,386 +0,0 @@ -/* -1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) -2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) -*/ - -*, -::before, -::after { - box-sizing: border-box; /* 1 */ - border-width: 0; /* 2 */ - border-style: solid; /* 2 */ - border-color: theme('borderColor.DEFAULT', currentColor); /* 2 */ -} - -::before, -::after { - --tw-content: ''; -} - -/* -1. Use a consistent sensible line-height in all browsers. -2. Prevent adjustments of font size after orientation changes in iOS. -3. Use a more readable tab size. -4. Use the user's configured `sans` font-family by default. -5. Use the user's configured `sans` font-feature-settings by default. -6. Use the user's configured `sans` font-variation-settings by default. -7. Disable tap highlights on iOS -*/ - -html, -:host { - line-height: 1.5; /* 1 */ - -webkit-text-size-adjust: 100%; /* 2 */ - -moz-tab-size: 4; /* 3 */ - tab-size: 4; /* 3 */ - font-family: theme('fontFamily.sans', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"); /* 4 */ - font-feature-settings: theme('fontFamily.sans[1].fontFeatureSettings', normal); /* 5 */ - font-variation-settings: theme('fontFamily.sans[1].fontVariationSettings', normal); /* 6 */ - -webkit-tap-highlight-color: transparent; /* 7 */ -} - -/* -1. Remove the margin in all browsers. -2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. -*/ - -body { - margin: 0; /* 1 */ - line-height: inherit; /* 2 */ -} - -/* -1. Add the correct height in Firefox. -2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) -3. Ensure horizontal rules are visible by default. -*/ - -hr { - height: 0; /* 1 */ - color: inherit; /* 2 */ - border-top-width: 1px; /* 3 */ -} - -/* -Add the correct text decoration in Chrome, Edge, and Safari. -*/ - -abbr:where([title]) { - text-decoration: underline dotted; -} - -/* -Remove the default font size and weight for headings. -*/ - -h1, -h2, -h3, -h4, -h5, -h6 { - font-size: inherit; - font-weight: inherit; -} - -/* -Reset links to optimize for opt-in styling instead of opt-out. -*/ - -a { - color: inherit; - text-decoration: inherit; -} - -/* -Add the correct font weight in Edge and Safari. -*/ - -b, -strong { - font-weight: bolder; -} - -/* -1. Use the user's configured `mono` font-family by default. -2. Use the user's configured `mono` font-feature-settings by default. -3. Use the user's configured `mono` font-variation-settings by default. -4. Correct the odd `em` font sizing in all browsers. -*/ - -code, -kbd, -samp, -pre { - font-family: theme('fontFamily.mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace); /* 1 */ - font-feature-settings: theme('fontFamily.mono[1].fontFeatureSettings', normal); /* 2 */ - font-variation-settings: theme('fontFamily.mono[1].fontVariationSettings', normal); /* 3 */ - font-size: 1em; /* 4 */ -} - -/* -Add the correct font size in all browsers. -*/ - -small { - font-size: 80%; -} - -/* -Prevent `sub` and `sup` elements from affecting the line height in all browsers. -*/ - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline; -} - -sub { - bottom: -0.25em; -} - -sup { - top: -0.5em; -} - -/* -1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) -2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) -3. Remove gaps between table borders by default. -*/ - -table { - text-indent: 0; /* 1 */ - border-color: inherit; /* 2 */ - border-collapse: collapse; /* 3 */ -} - -/* -1. Change the font styles in all browsers. -2. Remove the margin in Firefox and Safari. -3. Remove default padding in all browsers. -*/ - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; /* 1 */ - font-feature-settings: inherit; /* 1 */ - font-variation-settings: inherit; /* 1 */ - font-size: 100%; /* 1 */ - font-weight: inherit; /* 1 */ - line-height: inherit; /* 1 */ - letter-spacing: inherit; /* 1 */ - color: inherit; /* 1 */ - margin: 0; /* 2 */ - padding: 0; /* 3 */ -} - -/* -Remove the inheritance of text transform in Edge and Firefox. -*/ - -button, -select { - text-transform: none; -} - -/* -1. Correct the inability to style clickable types in iOS and Safari. -2. Remove default button styles. -*/ - -button, -input:where([type='button']), -input:where([type='reset']), -input:where([type='submit']) { - -webkit-appearance: button; /* 1 */ - background-color: transparent; /* 2 */ - background-image: none; /* 2 */ -} - -/* -Use the modern Firefox focus style for all focusable elements. -*/ - -:-moz-focusring { - outline: auto; -} - -/* -Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) -*/ - -:-moz-ui-invalid { - box-shadow: none; -} - -/* -Add the correct vertical alignment in Chrome and Firefox. -*/ - -progress { - vertical-align: baseline; -} - -/* -Correct the cursor style of increment and decrement buttons in Safari. -*/ - -::-webkit-inner-spin-button, -::-webkit-outer-spin-button { - height: auto; -} - -/* -1. Correct the odd appearance in Chrome and Safari. -2. Correct the outline style in Safari. -*/ - -[type='search'] { - -webkit-appearance: textfield; /* 1 */ - outline-offset: -2px; /* 2 */ -} - -/* -Remove the inner padding in Chrome and Safari on macOS. -*/ - -::-webkit-search-decoration { - -webkit-appearance: none; -} - -/* -1. Correct the inability to style clickable types in iOS and Safari. -2. Change font properties to `inherit` in Safari. -*/ - -::-webkit-file-upload-button { - -webkit-appearance: button; /* 1 */ - font: inherit; /* 2 */ -} - -/* -Add the correct display in Chrome and Safari. -*/ - -summary { - display: list-item; -} - -/* -Removes the default spacing and border for appropriate elements. -*/ - -blockquote, -dl, -dd, -h1, -h2, -h3, -h4, -h5, -h6, -hr, -figure, -p, -pre { - margin: 0; -} - -fieldset { - margin: 0; - padding: 0; -} - -legend { - padding: 0; -} - -ol, -ul, -menu { - list-style: none; - margin: 0; - padding: 0; -} - -/* -Reset default styling for dialogs. -*/ -dialog { - padding: 0; -} - -/* -Prevent resizing textareas horizontally by default. -*/ - -textarea { - resize: vertical; -} - -/* -1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) -2. Set the default placeholder color to the user's configured gray 400 color. -*/ - -input::placeholder, -textarea::placeholder { - opacity: 1; /* 1 */ - color: theme('colors.gray.400', #9ca3af); /* 2 */ -} - -/* -Set the default cursor for buttons. -*/ - -button, -[role="button"] { - cursor: pointer; -} - -/* -Make sure disabled buttons don't get the pointer cursor. -*/ -:disabled { - cursor: default; -} - -/* -1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) -2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) - This can trigger a poorly considered lint error in some tools but is included by design. -*/ - -img, -svg, -video, -canvas, -audio, -iframe, -embed, -object { - display: block; /* 1 */ - vertical-align: middle; /* 2 */ -} - -/* -Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) -*/ - -img, -video { - max-width: 100%; - height: auto; -} - -/* Make elements with the HTML hidden attribute stay hidden by default */ -[hidden]:where(:not([hidden="until-found"])) { - display: none; -} diff --git a/node_modules/tailwindcss/lib/featureFlags.js b/node_modules/tailwindcss/lib/featureFlags.js deleted file mode 100644 index 78826fd..0000000 --- a/node_modules/tailwindcss/lib/featureFlags.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] - }); -} -_export(exports, { - flagEnabled: function() { - return flagEnabled; - }, - issueFlagNotices: function() { - return issueFlagNotices; - }, - default: function() { - return _default; - } -}); -const _picocolors = /*#__PURE__*/ _interop_require_default(require("picocolors")); -const _log = /*#__PURE__*/ _interop_require_default(require("./util/log")); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -let defaults = { - optimizeUniversalDefaults: false, - generalizedModifiers: true, - disableColorOpacityUtilitiesByDefault: false, - relativeContentPathsByDefault: false -}; -let featureFlags = { - future: [ - "hoverOnlyWhenSupported", - "respectDefaultRingColorOpacity", - "disableColorOpacityUtilitiesByDefault", - "relativeContentPathsByDefault" - ], - experimental: [ - "optimizeUniversalDefaults", - "generalizedModifiers" - ] -}; -function flagEnabled(config, flag) { - if (featureFlags.future.includes(flag)) { - var _config_future; - var _config_future_flag, _ref; - return config.future === "all" || ((_ref = (_config_future_flag = config === null || config === void 0 ? void 0 : (_config_future = config.future) === null || _config_future === void 0 ? void 0 : _config_future[flag]) !== null && _config_future_flag !== void 0 ? _config_future_flag : defaults[flag]) !== null && _ref !== void 0 ? _ref : false); - } - if (featureFlags.experimental.includes(flag)) { - var _config_experimental; - var _config_experimental_flag, _ref1; - return config.experimental === "all" || ((_ref1 = (_config_experimental_flag = config === null || config === void 0 ? void 0 : (_config_experimental = config.experimental) === null || _config_experimental === void 0 ? void 0 : _config_experimental[flag]) !== null && _config_experimental_flag !== void 0 ? _config_experimental_flag : defaults[flag]) !== null && _ref1 !== void 0 ? _ref1 : false); - } - return false; -} -function experimentalFlagsEnabled(config) { - if (config.experimental === "all") { - return featureFlags.experimental; - } - var _config_experimental; - return Object.keys((_config_experimental = config === null || config === void 0 ? void 0 : config.experimental) !== null && _config_experimental !== void 0 ? _config_experimental : {}).filter((flag)=>featureFlags.experimental.includes(flag) && config.experimental[flag]); -} -function issueFlagNotices(config) { - if (process.env.JEST_WORKER_ID !== undefined) { - return; - } - if (experimentalFlagsEnabled(config).length > 0) { - let changes = experimentalFlagsEnabled(config).map((s)=>_picocolors.default.yellow(s)).join(", "); - _log.default.warn("experimental-flags-enabled", [ - `You have enabled experimental features: ${changes}`, - "Experimental features in Tailwind CSS are not covered by semver, may introduce breaking changes, and can change at any time." - ]); - } -} -const _default = featureFlags; diff --git a/node_modules/tailwindcss/lib/index.js b/node_modules/tailwindcss/lib/index.js deleted file mode 100644 index c947d97..0000000 --- a/node_modules/tailwindcss/lib/index.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -module.exports = require("./plugin"); diff --git a/node_modules/tailwindcss/lib/lib/cacheInvalidation.js b/node_modules/tailwindcss/lib/lib/cacheInvalidation.js deleted file mode 100644 index c247179..0000000 --- a/node_modules/tailwindcss/lib/lib/cacheInvalidation.js +++ /dev/null @@ -1,92 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "hasContentChanged", { - enumerable: true, - get: function() { - return hasContentChanged; - } -}); -const _crypto = /*#__PURE__*/ _interop_require_default(require("crypto")); -const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState")); -function _interop_require_default(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 _interop_require_wildcard(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; -} -/** - * Calculate the hash of a string. - * - * This doesn't need to be cryptographically secure or - * anything like that since it's used only to detect - * when the CSS changes to invalidate the context. - * - * This is wrapped in a try/catch because it's really dependent - * on how Node itself is build and the environment and OpenSSL - * version / build that is installed on the user's machine. - * - * Based on the environment this can just outright fail. - * - * See https://github.com/nodejs/node/issues/40455 - * - * @param {string} str - */ function getHash(str) { - try { - return _crypto.default.createHash("md5").update(str, "utf-8").digest("binary"); - } catch (err) { - return ""; - } -} -function hasContentChanged(sourcePath, root) { - let css = root.toString(); - // We only care about files with @tailwind directives - // Other files use an existing context - if (!css.includes("@tailwind")) { - return false; - } - let existingHash = _sharedState.sourceHashMap.get(sourcePath); - let rootHash = getHash(css); - let didChange = existingHash !== rootHash; - _sharedState.sourceHashMap.set(sourcePath, rootHash); - return didChange; -} diff --git a/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js b/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js deleted file mode 100644 index e900872..0000000 --- a/node_modules/tailwindcss/lib/lib/collapseAdjacentRules.js +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return collapseAdjacentRules; - } -}); -let comparisonMap = { - atrule: [ - "name", - "params" - ], - rule: [ - "selector" - ] -}; -let types = new Set(Object.keys(comparisonMap)); -function collapseAdjacentRules() { - function collapseRulesIn(root) { - let currentRule = null; - root.each((node)=>{ - if (!types.has(node.type)) { - currentRule = null; - return; - } - if (currentRule === null) { - currentRule = node; - return; - } - let properties = comparisonMap[node.type]; - var _node_property, _currentRule_property; - if (node.type === "atrule" && node.name === "font-face") { - currentRule = node; - } else if (properties.every((property)=>((_node_property = node[property]) !== null && _node_property !== void 0 ? _node_property : "").replace(/\s+/g, " ") === ((_currentRule_property = currentRule[property]) !== null && _currentRule_property !== void 0 ? _currentRule_property : "").replace(/\s+/g, " "))) { - // An AtRule may not have children (for example if we encounter duplicate @import url(…) rules) - if (node.nodes) { - currentRule.append(node.nodes); - } - node.remove(); - } else { - currentRule = node; - } - }); - // After we've collapsed adjacent rules & at-rules, we need to collapse - // adjacent rules & at-rules that are children of at-rules. - // We do not care about nesting rules because Tailwind CSS - // explicitly does not handle rule nesting on its own as - // the user is expected to use a nesting plugin - root.each((node)=>{ - if (node.type === "atrule") { - collapseRulesIn(node); - } - }); - } - return (root)=>{ - collapseRulesIn(root); - }; -} diff --git a/node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js b/node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js deleted file mode 100644 index 70a1ad1..0000000 --- a/node_modules/tailwindcss/lib/lib/collapseDuplicateDeclarations.js +++ /dev/null @@ -1,85 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return collapseDuplicateDeclarations; - } -}); -function collapseDuplicateDeclarations() { - return (root)=>{ - root.walkRules((node)=>{ - let seen = new Map(); - let droppable = new Set([]); - let byProperty = new Map(); - node.walkDecls((decl)=>{ - // This could happen if we have nested selectors. In that case the - // parent will loop over all its declarations but also the declarations - // of nested rules. With this we ensure that we are shallowly checking - // declarations. - if (decl.parent !== node) { - return; - } - if (seen.has(decl.prop)) { - // Exact same value as what we have seen so far - if (seen.get(decl.prop).value === decl.value) { - // Keep the last one, drop the one we've seen so far - droppable.add(seen.get(decl.prop)); - // Override the existing one with the new value. This is necessary - // so that if we happen to have more than one declaration with the - // same value, that we keep removing the previous one. Otherwise we - // will only remove the *first* one. - seen.set(decl.prop, decl); - return; - } - // Not the same value, so we need to check if we can merge it so - // let's collect it first. - if (!byProperty.has(decl.prop)) { - byProperty.set(decl.prop, new Set()); - } - byProperty.get(decl.prop).add(seen.get(decl.prop)); - byProperty.get(decl.prop).add(decl); - } - seen.set(decl.prop, decl); - }); - // Drop all the duplicate declarations with the exact same value we've - // already seen so far. - for (let decl of droppable){ - decl.remove(); - } - // Analyze the declarations based on its unit, drop all the declarations - // with the same unit but the last one in the list. - for (let declarations of byProperty.values()){ - let byUnit = new Map(); - for (let decl of declarations){ - let unit = resolveUnit(decl.value); - if (unit === null) { - continue; - } - if (!byUnit.has(unit)) { - byUnit.set(unit, new Set()); - } - byUnit.get(unit).add(decl); - } - for (let declarations of byUnit.values()){ - // Get all but the last one - let removableDeclarations = Array.from(declarations).slice(0, -1); - for (let decl of removableDeclarations){ - decl.remove(); - } - } - } - }); - }; -} -let UNITLESS_NUMBER = Symbol("unitless-number"); -function resolveUnit(input) { - let result = /^-?\d*.?\d+([\w%]+)?$/g.exec(input); - if (result) { - var _result_; - return (_result_ = result[1]) !== null && _result_ !== void 0 ? _result_ : UNITLESS_NUMBER; - } - return null; -} diff --git a/node_modules/tailwindcss/lib/lib/content.js b/node_modules/tailwindcss/lib/lib/content.js deleted file mode 100644 index a2d5941..0000000 --- a/node_modules/tailwindcss/lib/lib/content.js +++ /dev/null @@ -1,247 +0,0 @@ -// @ts-check -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] - }); -} -_export(exports, { - parseCandidateFiles: function() { - return parseCandidateFiles; - }, - resolvedChangedContent: function() { - return resolvedChangedContent; - }, - createBroadPatternCheck: function() { - return createBroadPatternCheck; - } -}); -const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); -const _path = /*#__PURE__*/ _interop_require_default(require("path")); -const _isglob = /*#__PURE__*/ _interop_require_default(require("is-glob")); -const _fastglob = /*#__PURE__*/ _interop_require_default(require("fast-glob")); -const _normalizepath = /*#__PURE__*/ _interop_require_default(require("normalize-path")); -const _parseGlob = require("../util/parseGlob"); -const _sharedState = require("./sharedState"); -const _log = /*#__PURE__*/ _interop_require_default(require("../util/log")); -const _micromatch = /*#__PURE__*/ _interop_require_default(require("micromatch")); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -function parseCandidateFiles(context, tailwindConfig) { - let files = tailwindConfig.content.files; - // Normalize the file globs - files = files.filter((filePath)=>typeof filePath === "string"); - files = files.map(_normalizepath.default); - // Split into included and excluded globs - let tasks = _fastglob.default.generateTasks(files); - /** @type {ContentPath[]} */ let included = []; - /** @type {ContentPath[]} */ let excluded = []; - for (const task of tasks){ - included.push(...task.positive.map((filePath)=>parseFilePath(filePath, false))); - excluded.push(...task.negative.map((filePath)=>parseFilePath(filePath, true))); - } - let paths = [ - ...included, - ...excluded - ]; - // Resolve paths relative to the config file or cwd - paths = resolveRelativePaths(context, paths); - // Resolve symlinks if possible - paths = paths.flatMap(resolvePathSymlinks); - // Update cached patterns - paths = paths.map(resolveGlobPattern); - return paths; -} -/** - * - * @param {string} filePath - * @param {boolean} ignore - * @returns {ContentPath} - */ function parseFilePath(filePath, ignore) { - let contentPath = { - original: filePath, - base: filePath, - ignore, - pattern: filePath, - glob: null - }; - if ((0, _isglob.default)(filePath)) { - Object.assign(contentPath, (0, _parseGlob.parseGlob)(filePath)); - } - return contentPath; -} -/** - * - * @param {ContentPath} contentPath - * @returns {ContentPath} - */ function resolveGlobPattern(contentPath) { - // This is required for Windows support to properly pick up Glob paths. - // Afaik, this technically shouldn't be needed but there's probably - // some internal, direct path matching with a normalized path in - // a package which can't handle mixed directory separators - let base = (0, _normalizepath.default)(contentPath.base); - // If the user's file path contains any special characters (like parens) for instance fast-glob - // is like "OOOH SHINY" and treats them as such. So we have to escape the base path to fix this - base = _fastglob.default.escapePath(base); - contentPath.pattern = contentPath.glob ? `${base}/${contentPath.glob}` : base; - contentPath.pattern = contentPath.ignore ? `!${contentPath.pattern}` : contentPath.pattern; - return contentPath; -} -/** - * Resolve each path relative to the config file (when possible) if the experimental flag is enabled - * Otherwise, resolve relative to the current working directory - * - * @param {any} context - * @param {ContentPath[]} contentPaths - * @returns {ContentPath[]} - */ function resolveRelativePaths(context, contentPaths) { - let resolveFrom = []; - // Resolve base paths relative to the config file (when possible) if the experimental flag is enabled - if (context.userConfigPath && context.tailwindConfig.content.relative) { - resolveFrom = [ - _path.default.dirname(context.userConfigPath) - ]; - } - return contentPaths.map((contentPath)=>{ - contentPath.base = _path.default.resolve(...resolveFrom, contentPath.base); - return contentPath; - }); -} -/** - * Resolve the symlink for the base directory / file in each path - * These are added as additional dependencies to watch for changes because - * some tools (like webpack) will only watch the actual file or directory - * but not the symlink itself even in projects that use monorepos. - * - * @param {ContentPath} contentPath - * @returns {ContentPath[]} - */ function resolvePathSymlinks(contentPath) { - let paths = [ - contentPath - ]; - try { - let resolvedPath = _fs.default.realpathSync(contentPath.base); - if (resolvedPath !== contentPath.base) { - paths.push({ - ...contentPath, - base: resolvedPath - }); - } - } catch { - // TODO: log this? - } - return paths; -} -function resolvedChangedContent(context, candidateFiles, fileModifiedMap) { - let changedContent = context.tailwindConfig.content.files.filter((item)=>typeof item.raw === "string").map(({ raw , extension ="html" })=>({ - content: raw, - extension - })); - let [changedFiles, mTimesToCommit] = resolveChangedFiles(candidateFiles, fileModifiedMap); - for (let changedFile of changedFiles){ - let extension = _path.default.extname(changedFile).slice(1); - changedContent.push({ - file: changedFile, - extension - }); - } - return [ - changedContent, - mTimesToCommit - ]; -} -const LARGE_DIRECTORIES = [ - "node_modules" -]; -// Ensures that `node_modules` has to match as-is, otherwise `mynode_modules` -// would match as well, but that is not a known large directory. -const LARGE_DIRECTORIES_REGEX = new RegExp(`(${LARGE_DIRECTORIES.map((dir)=>String.raw`\b${dir}\b`).join("|")})`); -function createBroadPatternCheck(paths) { - // Detect whether a glob pattern might be too broad. This means that it: - // - Includes `**` - // - Does not include any of the known large directories (e.g.: node_modules) - let maybeBroadPattern = paths.some((path)=>path.includes("**") && !LARGE_DIRECTORIES_REGEX.test(path)); - // Didn't detect any potentially broad patterns, so we can skip further - // checks. - if (!maybeBroadPattern) { - return ()=>{}; - } - // All glob matchers - let matchers = []; - // All glob matchers that explicitly contain any of the known large - // directories (e.g.: node_modules). - let explicitMatchers = []; - // Create matchers for all paths - for (let path of paths){ - let matcher = _micromatch.default.matcher(path); - if (LARGE_DIRECTORIES_REGEX.test(path)) { - explicitMatchers.push(matcher); - } - matchers.push(matcher); - } - // Keep track of whether we already warned about the broad pattern issue or - // not. The `log.warn` function already does something similar where we only - // output the log once. However, with this we can also skip the other checks - // when we already warned about the broad pattern. - let warned = false; - /** - * @param {string} file - */ return (file)=>{ - if (warned) return; // Already warned about the broad pattern - if (explicitMatchers.some((matcher)=>matcher(file))) return; // Explicitly included, so we can skip further checks - // When a broad pattern is used, we have to double check that the file was - // not explicitly included in the globs. - let matchingGlobIndex = matchers.findIndex((matcher)=>matcher(file)); - if (matchingGlobIndex === -1) return; // This should never happen - let matchingGlob = paths[matchingGlobIndex]; - // Create relative paths to make the output a bit more readable. - let relativeMatchingGlob = _path.default.relative(process.cwd(), matchingGlob); - if (relativeMatchingGlob[0] !== ".") relativeMatchingGlob = `./${relativeMatchingGlob}`; - let largeDirectory = LARGE_DIRECTORIES.find((directory)=>file.includes(directory)); - if (largeDirectory) { - warned = true; - _log.default.warn("broad-content-glob-pattern", [ - `Your \`content\` configuration includes a pattern which looks like it's accidentally matching all of \`${largeDirectory}\` and can cause serious performance issues.`, - `Pattern: \`${relativeMatchingGlob}\``, - `See our documentation for recommendations:`, - "https://tailwindcss.com/docs/content-configuration#pattern-recommendations" - ]); - } - }; -} -/** - * - * @param {ContentPath[]} candidateFiles - * @param {Map} fileModifiedMap - * @returns {[Set, Map]} - */ function resolveChangedFiles(candidateFiles, fileModifiedMap) { - let paths = candidateFiles.map((contentPath)=>contentPath.pattern); - let mTimesToCommit = new Map(); - let checkBroadPattern = createBroadPatternCheck(paths); - let changedFiles = new Set(); - _sharedState.env.DEBUG && console.time("Finding changed files"); - let files = _fastglob.default.sync(paths, { - absolute: true - }); - for (let file of files){ - checkBroadPattern(file); - let prevModified = fileModifiedMap.get(file) || -Infinity; - let modified = _fs.default.statSync(file).mtimeMs; - if (modified > prevModified) { - changedFiles.add(file); - mTimesToCommit.set(file, modified); - } - } - _sharedState.env.DEBUG && console.timeEnd("Finding changed files"); - return [ - changedFiles, - mTimesToCommit - ]; -} diff --git a/node_modules/tailwindcss/lib/lib/defaultExtractor.js b/node_modules/tailwindcss/lib/lib/defaultExtractor.js deleted file mode 100644 index 684808b..0000000 --- a/node_modules/tailwindcss/lib/lib/defaultExtractor.js +++ /dev/null @@ -1,273 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "defaultExtractor", { - enumerable: true, - get: function() { - return defaultExtractor; - } -}); -const _regex = /*#__PURE__*/ _interop_require_wildcard(require("./regex")); -const _splitAtTopLevelOnly = require("../util/splitAtTopLevelOnly"); -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 _interop_require_wildcard(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 defaultExtractor(context) { - let patterns = Array.from(buildRegExps(context)); - /** - * @param {string} content - */ return (content)=>{ - /** @type {(string|string)[]} */ let results = []; - for (let pattern of patterns){ - var _content_match; - for (let result of (_content_match = content.match(pattern)) !== null && _content_match !== void 0 ? _content_match : []){ - results.push(clipAtBalancedParens(result)); - } - } - // Extract any subclasses from languages like Slim and Pug, eg: - // div.flex.px-5.underline - for (let result of results.slice()){ - let segments = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(result, "."); - for(let idx = 0; idx < segments.length; idx++){ - let segment = segments[idx]; - if (idx >= segments.length - 1) { - results.push(segment); - continue; - } - // If the next segment is a number, discard both, for example seeing - // `px-1` and `5` means the real candidate was `px-1.5` which is already - // captured. - let next = Number(segments[idx + 1]); - if (isNaN(next)) { - results.push(segment); - } else { - idx++; - } - } - } - return results; - }; -} -function* buildRegExps(context) { - let separator = context.tailwindConfig.separator; - let prefix = context.tailwindConfig.prefix !== "" ? _regex.optional(_regex.pattern([ - /-?/, - _regex.escape(context.tailwindConfig.prefix) - ])) : ""; - let utility = _regex.any([ - // Arbitrary properties (without square brackets) - /\[[^\s:'"`]+:[^\s\[\]]+\]/, - // Arbitrary properties with balanced square brackets - // This is a targeted fix to continue to allow theme() - // with square brackets to work in arbitrary properties - // while fixing a problem with the regex matching too much - /\[[^\s:'"`\]]+:[^\s]+?\[[^\s]+\][^\s]+?\]/, - // Utilities - _regex.pattern([ - // Utility Name / Group Name - _regex.any([ - /-?(?:\w+)/, - // This is here to make sure @container supports everything that other utilities do - /@(?:\w+)/ - ]), - // Normal/Arbitrary values - _regex.optional(_regex.any([ - _regex.pattern([ - // Arbitrary values - _regex.any([ - /-(?:\w+-)*\['[^\s]+'\]/, - /-(?:\w+-)*\["[^\s]+"\]/, - /-(?:\w+-)*\[`[^\s]+`\]/, - /-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s:\[\]]+\]/ - ]), - // Not immediately followed by an `{[(` - /(?![{([]])/, - // optionally followed by an opacity modifier - /(?:\/[^\s'"`\\><$]*)?/ - ]), - _regex.pattern([ - // Arbitrary values - _regex.any([ - /-(?:\w+-)*\['[^\s]+'\]/, - /-(?:\w+-)*\["[^\s]+"\]/, - /-(?:\w+-)*\[`[^\s]+`\]/, - /-(?:\w+-)*\[(?:[^\s\[\]]+\[[^\s\[\]]+\])*[^\s\[\]]+\]/ - ]), - // Not immediately followed by an `{[(` - /(?![{([]])/, - // optionally followed by an opacity modifier - /(?:\/[^\s'"`\\$]*)?/ - ]), - // Normal values w/o quotes — may include an opacity modifier - /[-\/][^\s'"`\\$={><]*/ - ])) - ]) - ]); - let variantPatterns = [ - // Without quotes - _regex.any([ - // This is here to provide special support for the `@` variant - _regex.pattern([ - /@\[[^\s"'`]+\](\/[^\s"'`]+)?/, - separator - ]), - // With variant modifier (e.g.: group-[..]/modifier) - _regex.pattern([ - /([^\s"'`\[\\]+-)?\[[^\s"'`]+\]\/[\w_-]+/, - separator - ]), - _regex.pattern([ - /([^\s"'`\[\\]+-)?\[[^\s"'`]+\]/, - separator - ]), - _regex.pattern([ - /[^\s"'`\[\\]+/, - separator - ]) - ]), - // With quotes allowed - _regex.any([ - // With variant modifier (e.g.: group-[..]/modifier) - _regex.pattern([ - /([^\s"'`\[\\]+-)?\[[^\s`]+\]\/[\w_-]+/, - separator - ]), - _regex.pattern([ - /([^\s"'`\[\\]+-)?\[[^\s`]+\]/, - separator - ]), - _regex.pattern([ - /[^\s`\[\\]+/, - separator - ]) - ]) - ]; - for (const variantPattern of variantPatterns){ - yield _regex.pattern([ - // Variants - "((?=((", - variantPattern, - ")+))\\2)?", - // Important (optional) - /!?/, - prefix, - utility - ]); - } - // 5. Inner matches - yield /[^<>"'`\s.(){}[\]#=%$][^<>"'`\s(){}[\]#=%$]*[^<>"'`\s.(){}[\]#=%:$]/g; -} -// We want to capture any "special" characters -// AND the characters immediately following them (if there is one) -let SPECIALS = /([\[\]'"`])([^\[\]'"`])?/g; -let ALLOWED_CLASS_CHARACTERS = /[^"'`\s<>\]]+/; -/** - * Clips a string ensuring that parentheses, quotes, etc… are balanced - * Used for arbitrary values only - * - * We will go past the end of the balanced parens until we find a non-class character - * - * Depth matching behavior: - * w-[calc(100%-theme('spacing[some_key][1.5]'))]'] - * ┬ ┬ ┬┬ ┬ ┬┬ ┬┬┬┬┬┬┬ - * 1 2 3 4 34 3 210 END - * ╰────┴──────────┴────────┴────────┴┴───┴─┴┴┴ - * - * @param {string} input - */ function clipAtBalancedParens(input) { - // We are care about this for arbitrary values - if (!input.includes("-[")) { - return input; - } - let depth = 0; - let openStringTypes = []; - // Find all parens, brackets, quotes, etc - // Stop when we end at a balanced pair - // This is naive and will treat mismatched parens as balanced - // This shouldn't be a problem in practice though - let matches = input.matchAll(SPECIALS); - // We can't use lookbehind assertions because we have to support Safari - // So, instead, we've emulated it using capture groups and we'll re-work the matches to accommodate - matches = Array.from(matches).flatMap((match)=>{ - const [, ...groups] = match; - return groups.map((group, idx)=>Object.assign([], match, { - index: match.index + idx, - 0: group - })); - }); - for (let match of matches){ - let char = match[0]; - let inStringType = openStringTypes[openStringTypes.length - 1]; - if (char === inStringType) { - openStringTypes.pop(); - } else if (char === "'" || char === '"' || char === "`") { - openStringTypes.push(char); - } - if (inStringType) { - continue; - } else if (char === "[") { - depth++; - continue; - } else if (char === "]") { - depth--; - continue; - } - // We've gone one character past the point where we should stop - // This means that there was an extra closing `]` - // We'll clip to just before it - if (depth < 0) { - return input.substring(0, match.index - 1); - } - // We've finished balancing the brackets but there still may be characters that can be included - // For example in the class `text-[#336699]/[.35]` - // The depth goes to `0` at the closing `]` but goes up again at the `[` - // If we're at zero and encounter a non-class character then we clip the class there - if (depth === 0 && !ALLOWED_CLASS_CHARACTERS.test(char)) { - return input.substring(0, match.index); - } - } - return input; -} // Regular utilities - // {{modifier}:}*{namespace}{-{suffix}}*{/{opacityModifier}}? - // Arbitrary values - // {{modifier}:}*{namespace}-[{arbitraryValue}]{/{opacityModifier}}? - // arbitraryValue: no whitespace, balanced quotes unless within quotes, balanced brackets unless within quotes - // Arbitrary properties - // {{modifier}:}*[{validCssPropertyName}:{arbitraryValue}] diff --git a/node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js b/node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js deleted file mode 100644 index e2e3c26..0000000 --- a/node_modules/tailwindcss/lib/lib/evaluateTailwindFunctions.js +++ /dev/null @@ -1,238 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } -}); -const _dlv = /*#__PURE__*/ _interop_require_default(require("dlv")); -const _didyoumean = /*#__PURE__*/ _interop_require_default(require("didyoumean")); -const _transformThemeValue = /*#__PURE__*/ _interop_require_default(require("../util/transformThemeValue")); -const _index = /*#__PURE__*/ _interop_require_default(require("../value-parser/index")); -const _normalizeScreens = require("../util/normalizeScreens"); -const _buildMediaQuery = /*#__PURE__*/ _interop_require_default(require("../util/buildMediaQuery")); -const _toPath = require("../util/toPath"); -const _withAlphaVariable = require("../util/withAlphaVariable"); -const _pluginUtils = require("../util/pluginUtils"); -const _log = /*#__PURE__*/ _interop_require_default(require("../util/log")); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -function isObject(input) { - return typeof input === "object" && input !== null; -} -function findClosestExistingPath(theme, path) { - let parts = (0, _toPath.toPath)(path); - do { - parts.pop(); - if ((0, _dlv.default)(theme, parts) !== undefined) break; - }while (parts.length); - return parts.length ? parts : undefined; -} -function pathToString(path) { - if (typeof path === "string") return path; - return path.reduce((acc, cur, i)=>{ - if (cur.includes(".")) return `${acc}[${cur}]`; - return i === 0 ? cur : `${acc}.${cur}`; - }, ""); -} -function list(items) { - return items.map((key)=>`'${key}'`).join(", "); -} -function listKeys(obj) { - return list(Object.keys(obj)); -} -function validatePath(config, path, defaultValue, themeOpts = {}) { - const pathString = Array.isArray(path) ? pathToString(path) : path.replace(/^['"]+|['"]+$/g, ""); - const pathSegments = Array.isArray(path) ? path : (0, _toPath.toPath)(pathString); - const value = (0, _dlv.default)(config.theme, pathSegments, defaultValue); - if (value === undefined) { - let error = `'${pathString}' does not exist in your theme config.`; - const parentSegments = pathSegments.slice(0, -1); - const parentValue = (0, _dlv.default)(config.theme, parentSegments); - if (isObject(parentValue)) { - const validKeys = Object.keys(parentValue).filter((key)=>validatePath(config, [ - ...parentSegments, - key - ]).isValid); - const suggestion = (0, _didyoumean.default)(pathSegments[pathSegments.length - 1], validKeys); - if (suggestion) { - error += ` Did you mean '${pathToString([ - ...parentSegments, - suggestion - ])}'?`; - } else if (validKeys.length > 0) { - error += ` '${pathToString(parentSegments)}' has the following valid keys: ${list(validKeys)}`; - } - } else { - const closestPath = findClosestExistingPath(config.theme, pathString); - if (closestPath) { - const closestValue = (0, _dlv.default)(config.theme, closestPath); - if (isObject(closestValue)) { - error += ` '${pathToString(closestPath)}' has the following keys: ${listKeys(closestValue)}`; - } else { - error += ` '${pathToString(closestPath)}' is not an object.`; - } - } else { - error += ` Your theme has the following top-level keys: ${listKeys(config.theme)}`; - } - } - return { - isValid: false, - error - }; - } - if (!(typeof value === "string" || typeof value === "number" || typeof value === "function" || value instanceof String || value instanceof Number || Array.isArray(value))) { - let error = `'${pathString}' was found but does not resolve to a string.`; - if (isObject(value)) { - let validKeys = Object.keys(value).filter((key)=>validatePath(config, [ - ...pathSegments, - key - ]).isValid); - if (validKeys.length) { - error += ` Did you mean something like '${pathToString([ - ...pathSegments, - validKeys[0] - ])}'?`; - } - } - return { - isValid: false, - error - }; - } - const [themeSection] = pathSegments; - return { - isValid: true, - value: (0, _transformThemeValue.default)(themeSection)(value, themeOpts) - }; -} -function extractArgs(node, vNodes, functions) { - vNodes = vNodes.map((vNode)=>resolveVNode(node, vNode, functions)); - let args = [ - "" - ]; - for (let vNode of vNodes){ - if (vNode.type === "div" && vNode.value === ",") { - args.push(""); - } else { - args[args.length - 1] += _index.default.stringify(vNode); - } - } - return args; -} -function resolveVNode(node, vNode, functions) { - if (vNode.type === "function" && functions[vNode.value] !== undefined) { - let args = extractArgs(node, vNode.nodes, functions); - vNode.type = "word"; - vNode.value = functions[vNode.value](node, ...args); - } - return vNode; -} -function resolveFunctions(node, input, functions) { - let hasAnyFn = Object.keys(functions).some((fn)=>input.includes(`${fn}(`)); - if (!hasAnyFn) return input; - return (0, _index.default)(input).walk((vNode)=>{ - resolveVNode(node, vNode, functions); - }).toString(); -} -let nodeTypePropertyMap = { - atrule: "params", - decl: "value" -}; -/** - * @param {string} path - * @returns {Iterable<[path: string, alpha: string|undefined]>} - */ function* toPaths(path) { - // Strip quotes from beginning and end of string - // This allows the alpha value to be present inside of quotes - path = path.replace(/^['"]+|['"]+$/g, ""); - let matches = path.match(/^([^\s]+)(?![^\[]*\])(?:\s*\/\s*([^\/\s]+))$/); - let alpha = undefined; - yield [ - path, - undefined - ]; - if (matches) { - path = matches[1]; - alpha = matches[2]; - yield [ - path, - alpha - ]; - } -} -/** - * - * @param {any} config - * @param {string} path - * @param {any} defaultValue - */ function resolvePath(config, path, defaultValue) { - const results = Array.from(toPaths(path)).map(([path, alpha])=>{ - return Object.assign(validatePath(config, path, defaultValue, { - opacityValue: alpha - }), { - resolvedPath: path, - alpha - }); - }); - var _results_find; - return (_results_find = results.find((result)=>result.isValid)) !== null && _results_find !== void 0 ? _results_find : results[0]; -} -function _default(context) { - let config = context.tailwindConfig; - let functions = { - theme: (node, path, ...defaultValue)=>{ - let { isValid , value , error , alpha } = resolvePath(config, path, defaultValue.length ? defaultValue : undefined); - if (!isValid) { - var _parentNode_raws_tailwind; - let parentNode = node.parent; - let candidate = (_parentNode_raws_tailwind = parentNode === null || parentNode === void 0 ? void 0 : parentNode.raws.tailwind) === null || _parentNode_raws_tailwind === void 0 ? void 0 : _parentNode_raws_tailwind.candidate; - if (parentNode && candidate !== undefined) { - // Remove this utility from any caches - context.markInvalidUtilityNode(parentNode); - // Remove the CSS node from the markup - parentNode.remove(); - // Show a warning - _log.default.warn("invalid-theme-key-in-class", [ - `The utility \`${candidate}\` contains an invalid theme value and was not generated.` - ]); - return; - } - throw node.error(error); - } - let maybeColor = (0, _pluginUtils.parseColorFormat)(value); - let isColorFunction = maybeColor !== undefined && typeof maybeColor === "function"; - if (alpha !== undefined || isColorFunction) { - if (alpha === undefined) { - alpha = 1.0; - } - value = (0, _withAlphaVariable.withAlphaValue)(maybeColor, alpha, maybeColor); - } - return value; - }, - screen: (node, screen)=>{ - screen = screen.replace(/^['"]+/g, "").replace(/['"]+$/g, ""); - let screens = (0, _normalizeScreens.normalizeScreens)(config.theme.screens); - let screenDefinition = screens.find(({ name })=>name === screen); - if (!screenDefinition) { - throw node.error(`The '${screen}' screen does not exist in your theme.`); - } - return (0, _buildMediaQuery.default)(screenDefinition); - } - }; - return (root)=>{ - root.walk((node)=>{ - let property = nodeTypePropertyMap[node.type]; - if (property === undefined) { - return; - } - node[property] = resolveFunctions(node, node[property], functions); - }); - }; -} diff --git a/node_modules/tailwindcss/lib/lib/expandApplyAtRules.js b/node_modules/tailwindcss/lib/lib/expandApplyAtRules.js deleted file mode 100644 index c47ea1a..0000000 --- a/node_modules/tailwindcss/lib/lib/expandApplyAtRules.js +++ /dev/null @@ -1,553 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return expandApplyAtRules; - } -}); -const _postcss = /*#__PURE__*/ _interop_require_default(require("postcss")); -const _postcssselectorparser = /*#__PURE__*/ _interop_require_default(require("postcss-selector-parser")); -const _generateRules = require("./generateRules"); -const _escapeClassName = /*#__PURE__*/ _interop_require_default(require("../util/escapeClassName")); -const _applyImportantSelector = require("../util/applyImportantSelector"); -const _pseudoElements = require("../util/pseudoElements"); -function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -} -/** @typedef {Map} ApplyCache */ function extractClasses(node) { - /** @type {Map>} */ let groups = new Map(); - let container = _postcss.default.root({ - nodes: [ - node.clone() - ] - }); - container.walkRules((rule)=>{ - (0, _postcssselectorparser.default)((selectors)=>{ - selectors.walkClasses((classSelector)=>{ - let parentSelector = classSelector.parent.toString(); - let classes = groups.get(parentSelector); - if (!classes) { - groups.set(parentSelector, classes = new Set()); - } - classes.add(classSelector.value); - }); - }).processSync(rule.selector); - }); - let normalizedGroups = Array.from(groups.values(), (classes)=>Array.from(classes)); - let classes = normalizedGroups.flat(); - return Object.assign(classes, { - groups: normalizedGroups - }); -} -let selectorExtractor = (0, _postcssselectorparser.default)(); -/** - * @param {string} ruleSelectors - */ function extractSelectors(ruleSelectors) { - return selectorExtractor.astSync(ruleSelectors); -} -function extractBaseCandidates(candidates, separator) { - let baseClasses = new Set(); - for (let candidate of candidates){ - baseClasses.add(candidate.split(separator).pop()); - } - return Array.from(baseClasses); -} -function prefix(context, selector) { - let prefix = context.tailwindConfig.prefix; - return typeof prefix === "function" ? prefix(selector) : prefix + selector; -} -function* pathToRoot(node) { - yield node; - while(node.parent){ - yield node.parent; - node = node.parent; - } -} -/** - * Only clone the node itself and not its children - * - * @param {*} node - * @param {*} overrides - * @returns - */ function shallowClone(node, overrides = {}) { - let children = node.nodes; - node.nodes = []; - let tmp = node.clone(overrides); - node.nodes = children; - return tmp; -} -/** - * Clone just the nodes all the way to the top that are required to represent - * this singular rule in the tree. - * - * For example, if we have CSS like this: - * ```css - * @media (min-width: 768px) { - * @supports (display: grid) { - * .foo { - * display: grid; - * grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); - * } - * } - * - * @supports (backdrop-filter: blur(1px)) { - * .bar { - * backdrop-filter: blur(1px); - * } - * } - * - * .baz { - * color: orange; - * } - * } - * ``` - * - * And we're cloning `.bar` it'll return a cloned version of what's required for just that single node: - * - * ```css - * @media (min-width: 768px) { - * @supports (backdrop-filter: blur(1px)) { - * .bar { - * backdrop-filter: blur(1px); - * } - * } - * } - * ``` - * - * @param {import('postcss').Node} node - */ function nestedClone(node) { - for (let parent of pathToRoot(node)){ - if (node === parent) { - continue; - } - if (parent.type === "root") { - break; - } - node = shallowClone(parent, { - nodes: [ - node - ] - }); - } - return node; -} -/** - * @param {import('postcss').Root} root - */ function buildLocalApplyCache(root, context) { - /** @type {ApplyCache} */ let cache = new Map(); - root.walkRules((rule)=>{ - // Ignore rules generated by Tailwind - for (let node of pathToRoot(rule)){ - var _node_raws_tailwind; - if (((_node_raws_tailwind = node.raws.tailwind) === null || _node_raws_tailwind === void 0 ? void 0 : _node_raws_tailwind.layer) !== undefined) { - return; - } - } - // Clone what's required to represent this singular rule in the tree - let container = nestedClone(rule); - let sort = context.offsets.create("user"); - for (let className of extractClasses(rule)){ - let list = cache.get(className) || []; - cache.set(className, list); - list.push([ - { - layer: "user", - sort, - important: false - }, - container - ]); - } - }); - return cache; -} -/** - * @returns {ApplyCache} - */ function buildApplyCache(applyCandidates, context) { - for (let candidate of applyCandidates){ - if (context.notClassCache.has(candidate) || context.applyClassCache.has(candidate)) { - continue; - } - if (context.classCache.has(candidate)) { - context.applyClassCache.set(candidate, context.classCache.get(candidate).map(([meta, rule])=>[ - meta, - rule.clone() - ])); - continue; - } - let matches = Array.from((0, _generateRules.resolveMatches)(candidate, context)); - if (matches.length === 0) { - context.notClassCache.add(candidate); - continue; - } - context.applyClassCache.set(candidate, matches); - } - return context.applyClassCache; -} -/** - * Build a cache only when it's first used - * - * @param {() => ApplyCache} buildCacheFn - * @returns {ApplyCache} - */ function lazyCache(buildCacheFn) { - let cache = null; - return { - get: (name)=>{ - cache = cache || buildCacheFn(); - return cache.get(name); - }, - has: (name)=>{ - cache = cache || buildCacheFn(); - return cache.has(name); - } - }; -} -/** - * Take a series of multiple caches and merge - * them so they act like one large cache - * - * @param {ApplyCache[]} caches - * @returns {ApplyCache} - */ function combineCaches(caches) { - return { - get: (name)=>caches.flatMap((cache)=>cache.get(name) || []), - has: (name)=>caches.some((cache)=>cache.has(name)) - }; -} -function extractApplyCandidates(params) { - let candidates = params.split(/[\s\t\n]+/g); - if (candidates[candidates.length - 1] === "!important") { - return [ - candidates.slice(0, -1), - true - ]; - } - return [ - candidates, - false - ]; -} -function processApply(root, context, localCache) { - let applyCandidates = new Set(); - // Collect all @apply rules and candidates - let applies = []; - root.walkAtRules("apply", (rule)=>{ - let [candidates] = extractApplyCandidates(rule.params); - for (let util of candidates){ - applyCandidates.add(util); - } - applies.push(rule); - }); - // Start the @apply process if we have rules with @apply in them - if (applies.length === 0) { - return; - } - // Fill up some caches! - let applyClassCache = combineCaches([ - localCache, - buildApplyCache(applyCandidates, context) - ]); - /** - * When we have an apply like this: - * - * .abc { - * @apply hover:font-bold; - * } - * - * What we essentially will do is resolve to this: - * - * .abc { - * @apply .hover\:font-bold:hover { - * font-weight: 500; - * } - * } - * - * Notice that the to-be-applied class is `.hover\:font-bold:hover` and that the utility candidate was `hover:font-bold`. - * What happens in this function is that we prepend a `.` and escape the candidate. - * This will result in `.hover\:font-bold` - * Which means that we can replace `.hover\:font-bold` with `.abc` in `.hover\:font-bold:hover` resulting in `.abc:hover` - * - * @param {string} selector - * @param {string} utilitySelectors - * @param {string} candidate - */ function replaceSelector(selector, utilitySelectors, candidate) { - let selectorList = extractSelectors(selector); - let utilitySelectorsList = extractSelectors(utilitySelectors); - let candidateList = extractSelectors(`.${(0, _escapeClassName.default)(candidate)}`); - let candidateClass = candidateList.nodes[0].nodes[0]; - selectorList.each((sel)=>{ - /** @type {Set} */ let replaced = new Set(); - utilitySelectorsList.each((utilitySelector)=>{ - let hasReplaced = false; - utilitySelector = utilitySelector.clone(); - utilitySelector.walkClasses((node)=>{ - if (node.value !== candidateClass.value) { - return; - } - // Don't replace multiple instances of the same class - // This is theoretically correct but only partially - // We'd need to generate every possible permutation of the replacement - // For example with `.foo + .foo { … }` and `section { @apply foo; }` - // We'd need to generate all of these: - // - `.foo + .foo` - // - `.foo + section` - // - `section + .foo` - // - `section + section` - if (hasReplaced) { - return; - } - // Since you can only `@apply` class names this is sufficient - // We want to replace the matched class name with the selector the user is using - // Ex: Replace `.text-blue-500` with `.foo.bar:is(.something-cool)` - node.replaceWith(...sel.nodes.map((node)=>node.clone())); - // Record that we did something and we want to use this new selector - replaced.add(utilitySelector); - hasReplaced = true; - }); - }); - // Sort tag names before class names (but only sort each group (separated by a combinator) - // separately and not in total) - // This happens when replacing `.bar` in `.foo.bar` with a tag like `section` - for (let sel of replaced){ - let groups = [ - [] - ]; - for (let node of sel.nodes){ - if (node.type === "combinator") { - groups.push(node); - groups.push([]); - } else { - let last = groups[groups.length - 1]; - last.push(node); - } - } - sel.nodes = []; - for (let group of groups){ - if (Array.isArray(group)) { - group.sort((a, b)=>{ - if (a.type === "tag" && b.type === "class") { - return -1; - } else if (a.type === "class" && b.type === "tag") { - return 1; - } else if (a.type === "class" && b.type === "pseudo" && b.value.startsWith("::")) { - return -1; - } else if (a.type === "pseudo" && a.value.startsWith("::") && b.type === "class") { - return 1; - } - return 0; - }); - } - sel.nodes = sel.nodes.concat(group); - } - } - sel.replaceWith(...replaced); - }); - return selectorList.toString(); - } - let perParentApplies = new Map(); - // Collect all apply candidates and their rules - for (let apply of applies){ - let [candidates] = perParentApplies.get(apply.parent) || [ - [], - apply.source - ]; - perParentApplies.set(apply.parent, [ - candidates, - apply.source - ]); - let [applyCandidates, important] = extractApplyCandidates(apply.params); - if (apply.parent.type === "atrule") { - if (apply.parent.name === "screen") { - let screenType = apply.parent.params; - throw apply.error(`@apply is not supported within nested at-rules like @screen. We suggest you write this as @apply ${applyCandidates.map((c)=>`${screenType}:${c}`).join(" ")} instead.`); - } - throw apply.error(`@apply is not supported within nested at-rules like @${apply.parent.name}. You can fix this by un-nesting @${apply.parent.name}.`); - } - for (let applyCandidate of applyCandidates){ - if ([ - prefix(context, "group"), - prefix(context, "peer") - ].includes(applyCandidate)) { - // TODO: Link to specific documentation page with error code. - throw apply.error(`@apply should not be used with the '${applyCandidate}' utility`); - } - if (!applyClassCache.has(applyCandidate)) { - throw apply.error(`The \`${applyCandidate}\` class does not exist. If \`${applyCandidate}\` is a custom class, make sure it is defined within a \`@layer\` directive.`); - } - let rules = applyClassCache.get(applyCandidate); - // Verify that we can apply the class - for (let [, rule] of rules){ - if (rule.type === "atrule") { - continue; - } - rule.walkRules(()=>{ - throw apply.error([ - `The \`${applyCandidate}\` class cannot be used with \`@apply\` because \`@apply\` does not currently support nested CSS.`, - "Rewrite the selector without nesting or configure the `tailwindcss/nesting` plugin:", - "https://tailwindcss.com/docs/using-with-preprocessors#nesting" - ].join("\n")); - }); - } - candidates.push([ - applyCandidate, - important, - rules - ]); - } - } - for (let [parent, [candidates, atApplySource]] of perParentApplies){ - let siblings = []; - for (let [applyCandidate, important, rules] of candidates){ - let potentialApplyCandidates = [ - applyCandidate, - ...extractBaseCandidates([ - applyCandidate - ], context.tailwindConfig.separator) - ]; - for (let [meta, node] of rules){ - let parentClasses = extractClasses(parent); - let nodeClasses = extractClasses(node); - // When we encounter a rule like `.dark .a, .b { … }` we only want to be left with `[.dark, .a]` if the base applyCandidate is `.a` or with `[.b]` if the base applyCandidate is `.b` - // So we've split them into groups - nodeClasses = nodeClasses.groups.filter((classList)=>classList.some((className)=>potentialApplyCandidates.includes(className))).flat(); - // Add base utility classes from the @apply node to the list of - // classes to check whether it intersects and therefore results in a - // circular dependency or not. - // - // E.g.: - // .foo { - // @apply hover:a; // This applies "a" but with a modifier - // } - // - // We only have to do that with base classes of the `node`, not of the `parent` - // E.g.: - // .hover\:foo { - // @apply bar; - // } - // .bar { - // @apply foo; - // } - // - // This should not result in a circular dependency because we are - // just applying `.foo` and the rule above is `.hover\:foo` which is - // unrelated. However, if we were to apply `hover:foo` then we _did_ - // have to include this one. - nodeClasses = nodeClasses.concat(extractBaseCandidates(nodeClasses, context.tailwindConfig.separator)); - let intersects = parentClasses.some((selector)=>nodeClasses.includes(selector)); - if (intersects) { - throw node.error(`You cannot \`@apply\` the \`${applyCandidate}\` utility here because it creates a circular dependency.`); - } - let root = _postcss.default.root({ - nodes: [ - node.clone() - ] - }); - // Make sure every node in the entire tree points back at the @apply rule that generated it - root.walk((node)=>{ - node.source = atApplySource; - }); - let canRewriteSelector = node.type !== "atrule" || node.type === "atrule" && node.name !== "keyframes"; - if (canRewriteSelector) { - root.walkRules((rule)=>{ - // Let's imagine you have the following structure: - // - // .foo { - // @apply bar; - // } - // - // @supports (a: b) { - // .bar { - // color: blue - // } - // - // .something-unrelated {} - // } - // - // In this case we want to apply `.bar` but it happens to be in - // an atrule node. We clone that node instead of the nested one - // because we still want that @supports rule to be there once we - // applied everything. - // - // However it happens to be that the `.something-unrelated` is - // also in that same shared @supports atrule. This is not good, - // and this should not be there. The good part is that this is - // a clone already and it can be safely removed. The question is - // how do we know we can remove it. Basically what we can do is - // match it against the applyCandidate that you want to apply. If - // it doesn't match the we can safely delete it. - // - // If we didn't do this, then the `replaceSelector` function - // would have replaced this with something that didn't exist and - // therefore it removed the selector altogether. In this specific - // case it would result in `{}` instead of `.something-unrelated {}` - if (!extractClasses(rule).some((candidate)=>candidate === applyCandidate)) { - rule.remove(); - return; - } - // Strip the important selector from the parent selector if at the beginning - let importantSelector = typeof context.tailwindConfig.important === "string" ? context.tailwindConfig.important : null; - // We only want to move the "important" selector if this is a Tailwind-generated utility - // We do *not* want to do this for user CSS that happens to be structured the same - let isGenerated = parent.raws.tailwind !== undefined; - let parentSelector = isGenerated && importantSelector && parent.selector.indexOf(importantSelector) === 0 ? parent.selector.slice(importantSelector.length) : parent.selector; - // If the selector becomes empty after replacing the important selector - // This means that it's the same as the parent selector and we don't want to replace it - // Otherwise we'll crash - if (parentSelector === "") { - parentSelector = parent.selector; - } - rule.selector = replaceSelector(parentSelector, rule.selector, applyCandidate); - // And then re-add it if it was removed - if (importantSelector && parentSelector !== parent.selector) { - rule.selector = (0, _applyImportantSelector.applyImportantSelector)(rule.selector, importantSelector); - } - rule.walkDecls((d)=>{ - d.important = meta.important || important; - }); - // Move pseudo elements to the end of the selector (if necessary) - let selector = (0, _postcssselectorparser.default)().astSync(rule.selector); - selector.each((sel)=>(0, _pseudoElements.movePseudos)(sel)); - rule.selector = selector.toString(); - }); - } - // It could be that the node we were inserted was removed because the class didn't match - // If that was the *only* rule in the parent, then we have nothing add so we skip it - if (!root.nodes[0]) { - continue; - } - // Insert it - siblings.push([ - meta.sort, - root.nodes[0] - ]); - } - } - // Inject the rules, sorted, correctly - let nodes = context.offsets.sort(siblings).map((s)=>s[1]); - // `parent` refers to the node at `.abc` in: .abc { @apply mt-2 } - parent.after(nodes); - } - for (let apply of applies){ - // If there are left-over declarations, just remove the @apply - if (apply.parent.nodes.length > 1) { - apply.remove(); - } else { - // The node is empty, drop the full node - apply.parent.remove(); - } - } - // Do it again, in case we have other `@apply` rules - processApply(root, context, localCache); -} -function expandApplyAtRules(context) { - return (root)=>{ - // Build a cache of the user's CSS so we can use it to resolve classes used by @apply - let localCache = lazyCache(()=>buildLocalApplyCache(root, context)); - processApply(root, context, localCache); - }; -} diff --git a/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js b/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js deleted file mode 100644 index 0836d3f..0000000 --- a/node_modules/tailwindcss/lib/lib/expandTailwindAtRules.js +++ /dev/null @@ -1,279 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { - value: true -}); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return expandTailwindAtRules; - } -}); -const _fs = /*#__PURE__*/ _interop_require_default(require("fs")); -const _quicklru = /*#__PURE__*/ _interop_require_default(require("@alloc/quick-lru")); -const _sharedState = /*#__PURE__*/ _interop_require_wildcard(require("./sharedState")); -const _generateRules = require("./generateRules"); -const _log = /*#__PURE__*/ _interop_require_default(require("../util/log")); -const _cloneNodes = /*#__PURE__*/ _interop_require_default(require("../util/cloneNodes")); -const _defaultExtractor = require("./defaultExtractor"); -function _interop_require_default(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 _interop_require_wildcard(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; -} -let env = _sharedState.env; -const builtInExtractors = { - DEFAULT: _defaultExtractor.defaultExtractor -}; -const builtInTransformers = { - DEFAULT: (content)=>content, - svelte: (content)=>content.replace(/(?:^|\s)class:/g, " ") -}; -function getExtractor(context, fileExtension) { - let extractors = context.tailwindConfig.content.extract; - return extractors[fileExtension] || extractors.DEFAULT || builtInExtractors[fileExtension] || builtInExtractors.DEFAULT(context); -} -function getTransformer(tailwindConfig, fileExtension) { - let transformers = tailwindConfig.content.transform; - return transformers[fileExtension] || transformers.DEFAULT || builtInTransformers[fileExtension] || builtInTransformers.DEFAULT; -} -let extractorCache = new WeakMap(); -// Scans template contents for possible classes. This is a hot path on initial build but -// not too important for subsequent builds. The faster the better though — if we can speed -// up these regexes by 50% that could cut initial build time by like 20%. -function getClassCandidates(content, extractor, candidates, seen) { - if (!extractorCache.has(extractor)) { - extractorCache.set(extractor, new _quicklru.default({ - maxSize: 25000 - })); - } - for (let line of content.split("\n")){ - line = line.trim(); - if (seen.has(line)) { - continue; - } - seen.add(line); - if (extractorCache.get(extractor).has(line)) { - for (let match of extractorCache.get(extractor).get(line)){ - candidates.add(match); - } - } else { - let extractorMatches = extractor(line).filter((s)=>s !== "!*"); - let lineMatchesSet = new Set(extractorMatches); - for (let match of lineMatchesSet){ - candidates.add(match); - } - extractorCache.get(extractor).set(line, lineMatchesSet); - } - } -} -/** - * - * @param {[import('./offsets.js').RuleOffset, import('postcss').Node][]} rules - * @param {*} context - */ function buildStylesheet(rules, context) { - let sortedRules = context.offsets.sort(rules); - let returnValue = { - base: new Set(), - defaults: new Set(), - components: new Set(), - utilities: new Set(), - variants: new Set() - }; - for (let [sort, rule] of sortedRules){ - returnValue[sort.layer].add(rule); - } - return returnValue; -} -function expandTailwindAtRules(context) { - return async (root)=>{ - let layerNodes = { - base: null, - components: null, - utilities: null, - variants: null - }; - root.walkAtRules((rule)=>{ - // Make sure this file contains Tailwind directives. If not, we can save - // a lot of work and bail early. Also we don't have to register our touch - // file as a dependency since the output of this CSS does not depend on - // the source of any templates. Think Vue