From d1d376b7a26bd00c3ecae237bf17f3d41980819f Mon Sep 17 00:00:00 2001 From: Greg Dennis Date: Wed, 18 Oct 2023 10:25:49 +1300 Subject: [PATCH 1/4] restructure and add replicating tests --- evaluate-dependencies.js | 162 + evaluate-dependencies.test.js | 79 + index.js | 154 +- node_modules/.bin/browserslist | 12 + node_modules/.bin/browserslist.cmd | 17 + node_modules/.bin/browserslist.ps1 | 28 + node_modules/.bin/create-jest | 12 + node_modules/.bin/create-jest.cmd | 17 + node_modules/.bin/create-jest.ps1 | 28 + node_modules/.bin/esparse | 12 + node_modules/.bin/esparse.cmd | 17 + node_modules/.bin/esparse.ps1 | 28 + node_modules/.bin/esvalidate | 12 + node_modules/.bin/esvalidate.cmd | 17 + node_modules/.bin/esvalidate.ps1 | 28 + node_modules/.bin/import-local-fixture | 12 + node_modules/.bin/import-local-fixture.cmd | 17 + node_modules/.bin/import-local-fixture.ps1 | 28 + node_modules/.bin/jest | 12 + node_modules/.bin/jest.cmd | 17 + node_modules/.bin/jest.ps1 | 28 + node_modules/.bin/js-yaml | 12 + node_modules/.bin/js-yaml.cmd | 17 + node_modules/.bin/js-yaml.ps1 | 28 + node_modules/.bin/jsesc | 12 + node_modules/.bin/jsesc.cmd | 17 + node_modules/.bin/jsesc.ps1 | 28 + node_modules/.bin/json5 | 12 + node_modules/.bin/json5.cmd | 17 + node_modules/.bin/json5.ps1 | 28 + node_modules/.bin/node-which | 12 + node_modules/.bin/node-which.cmd | 17 + node_modules/.bin/node-which.ps1 | 28 + node_modules/.bin/parser | 12 + node_modules/.bin/parser.cmd | 17 + node_modules/.bin/parser.ps1 | 28 + node_modules/.bin/resolve | 12 + node_modules/.bin/resolve.cmd | 17 + node_modules/.bin/resolve.ps1 | 28 + node_modules/.bin/semver | 12 + node_modules/.bin/semver.cmd | 17 + node_modules/.bin/semver.ps1 | 28 + node_modules/.bin/update-browserslist-db | 12 + node_modules/.bin/update-browserslist-db.cmd | 17 + node_modules/.bin/update-browserslist-db.ps1 | 28 + node_modules/.bin/uuid | 13 +- node_modules/.bin/uuid.cmd | 17 + node_modules/.bin/uuid.ps1 | 28 + node_modules/.package-lock.json | 3740 +++- node_modules/@ampproject/remapping/LICENSE | 202 + node_modules/@ampproject/remapping/README.md | 218 + .../@ampproject/remapping/dist/remapping.mjs | 191 + .../remapping/dist/remapping.mjs.map | 1 + .../remapping/dist/remapping.umd.js | 196 + .../remapping/dist/remapping.umd.js.map | 1 + .../dist/types/build-source-map-tree.d.ts | 14 + .../remapping/dist/types/remapping.d.ts | 19 + .../remapping/dist/types/source-map-tree.d.ts | 42 + .../remapping/dist/types/source-map.d.ts | 17 + .../remapping/dist/types/types.d.ts | 14 + .../@ampproject/remapping/package.json | 75 + node_modules/@babel/code-frame/LICENSE | 22 + node_modules/@babel/code-frame/README.md | 19 + node_modules/@babel/code-frame/lib/index.js | 157 + .../@babel/code-frame/lib/index.js.map | 1 + .../node_modules/ansi-styles/index.js | 165 + .../node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 56 + .../node_modules/ansi-styles/readme.md | 147 + .../code-frame/node_modules/chalk/index.js | 228 + .../node_modules/chalk/index.js.flow | 93 + .../code-frame/node_modules/chalk/license | 9 + .../node_modules/chalk/package.json | 71 + .../code-frame/node_modules/chalk/readme.md | 314 + .../node_modules/chalk/templates.js | 128 + .../node_modules/chalk/types/index.d.ts | 97 + .../node_modules/color-convert/CHANGELOG.md | 54 + .../node_modules/color-convert/LICENSE | 21 + .../node_modules/color-convert/README.md | 68 + .../node_modules/color-convert/conversions.js | 868 + .../node_modules/color-convert/index.js | 78 + .../node_modules/color-convert/package.json | 46 + .../node_modules/color-convert/route.js | 97 + .../node_modules/color-name/.eslintrc.json | 43 + .../node_modules/color-name/.npmignore | 107 + .../node_modules/color-name/LICENSE | 8 + .../node_modules/color-name/README.md | 11 + .../node_modules/color-name/index.js | 152 + .../node_modules/color-name/package.json | 25 + .../node_modules/color-name/test.js | 7 + .../escape-string-regexp/index.js | 11 + .../node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 41 + .../escape-string-regexp/readme.md | 27 + .../code-frame/node_modules/has-flag/index.js | 8 + .../code-frame/node_modules/has-flag/license | 9 + .../node_modules/has-flag/package.json | 44 + .../node_modules/has-flag/readme.md | 70 + .../node_modules/supports-color/browser.js | 5 + .../node_modules/supports-color/index.js | 131 + .../node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 53 + .../node_modules/supports-color/readme.md | 66 + node_modules/@babel/code-frame/package.json | 30 + node_modules/@babel/compat-data/LICENSE | 22 + node_modules/@babel/compat-data/README.md | 19 + .../@babel/compat-data/corejs2-built-ins.js | 2 + .../compat-data/corejs3-shipped-proposals.js | 2 + .../compat-data/data/corejs2-built-ins.json | 2081 +++ .../data/corejs3-shipped-proposals.json | 5 + .../compat-data/data/native-modules.json | 18 + .../compat-data/data/overlapping-plugins.json | 25 + .../compat-data/data/plugin-bugfixes.json | 201 + .../@babel/compat-data/data/plugins.json | 764 + .../@babel/compat-data/native-modules.js | 1 + .../@babel/compat-data/overlapping-plugins.js | 1 + node_modules/@babel/compat-data/package.json | 40 + .../@babel/compat-data/plugin-bugfixes.js | 1 + node_modules/@babel/compat-data/plugins.js | 1 + node_modules/@babel/core/LICENSE | 22 + node_modules/@babel/core/README.md | 19 + node_modules/@babel/core/cjs-proxy.cjs | 53 + .../@babel/core/lib/config/cache-contexts.js | 3 + .../core/lib/config/cache-contexts.js.map | 1 + .../@babel/core/lib/config/caching.js | 261 + .../@babel/core/lib/config/caching.js.map | 1 + .../@babel/core/lib/config/config-chain.js | 470 + .../core/lib/config/config-chain.js.map | 1 + .../core/lib/config/config-descriptors.js | 190 + .../core/lib/config/config-descriptors.js.map | 1 + .../core/lib/config/files/configuration.js | 287 + .../lib/config/files/configuration.js.map | 1 + .../@babel/core/lib/config/files/import.cjs | 6 + .../core/lib/config/files/import.cjs.map | 1 + .../core/lib/config/files/index-browser.js | 59 + .../lib/config/files/index-browser.js.map | 1 + .../@babel/core/lib/config/files/index.js | 78 + .../@babel/core/lib/config/files/index.js.map | 1 + .../core/lib/config/files/module-types.js | 174 + .../core/lib/config/files/module-types.js.map | 1 + .../@babel/core/lib/config/files/package.js | 61 + .../core/lib/config/files/package.js.map | 1 + .../@babel/core/lib/config/files/plugins.js | 206 + .../core/lib/config/files/plugins.js.map | 1 + .../@babel/core/lib/config/files/types.js | 3 + .../@babel/core/lib/config/files/types.js.map | 1 + .../@babel/core/lib/config/files/utils.js | 36 + .../@babel/core/lib/config/files/utils.js.map | 1 + node_modules/@babel/core/lib/config/full.js | 311 + .../@babel/core/lib/config/full.js.map | 1 + .../core/lib/config/helpers/config-api.js | 85 + .../core/lib/config/helpers/config-api.js.map | 1 + .../core/lib/config/helpers/deep-array.js | 23 + .../core/lib/config/helpers/deep-array.js.map | 1 + .../core/lib/config/helpers/environment.js | 12 + .../lib/config/helpers/environment.js.map | 1 + node_modules/@babel/core/lib/config/index.js | 93 + .../@babel/core/lib/config/index.js.map | 1 + node_modules/@babel/core/lib/config/item.js | 67 + .../@babel/core/lib/config/item.js.map | 1 + .../@babel/core/lib/config/partial.js | 158 + .../@babel/core/lib/config/partial.js.map | 1 + .../core/lib/config/pattern-to-regex.js | 38 + .../core/lib/config/pattern-to-regex.js.map | 1 + node_modules/@babel/core/lib/config/plugin.js | 33 + .../@babel/core/lib/config/plugin.js.map | 1 + .../@babel/core/lib/config/printer.js | 114 + .../@babel/core/lib/config/printer.js.map | 1 + .../lib/config/resolve-targets-browser.js | 41 + .../lib/config/resolve-targets-browser.js.map | 1 + .../@babel/core/lib/config/resolve-targets.js | 61 + .../core/lib/config/resolve-targets.js.map | 1 + node_modules/@babel/core/lib/config/util.js | 31 + .../@babel/core/lib/config/util.js.map | 1 + .../config/validation/option-assertions.js | 277 + .../validation/option-assertions.js.map | 1 + .../core/lib/config/validation/options.js | 193 + .../core/lib/config/validation/options.js.map | 1 + .../core/lib/config/validation/plugins.js | 67 + .../core/lib/config/validation/plugins.js.map | 1 + .../core/lib/config/validation/removed.js | 69 + .../core/lib/config/validation/removed.js.map | 1 + .../@babel/core/lib/errors/config-error.js | 18 + .../core/lib/errors/config-error.js.map | 1 + .../core/lib/errors/rewrite-stack-trace.js | 98 + .../lib/errors/rewrite-stack-trace.js.map | 1 + .../@babel/core/lib/gensync-utils/async.js | 93 + .../core/lib/gensync-utils/async.js.map | 1 + .../@babel/core/lib/gensync-utils/fs.js | 33 + .../@babel/core/lib/gensync-utils/fs.js.map | 1 + .../core/lib/gensync-utils/functional.js | 33 + .../core/lib/gensync-utils/functional.js.map | 1 + node_modules/@babel/core/lib/index.js | 244 + node_modules/@babel/core/lib/index.js.map | 1 + node_modules/@babel/core/lib/parse.js | 48 + node_modules/@babel/core/lib/parse.js.map | 1 + node_modules/@babel/core/lib/parser/index.js | 79 + .../@babel/core/lib/parser/index.js.map | 1 + .../lib/parser/util/missing-plugin-helper.js | 329 + .../parser/util/missing-plugin-helper.js.map | 1 + .../core/lib/tools/build-external-helpers.js | 143 + .../lib/tools/build-external-helpers.js.map | 1 + node_modules/@babel/core/lib/transform-ast.js | 51 + .../@babel/core/lib/transform-ast.js.map | 1 + .../@babel/core/lib/transform-file-browser.js | 24 + .../core/lib/transform-file-browser.js.map | 1 + .../@babel/core/lib/transform-file.js | 40 + .../@babel/core/lib/transform-file.js.map | 1 + node_modules/@babel/core/lib/transform.js | 50 + node_modules/@babel/core/lib/transform.js.map | 1 + .../lib/transformation/block-hoist-plugin.js | 77 + .../transformation/block-hoist-plugin.js.map | 1 + .../core/lib/transformation/file/file.js | 211 + .../core/lib/transformation/file/file.js.map | 1 + .../core/lib/transformation/file/generate.js | 84 + .../lib/transformation/file/generate.js.map | 1 + .../core/lib/transformation/file/merge-map.js | 37 + .../lib/transformation/file/merge-map.js.map | 1 + .../@babel/core/lib/transformation/index.js | 101 + .../core/lib/transformation/index.js.map | 1 + .../core/lib/transformation/normalize-file.js | 129 + .../lib/transformation/normalize-file.js.map | 1 + .../core/lib/transformation/normalize-opts.js | 59 + .../lib/transformation/normalize-opts.js.map | 1 + .../core/lib/transformation/plugin-pass.js | 48 + .../lib/transformation/plugin-pass.js.map | 1 + .../lib/transformation/util/clone-deep.js | 36 + .../lib/transformation/util/clone-deep.js.map | 1 + .../core/lib/vendor/import-meta-resolve.js | 1012 ++ .../lib/vendor/import-meta-resolve.js.map | 1 + node_modules/@babel/core/package.json | 82 + .../core/src/config/files/index-browser.ts | 109 + .../@babel/core/src/config/files/index.ts | 29 + .../src/config/resolve-targets-browser.ts | 40 + .../@babel/core/src/config/resolve-targets.ts | 56 + .../@babel/core/src/transform-file-browser.ts | 31 + .../@babel/core/src/transform-file.ts | 55 + node_modules/@babel/generator/LICENSE | 22 + node_modules/@babel/generator/README.md | 19 + node_modules/@babel/generator/lib/buffer.js | 307 + .../@babel/generator/lib/buffer.js.map | 1 + .../@babel/generator/lib/generators/base.js | 92 + .../generator/lib/generators/base.js.map | 1 + .../generator/lib/generators/classes.js | 177 + .../generator/lib/generators/classes.js.map | 1 + .../generator/lib/generators/expressions.js | 309 + .../lib/generators/expressions.js.map | 1 + .../@babel/generator/lib/generators/flow.js | 668 + .../generator/lib/generators/flow.js.map | 1 + .../@babel/generator/lib/generators/index.js | 128 + .../generator/lib/generators/index.js.map | 1 + .../@babel/generator/lib/generators/jsx.js | 123 + .../generator/lib/generators/jsx.js.map | 1 + .../generator/lib/generators/methods.js | 173 + .../generator/lib/generators/methods.js.map | 1 + .../generator/lib/generators/modules.js | 274 + .../generator/lib/generators/modules.js.map | 1 + .../generator/lib/generators/statements.js | 277 + .../lib/generators/statements.js.map | 1 + .../lib/generators/template-literals.js | 30 + .../lib/generators/template-literals.js.map | 1 + .../@babel/generator/lib/generators/types.js | 220 + .../generator/lib/generators/types.js.map | 1 + .../generator/lib/generators/typescript.js | 694 + .../lib/generators/typescript.js.map | 1 + node_modules/@babel/generator/lib/index.js | 94 + .../@babel/generator/lib/index.js.map | 1 + .../@babel/generator/lib/node/index.js | 78 + .../@babel/generator/lib/node/index.js.map | 1 + .../@babel/generator/lib/node/parentheses.js | 305 + .../generator/lib/node/parentheses.js.map | 1 + .../@babel/generator/lib/node/whitespace.js | 146 + .../generator/lib/node/whitespace.js.map | 1 + node_modules/@babel/generator/lib/printer.js | 651 + .../@babel/generator/lib/printer.js.map | 1 + .../@babel/generator/lib/source-map.js | 85 + .../@babel/generator/lib/source-map.js.map | 1 + node_modules/@babel/generator/package.json | 38 + .../@babel/helper-compilation-targets/LICENSE | 22 + .../helper-compilation-targets/README.md | 19 + .../helper-compilation-targets/lib/debug.js | 28 + .../lib/debug.js.map | 1 + .../lib/filter-items.js | 67 + .../lib/filter-items.js.map | 1 + .../helper-compilation-targets/lib/index.js | 224 + .../lib/index.js.map | 1 + .../helper-compilation-targets/lib/options.js | 25 + .../lib/options.js.map | 1 + .../helper-compilation-targets/lib/pretty.js | 40 + .../lib/pretty.js.map | 1 + .../helper-compilation-targets/lib/targets.js | 30 + .../lib/targets.js.map | 1 + .../helper-compilation-targets/lib/utils.js | 58 + .../lib/utils.js.map | 1 + .../helper-compilation-targets/package.json | 40 + .../@babel/helper-environment-visitor/LICENSE | 22 + .../helper-environment-visitor/README.md | 19 + .../helper-environment-visitor/lib/index.js | 52 + .../lib/index.js.map | 1 + .../helper-environment-visitor/package.json | 29 + .../@babel/helper-function-name/LICENSE | 22 + .../@babel/helper-function-name/README.md | 19 + .../@babel/helper-function-name/lib/index.js | 170 + .../helper-function-name/lib/index.js.map | 1 + .../@babel/helper-function-name/package.json | 25 + .../@babel/helper-hoist-variables/LICENSE | 22 + .../@babel/helper-hoist-variables/README.md | 19 + .../helper-hoist-variables/lib/index.js | 50 + .../helper-hoist-variables/lib/index.js.map | 1 + .../helper-hoist-variables/package.json | 28 + .../@babel/helper-module-imports/LICENSE | 22 + .../@babel/helper-module-imports/README.md | 19 + .../lib/import-builder.js | 122 + .../lib/import-builder.js.map | 1 + .../lib/import-injector.js | 240 + .../lib/import-injector.js.map | 1 + .../@babel/helper-module-imports/lib/index.js | 37 + .../helper-module-imports/lib/index.js.map | 1 + .../helper-module-imports/lib/is-module.js | 11 + .../lib/is-module.js.map | 1 + .../@babel/helper-module-imports/package.json | 28 + .../@babel/helper-module-transforms/LICENSE | 22 + .../@babel/helper-module-transforms/README.md | 19 + .../lib/dynamic-import.js | 48 + .../lib/dynamic-import.js.map | 1 + .../lib/get-module-name.js | 48 + .../lib/get-module-name.js.map | 1 + .../helper-module-transforms/lib/index.js | 377 + .../helper-module-transforms/lib/index.js.map | 1 + .../lib/lazy-modules.js | 31 + .../lib/lazy-modules.js.map | 1 + .../lib/normalize-and-load-metadata.js | 358 + .../lib/normalize-and-load-metadata.js.map | 1 + .../lib/rewrite-live-references.js | 376 + .../lib/rewrite-live-references.js.map | 1 + .../lib/rewrite-this.js | 24 + .../lib/rewrite-this.js.map | 1 + .../helper-module-transforms/package.json | 35 + .../@babel/helper-plugin-utils/LICENSE | 22 + .../@babel/helper-plugin-utils/README.md | 19 + .../@babel/helper-plugin-utils/lib/index.js | 81 + .../helper-plugin-utils/lib/index.js.map | 1 + .../@babel/helper-plugin-utils/package.json | 21 + .../@babel/helper-simple-access/LICENSE | 22 + .../@babel/helper-simple-access/README.md | 19 + .../@babel/helper-simple-access/lib/index.js | 91 + .../helper-simple-access/lib/index.js.map | 1 + .../@babel/helper-simple-access/package.json | 28 + .../helper-split-export-declaration/LICENSE | 22 + .../helper-split-export-declaration/README.md | 19 + .../lib/index.js | 59 + .../lib/index.js.map | 1 + .../package.json | 24 + .../@babel/helper-string-parser/LICENSE | 22 + .../@babel/helper-string-parser/README.md | 19 + .../@babel/helper-string-parser/lib/index.js | 295 + .../helper-string-parser/lib/index.js.map | 1 + .../@babel/helper-string-parser/package.json | 28 + .../helper-validator-identifier/LICENSE | 22 + .../helper-validator-identifier/README.md | 19 + .../lib/identifier.js | 70 + .../lib/identifier.js.map | 1 + .../helper-validator-identifier/lib/index.js | 57 + .../lib/index.js.map | 1 + .../lib/keyword.js | 35 + .../lib/keyword.js.map | 1 + .../helper-validator-identifier/package.json | 28 + .../scripts/generate-identifier-regex.js | 73 + .../@babel/helper-validator-option/LICENSE | 22 + .../@babel/helper-validator-option/README.md | 19 + .../lib/find-suggestion.js | 39 + .../lib/find-suggestion.js.map | 1 + .../helper-validator-option/lib/index.js | 21 + .../helper-validator-option/lib/index.js.map | 1 + .../helper-validator-option/lib/validator.js | 48 + .../lib/validator.js.map | 1 + .../helper-validator-option/package.json | 24 + node_modules/@babel/helpers/LICENSE | 22 + node_modules/@babel/helpers/README.md | 19 + .../@babel/helpers/lib/helpers-generated.js | 43 + .../helpers/lib/helpers-generated.js.map | 1 + node_modules/@babel/helpers/lib/helpers.js | 1748 ++ .../@babel/helpers/lib/helpers.js.map | 1 + .../helpers/lib/helpers/AsyncGenerator.js | 92 + .../helpers/lib/helpers/AsyncGenerator.js.map | 1 + .../helpers/lib/helpers/OverloadYield.js | 12 + .../helpers/lib/helpers/OverloadYield.js.map | 1 + .../@babel/helpers/lib/helpers/applyDecs.js | 448 + .../helpers/lib/helpers/applyDecs.js.map | 1 + .../helpers/lib/helpers/applyDecs2203.js | 363 + .../helpers/lib/helpers/applyDecs2203.js.map | 1 + .../helpers/lib/helpers/applyDecs2203R.js | 365 + .../helpers/lib/helpers/applyDecs2203R.js.map | 1 + .../helpers/lib/helpers/applyDecs2301.js | 410 + .../helpers/lib/helpers/applyDecs2301.js.map | 1 + .../helpers/lib/helpers/applyDecs2305.js | 403 + .../helpers/lib/helpers/applyDecs2305.js.map | 1 + .../lib/helpers/asyncGeneratorDelegate.js | 52 + .../lib/helpers/asyncGeneratorDelegate.js.map | 1 + .../helpers/lib/helpers/asyncIterator.js | 70 + .../helpers/lib/helpers/asyncIterator.js.map | 1 + .../lib/helpers/awaitAsyncGenerator.js | 12 + .../lib/helpers/awaitAsyncGenerator.js.map | 1 + .../@babel/helpers/lib/helpers/checkInRHS.js | 14 + .../helpers/lib/helpers/checkInRHS.js.map | 1 + .../helpers/lib/helpers/defineAccessor.js | 16 + .../helpers/lib/helpers/defineAccessor.js.map | 1 + .../@babel/helpers/lib/helpers/dispose.js | 47 + .../@babel/helpers/lib/helpers/dispose.js.map | 1 + .../helpers/lib/helpers/importDeferProxy.js | 35 + .../lib/helpers/importDeferProxy.js.map | 1 + .../lib/helpers/interopRequireWildcard.js | 49 + .../lib/helpers/interopRequireWildcard.js.map | 1 + .../lib/helpers/iterableToArrayLimit.js | 41 + .../lib/helpers/iterableToArrayLimit.js.map | 1 + .../lib/helpers/iterableToArrayLimitLoose.js | 18 + .../helpers/iterableToArrayLimitLoose.js.map | 1 + .../@babel/helpers/lib/helpers/jsx.js | 47 + .../@babel/helpers/lib/helpers/jsx.js.map | 1 + .../helpers/lib/helpers/objectSpread2.js | 39 + .../helpers/lib/helpers/objectSpread2.js.map | 1 + .../helpers/lib/helpers/regeneratorRuntime.js | 499 + .../lib/helpers/regeneratorRuntime.js.map | 1 + .../@babel/helpers/lib/helpers/typeof.js | 22 + .../@babel/helpers/lib/helpers/typeof.js.map | 1 + .../@babel/helpers/lib/helpers/using.js | 29 + .../@babel/helpers/lib/helpers/using.js.map | 1 + .../@babel/helpers/lib/helpers/wrapRegExp.js | 66 + .../helpers/lib/helpers/wrapRegExp.js.map | 1 + node_modules/@babel/helpers/lib/index.js | 242 + node_modules/@babel/helpers/lib/index.js.map | 1 + node_modules/@babel/helpers/package.json | 33 + .../helpers/scripts/generate-helpers.js | 64 + .../scripts/generate-regenerator-runtime.js | 63 + .../@babel/helpers/scripts/package.json | 1 + node_modules/@babel/highlight/LICENSE | 22 + node_modules/@babel/highlight/README.md | 19 + node_modules/@babel/highlight/lib/index.js | 105 + .../@babel/highlight/lib/index.js.map | 1 + .../node_modules/ansi-styles/index.js | 165 + .../node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 56 + .../node_modules/ansi-styles/readme.md | 147 + .../highlight/node_modules/chalk/index.js | 228 + .../node_modules/chalk/index.js.flow | 93 + .../highlight/node_modules/chalk/license | 9 + .../highlight/node_modules/chalk/package.json | 71 + .../highlight/node_modules/chalk/readme.md | 314 + .../highlight/node_modules/chalk/templates.js | 128 + .../node_modules/chalk/types/index.d.ts | 97 + .../node_modules/color-convert/CHANGELOG.md | 54 + .../node_modules/color-convert/LICENSE | 21 + .../node_modules/color-convert/README.md | 68 + .../node_modules/color-convert/conversions.js | 868 + .../node_modules/color-convert/index.js | 78 + .../node_modules/color-convert/package.json | 46 + .../node_modules/color-convert/route.js | 97 + .../node_modules/color-name/.eslintrc.json | 43 + .../node_modules/color-name/.npmignore | 107 + .../highlight/node_modules/color-name/LICENSE | 8 + .../node_modules/color-name/README.md | 11 + .../node_modules/color-name/index.js | 152 + .../node_modules/color-name/package.json | 25 + .../highlight/node_modules/color-name/test.js | 7 + .../escape-string-regexp/index.js | 11 + .../node_modules/escape-string-regexp/license | 21 + .../escape-string-regexp/package.json | 41 + .../escape-string-regexp/readme.md | 27 + .../highlight/node_modules/has-flag/index.js | 8 + .../highlight/node_modules/has-flag/license | 9 + .../node_modules/has-flag/package.json | 44 + .../highlight/node_modules/has-flag/readme.md | 70 + .../node_modules/supports-color/browser.js | 5 + .../node_modules/supports-color/index.js | 131 + .../node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 53 + .../node_modules/supports-color/readme.md | 66 + node_modules/@babel/highlight/package.json | 29 + node_modules/@babel/parser/CHANGELOG.md | 1073 ++ node_modules/@babel/parser/LICENSE | 19 + node_modules/@babel/parser/README.md | 19 + .../@babel/parser/bin/babel-parser.js | 15 + node_modules/@babel/parser/index.cjs | 5 + node_modules/@babel/parser/lib/index.js | 14465 ++++++++++++++++ node_modules/@babel/parser/lib/index.js.map | 1 + node_modules/@babel/parser/package.json | 46 + .../@babel/parser/typings/babel-parser.d.ts | 250 + .../plugin-syntax-async-generators/LICENSE | 22 + .../plugin-syntax-async-generators/README.md | 19 + .../lib/index.js | 22 + .../package.json | 23 + .../@babel/plugin-syntax-bigint/LICENSE | 22 + .../@babel/plugin-syntax-bigint/README.md | 19 + .../@babel/plugin-syntax-bigint/lib/index.js | 22 + .../@babel/plugin-syntax-bigint/package.json | 23 + .../plugin-syntax-class-properties/LICENSE | 22 + .../plugin-syntax-class-properties/README.md | 19 + .../lib/index.js | 22 + .../package.json | 28 + .../@babel/plugin-syntax-import-meta/LICENSE | 22 + .../plugin-syntax-import-meta/README.md | 19 + .../plugin-syntax-import-meta/lib/index.js | 22 + .../plugin-syntax-import-meta/package.json | 28 + .../@babel/plugin-syntax-json-strings/LICENSE | 22 + .../plugin-syntax-json-strings/README.md | 19 + .../plugin-syntax-json-strings/lib/index.js | 22 + .../plugin-syntax-json-strings/package.json | 23 + node_modules/@babel/plugin-syntax-jsx/LICENSE | 22 + .../@babel/plugin-syntax-jsx/README.md | 19 + .../@babel/plugin-syntax-jsx/lib/index.js | 24 + .../@babel/plugin-syntax-jsx/lib/index.js.map | 1 + .../@babel/plugin-syntax-jsx/package.json | 33 + .../LICENSE | 22 + .../README.md | 19 + .../lib/index.js | 22 + .../package.json | 28 + .../LICENSE | 22 + .../README.md | 19 + .../lib/index.js | 22 + .../package.json | 23 + .../plugin-syntax-numeric-separator/LICENSE | 22 + .../plugin-syntax-numeric-separator/README.md | 19 + .../lib/index.js | 22 + .../package.json | 28 + .../plugin-syntax-object-rest-spread/LICENSE | 22 + .../README.md | 19 + .../lib/index.js | 22 + .../package.json | 23 + .../LICENSE | 22 + .../README.md | 19 + .../lib/index.js | 22 + .../package.json | 23 + .../plugin-syntax-optional-chaining/LICENSE | 22 + .../plugin-syntax-optional-chaining/README.md | 19 + .../lib/index.js | 22 + .../package.json | 23 + .../plugin-syntax-top-level-await/LICENSE | 22 + .../plugin-syntax-top-level-await/README.md | 19 + .../lib/index.js | 22 + .../package.json | 32 + .../@babel/plugin-syntax-typescript/LICENSE | 22 + .../@babel/plugin-syntax-typescript/README.md | 19 + .../plugin-syntax-typescript/lib/index.js | 56 + .../plugin-syntax-typescript/lib/index.js.map | 1 + .../plugin-syntax-typescript/package.json | 35 + node_modules/@babel/template/LICENSE | 22 + node_modules/@babel/template/README.md | 19 + node_modules/@babel/template/lib/builder.js | 69 + .../@babel/template/lib/builder.js.map | 1 + .../@babel/template/lib/formatters.js | 66 + .../@babel/template/lib/formatters.js.map | 1 + node_modules/@babel/template/lib/index.js | 29 + node_modules/@babel/template/lib/index.js.map | 1 + node_modules/@babel/template/lib/literal.js | 69 + .../@babel/template/lib/literal.js.map | 1 + node_modules/@babel/template/lib/options.js | 73 + .../@babel/template/lib/options.js.map | 1 + node_modules/@babel/template/lib/parse.js | 160 + node_modules/@babel/template/lib/parse.js.map | 1 + node_modules/@babel/template/lib/populate.js | 122 + .../@babel/template/lib/populate.js.map | 1 + node_modules/@babel/template/lib/string.js | 20 + .../@babel/template/lib/string.js.map | 1 + node_modules/@babel/template/package.json | 27 + node_modules/@babel/traverse/LICENSE | 22 + node_modules/@babel/traverse/README.md | 19 + node_modules/@babel/traverse/lib/cache.js | 46 + node_modules/@babel/traverse/lib/cache.js.map | 1 + node_modules/@babel/traverse/lib/context.js | 115 + .../@babel/traverse/lib/context.js.map | 1 + node_modules/@babel/traverse/lib/hub.js | 19 + node_modules/@babel/traverse/lib/hub.js.map | 1 + node_modules/@babel/traverse/lib/index.js | 95 + node_modules/@babel/traverse/lib/index.js.map | 1 + .../@babel/traverse/lib/path/ancestry.js | 141 + .../@babel/traverse/lib/path/ancestry.js.map | 1 + .../@babel/traverse/lib/path/comments.js | 54 + .../@babel/traverse/lib/path/comments.js.map | 1 + .../@babel/traverse/lib/path/context.js | 222 + .../@babel/traverse/lib/path/context.js.map | 1 + .../@babel/traverse/lib/path/conversion.js | 468 + .../traverse/lib/path/conversion.js.map | 1 + .../@babel/traverse/lib/path/evaluation.js | 347 + .../traverse/lib/path/evaluation.js.map | 1 + .../@babel/traverse/lib/path/family.js | 336 + .../@babel/traverse/lib/path/family.js.map | 1 + .../@babel/traverse/lib/path/index.js | 193 + .../@babel/traverse/lib/path/index.js.map | 1 + .../traverse/lib/path/inference/index.js | 149 + .../traverse/lib/path/inference/index.js.map | 1 + .../lib/path/inference/inferer-reference.js | 151 + .../path/inference/inferer-reference.js.map | 1 + .../traverse/lib/path/inference/inferers.js | 207 + .../lib/path/inference/inferers.js.map | 1 + .../traverse/lib/path/inference/util.js | 30 + .../traverse/lib/path/inference/util.js.map | 1 + .../@babel/traverse/lib/path/introspection.js | 385 + .../traverse/lib/path/introspection.js.map | 1 + .../@babel/traverse/lib/path/lib/hoister.js | 171 + .../traverse/lib/path/lib/hoister.js.map | 1 + .../traverse/lib/path/lib/removal-hooks.js | 38 + .../lib/path/lib/removal-hooks.js.map | 1 + .../lib/path/lib/virtual-types-validator.js | 161 + .../path/lib/virtual-types-validator.js.map | 1 + .../traverse/lib/path/lib/virtual-types.js | 44 + .../lib/path/lib/virtual-types.js.map | 1 + .../@babel/traverse/lib/path/modification.js | 225 + .../traverse/lib/path/modification.js.map | 1 + .../@babel/traverse/lib/path/removal.js | 60 + .../@babel/traverse/lib/path/removal.js.map | 1 + .../@babel/traverse/lib/path/replacement.js | 205 + .../traverse/lib/path/replacement.js.map | 1 + .../@babel/traverse/lib/scope/binding.js | 83 + .../@babel/traverse/lib/scope/binding.js.map | 1 + .../@babel/traverse/lib/scope/index.js | 888 + .../@babel/traverse/lib/scope/index.js.map | 1 + .../@babel/traverse/lib/scope/lib/renamer.js | 113 + .../traverse/lib/scope/lib/renamer.js.map | 1 + .../@babel/traverse/lib/traverse-node.js | 29 + .../@babel/traverse/lib/traverse-node.js.map | 1 + node_modules/@babel/traverse/lib/types.js | 3 + node_modules/@babel/traverse/lib/types.js.map | 1 + node_modules/@babel/traverse/lib/visitors.js | 218 + .../@babel/traverse/lib/visitors.js.map | 1 + node_modules/@babel/traverse/package.json | 38 + node_modules/@babel/types/LICENSE | 22 + node_modules/@babel/types/README.md | 19 + .../@babel/types/lib/asserts/assertNode.js | 16 + .../types/lib/asserts/assertNode.js.map | 1 + .../types/lib/asserts/generated/index.js | 1235 ++ .../types/lib/asserts/generated/index.js.map | 1 + .../types/lib/ast-types/generated/index.js | 3 + .../lib/ast-types/generated/index.js.map | 1 + .../lib/builders/flow/createFlowUnionType.js | 18 + .../builders/flow/createFlowUnionType.js.map | 1 + .../flow/createTypeAnnotationBasedOnTypeof.js | 32 + .../createTypeAnnotationBasedOnTypeof.js.map | 1 + .../types/lib/builders/generated/index.js | 1993 +++ .../types/lib/builders/generated/index.js.map | 1 + .../types/lib/builders/generated/uppercase.js | 1532 ++ .../lib/builders/generated/uppercase.js.map | 1 + .../@babel/types/lib/builders/productions.js | 12 + .../types/lib/builders/productions.js.map | 1 + .../types/lib/builders/react/buildChildren.js | 24 + .../lib/builders/react/buildChildren.js.map | 1 + .../builders/typescript/createTSUnionType.js | 22 + .../typescript/createTSUnionType.js.map | 1 + .../@babel/types/lib/builders/validateNode.js | 17 + .../types/lib/builders/validateNode.js.map | 1 + node_modules/@babel/types/lib/clone/clone.js | 12 + .../@babel/types/lib/clone/clone.js.map | 1 + .../@babel/types/lib/clone/cloneDeep.js | 12 + .../@babel/types/lib/clone/cloneDeep.js.map | 1 + .../types/lib/clone/cloneDeepWithoutLoc.js | 12 + .../lib/clone/cloneDeepWithoutLoc.js.map | 1 + .../@babel/types/lib/clone/cloneNode.js | 100 + .../@babel/types/lib/clone/cloneNode.js.map | 1 + .../@babel/types/lib/clone/cloneWithoutLoc.js | 12 + .../types/lib/clone/cloneWithoutLoc.js.map | 1 + .../@babel/types/lib/comments/addComment.js | 15 + .../types/lib/comments/addComment.js.map | 1 + .../@babel/types/lib/comments/addComments.js | 22 + .../types/lib/comments/addComments.js.map | 1 + .../lib/comments/inheritInnerComments.js | 12 + .../lib/comments/inheritInnerComments.js.map | 1 + .../lib/comments/inheritLeadingComments.js | 12 + .../comments/inheritLeadingComments.js.map | 1 + .../lib/comments/inheritTrailingComments.js | 12 + .../comments/inheritTrailingComments.js.map | 1 + .../types/lib/comments/inheritsComments.js | 17 + .../lib/comments/inheritsComments.js.map | 1 + .../types/lib/comments/removeComments.js | 15 + .../types/lib/comments/removeComments.js.map | 1 + .../types/lib/constants/generated/index.js | 109 + .../lib/constants/generated/index.js.map | 1 + .../@babel/types/lib/constants/index.js | 51 + .../@babel/types/lib/constants/index.js.map | 1 + .../types/lib/converters/ensureBlock.js | 14 + .../types/lib/converters/ensureBlock.js.map | 1 + .../converters/gatherSequenceExpressions.js | 64 + .../gatherSequenceExpressions.js.map | 1 + .../lib/converters/toBindingIdentifierName.js | 14 + .../converters/toBindingIdentifierName.js.map | 1 + .../@babel/types/lib/converters/toBlock.js | 29 + .../types/lib/converters/toBlock.js.map | 1 + .../types/lib/converters/toComputedKey.js | 14 + .../types/lib/converters/toComputedKey.js.map | 1 + .../types/lib/converters/toExpression.js | 28 + .../types/lib/converters/toExpression.js.map | 1 + .../types/lib/converters/toIdentifier.js | 25 + .../types/lib/converters/toIdentifier.js.map | 1 + .../@babel/types/lib/converters/toKeyAlias.js | 38 + .../types/lib/converters/toKeyAlias.js.map | 1 + .../lib/converters/toSequenceExpression.js | 19 + .../converters/toSequenceExpression.js.map | 1 + .../types/lib/converters/toStatement.js | 40 + .../types/lib/converters/toStatement.js.map | 1 + .../types/lib/converters/valueToNode.js | 77 + .../types/lib/converters/valueToNode.js.map | 1 + .../@babel/types/lib/definitions/core.js | 1692 ++ .../@babel/types/lib/definitions/core.js.map | 1 + .../lib/definitions/deprecated-aliases.js | 12 + .../lib/definitions/deprecated-aliases.js.map | 1 + .../types/lib/definitions/experimental.js | 134 + .../types/lib/definitions/experimental.js.map | 1 + .../@babel/types/lib/definitions/flow.js | 488 + .../@babel/types/lib/definitions/flow.js.map | 1 + .../@babel/types/lib/definitions/index.js | 97 + .../@babel/types/lib/definitions/index.js.map | 1 + .../@babel/types/lib/definitions/jsx.js | 158 + .../@babel/types/lib/definitions/jsx.js.map | 1 + .../@babel/types/lib/definitions/misc.js | 32 + .../@babel/types/lib/definitions/misc.js.map | 1 + .../types/lib/definitions/placeholders.js | 30 + .../types/lib/definitions/placeholders.js.map | 1 + .../types/lib/definitions/typescript.js | 490 + .../types/lib/definitions/typescript.js.map | 1 + .../@babel/types/lib/definitions/utils.js | 280 + .../@babel/types/lib/definitions/utils.js.map | 1 + .../@babel/types/lib/index-legacy.d.ts | 2759 +++ node_modules/@babel/types/lib/index.d.ts | 3280 ++++ node_modules/@babel/types/lib/index.js | 582 + node_modules/@babel/types/lib/index.js.flow | 2613 +++ node_modules/@babel/types/lib/index.js.map | 1 + .../modifications/appendToMemberExpression.js | 15 + .../appendToMemberExpression.js.map | 1 + .../flow/removeTypeDuplicates.js | 65 + .../flow/removeTypeDuplicates.js.map | 1 + .../types/lib/modifications/inherits.js | 28 + .../types/lib/modifications/inherits.js.map | 1 + .../prependToMemberExpression.js | 17 + .../prependToMemberExpression.js.map | 1 + .../lib/modifications/removeProperties.js | 24 + .../lib/modifications/removeProperties.js.map | 1 + .../lib/modifications/removePropertiesDeep.js | 14 + .../modifications/removePropertiesDeep.js.map | 1 + .../typescript/removeTypeDuplicates.js | 65 + .../typescript/removeTypeDuplicates.js.map | 1 + .../lib/retrievers/getBindingIdentifiers.js | 93 + .../retrievers/getBindingIdentifiers.js.map | 1 + .../retrievers/getOuterBindingIdentifiers.js | 14 + .../getOuterBindingIdentifiers.js.map | 1 + .../@babel/types/lib/traverse/traverse.js | 50 + .../@babel/types/lib/traverse/traverse.js.map | 1 + .../@babel/types/lib/traverse/traverseFast.js | 26 + .../types/lib/traverse/traverseFast.js.map | 1 + .../types/lib/utils/deprecationWarning.js | 44 + .../types/lib/utils/deprecationWarning.js.map | 1 + .../@babel/types/lib/utils/inherit.js | 13 + .../@babel/types/lib/utils/inherit.js.map | 1 + .../react/cleanJSXElementLiteralChild.js | 40 + .../react/cleanJSXElementLiteralChild.js.map | 1 + .../@babel/types/lib/utils/shallowEqual.js | 17 + .../types/lib/utils/shallowEqual.js.map | 1 + .../validators/buildMatchMemberExpression.js | 13 + .../buildMatchMemberExpression.js.map | 1 + .../types/lib/validators/generated/index.js | 2752 +++ .../lib/validators/generated/index.js.map | 1 + .../@babel/types/lib/validators/is.js | 27 + .../@babel/types/lib/validators/is.js.map | 1 + .../@babel/types/lib/validators/isBinding.js | 27 + .../types/lib/validators/isBinding.js.map | 1 + .../types/lib/validators/isBlockScoped.js | 13 + .../types/lib/validators/isBlockScoped.js.map | 1 + .../types/lib/validators/isImmutable.js | 21 + .../types/lib/validators/isImmutable.js.map | 1 + .../@babel/types/lib/validators/isLet.js | 13 + .../@babel/types/lib/validators/isLet.js.map | 1 + .../@babel/types/lib/validators/isNode.js | 12 + .../@babel/types/lib/validators/isNode.js.map | 1 + .../types/lib/validators/isNodesEquivalent.js | 57 + .../lib/validators/isNodesEquivalent.js.map | 1 + .../types/lib/validators/isPlaceholderType.js | 19 + .../lib/validators/isPlaceholderType.js.map | 1 + .../types/lib/validators/isReferenced.js | 96 + .../types/lib/validators/isReferenced.js.map | 1 + .../@babel/types/lib/validators/isScope.js | 18 + .../types/lib/validators/isScope.js.map | 1 + .../lib/validators/isSpecifierDefault.js | 14 + .../lib/validators/isSpecifierDefault.js.map | 1 + .../@babel/types/lib/validators/isType.js | 22 + .../@babel/types/lib/validators/isType.js.map | 1 + .../lib/validators/isValidES3Identifier.js | 13 + .../validators/isValidES3Identifier.js.map | 1 + .../types/lib/validators/isValidIdentifier.js | 18 + .../lib/validators/isValidIdentifier.js.map | 1 + .../@babel/types/lib/validators/isVar.js | 15 + .../@babel/types/lib/validators/isVar.js.map | 1 + .../types/lib/validators/matchesPattern.js | 36 + .../lib/validators/matchesPattern.js.map | 1 + .../types/lib/validators/react/isCompatTag.js | 11 + .../lib/validators/react/isCompatTag.js.map | 1 + .../lib/validators/react/isReactComponent.js | 12 + .../validators/react/isReactComponent.js.map | 1 + .../@babel/types/lib/validators/validate.js | 30 + .../types/lib/validators/validate.js.map | 1 + node_modules/@babel/types/package.json | 40 + node_modules/@bcoe/v8-coverage/.editorconfig | 9 + node_modules/@bcoe/v8-coverage/.gitattributes | 2 + node_modules/@bcoe/v8-coverage/CHANGELOG.md | 250 + node_modules/@bcoe/v8-coverage/LICENSE.md | 21 + node_modules/@bcoe/v8-coverage/LICENSE.txt | 14 + node_modules/@bcoe/v8-coverage/README.md | 11 + .../@bcoe/v8-coverage/dist/lib/CHANGELOG.md | 250 + .../@bcoe/v8-coverage/dist/lib/LICENSE.md | 21 + .../@bcoe/v8-coverage/dist/lib/README.md | 11 + .../@bcoe/v8-coverage/dist/lib/_src/ascii.ts | 146 + .../@bcoe/v8-coverage/dist/lib/_src/clone.ts | 70 + .../v8-coverage/dist/lib/_src/compare.ts | 40 + .../@bcoe/v8-coverage/dist/lib/_src/index.ts | 6 + .../@bcoe/v8-coverage/dist/lib/_src/merge.ts | 343 + .../v8-coverage/dist/lib/_src/normalize.ts | 84 + .../v8-coverage/dist/lib/_src/range-tree.ts | 156 + .../@bcoe/v8-coverage/dist/lib/_src/types.ts | 26 + .../@bcoe/v8-coverage/dist/lib/ascii.d.ts | 12 + .../@bcoe/v8-coverage/dist/lib/ascii.js | 136 + .../@bcoe/v8-coverage/dist/lib/ascii.mjs | 130 + .../@bcoe/v8-coverage/dist/lib/clone.d.ts | 29 + .../@bcoe/v8-coverage/dist/lib/clone.js | 70 + .../@bcoe/v8-coverage/dist/lib/clone.mjs | 64 + .../@bcoe/v8-coverage/dist/lib/compare.d.ts | 21 + .../@bcoe/v8-coverage/dist/lib/compare.js | 46 + .../@bcoe/v8-coverage/dist/lib/compare.mjs | 41 + .../@bcoe/v8-coverage/dist/lib/index.d.ts | 6 + .../@bcoe/v8-coverage/dist/lib/index.js | 24 + .../@bcoe/v8-coverage/dist/lib/index.mjs | 7 + .../@bcoe/v8-coverage/dist/lib/merge.d.ts | 39 + .../@bcoe/v8-coverage/dist/lib/merge.js | 302 + .../@bcoe/v8-coverage/dist/lib/merge.mjs | 297 + .../@bcoe/v8-coverage/dist/lib/normalize.d.ts | 53 + .../@bcoe/v8-coverage/dist/lib/normalize.js | 87 + .../@bcoe/v8-coverage/dist/lib/normalize.mjs | 79 + .../@bcoe/v8-coverage/dist/lib/package.json | 44 + .../v8-coverage/dist/lib/range-tree.d.ts | 24 + .../@bcoe/v8-coverage/dist/lib/range-tree.js | 139 + .../@bcoe/v8-coverage/dist/lib/range-tree.mjs | 136 + .../@bcoe/v8-coverage/dist/lib/tsconfig.json | 62 + .../@bcoe/v8-coverage/dist/lib/types.d.ts | 22 + .../@bcoe/v8-coverage/dist/lib/types.js | 4 + .../@bcoe/v8-coverage/dist/lib/types.mjs | 3 + node_modules/@bcoe/v8-coverage/gulpfile.ts | 95 + node_modules/@bcoe/v8-coverage/package.json | 48 + .../@bcoe/v8-coverage/src/lib/ascii.ts | 146 + .../@bcoe/v8-coverage/src/lib/clone.ts | 70 + .../@bcoe/v8-coverage/src/lib/compare.ts | 40 + .../@bcoe/v8-coverage/src/lib/index.ts | 6 + .../@bcoe/v8-coverage/src/lib/merge.ts | 343 + .../@bcoe/v8-coverage/src/lib/normalize.ts | 84 + .../@bcoe/v8-coverage/src/lib/range-tree.ts | 156 + .../@bcoe/v8-coverage/src/lib/types.ts | 26 + .../@bcoe/v8-coverage/src/test/merge.spec.ts | 280 + node_modules/@bcoe/v8-coverage/tsconfig.json | 59 + .../@istanbuljs/load-nyc-config/CHANGELOG.md | 41 + .../@istanbuljs/load-nyc-config/LICENSE | 16 + .../@istanbuljs/load-nyc-config/README.md | 64 + .../@istanbuljs/load-nyc-config/index.js | 166 + .../@istanbuljs/load-nyc-config/load-esm.js | 12 + .../@istanbuljs/load-nyc-config/package.json | 49 + node_modules/@istanbuljs/schema/CHANGELOG.md | 44 + node_modules/@istanbuljs/schema/LICENSE | 21 + node_modules/@istanbuljs/schema/README.md | 30 + .../@istanbuljs/schema/default-exclude.js | 22 + .../@istanbuljs/schema/default-extension.js | 10 + node_modules/@istanbuljs/schema/index.js | 466 + node_modules/@istanbuljs/schema/package.json | 30 + node_modules/@jest/console/LICENSE | 21 + .../@jest/console/build/BufferedConsole.js | 197 + .../@jest/console/build/CustomConsole.js | 182 + .../@jest/console/build/NullConsole.js | 35 + .../@jest/console/build/getConsoleOutput.js | 70 + node_modules/@jest/console/build/index.d.ts | 131 + node_modules/@jest/console/build/index.js | 36 + node_modules/@jest/console/build/types.js | 1 + node_modules/@jest/console/package.json | 37 + node_modules/@jest/core/LICENSE | 21 + node_modules/@jest/core/README.md | 3 + .../@jest/core/build/FailedTestsCache.js | 46 + .../core/build/FailedTestsInteractiveMode.js | 195 + .../@jest/core/build/ReporterDispatcher.js | 87 + node_modules/@jest/core/build/SearchSource.js | 408 + .../core/build/SnapshotInteractiveMode.js | 238 + .../@jest/core/build/TestNamePatternPrompt.js | 39 + .../@jest/core/build/TestPathPatternPrompt.js | 39 + .../@jest/core/build/TestScheduler.js | 463 + node_modules/@jest/core/build/cli/index.js | 417 + .../@jest/core/build/collectHandles.js | 266 + .../core/build/getChangedFilesPromise.js | 65 + .../core/build/getConfigsOfProjectsToRun.js | 40 + .../@jest/core/build/getNoTestFound.js | 80 + .../@jest/core/build/getNoTestFoundFailed.js | 43 + .../build/getNoTestFoundPassWithNoTests.js | 26 + .../getNoTestFoundRelatedToChangedFiles.js | 48 + .../@jest/core/build/getNoTestFoundVerbose.js | 91 + .../core/build/getNoTestsFoundMessage.js | 64 + .../@jest/core/build/getProjectDisplayName.js | 16 + .../build/getProjectNamesMissingWarning.js | 49 + .../core/build/getSelectProjectsMessage.js | 71 + node_modules/@jest/core/build/index.d.ts | 118 + node_modules/@jest/core/build/index.js | 36 + .../core/build/lib/activeFiltersMessage.js | 52 + .../@jest/core/build/lib/createContext.js | 31 + .../build/lib/handleDeprecationWarnings.js | 65 + .../@jest/core/build/lib/isValidPath.js | 26 + .../@jest/core/build/lib/logDebugMessages.js | 24 + .../core/build/lib/updateGlobalConfig.js | 95 + .../core/build/lib/watchPluginsHelpers.js | 56 + .../build/plugins/FailedTestsInteractive.js | 96 + node_modules/@jest/core/build/plugins/Quit.js | 42 + .../core/build/plugins/TestNamePattern.js | 70 + .../core/build/plugins/TestPathPattern.js | 70 + .../core/build/plugins/UpdateSnapshots.js | 51 + .../plugins/UpdateSnapshotsInteractive.js | 99 + .../@jest/core/build/runGlobalHook.js | 133 + node_modules/@jest/core/build/runJest.js | 391 + .../@jest/core/build/testSchedulerHelper.js | 57 + node_modules/@jest/core/build/types.js | 1 + node_modules/@jest/core/build/version.js | 18 + node_modules/@jest/core/build/watch.js | 666 + node_modules/@jest/core/package.json | 102 + node_modules/@jest/environment/LICENSE | 21 + .../@jest/environment/build/index.d.ts | 418 + node_modules/@jest/environment/build/index.js | 1 + node_modules/@jest/environment/package.json | 32 + node_modules/@jest/expect-utils/LICENSE | 21 + node_modules/@jest/expect-utils/README.md | 5 + .../expect-utils/build/immutableUtils.js | 66 + .../@jest/expect-utils/build/index.d.ts | 94 + .../@jest/expect-utils/build/index.js | 34 + .../@jest/expect-utils/build/jasmineUtils.js | 218 + .../@jest/expect-utils/build/types.js | 1 + .../@jest/expect-utils/build/utils.js | 462 + node_modules/@jest/expect-utils/package.json | 35 + node_modules/@jest/expect/LICENSE | 21 + node_modules/@jest/expect/README.md | 5 + node_modules/@jest/expect/build/index.d.ts | 68 + node_modules/@jest/expect/build/index.js | 40 + node_modules/@jest/expect/build/types.js | 1 + node_modules/@jest/expect/package.json | 34 + node_modules/@jest/fake-timers/LICENSE | 21 + .../@jest/fake-timers/build/index.d.ts | 110 + node_modules/@jest/fake-timers/build/index.js | 22 + .../fake-timers/build/legacyFakeTimers.js | 545 + .../fake-timers/build/modernFakeTimers.js | 191 + node_modules/@jest/fake-timers/package.json | 38 + node_modules/@jest/globals/LICENSE | 21 + node_modules/@jest/globals/build/index.d.ts | 71 + node_modules/@jest/globals/build/index.js | 14 + node_modules/@jest/globals/package.json | 32 + node_modules/@jest/reporters/LICENSE | 21 + .../@jest/reporters/assets/jest_logo.png | Bin 0 -> 3030 bytes .../@jest/reporters/build/BaseReporter.js | 48 + .../@jest/reporters/build/CoverageReporter.js | 561 + .../@jest/reporters/build/CoverageWorker.js | 89 + .../@jest/reporters/build/DefaultReporter.js | 229 + .../reporters/build/GitHubActionsReporter.js | 381 + .../@jest/reporters/build/NotifyReporter.js | 218 + node_modules/@jest/reporters/build/Status.js | 214 + .../@jest/reporters/build/SummaryReporter.js | 239 + .../@jest/reporters/build/VerboseReporter.js | 175 + .../@jest/reporters/build/formatTestPath.js | 84 + .../reporters/build/generateEmptyCoverage.js | 151 + .../@jest/reporters/build/getResultHeader.js | 65 + .../reporters/build/getSnapshotStatus.js | 92 + .../reporters/build/getSnapshotSummary.js | 169 + .../@jest/reporters/build/getSummary.js | 206 + .../@jest/reporters/build/getWatermarks.js | 38 + node_modules/@jest/reporters/build/index.d.ts | 325 + node_modules/@jest/reporters/build/index.js | 88 + .../@jest/reporters/build/printDisplayName.js | 35 + .../@jest/reporters/build/relativePath.js | 72 + .../reporters/build/trimAndFormatPath.js | 118 + node_modules/@jest/reporters/build/types.js | 1 + .../@jest/reporters/build/wrapAnsiString.js | 69 + node_modules/@jest/reporters/package.json | 82 + node_modules/@jest/schemas/LICENSE | 21 + node_modules/@jest/schemas/README.md | 3 + node_modules/@jest/schemas/build/index.d.ts | 63 + node_modules/@jest/schemas/build/index.js | 60 + node_modules/@jest/schemas/package.json | 29 + node_modules/@jest/source-map/LICENSE | 21 + .../@jest/source-map/build/getCallsite.js | 85 + .../@jest/source-map/build/index.d.ts | 16 + node_modules/@jest/source-map/build/index.js | 15 + node_modules/@jest/source-map/build/types.js | 1 + node_modules/@jest/source-map/package.json | 34 + node_modules/@jest/test-result/LICENSE | 21 + .../test-result/build/formatTestResults.js | 69 + .../@jest/test-result/build/helpers.js | 175 + .../@jest/test-result/build/index.d.ts | 232 + node_modules/@jest/test-result/build/index.js | 40 + node_modules/@jest/test-result/build/types.js | 1 + node_modules/@jest/test-result/package.json | 36 + node_modules/@jest/test-sequencer/LICENSE | 21 + .../@jest/test-sequencer/build/index.d.ts | 91 + .../@jest/test-sequencer/build/index.js | 287 + .../@jest/test-sequencer/package.json | 36 + node_modules/@jest/transform/LICENSE | 21 + .../transform/build/ScriptTransformer.js | 1000 ++ .../build/enhanceUnexpectedTokenMessage.js | 76 + node_modules/@jest/transform/build/index.d.ts | 240 + node_modules/@jest/transform/build/index.js | 37 + .../build/runtimeErrorsAndWarnings.js | 94 + .../@jest/transform/build/shouldInstrument.js | 177 + node_modules/@jest/transform/build/types.js | 1 + node_modules/@jest/transform/package.json | 52 + node_modules/@jest/types/LICENSE | 21 + node_modules/@jest/types/README.md | 30 + node_modules/@jest/types/build/Circus.js | 1 + node_modules/@jest/types/build/Config.js | 1 + node_modules/@jest/types/build/Global.js | 1 + node_modules/@jest/types/build/TestResult.js | 1 + node_modules/@jest/types/build/Transform.js | 1 + node_modules/@jest/types/build/index.d.ts | 1204 ++ node_modules/@jest/types/build/index.js | 1 + node_modules/@jest/types/package.json | 38 + node_modules/@jridgewell/gen-mapping/LICENSE | 19 + .../@jridgewell/gen-mapping/README.md | 227 + .../gen-mapping/dist/gen-mapping.mjs | 230 + .../gen-mapping/dist/gen-mapping.mjs.map | 1 + .../gen-mapping/dist/gen-mapping.umd.js | 236 + .../gen-mapping/dist/gen-mapping.umd.js.map | 1 + .../gen-mapping/dist/types/gen-mapping.d.ts | 90 + .../dist/types/sourcemap-segment.d.ts | 12 + .../gen-mapping/dist/types/types.d.ts | 35 + .../@jridgewell/gen-mapping/package.json | 77 + node_modules/@jridgewell/resolve-uri/LICENSE | 19 + .../@jridgewell/resolve-uri/README.md | 40 + .../resolve-uri/dist/resolve-uri.mjs | 242 + .../resolve-uri/dist/resolve-uri.mjs.map | 1 + .../resolve-uri/dist/resolve-uri.umd.js | 250 + .../resolve-uri/dist/resolve-uri.umd.js.map | 1 + .../resolve-uri/dist/types/resolve-uri.d.ts | 4 + .../@jridgewell/resolve-uri/package.json | 69 + node_modules/@jridgewell/set-array/LICENSE | 19 + node_modules/@jridgewell/set-array/README.md | 37 + .../@jridgewell/set-array/dist/set-array.mjs | 48 + .../set-array/dist/set-array.mjs.map | 1 + .../set-array/dist/set-array.umd.js | 58 + .../set-array/dist/set-array.umd.js.map | 1 + .../set-array/dist/types/set-array.d.ts | 26 + .../@jridgewell/set-array/package.json | 66 + .../@jridgewell/set-array/src/set-array.ts | 55 + .../@jridgewell/sourcemap-codec/LICENSE | 21 + .../@jridgewell/sourcemap-codec/README.md | 200 + .../sourcemap-codec/dist/sourcemap-codec.mjs | 164 + .../dist/sourcemap-codec.mjs.map | 1 + .../dist/sourcemap-codec.umd.js | 175 + .../dist/sourcemap-codec.umd.js.map | 1 + .../dist/types/sourcemap-codec.d.ts | 6 + .../@jridgewell/sourcemap-codec/package.json | 74 + .../@jridgewell/trace-mapping/LICENSE | 19 + .../@jridgewell/trace-mapping/README.md | 252 + .../trace-mapping/dist/trace-mapping.mjs | 552 + .../trace-mapping/dist/trace-mapping.mjs.map | 1 + .../trace-mapping/dist/trace-mapping.umd.js | 566 + .../dist/trace-mapping.umd.js.map | 1 + .../trace-mapping/dist/types/any-map.d.ts | 8 + .../dist/types/binary-search.d.ts | 32 + .../trace-mapping/dist/types/by-source.d.ts | 7 + .../trace-mapping/dist/types/resolve.d.ts | 1 + .../trace-mapping/dist/types/sort.d.ts | 2 + .../dist/types/sourcemap-segment.d.ts | 16 + .../dist/types/strip-filename.d.ts | 4 + .../dist/types/trace-mapping.d.ts | 74 + .../trace-mapping/dist/types/types.d.ts | 92 + .../@jridgewell/trace-mapping/package.json | 75 + .../@sinclair/typebox/compiler/compiler.d.ts | 35 + .../@sinclair/typebox/compiler/compiler.js | 577 + .../@sinclair/typebox/compiler/index.d.ts | 2 + .../@sinclair/typebox/compiler/index.js | 47 + .../@sinclair/typebox/errors/errors.d.ts | 88 + .../@sinclair/typebox/errors/errors.js | 609 + .../@sinclair/typebox/errors/index.d.ts | 1 + .../@sinclair/typebox/errors/index.js | 44 + node_modules/@sinclair/typebox/license | 23 + node_modules/@sinclair/typebox/package.json | 47 + node_modules/@sinclair/typebox/readme.md | 1424 ++ .../@sinclair/typebox/system/index.d.ts | 1 + .../@sinclair/typebox/system/index.js | 44 + .../@sinclair/typebox/system/system.d.ts | 26 + .../@sinclair/typebox/system/system.js | 90 + node_modules/@sinclair/typebox/typebox.d.ts | 723 + node_modules/@sinclair/typebox/typebox.js | 2220 +++ .../@sinclair/typebox/value/cast.d.ts | 30 + node_modules/@sinclair/typebox/value/cast.js | 372 + .../@sinclair/typebox/value/check.d.ts | 12 + node_modules/@sinclair/typebox/value/check.js | 484 + .../@sinclair/typebox/value/clone.d.ts | 3 + node_modules/@sinclair/typebox/value/clone.js | 71 + .../@sinclair/typebox/value/convert.d.ts | 13 + .../@sinclair/typebox/value/convert.js | 372 + .../@sinclair/typebox/value/create.d.ts | 26 + .../@sinclair/typebox/value/create.js | 480 + .../@sinclair/typebox/value/delta.d.ts | 43 + node_modules/@sinclair/typebox/value/delta.js | 204 + .../@sinclair/typebox/value/equal.d.ts | 3 + node_modules/@sinclair/typebox/value/equal.js | 80 + .../@sinclair/typebox/value/hash.d.ts | 8 + node_modules/@sinclair/typebox/value/hash.js | 208 + .../@sinclair/typebox/value/index.d.ts | 6 + node_modules/@sinclair/typebox/value/index.js | 56 + node_modules/@sinclair/typebox/value/is.d.ts | 11 + node_modules/@sinclair/typebox/value/is.js | 53 + .../@sinclair/typebox/value/mutate.d.ts | 13 + .../@sinclair/typebox/value/mutate.js | 121 + .../@sinclair/typebox/value/pointer.d.ts | 24 + .../@sinclair/typebox/value/pointer.js | 142 + .../@sinclair/typebox/value/value.d.ts | 39 + node_modules/@sinclair/typebox/value/value.js | 99 + node_modules/@sinonjs/commons/LICENSE | 29 + node_modules/@sinonjs/commons/README.md | 16 + .../@sinonjs/commons/lib/called-in-order.js | 57 + .../commons/lib/called-in-order.test.js | 121 + .../@sinonjs/commons/lib/class-name.js | 27 + .../@sinonjs/commons/lib/class-name.test.js | 37 + .../@sinonjs/commons/lib/deprecated.js | 51 + .../@sinonjs/commons/lib/deprecated.test.js | 101 + node_modules/@sinonjs/commons/lib/every.js | 27 + .../@sinonjs/commons/lib/every.test.js | 41 + .../@sinonjs/commons/lib/function-name.js | 29 + .../commons/lib/function-name.test.js | 76 + node_modules/@sinonjs/commons/lib/global.js | 22 + .../@sinonjs/commons/lib/global.test.js | 16 + node_modules/@sinonjs/commons/lib/index.js | 14 + .../@sinonjs/commons/lib/index.test.js | 31 + .../commons/lib/order-by-first-call.js | 36 + .../commons/lib/order-by-first-call.test.js | 52 + .../@sinonjs/commons/lib/prototypes/README.md | 43 + .../@sinonjs/commons/lib/prototypes/array.js | 5 + .../lib/prototypes/copy-prototype-methods.js | 40 + .../prototypes/copy-prototype-methods.test.js | 12 + .../commons/lib/prototypes/function.js | 5 + .../@sinonjs/commons/lib/prototypes/index.js | 10 + .../commons/lib/prototypes/index.test.js | 61 + .../@sinonjs/commons/lib/prototypes/map.js | 5 + .../@sinonjs/commons/lib/prototypes/object.js | 5 + .../@sinonjs/commons/lib/prototypes/set.js | 5 + .../@sinonjs/commons/lib/prototypes/string.js | 5 + .../commons/lib/prototypes/throws-on-proto.js | 26 + node_modules/@sinonjs/commons/lib/type-of.js | 13 + .../@sinonjs/commons/lib/type-of.test.js | 51 + .../@sinonjs/commons/lib/value-to-string.js | 17 + .../commons/lib/value-to-string.test.js | 20 + node_modules/@sinonjs/commons/package.json | 57 + .../commons/types/called-in-order.d.ts | 36 + .../@sinonjs/commons/types/class-name.d.ts | 8 + .../@sinonjs/commons/types/deprecated.d.ts | 3 + .../@sinonjs/commons/types/every.d.ts | 2 + .../@sinonjs/commons/types/function-name.d.ts | 2 + .../@sinonjs/commons/types/global.d.ts | 7 + .../@sinonjs/commons/types/index.d.ts | 17 + .../commons/types/order-by-first-call.d.ts | 26 + .../commons/types/prototypes/array.d.ts | 2 + .../prototypes/copy-prototype-methods.d.ts | 2 + .../commons/types/prototypes/function.d.ts | 2 + .../commons/types/prototypes/index.d.ts | 7 + .../commons/types/prototypes/map.d.ts | 2 + .../commons/types/prototypes/object.d.ts | 2 + .../commons/types/prototypes/set.d.ts | 2 + .../commons/types/prototypes/string.d.ts | 2 + .../types/prototypes/throws-on-proto.d.ts | 12 + .../@sinonjs/commons/types/type-of.d.ts | 2 + .../commons/types/value-to-string.d.ts | 8 + node_modules/@sinonjs/fake-timers/LICENSE | 11 + node_modules/@sinonjs/fake-timers/README.md | 358 + .../@sinonjs/fake-timers/package.json | 65 + .../fake-timers/src/fake-timers-src.js | 1787 ++ node_modules/@types/babel__core/LICENSE | 21 + node_modules/@types/babel__core/README.md | 16 + node_modules/@types/babel__core/index.d.ts | 840 + node_modules/@types/babel__core/package.json | 51 + node_modules/@types/babel__generator/LICENSE | 21 + .../@types/babel__generator/README.md | 16 + .../@types/babel__generator/index.d.ts | 211 + .../@types/babel__generator/package.json | 42 + node_modules/@types/babel__template/LICENSE | 21 + node_modules/@types/babel__template/README.md | 16 + .../@types/babel__template/index.d.ts | 100 + .../@types/babel__template/package.json | 43 + node_modules/@types/babel__traverse/LICENSE | 21 + node_modules/@types/babel__traverse/README.md | 16 + .../@types/babel__traverse/index.d.ts | 1484 ++ .../@types/babel__traverse/package.json | 62 + node_modules/@types/graceful-fs/LICENSE | 21 + node_modules/@types/graceful-fs/README.md | 38 + node_modules/@types/graceful-fs/index.d.ts | 18 + node_modules/@types/graceful-fs/package.json | 32 + .../@types/istanbul-lib-coverage/LICENSE | 21 + .../@types/istanbul-lib-coverage/README.md | 16 + .../@types/istanbul-lib-coverage/index.d.ts | 117 + .../@types/istanbul-lib-coverage/package.json | 25 + .../@types/istanbul-lib-report/LICENSE | 21 + .../@types/istanbul-lib-report/README.md | 16 + .../@types/istanbul-lib-report/index.d.ts | 191 + .../@types/istanbul-lib-report/package.json | 32 + node_modules/@types/istanbul-reports/LICENSE | 21 + .../@types/istanbul-reports/README.md | 94 + .../@types/istanbul-reports/index.d.ts | 74 + .../@types/istanbul-reports/package.json | 32 + node_modules/@types/stack-utils/LICENSE | 21 + node_modules/@types/stack-utils/README.md | 85 + node_modules/@types/stack-utils/index.d.ts | 65 + node_modules/@types/stack-utils/package.json | 25 + node_modules/@types/yargs-parser/LICENSE | 21 + node_modules/@types/yargs-parser/README.md | 16 + node_modules/@types/yargs-parser/index.d.ts | 118 + node_modules/@types/yargs-parser/package.json | 25 + node_modules/@types/yargs/LICENSE | 21 + node_modules/@types/yargs/README.md | 16 + node_modules/@types/yargs/helpers.d.mts | 1 + node_modules/@types/yargs/helpers.d.ts | 5 + node_modules/@types/yargs/index.d.mts | 46 + node_modules/@types/yargs/index.d.ts | 1044 ++ node_modules/@types/yargs/package.json | 87 + node_modules/@types/yargs/yargs.d.ts | 9 + node_modules/ansi-escapes/index.d.ts | 248 + node_modules/ansi-escapes/index.js | 157 + node_modules/ansi-escapes/license | 9 + node_modules/ansi-escapes/package.json | 57 + node_modules/ansi-escapes/readme.md | 245 + node_modules/ansi-regex/index.d.ts | 37 + node_modules/ansi-regex/index.js | 10 + node_modules/ansi-regex/license | 9 + node_modules/ansi-regex/package.json | 55 + node_modules/ansi-regex/readme.md | 78 + node_modules/ansi-styles/index.d.ts | 345 + node_modules/ansi-styles/index.js | 163 + node_modules/ansi-styles/license | 9 + node_modules/ansi-styles/package.json | 56 + node_modules/ansi-styles/readme.md | 152 + 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/argparse/CHANGELOG.md | 185 + node_modules/argparse/LICENSE | 21 + node_modules/argparse/README.md | 257 + node_modules/argparse/index.js | 3 + node_modules/argparse/lib/action.js | 146 + node_modules/argparse/lib/action/append.js | 53 + .../argparse/lib/action/append/constant.js | 47 + node_modules/argparse/lib/action/count.js | 40 + node_modules/argparse/lib/action/help.js | 47 + node_modules/argparse/lib/action/store.js | 50 + .../argparse/lib/action/store/constant.js | 43 + .../argparse/lib/action/store/false.js | 27 + .../argparse/lib/action/store/true.js | 26 + .../argparse/lib/action/subparsers.js | 149 + node_modules/argparse/lib/action/version.js | 47 + node_modules/argparse/lib/action_container.js | 482 + node_modules/argparse/lib/argparse.js | 14 + node_modules/argparse/lib/argument/error.js | 50 + .../argparse/lib/argument/exclusive.js | 54 + node_modules/argparse/lib/argument/group.js | 75 + node_modules/argparse/lib/argument_parser.js | 1161 ++ node_modules/argparse/lib/const.js | 21 + .../argparse/lib/help/added_formatters.js | 87 + node_modules/argparse/lib/help/formatter.js | 795 + node_modules/argparse/lib/namespace.js | 76 + node_modules/argparse/lib/utils.js | 57 + node_modules/argparse/package.json | 34 + node_modules/babel-jest/LICENSE | 21 + node_modules/babel-jest/README.md | 25 + node_modules/babel-jest/build/index.d.ts | 24 + node_modules/babel-jest/build/index.js | 323 + .../babel-jest/build/loadBabelConfig.js | 24 + node_modules/babel-jest/package.json | 44 + .../babel-plugin-istanbul/CHANGELOG.md | 320 + node_modules/babel-plugin-istanbul/LICENSE | 27 + node_modules/babel-plugin-istanbul/README.md | 135 + .../babel-plugin-istanbul/lib/index.js | 170 + .../lib/load-nyc-config-sync.js | 20 + .../istanbul-lib-instrument/CHANGELOG.md | 631 + .../istanbul-lib-instrument/LICENSE | 24 + .../istanbul-lib-instrument/README.md | 22 + .../istanbul-lib-instrument/package.json | 50 + .../istanbul-lib-instrument/src/constants.js | 14 + .../istanbul-lib-instrument/src/index.js | 21 + .../src/instrumenter.js | 162 + .../src/read-coverage.js | 77 + .../src/source-coverage.js | 135 + .../istanbul-lib-instrument/src/visitor.js | 843 + .../babel-plugin-istanbul/package.json | 71 + node_modules/babel-plugin-jest-hoist/LICENSE | 21 + .../babel-plugin-jest-hoist/README.md | 33 + .../babel-plugin-jest-hoist/build/index.d.ts | 16 + .../babel-plugin-jest-hoist/build/index.js | 367 + .../babel-plugin-jest-hoist/package.json | 42 + .../babel-preset-current-node-syntax/LICENSE | 22 + .../README.md | 30 + .../package.json | 41 + .../scripts/check-yarn-bug.sh | 5 + .../src/index.js | 57 + node_modules/babel-preset-jest/LICENSE | 21 + node_modules/babel-preset-jest/README.md | 33 + node_modules/babel-preset-jest/index.js | 14 + node_modules/babel-preset-jest/package.json | 29 + .../balanced-match/.github/FUNDING.yml | 2 + node_modules/balanced-match/LICENSE.md | 21 + node_modules/balanced-match/README.md | 97 + node_modules/balanced-match/index.js | 62 + node_modules/balanced-match/package.json | 48 + node_modules/brace-expansion/LICENSE | 21 + node_modules/brace-expansion/README.md | 129 + node_modules/brace-expansion/index.js | 201 + node_modules/brace-expansion/package.json | 47 + node_modules/braces/CHANGELOG.md | 184 + node_modules/braces/LICENSE | 21 + node_modules/braces/README.md | 593 + node_modules/braces/index.js | 170 + node_modules/braces/lib/compile.js | 57 + node_modules/braces/lib/constants.js | 57 + node_modules/braces/lib/expand.js | 113 + node_modules/braces/lib/parse.js | 333 + node_modules/braces/lib/stringify.js | 32 + node_modules/braces/lib/utils.js | 112 + node_modules/braces/package.json | 77 + node_modules/browserslist/LICENSE | 20 + node_modules/browserslist/README.md | 73 + node_modules/browserslist/browser.js | 52 + node_modules/browserslist/cli.js | 156 + node_modules/browserslist/error.d.ts | 7 + node_modules/browserslist/error.js | 12 + node_modules/browserslist/index.d.ts | 200 + node_modules/browserslist/index.js | 1197 ++ node_modules/browserslist/node.js | 410 + node_modules/browserslist/package.json | 44 + node_modules/browserslist/parse.js | 78 + node_modules/bser/README.md | 81 + node_modules/bser/index.js | 586 + node_modules/bser/package.json | 33 + node_modules/buffer-from/LICENSE | 21 + node_modules/buffer-from/index.js | 72 + node_modules/buffer-from/package.json | 19 + node_modules/buffer-from/readme.md | 69 + node_modules/callsites/index.d.ts | 96 + node_modules/callsites/index.js | 13 + node_modules/callsites/license | 9 + node_modules/callsites/package.json | 39 + node_modules/callsites/readme.md | 48 + node_modules/camelcase/index.d.ts | 63 + node_modules/camelcase/index.js | 76 + node_modules/camelcase/license | 9 + node_modules/camelcase/package.json | 43 + node_modules/camelcase/readme.md | 99 + node_modules/caniuse-lite/LICENSE | 395 + node_modules/caniuse-lite/README.md | 6 + node_modules/caniuse-lite/data/agents.js | 1 + .../caniuse-lite/data/browserVersions.js | 1 + node_modules/caniuse-lite/data/browsers.js | 1 + node_modules/caniuse-lite/data/features.js | 1 + .../caniuse-lite/data/features/aac.js | 1 + .../data/features/abortcontroller.js | 1 + .../caniuse-lite/data/features/ac3-ec3.js | 1 + .../data/features/accelerometer.js | 1 + .../data/features/addeventlistener.js | 1 + .../data/features/alternate-stylesheet.js | 1 + .../data/features/ambient-light.js | 1 + .../caniuse-lite/data/features/apng.js | 1 + .../data/features/array-find-index.js | 1 + .../caniuse-lite/data/features/array-find.js | 1 + .../caniuse-lite/data/features/array-flat.js | 1 + .../data/features/array-includes.js | 1 + .../data/features/arrow-functions.js | 1 + .../caniuse-lite/data/features/asmjs.js | 1 + .../data/features/async-clipboard.js | 1 + .../data/features/async-functions.js | 1 + .../caniuse-lite/data/features/atob-btoa.js | 1 + .../caniuse-lite/data/features/audio-api.js | 1 + .../caniuse-lite/data/features/audio.js | 1 + .../caniuse-lite/data/features/audiotracks.js | 1 + .../caniuse-lite/data/features/autofocus.js | 1 + .../caniuse-lite/data/features/auxclick.js | 1 + .../caniuse-lite/data/features/av1.js | 1 + .../caniuse-lite/data/features/avif.js | 1 + .../data/features/background-attachment.js | 1 + .../data/features/background-clip-text.js | 1 + .../data/features/background-img-opts.js | 1 + .../data/features/background-position-x-y.js | 1 + .../features/background-repeat-round-space.js | 1 + .../data/features/background-sync.js | 1 + .../data/features/battery-status.js | 1 + .../caniuse-lite/data/features/beacon.js | 1 + .../data/features/beforeafterprint.js | 1 + .../caniuse-lite/data/features/bigint.js | 1 + .../caniuse-lite/data/features/blobbuilder.js | 1 + .../caniuse-lite/data/features/bloburls.js | 1 + .../data/features/border-image.js | 1 + .../data/features/border-radius.js | 1 + .../data/features/broadcastchannel.js | 1 + .../caniuse-lite/data/features/brotli.js | 1 + .../caniuse-lite/data/features/calc.js | 1 + .../data/features/canvas-blending.js | 1 + .../caniuse-lite/data/features/canvas-text.js | 1 + .../caniuse-lite/data/features/canvas.js | 1 + .../caniuse-lite/data/features/ch-unit.js | 1 + .../data/features/chacha20-poly1305.js | 1 + .../data/features/channel-messaging.js | 1 + .../data/features/childnode-remove.js | 1 + .../caniuse-lite/data/features/classlist.js | 1 + .../client-hints-dpr-width-viewport.js | 1 + .../caniuse-lite/data/features/clipboard.js | 1 + .../caniuse-lite/data/features/colr-v1.js | 1 + .../caniuse-lite/data/features/colr.js | 1 + .../data/features/comparedocumentposition.js | 1 + .../data/features/console-basic.js | 1 + .../data/features/console-time.js | 1 + .../caniuse-lite/data/features/const.js | 1 + .../data/features/constraint-validation.js | 1 + .../data/features/contenteditable.js | 1 + .../data/features/contentsecuritypolicy.js | 1 + .../data/features/contentsecuritypolicy2.js | 1 + .../data/features/cookie-store-api.js | 1 + .../caniuse-lite/data/features/cors.js | 1 + .../data/features/createimagebitmap.js | 1 + .../data/features/credential-management.js | 1 + .../data/features/cryptography.js | 1 + .../caniuse-lite/data/features/css-all.js | 1 + .../data/features/css-anchor-positioning.js | 1 + .../data/features/css-animation.js | 1 + .../data/features/css-any-link.js | 1 + .../data/features/css-appearance.js | 1 + .../data/features/css-at-counter-style.js | 1 + .../data/features/css-autofill.js | 1 + .../data/features/css-backdrop-filter.js | 1 + .../data/features/css-background-offsets.js | 1 + .../data/features/css-backgroundblendmode.js | 1 + .../data/features/css-boxdecorationbreak.js | 1 + .../data/features/css-boxshadow.js | 1 + .../caniuse-lite/data/features/css-canvas.js | 1 + .../data/features/css-caret-color.js | 1 + .../data/features/css-cascade-layers.js | 1 + .../data/features/css-cascade-scope.js | 1 + .../data/features/css-case-insensitive.js | 1 + .../data/features/css-clip-path.js | 1 + .../data/features/css-color-adjust.js | 1 + .../data/features/css-color-function.js | 1 + .../data/features/css-conic-gradients.js | 1 + .../features/css-container-queries-style.js | 1 + .../data/features/css-container-queries.js | 1 + .../features/css-container-query-units.js | 1 + .../data/features/css-containment.js | 1 + .../data/features/css-content-visibility.js | 1 + .../data/features/css-counters.js | 1 + .../data/features/css-crisp-edges.js | 1 + .../data/features/css-cross-fade.js | 1 + .../data/features/css-default-pseudo.js | 1 + .../data/features/css-descendant-gtgt.js | 1 + .../data/features/css-deviceadaptation.js | 1 + .../data/features/css-dir-pseudo.js | 1 + .../data/features/css-display-contents.js | 1 + .../data/features/css-element-function.js | 1 + .../data/features/css-env-function.js | 1 + .../data/features/css-exclusions.js | 1 + .../data/features/css-featurequeries.js | 1 + .../data/features/css-file-selector-button.js | 1 + .../data/features/css-filter-function.js | 1 + .../caniuse-lite/data/features/css-filters.js | 1 + .../data/features/css-first-letter.js | 1 + .../data/features/css-first-line.js | 1 + .../caniuse-lite/data/features/css-fixed.js | 1 + .../data/features/css-focus-visible.js | 1 + .../data/features/css-focus-within.js | 1 + .../data/features/css-font-palette.js | 1 + .../features/css-font-rendering-controls.js | 1 + .../data/features/css-font-stretch.js | 1 + .../data/features/css-gencontent.js | 1 + .../data/features/css-gradients.js | 1 + .../data/features/css-grid-animation.js | 1 + .../caniuse-lite/data/features/css-grid.js | 1 + .../data/features/css-hanging-punctuation.js | 1 + .../caniuse-lite/data/features/css-has.js | 1 + .../caniuse-lite/data/features/css-hyphens.js | 1 + .../data/features/css-image-orientation.js | 1 + .../data/features/css-image-set.js | 1 + .../data/features/css-in-out-of-range.js | 1 + .../data/features/css-indeterminate-pseudo.js | 1 + .../data/features/css-initial-letter.js | 1 + .../data/features/css-initial-value.js | 1 + .../caniuse-lite/data/features/css-lch-lab.js | 1 + .../data/features/css-letter-spacing.js | 1 + .../data/features/css-line-clamp.js | 1 + .../data/features/css-logical-props.js | 1 + .../data/features/css-marker-pseudo.js | 1 + .../caniuse-lite/data/features/css-masks.js | 1 + .../data/features/css-matches-pseudo.js | 1 + .../data/features/css-math-functions.js | 1 + .../data/features/css-media-interaction.js | 1 + .../data/features/css-media-range-syntax.js | 1 + .../data/features/css-media-resolution.js | 1 + .../data/features/css-media-scripting.js | 1 + .../data/features/css-mediaqueries.js | 1 + .../data/features/css-mixblendmode.js | 1 + .../data/features/css-motion-paths.js | 1 + .../data/features/css-namespaces.js | 1 + .../caniuse-lite/data/features/css-nesting.js | 1 + .../data/features/css-not-sel-list.js | 1 + .../data/features/css-nth-child-of.js | 1 + .../caniuse-lite/data/features/css-opacity.js | 1 + .../data/features/css-optional-pseudo.js | 1 + .../data/features/css-overflow-anchor.js | 1 + .../data/features/css-overflow-overlay.js | 1 + .../data/features/css-overflow.js | 1 + .../data/features/css-overscroll-behavior.js | 1 + .../data/features/css-page-break.js | 1 + .../data/features/css-paged-media.js | 1 + .../data/features/css-paint-api.js | 1 + .../data/features/css-placeholder-shown.js | 1 + .../data/features/css-placeholder.js | 1 + .../data/features/css-print-color-adjust.js | 1 + .../data/features/css-read-only-write.js | 1 + .../data/features/css-rebeccapurple.js | 1 + .../data/features/css-reflections.js | 1 + .../caniuse-lite/data/features/css-regions.js | 1 + .../data/features/css-relative-colors.js | 1 + .../data/features/css-repeating-gradients.js | 1 + .../caniuse-lite/data/features/css-resize.js | 1 + .../data/features/css-revert-value.js | 1 + .../data/features/css-rrggbbaa.js | 1 + .../data/features/css-scroll-behavior.js | 1 + .../data/features/css-scroll-timeline.js | 1 + .../data/features/css-scrollbar.js | 1 + .../caniuse-lite/data/features/css-sel2.js | 1 + .../caniuse-lite/data/features/css-sel3.js | 1 + .../data/features/css-selection.js | 1 + .../caniuse-lite/data/features/css-shapes.js | 1 + .../data/features/css-snappoints.js | 1 + .../caniuse-lite/data/features/css-sticky.js | 1 + .../caniuse-lite/data/features/css-subgrid.js | 1 + .../data/features/css-supports-api.js | 1 + .../caniuse-lite/data/features/css-table.js | 1 + .../data/features/css-text-align-last.js | 1 + .../data/features/css-text-box-trim.js | 1 + .../data/features/css-text-indent.js | 1 + .../data/features/css-text-justify.js | 1 + .../data/features/css-text-orientation.js | 1 + .../data/features/css-text-spacing.js | 1 + .../data/features/css-text-wrap-balance.js | 1 + .../data/features/css-textshadow.js | 1 + .../data/features/css-touch-action.js | 1 + .../data/features/css-transitions.js | 1 + .../data/features/css-unicode-bidi.js | 1 + .../data/features/css-unset-value.js | 1 + .../data/features/css-variables.js | 1 + .../data/features/css-when-else.js | 1 + .../data/features/css-widows-orphans.js | 1 + .../data/features/css-width-stretch.js | 1 + .../data/features/css-writing-mode.js | 1 + .../caniuse-lite/data/features/css-zoom.js | 1 + .../caniuse-lite/data/features/css3-attr.js | 1 + .../data/features/css3-boxsizing.js | 1 + .../caniuse-lite/data/features/css3-colors.js | 1 + .../data/features/css3-cursors-grab.js | 1 + .../data/features/css3-cursors-newer.js | 1 + .../data/features/css3-cursors.js | 1 + .../data/features/css3-tabsize.js | 1 + .../data/features/currentcolor.js | 1 + .../data/features/custom-elements.js | 1 + .../data/features/custom-elementsv1.js | 1 + .../caniuse-lite/data/features/customevent.js | 1 + .../caniuse-lite/data/features/datalist.js | 1 + .../caniuse-lite/data/features/dataset.js | 1 + .../caniuse-lite/data/features/datauri.js | 1 + .../data/features/date-tolocaledatestring.js | 1 + .../data/features/declarative-shadow-dom.js | 1 + .../caniuse-lite/data/features/decorators.js | 1 + .../caniuse-lite/data/features/details.js | 1 + .../data/features/deviceorientation.js | 1 + .../data/features/devicepixelratio.js | 1 + .../caniuse-lite/data/features/dialog.js | 1 + .../data/features/dispatchevent.js | 1 + .../caniuse-lite/data/features/dnssec.js | 1 + .../data/features/do-not-track.js | 1 + .../data/features/document-currentscript.js | 1 + .../data/features/document-evaluate-xpath.js | 1 + .../data/features/document-execcommand.js | 1 + .../data/features/document-policy.js | 1 + .../features/document-scrollingelement.js | 1 + .../data/features/documenthead.js | 1 + .../data/features/dom-manip-convenience.js | 1 + .../caniuse-lite/data/features/dom-range.js | 1 + .../data/features/domcontentloaded.js | 1 + .../caniuse-lite/data/features/dommatrix.js | 1 + .../caniuse-lite/data/features/download.js | 1 + .../caniuse-lite/data/features/dragndrop.js | 1 + .../data/features/element-closest.js | 1 + .../data/features/element-from-point.js | 1 + .../data/features/element-scroll-methods.js | 1 + .../caniuse-lite/data/features/eme.js | 1 + .../caniuse-lite/data/features/eot.js | 1 + .../caniuse-lite/data/features/es5.js | 1 + .../caniuse-lite/data/features/es6-class.js | 1 + .../data/features/es6-generators.js | 1 + .../features/es6-module-dynamic-import.js | 1 + .../caniuse-lite/data/features/es6-module.js | 1 + .../caniuse-lite/data/features/es6-number.js | 1 + .../data/features/es6-string-includes.js | 1 + .../caniuse-lite/data/features/es6.js | 1 + .../caniuse-lite/data/features/eventsource.js | 1 + .../data/features/extended-system-fonts.js | 1 + .../data/features/feature-policy.js | 1 + .../caniuse-lite/data/features/fetch.js | 1 + .../data/features/fieldset-disabled.js | 1 + .../caniuse-lite/data/features/fileapi.js | 1 + .../caniuse-lite/data/features/filereader.js | 1 + .../data/features/filereadersync.js | 1 + .../caniuse-lite/data/features/filesystem.js | 1 + .../caniuse-lite/data/features/flac.js | 1 + .../caniuse-lite/data/features/flexbox-gap.js | 1 + .../caniuse-lite/data/features/flexbox.js | 1 + .../caniuse-lite/data/features/flow-root.js | 1 + .../data/features/focusin-focusout-events.js | 1 + .../data/features/font-family-system-ui.js | 1 + .../data/features/font-feature.js | 1 + .../data/features/font-kerning.js | 1 + .../data/features/font-loading.js | 1 + .../data/features/font-size-adjust.js | 1 + .../caniuse-lite/data/features/font-smooth.js | 1 + .../data/features/font-unicode-range.js | 1 + .../data/features/font-variant-alternates.js | 1 + .../data/features/font-variant-numeric.js | 1 + .../caniuse-lite/data/features/fontface.js | 1 + .../data/features/form-attribute.js | 1 + .../data/features/form-submit-attributes.js | 1 + .../data/features/form-validation.js | 1 + .../caniuse-lite/data/features/forms.js | 1 + .../caniuse-lite/data/features/fullscreen.js | 1 + .../caniuse-lite/data/features/gamepad.js | 1 + .../caniuse-lite/data/features/geolocation.js | 1 + .../data/features/getboundingclientrect.js | 1 + .../data/features/getcomputedstyle.js | 1 + .../data/features/getelementsbyclassname.js | 1 + .../data/features/getrandomvalues.js | 1 + .../caniuse-lite/data/features/gyroscope.js | 1 + .../data/features/hardwareconcurrency.js | 1 + .../caniuse-lite/data/features/hashchange.js | 1 + .../caniuse-lite/data/features/heif.js | 1 + .../caniuse-lite/data/features/hevc.js | 1 + .../caniuse-lite/data/features/hidden.js | 1 + .../data/features/high-resolution-time.js | 1 + .../caniuse-lite/data/features/history.js | 1 + .../data/features/html-media-capture.js | 1 + .../data/features/html5semantic.js | 1 + .../data/features/http-live-streaming.js | 1 + .../caniuse-lite/data/features/http2.js | 1 + .../caniuse-lite/data/features/http3.js | 1 + .../data/features/iframe-sandbox.js | 1 + .../data/features/iframe-seamless.js | 1 + .../data/features/iframe-srcdoc.js | 1 + .../data/features/imagecapture.js | 1 + .../caniuse-lite/data/features/ime.js | 1 + .../img-naturalwidth-naturalheight.js | 1 + .../caniuse-lite/data/features/import-maps.js | 1 + .../caniuse-lite/data/features/imports.js | 1 + .../data/features/indeterminate-checkbox.js | 1 + .../caniuse-lite/data/features/indexeddb.js | 1 + .../caniuse-lite/data/features/indexeddb2.js | 1 + .../data/features/inline-block.js | 1 + .../caniuse-lite/data/features/innertext.js | 1 + .../data/features/input-autocomplete-onoff.js | 1 + .../caniuse-lite/data/features/input-color.js | 1 + .../data/features/input-datetime.js | 1 + .../data/features/input-email-tel-url.js | 1 + .../caniuse-lite/data/features/input-event.js | 1 + .../data/features/input-file-accept.js | 1 + .../data/features/input-file-directory.js | 1 + .../data/features/input-file-multiple.js | 1 + .../data/features/input-inputmode.js | 1 + .../data/features/input-minlength.js | 1 + .../data/features/input-number.js | 1 + .../data/features/input-pattern.js | 1 + .../data/features/input-placeholder.js | 1 + .../caniuse-lite/data/features/input-range.js | 1 + .../data/features/input-search.js | 1 + .../data/features/input-selection.js | 1 + .../data/features/insert-adjacent.js | 1 + .../data/features/insertadjacenthtml.js | 1 + .../data/features/internationalization.js | 1 + .../data/features/intersectionobserver-v2.js | 1 + .../data/features/intersectionobserver.js | 1 + .../data/features/intl-pluralrules.js | 1 + .../data/features/intrinsic-width.js | 1 + .../caniuse-lite/data/features/jpeg2000.js | 1 + .../caniuse-lite/data/features/jpegxl.js | 1 + .../caniuse-lite/data/features/jpegxr.js | 1 + .../data/features/js-regexp-lookbehind.js | 1 + .../caniuse-lite/data/features/json.js | 1 + .../features/justify-content-space-evenly.js | 1 + .../data/features/kerning-pairs-ligatures.js | 1 + .../data/features/keyboardevent-charcode.js | 1 + .../data/features/keyboardevent-code.js | 1 + .../keyboardevent-getmodifierstate.js | 1 + .../data/features/keyboardevent-key.js | 1 + .../data/features/keyboardevent-location.js | 1 + .../data/features/keyboardevent-which.js | 1 + .../caniuse-lite/data/features/lazyload.js | 1 + .../caniuse-lite/data/features/let.js | 1 + .../data/features/link-icon-png.js | 1 + .../data/features/link-icon-svg.js | 1 + .../data/features/link-rel-dns-prefetch.js | 1 + .../data/features/link-rel-modulepreload.js | 1 + .../data/features/link-rel-preconnect.js | 1 + .../data/features/link-rel-prefetch.js | 1 + .../data/features/link-rel-preload.js | 1 + .../data/features/link-rel-prerender.js | 1 + .../data/features/loading-lazy-attr.js | 1 + .../data/features/localecompare.js | 1 + .../data/features/magnetometer.js | 1 + .../data/features/matchesselector.js | 1 + .../caniuse-lite/data/features/matchmedia.js | 1 + .../caniuse-lite/data/features/mathml.js | 1 + .../caniuse-lite/data/features/maxlength.js | 1 + .../mdn-css-backdrop-pseudo-element.js | 1 + .../mdn-css-unicode-bidi-isolate-override.js | 1 + .../features/mdn-css-unicode-bidi-isolate.js | 1 + .../mdn-css-unicode-bidi-plaintext.js | 1 + .../features/mdn-text-decoration-color.js | 1 + .../data/features/mdn-text-decoration-line.js | 1 + .../features/mdn-text-decoration-shorthand.js | 1 + .../features/mdn-text-decoration-style.js | 1 + .../data/features/media-fragments.js | 1 + .../data/features/mediacapture-fromelement.js | 1 + .../data/features/mediarecorder.js | 1 + .../caniuse-lite/data/features/mediasource.js | 1 + .../caniuse-lite/data/features/menu.js | 1 + .../data/features/meta-theme-color.js | 1 + .../caniuse-lite/data/features/meter.js | 1 + .../caniuse-lite/data/features/midi.js | 1 + .../caniuse-lite/data/features/minmaxwh.js | 1 + .../caniuse-lite/data/features/mp3.js | 1 + .../caniuse-lite/data/features/mpeg-dash.js | 1 + .../caniuse-lite/data/features/mpeg4.js | 1 + .../data/features/multibackgrounds.js | 1 + .../caniuse-lite/data/features/multicolumn.js | 1 + .../data/features/mutation-events.js | 1 + .../data/features/mutationobserver.js | 1 + .../data/features/namevalue-storage.js | 1 + .../data/features/native-filesystem-api.js | 1 + .../caniuse-lite/data/features/nav-timing.js | 1 + .../caniuse-lite/data/features/netinfo.js | 1 + .../data/features/notifications.js | 1 + .../data/features/object-entries.js | 1 + .../caniuse-lite/data/features/object-fit.js | 1 + .../data/features/object-observe.js | 1 + .../data/features/object-values.js | 1 + .../caniuse-lite/data/features/objectrtc.js | 1 + .../data/features/offline-apps.js | 1 + .../data/features/offscreencanvas.js | 1 + .../caniuse-lite/data/features/ogg-vorbis.js | 1 + .../caniuse-lite/data/features/ogv.js | 1 + .../caniuse-lite/data/features/ol-reversed.js | 1 + .../data/features/once-event-listener.js | 1 + .../data/features/online-status.js | 1 + .../caniuse-lite/data/features/opus.js | 1 + .../data/features/orientation-sensor.js | 1 + .../caniuse-lite/data/features/outline.js | 1 + .../data/features/pad-start-end.js | 1 + .../data/features/page-transition-events.js | 1 + .../data/features/pagevisibility.js | 1 + .../data/features/passive-event-listener.js | 1 + .../caniuse-lite/data/features/passkeys.js | 1 + .../data/features/passwordrules.js | 1 + .../caniuse-lite/data/features/path2d.js | 1 + .../data/features/payment-request.js | 1 + .../caniuse-lite/data/features/pdf-viewer.js | 1 + .../data/features/permissions-api.js | 1 + .../data/features/permissions-policy.js | 1 + .../data/features/picture-in-picture.js | 1 + .../caniuse-lite/data/features/picture.js | 1 + .../caniuse-lite/data/features/ping.js | 1 + .../caniuse-lite/data/features/png-alpha.js | 1 + .../data/features/pointer-events.js | 1 + .../caniuse-lite/data/features/pointer.js | 1 + .../caniuse-lite/data/features/pointerlock.js | 1 + .../caniuse-lite/data/features/portals.js | 1 + .../data/features/prefers-color-scheme.js | 1 + .../data/features/prefers-reduced-motion.js | 1 + .../caniuse-lite/data/features/progress.js | 1 + .../data/features/promise-finally.js | 1 + .../caniuse-lite/data/features/promises.js | 1 + .../caniuse-lite/data/features/proximity.js | 1 + .../caniuse-lite/data/features/proxy.js | 1 + .../data/features/publickeypinning.js | 1 + .../caniuse-lite/data/features/push-api.js | 1 + .../data/features/queryselector.js | 1 + .../data/features/readonly-attr.js | 1 + .../data/features/referrer-policy.js | 1 + .../data/features/registerprotocolhandler.js | 1 + .../data/features/rel-noopener.js | 1 + .../data/features/rel-noreferrer.js | 1 + .../caniuse-lite/data/features/rellist.js | 1 + .../caniuse-lite/data/features/rem.js | 1 + .../data/features/requestanimationframe.js | 1 + .../data/features/requestidlecallback.js | 1 + .../data/features/resizeobserver.js | 1 + .../data/features/resource-timing.js | 1 + .../data/features/rest-parameters.js | 1 + .../data/features/rtcpeerconnection.js | 1 + .../caniuse-lite/data/features/ruby.js | 1 + .../caniuse-lite/data/features/run-in.js | 1 + .../features/same-site-cookie-attribute.js | 1 + .../data/features/screen-orientation.js | 1 + .../data/features/script-async.js | 1 + .../data/features/script-defer.js | 1 + .../data/features/scrollintoview.js | 1 + .../data/features/scrollintoviewifneeded.js | 1 + .../caniuse-lite/data/features/sdch.js | 1 + .../data/features/selection-api.js | 1 + .../data/features/server-timing.js | 1 + .../data/features/serviceworkers.js | 1 + .../data/features/setimmediate.js | 1 + .../caniuse-lite/data/features/shadowdom.js | 1 + .../caniuse-lite/data/features/shadowdomv1.js | 1 + .../data/features/sharedarraybuffer.js | 1 + .../data/features/sharedworkers.js | 1 + .../caniuse-lite/data/features/sni.js | 1 + .../caniuse-lite/data/features/spdy.js | 1 + .../data/features/speech-recognition.js | 1 + .../data/features/speech-synthesis.js | 1 + .../data/features/spellcheck-attribute.js | 1 + .../caniuse-lite/data/features/sql-storage.js | 1 + .../caniuse-lite/data/features/srcset.js | 1 + .../caniuse-lite/data/features/stream.js | 1 + .../caniuse-lite/data/features/streams.js | 1 + .../data/features/stricttransportsecurity.js | 1 + .../data/features/style-scoped.js | 1 + .../data/features/subresource-bundling.js | 1 + .../data/features/subresource-integrity.js | 1 + .../caniuse-lite/data/features/svg-css.js | 1 + .../caniuse-lite/data/features/svg-filters.js | 1 + .../caniuse-lite/data/features/svg-fonts.js | 1 + .../data/features/svg-fragment.js | 1 + .../caniuse-lite/data/features/svg-html.js | 1 + .../caniuse-lite/data/features/svg-html5.js | 1 + .../caniuse-lite/data/features/svg-img.js | 1 + .../caniuse-lite/data/features/svg-smil.js | 1 + .../caniuse-lite/data/features/svg.js | 1 + .../caniuse-lite/data/features/sxg.js | 1 + .../data/features/tabindex-attr.js | 1 + .../data/features/template-literals.js | 1 + .../caniuse-lite/data/features/template.js | 1 + .../caniuse-lite/data/features/temporal.js | 1 + .../caniuse-lite/data/features/testfeat.js | 1 + .../data/features/text-decoration.js | 1 + .../data/features/text-emphasis.js | 1 + .../data/features/text-overflow.js | 1 + .../data/features/text-size-adjust.js | 1 + .../caniuse-lite/data/features/text-stroke.js | 1 + .../caniuse-lite/data/features/textcontent.js | 1 + .../caniuse-lite/data/features/textencoder.js | 1 + .../caniuse-lite/data/features/tls1-1.js | 1 + .../caniuse-lite/data/features/tls1-2.js | 1 + .../caniuse-lite/data/features/tls1-3.js | 1 + .../caniuse-lite/data/features/touch.js | 1 + .../data/features/transforms2d.js | 1 + .../data/features/transforms3d.js | 1 + .../data/features/trusted-types.js | 1 + .../caniuse-lite/data/features/ttf.js | 1 + .../caniuse-lite/data/features/typedarrays.js | 1 + .../caniuse-lite/data/features/u2f.js | 1 + .../data/features/unhandledrejection.js | 1 + .../data/features/upgradeinsecurerequests.js | 1 + .../features/url-scroll-to-text-fragment.js | 1 + .../caniuse-lite/data/features/url.js | 1 + .../data/features/urlsearchparams.js | 1 + .../caniuse-lite/data/features/use-strict.js | 1 + .../data/features/user-select-none.js | 1 + .../caniuse-lite/data/features/user-timing.js | 1 + .../data/features/variable-fonts.js | 1 + .../data/features/vector-effect.js | 1 + .../caniuse-lite/data/features/vibration.js | 1 + .../caniuse-lite/data/features/video.js | 1 + .../caniuse-lite/data/features/videotracks.js | 1 + .../data/features/view-transitions.js | 1 + .../data/features/viewport-unit-variants.js | 1 + .../data/features/viewport-units.js | 1 + .../caniuse-lite/data/features/wai-aria.js | 1 + .../caniuse-lite/data/features/wake-lock.js | 1 + .../caniuse-lite/data/features/wasm.js | 1 + .../caniuse-lite/data/features/wav.js | 1 + .../caniuse-lite/data/features/wbr-element.js | 1 + .../data/features/web-animation.js | 1 + .../data/features/web-app-manifest.js | 1 + .../data/features/web-bluetooth.js | 1 + .../caniuse-lite/data/features/web-serial.js | 1 + .../caniuse-lite/data/features/web-share.js | 1 + .../caniuse-lite/data/features/webauthn.js | 1 + .../caniuse-lite/data/features/webcodecs.js | 1 + .../caniuse-lite/data/features/webgl.js | 1 + .../caniuse-lite/data/features/webgl2.js | 1 + .../caniuse-lite/data/features/webgpu.js | 1 + .../caniuse-lite/data/features/webhid.js | 1 + .../data/features/webkit-user-drag.js | 1 + .../caniuse-lite/data/features/webm.js | 1 + .../caniuse-lite/data/features/webnfc.js | 1 + .../caniuse-lite/data/features/webp.js | 1 + .../caniuse-lite/data/features/websockets.js | 1 + .../data/features/webtransport.js | 1 + .../caniuse-lite/data/features/webusb.js | 1 + .../caniuse-lite/data/features/webvr.js | 1 + .../caniuse-lite/data/features/webvtt.js | 1 + .../caniuse-lite/data/features/webworkers.js | 1 + .../caniuse-lite/data/features/webxr.js | 1 + .../caniuse-lite/data/features/will-change.js | 1 + .../caniuse-lite/data/features/woff.js | 1 + .../caniuse-lite/data/features/woff2.js | 1 + .../caniuse-lite/data/features/word-break.js | 1 + .../caniuse-lite/data/features/wordwrap.js | 1 + .../data/features/x-doc-messaging.js | 1 + .../data/features/x-frame-options.js | 1 + .../caniuse-lite/data/features/xhr2.js | 1 + .../caniuse-lite/data/features/xhtml.js | 1 + .../caniuse-lite/data/features/xhtmlsmil.js | 1 + .../data/features/xml-serializer.js | 1 + .../caniuse-lite/data/features/zstd.js | 1 + node_modules/caniuse-lite/data/regions/AD.js | 1 + node_modules/caniuse-lite/data/regions/AE.js | 1 + node_modules/caniuse-lite/data/regions/AF.js | 1 + node_modules/caniuse-lite/data/regions/AG.js | 1 + node_modules/caniuse-lite/data/regions/AI.js | 1 + node_modules/caniuse-lite/data/regions/AL.js | 1 + node_modules/caniuse-lite/data/regions/AM.js | 1 + node_modules/caniuse-lite/data/regions/AO.js | 1 + node_modules/caniuse-lite/data/regions/AR.js | 1 + node_modules/caniuse-lite/data/regions/AS.js | 1 + node_modules/caniuse-lite/data/regions/AT.js | 1 + node_modules/caniuse-lite/data/regions/AU.js | 1 + node_modules/caniuse-lite/data/regions/AW.js | 1 + node_modules/caniuse-lite/data/regions/AX.js | 1 + node_modules/caniuse-lite/data/regions/AZ.js | 1 + node_modules/caniuse-lite/data/regions/BA.js | 1 + node_modules/caniuse-lite/data/regions/BB.js | 1 + node_modules/caniuse-lite/data/regions/BD.js | 1 + node_modules/caniuse-lite/data/regions/BE.js | 1 + node_modules/caniuse-lite/data/regions/BF.js | 1 + node_modules/caniuse-lite/data/regions/BG.js | 1 + node_modules/caniuse-lite/data/regions/BH.js | 1 + node_modules/caniuse-lite/data/regions/BI.js | 1 + node_modules/caniuse-lite/data/regions/BJ.js | 1 + node_modules/caniuse-lite/data/regions/BM.js | 1 + node_modules/caniuse-lite/data/regions/BN.js | 1 + node_modules/caniuse-lite/data/regions/BO.js | 1 + node_modules/caniuse-lite/data/regions/BR.js | 1 + node_modules/caniuse-lite/data/regions/BS.js | 1 + node_modules/caniuse-lite/data/regions/BT.js | 1 + node_modules/caniuse-lite/data/regions/BW.js | 1 + node_modules/caniuse-lite/data/regions/BY.js | 1 + node_modules/caniuse-lite/data/regions/BZ.js | 1 + node_modules/caniuse-lite/data/regions/CA.js | 1 + node_modules/caniuse-lite/data/regions/CD.js | 1 + node_modules/caniuse-lite/data/regions/CF.js | 1 + node_modules/caniuse-lite/data/regions/CG.js | 1 + node_modules/caniuse-lite/data/regions/CH.js | 1 + node_modules/caniuse-lite/data/regions/CI.js | 1 + node_modules/caniuse-lite/data/regions/CK.js | 1 + node_modules/caniuse-lite/data/regions/CL.js | 1 + node_modules/caniuse-lite/data/regions/CM.js | 1 + node_modules/caniuse-lite/data/regions/CN.js | 1 + node_modules/caniuse-lite/data/regions/CO.js | 1 + node_modules/caniuse-lite/data/regions/CR.js | 1 + node_modules/caniuse-lite/data/regions/CU.js | 1 + node_modules/caniuse-lite/data/regions/CV.js | 1 + node_modules/caniuse-lite/data/regions/CX.js | 1 + node_modules/caniuse-lite/data/regions/CY.js | 1 + node_modules/caniuse-lite/data/regions/CZ.js | 1 + node_modules/caniuse-lite/data/regions/DE.js | 1 + node_modules/caniuse-lite/data/regions/DJ.js | 1 + node_modules/caniuse-lite/data/regions/DK.js | 1 + node_modules/caniuse-lite/data/regions/DM.js | 1 + node_modules/caniuse-lite/data/regions/DO.js | 1 + node_modules/caniuse-lite/data/regions/DZ.js | 1 + node_modules/caniuse-lite/data/regions/EC.js | 1 + node_modules/caniuse-lite/data/regions/EE.js | 1 + node_modules/caniuse-lite/data/regions/EG.js | 1 + node_modules/caniuse-lite/data/regions/ER.js | 1 + node_modules/caniuse-lite/data/regions/ES.js | 1 + node_modules/caniuse-lite/data/regions/ET.js | 1 + node_modules/caniuse-lite/data/regions/FI.js | 1 + node_modules/caniuse-lite/data/regions/FJ.js | 1 + node_modules/caniuse-lite/data/regions/FK.js | 1 + node_modules/caniuse-lite/data/regions/FM.js | 1 + node_modules/caniuse-lite/data/regions/FO.js | 1 + node_modules/caniuse-lite/data/regions/FR.js | 1 + node_modules/caniuse-lite/data/regions/GA.js | 1 + node_modules/caniuse-lite/data/regions/GB.js | 1 + node_modules/caniuse-lite/data/regions/GD.js | 1 + node_modules/caniuse-lite/data/regions/GE.js | 1 + node_modules/caniuse-lite/data/regions/GF.js | 1 + node_modules/caniuse-lite/data/regions/GG.js | 1 + node_modules/caniuse-lite/data/regions/GH.js | 1 + node_modules/caniuse-lite/data/regions/GI.js | 1 + node_modules/caniuse-lite/data/regions/GL.js | 1 + node_modules/caniuse-lite/data/regions/GM.js | 1 + node_modules/caniuse-lite/data/regions/GN.js | 1 + node_modules/caniuse-lite/data/regions/GP.js | 1 + node_modules/caniuse-lite/data/regions/GQ.js | 1 + node_modules/caniuse-lite/data/regions/GR.js | 1 + node_modules/caniuse-lite/data/regions/GT.js | 1 + node_modules/caniuse-lite/data/regions/GU.js | 1 + node_modules/caniuse-lite/data/regions/GW.js | 1 + node_modules/caniuse-lite/data/regions/GY.js | 1 + node_modules/caniuse-lite/data/regions/HK.js | 1 + node_modules/caniuse-lite/data/regions/HN.js | 1 + node_modules/caniuse-lite/data/regions/HR.js | 1 + node_modules/caniuse-lite/data/regions/HT.js | 1 + node_modules/caniuse-lite/data/regions/HU.js | 1 + node_modules/caniuse-lite/data/regions/ID.js | 1 + node_modules/caniuse-lite/data/regions/IE.js | 1 + node_modules/caniuse-lite/data/regions/IL.js | 1 + node_modules/caniuse-lite/data/regions/IM.js | 1 + node_modules/caniuse-lite/data/regions/IN.js | 1 + node_modules/caniuse-lite/data/regions/IQ.js | 1 + node_modules/caniuse-lite/data/regions/IR.js | 1 + node_modules/caniuse-lite/data/regions/IS.js | 1 + node_modules/caniuse-lite/data/regions/IT.js | 1 + node_modules/caniuse-lite/data/regions/JE.js | 1 + node_modules/caniuse-lite/data/regions/JM.js | 1 + node_modules/caniuse-lite/data/regions/JO.js | 1 + node_modules/caniuse-lite/data/regions/JP.js | 1 + node_modules/caniuse-lite/data/regions/KE.js | 1 + node_modules/caniuse-lite/data/regions/KG.js | 1 + node_modules/caniuse-lite/data/regions/KH.js | 1 + node_modules/caniuse-lite/data/regions/KI.js | 1 + node_modules/caniuse-lite/data/regions/KM.js | 1 + node_modules/caniuse-lite/data/regions/KN.js | 1 + node_modules/caniuse-lite/data/regions/KP.js | 1 + node_modules/caniuse-lite/data/regions/KR.js | 1 + node_modules/caniuse-lite/data/regions/KW.js | 1 + node_modules/caniuse-lite/data/regions/KY.js | 1 + node_modules/caniuse-lite/data/regions/KZ.js | 1 + node_modules/caniuse-lite/data/regions/LA.js | 1 + node_modules/caniuse-lite/data/regions/LB.js | 1 + node_modules/caniuse-lite/data/regions/LC.js | 1 + node_modules/caniuse-lite/data/regions/LI.js | 1 + node_modules/caniuse-lite/data/regions/LK.js | 1 + node_modules/caniuse-lite/data/regions/LR.js | 1 + node_modules/caniuse-lite/data/regions/LS.js | 1 + node_modules/caniuse-lite/data/regions/LT.js | 1 + node_modules/caniuse-lite/data/regions/LU.js | 1 + node_modules/caniuse-lite/data/regions/LV.js | 1 + node_modules/caniuse-lite/data/regions/LY.js | 1 + node_modules/caniuse-lite/data/regions/MA.js | 1 + node_modules/caniuse-lite/data/regions/MC.js | 1 + node_modules/caniuse-lite/data/regions/MD.js | 1 + node_modules/caniuse-lite/data/regions/ME.js | 1 + node_modules/caniuse-lite/data/regions/MG.js | 1 + node_modules/caniuse-lite/data/regions/MH.js | 1 + node_modules/caniuse-lite/data/regions/MK.js | 1 + node_modules/caniuse-lite/data/regions/ML.js | 1 + node_modules/caniuse-lite/data/regions/MM.js | 1 + node_modules/caniuse-lite/data/regions/MN.js | 1 + node_modules/caniuse-lite/data/regions/MO.js | 1 + node_modules/caniuse-lite/data/regions/MP.js | 1 + node_modules/caniuse-lite/data/regions/MQ.js | 1 + node_modules/caniuse-lite/data/regions/MR.js | 1 + node_modules/caniuse-lite/data/regions/MS.js | 1 + node_modules/caniuse-lite/data/regions/MT.js | 1 + node_modules/caniuse-lite/data/regions/MU.js | 1 + node_modules/caniuse-lite/data/regions/MV.js | 1 + node_modules/caniuse-lite/data/regions/MW.js | 1 + node_modules/caniuse-lite/data/regions/MX.js | 1 + node_modules/caniuse-lite/data/regions/MY.js | 1 + node_modules/caniuse-lite/data/regions/MZ.js | 1 + node_modules/caniuse-lite/data/regions/NA.js | 1 + node_modules/caniuse-lite/data/regions/NC.js | 1 + node_modules/caniuse-lite/data/regions/NE.js | 1 + node_modules/caniuse-lite/data/regions/NF.js | 1 + node_modules/caniuse-lite/data/regions/NG.js | 1 + node_modules/caniuse-lite/data/regions/NI.js | 1 + node_modules/caniuse-lite/data/regions/NL.js | 1 + node_modules/caniuse-lite/data/regions/NO.js | 1 + node_modules/caniuse-lite/data/regions/NP.js | 1 + node_modules/caniuse-lite/data/regions/NR.js | 1 + node_modules/caniuse-lite/data/regions/NU.js | 1 + node_modules/caniuse-lite/data/regions/NZ.js | 1 + node_modules/caniuse-lite/data/regions/OM.js | 1 + node_modules/caniuse-lite/data/regions/PA.js | 1 + node_modules/caniuse-lite/data/regions/PE.js | 1 + node_modules/caniuse-lite/data/regions/PF.js | 1 + node_modules/caniuse-lite/data/regions/PG.js | 1 + node_modules/caniuse-lite/data/regions/PH.js | 1 + node_modules/caniuse-lite/data/regions/PK.js | 1 + node_modules/caniuse-lite/data/regions/PL.js | 1 + node_modules/caniuse-lite/data/regions/PM.js | 1 + node_modules/caniuse-lite/data/regions/PN.js | 1 + node_modules/caniuse-lite/data/regions/PR.js | 1 + node_modules/caniuse-lite/data/regions/PS.js | 1 + node_modules/caniuse-lite/data/regions/PT.js | 1 + node_modules/caniuse-lite/data/regions/PW.js | 1 + node_modules/caniuse-lite/data/regions/PY.js | 1 + node_modules/caniuse-lite/data/regions/QA.js | 1 + node_modules/caniuse-lite/data/regions/RE.js | 1 + node_modules/caniuse-lite/data/regions/RO.js | 1 + node_modules/caniuse-lite/data/regions/RS.js | 1 + node_modules/caniuse-lite/data/regions/RU.js | 1 + node_modules/caniuse-lite/data/regions/RW.js | 1 + node_modules/caniuse-lite/data/regions/SA.js | 1 + node_modules/caniuse-lite/data/regions/SB.js | 1 + node_modules/caniuse-lite/data/regions/SC.js | 1 + node_modules/caniuse-lite/data/regions/SD.js | 1 + node_modules/caniuse-lite/data/regions/SE.js | 1 + node_modules/caniuse-lite/data/regions/SG.js | 1 + node_modules/caniuse-lite/data/regions/SH.js | 1 + node_modules/caniuse-lite/data/regions/SI.js | 1 + node_modules/caniuse-lite/data/regions/SK.js | 1 + node_modules/caniuse-lite/data/regions/SL.js | 1 + node_modules/caniuse-lite/data/regions/SM.js | 1 + node_modules/caniuse-lite/data/regions/SN.js | 1 + node_modules/caniuse-lite/data/regions/SO.js | 1 + node_modules/caniuse-lite/data/regions/SR.js | 1 + node_modules/caniuse-lite/data/regions/ST.js | 1 + node_modules/caniuse-lite/data/regions/SV.js | 1 + node_modules/caniuse-lite/data/regions/SY.js | 1 + node_modules/caniuse-lite/data/regions/SZ.js | 1 + node_modules/caniuse-lite/data/regions/TC.js | 1 + node_modules/caniuse-lite/data/regions/TD.js | 1 + node_modules/caniuse-lite/data/regions/TG.js | 1 + node_modules/caniuse-lite/data/regions/TH.js | 1 + node_modules/caniuse-lite/data/regions/TJ.js | 1 + node_modules/caniuse-lite/data/regions/TK.js | 1 + node_modules/caniuse-lite/data/regions/TL.js | 1 + node_modules/caniuse-lite/data/regions/TM.js | 1 + node_modules/caniuse-lite/data/regions/TN.js | 1 + node_modules/caniuse-lite/data/regions/TO.js | 1 + node_modules/caniuse-lite/data/regions/TR.js | 1 + node_modules/caniuse-lite/data/regions/TT.js | 1 + node_modules/caniuse-lite/data/regions/TV.js | 1 + node_modules/caniuse-lite/data/regions/TW.js | 1 + node_modules/caniuse-lite/data/regions/TZ.js | 1 + node_modules/caniuse-lite/data/regions/UA.js | 1 + node_modules/caniuse-lite/data/regions/UG.js | 1 + node_modules/caniuse-lite/data/regions/US.js | 1 + node_modules/caniuse-lite/data/regions/UY.js | 1 + node_modules/caniuse-lite/data/regions/UZ.js | 1 + node_modules/caniuse-lite/data/regions/VA.js | 1 + node_modules/caniuse-lite/data/regions/VC.js | 1 + node_modules/caniuse-lite/data/regions/VE.js | 1 + node_modules/caniuse-lite/data/regions/VG.js | 1 + node_modules/caniuse-lite/data/regions/VI.js | 1 + node_modules/caniuse-lite/data/regions/VN.js | 1 + node_modules/caniuse-lite/data/regions/VU.js | 1 + node_modules/caniuse-lite/data/regions/WF.js | 1 + node_modules/caniuse-lite/data/regions/WS.js | 1 + node_modules/caniuse-lite/data/regions/YE.js | 1 + node_modules/caniuse-lite/data/regions/YT.js | 1 + node_modules/caniuse-lite/data/regions/ZA.js | 1 + node_modules/caniuse-lite/data/regions/ZM.js | 1 + node_modules/caniuse-lite/data/regions/ZW.js | 1 + .../caniuse-lite/data/regions/alt-af.js | 1 + .../caniuse-lite/data/regions/alt-an.js | 1 + .../caniuse-lite/data/regions/alt-as.js | 1 + .../caniuse-lite/data/regions/alt-eu.js | 1 + .../caniuse-lite/data/regions/alt-na.js | 1 + .../caniuse-lite/data/regions/alt-oc.js | 1 + .../caniuse-lite/data/regions/alt-sa.js | 1 + .../caniuse-lite/data/regions/alt-ww.js | 1 + .../caniuse-lite/dist/lib/statuses.js | 9 + .../caniuse-lite/dist/lib/supported.js | 9 + .../caniuse-lite/dist/unpacker/agents.js | 47 + .../dist/unpacker/browserVersions.js | 1 + .../caniuse-lite/dist/unpacker/browsers.js | 1 + .../caniuse-lite/dist/unpacker/feature.js | 52 + .../caniuse-lite/dist/unpacker/features.js | 6 + .../caniuse-lite/dist/unpacker/index.js | 4 + .../caniuse-lite/dist/unpacker/region.js | 22 + node_modules/caniuse-lite/package.json | 34 + node_modules/chalk/index.d.ts | 415 + node_modules/chalk/license | 9 + node_modules/chalk/package.json | 68 + node_modules/chalk/readme.md | 341 + node_modules/chalk/source/index.js | 229 + node_modules/chalk/source/templates.js | 134 + node_modules/chalk/source/util.js | 39 + node_modules/char-regex/LICENSE | 21 + node_modules/char-regex/README.md | 27 + node_modules/char-regex/index.d.ts | 13 + node_modules/char-regex/index.js | 39 + node_modules/char-regex/package.json | 44 + node_modules/ci-info/CHANGELOG.md | 178 + node_modules/ci-info/LICENSE | 21 + node_modules/ci-info/README.md | 135 + node_modules/ci-info/index.d.ts | 75 + node_modules/ci-info/index.js | 90 + node_modules/ci-info/package.json | 45 + node_modules/ci-info/vendors.json | 321 + node_modules/cjs-module-lexer/LICENSE | 10 + node_modules/cjs-module-lexer/README.md | 461 + node_modules/cjs-module-lexer/dist/lexer.js | 1 + node_modules/cjs-module-lexer/dist/lexer.mjs | 2 + node_modules/cjs-module-lexer/lexer.d.ts | 7 + node_modules/cjs-module-lexer/lexer.js | 1438 ++ node_modules/cjs-module-lexer/package.json | 45 + node_modules/cliui/CHANGELOG.md | 139 + node_modules/cliui/LICENSE.txt | 14 + node_modules/cliui/README.md | 141 + node_modules/cliui/build/index.cjs | 302 + node_modules/cliui/build/index.d.cts | 43 + node_modules/cliui/build/lib/index.js | 287 + node_modules/cliui/build/lib/string-utils.js | 27 + node_modules/cliui/index.mjs | 13 + node_modules/cliui/package.json | 83 + node_modules/co/History.md | 172 + node_modules/co/LICENSE | 22 + node_modules/co/Readme.md | 212 + node_modules/co/index.js | 237 + node_modules/co/package.json | 34 + node_modules/collect-v8-coverage/CHANGELOG.md | 18 + node_modules/collect-v8-coverage/LICENSE | 22 + node_modules/collect-v8-coverage/README.md | 15 + node_modules/collect-v8-coverage/index.d.ts | 7 + node_modules/collect-v8-coverage/index.js | 52 + node_modules/collect-v8-coverage/package.json | 52 + node_modules/color-convert/CHANGELOG.md | 54 + node_modules/color-convert/LICENSE | 21 + node_modules/color-convert/README.md | 68 + node_modules/color-convert/conversions.js | 839 + node_modules/color-convert/index.js | 81 + node_modules/color-convert/package.json | 48 + node_modules/color-convert/route.js | 97 + node_modules/color-name/LICENSE | 8 + node_modules/color-name/README.md | 11 + node_modules/color-name/index.js | 152 + node_modules/color-name/package.json | 28 + node_modules/concat-map/.travis.yml | 4 + node_modules/concat-map/LICENSE | 18 + node_modules/concat-map/README.markdown | 62 + node_modules/concat-map/example/map.js | 6 + node_modules/concat-map/index.js | 13 + node_modules/concat-map/package.json | 43 + node_modules/concat-map/test/map.js | 39 + node_modules/convert-source-map/LICENSE | 23 + node_modules/convert-source-map/README.md | 206 + node_modules/convert-source-map/index.js | 233 + node_modules/convert-source-map/package.json | 38 + node_modules/create-jest/LICENSE | 21 + node_modules/create-jest/README.md | 11 + node_modules/create-jest/bin/create-jest.js | 8 + node_modules/create-jest/build/errors.js | 31 + .../create-jest/build/generateConfigFile.js | 92 + node_modules/create-jest/build/index.d.ts | 12 + node_modules/create-jest/build/index.js | 18 + .../create-jest/build/modifyPackageJson.js | 26 + node_modules/create-jest/build/questions.js | 76 + node_modules/create-jest/build/runCreate.js | 237 + node_modules/create-jest/build/types.js | 1 + node_modules/create-jest/package.json | 43 + node_modules/cross-spawn/CHANGELOG.md | 130 + node_modules/cross-spawn/LICENSE | 21 + node_modules/cross-spawn/README.md | 96 + node_modules/cross-spawn/index.js | 39 + node_modules/cross-spawn/lib/enoent.js | 59 + node_modules/cross-spawn/lib/parse.js | 91 + node_modules/cross-spawn/lib/util/escape.js | 45 + .../cross-spawn/lib/util/readShebang.js | 23 + .../cross-spawn/lib/util/resolveCommand.js | 52 + node_modules/cross-spawn/package.json | 73 + node_modules/debug/LICENSE | 20 + node_modules/debug/README.md | 481 + node_modules/debug/package.json | 59 + node_modules/debug/src/browser.js | 269 + node_modules/debug/src/common.js | 274 + node_modules/debug/src/index.js | 10 + node_modules/debug/src/node.js | 263 + node_modules/dedent/LICENSE | 21 + node_modules/dedent/README.md | 115 + node_modules/dedent/dist/dedent.d.mts | 17 + node_modules/dedent/dist/dedent.d.ts | 17 + node_modules/dedent/dist/dedent.js | 66 + node_modules/dedent/dist/dedent.mjs | 59 + node_modules/dedent/macro.d.ts | 2 + node_modules/dedent/macro.js | 34 + node_modules/dedent/package.json | 87 + node_modules/deepmerge/.editorconfig | 7 + node_modules/deepmerge/.eslintcache | 1 + node_modules/deepmerge/changelog.md | 167 + node_modules/deepmerge/dist/cjs.js | 133 + node_modules/deepmerge/dist/umd.js | 139 + node_modules/deepmerge/index.d.ts | 20 + node_modules/deepmerge/index.js | 106 + node_modules/deepmerge/license.txt | 21 + node_modules/deepmerge/package.json | 42 + node_modules/deepmerge/readme.md | 264 + node_modules/deepmerge/rollup.config.js | 22 + node_modules/detect-newline/index.d.ts | 26 + node_modules/detect-newline/index.js | 21 + node_modules/detect-newline/license | 9 + node_modules/detect-newline/package.json | 39 + node_modules/detect-newline/readme.md | 42 + node_modules/diff-sequences/LICENSE | 21 + node_modules/diff-sequences/README.md | 404 + node_modules/diff-sequences/build/index.d.ts | 38 + node_modules/diff-sequences/build/index.js | 798 + node_modules/diff-sequences/package.json | 39 + .../electron-to-chromium/CHANGELOG.md | 14 + node_modules/electron-to-chromium/LICENSE | 5 + node_modules/electron-to-chromium/README.md | 186 + .../electron-to-chromium/chromium-versions.js | 59 + .../chromium-versions.json | 1 + .../full-chromium-versions.js | 2872 +++ .../full-chromium-versions.json | 1 + .../electron-to-chromium/full-versions.js | 2096 +++ .../electron-to-chromium/full-versions.json | 1 + node_modules/electron-to-chromium/index.js | 36 + .../electron-to-chromium/package.json | 44 + node_modules/electron-to-chromium/versions.js | 141 + .../electron-to-chromium/versions.json | 1 + node_modules/emittery/index.d.ts | 606 + node_modules/emittery/index.js | 531 + node_modules/emittery/license | 9 + node_modules/emittery/maps.js | 9 + node_modules/emittery/package.json | 67 + node_modules/emittery/readme.md | 569 + node_modules/emoji-regex/LICENSE-MIT.txt | 20 + node_modules/emoji-regex/README.md | 73 + node_modules/emoji-regex/es2015/index.js | 6 + node_modules/emoji-regex/es2015/text.js | 6 + node_modules/emoji-regex/index.d.ts | 23 + node_modules/emoji-regex/index.js | 6 + node_modules/emoji-regex/package.json | 50 + node_modules/emoji-regex/text.js | 6 + node_modules/error-ex/LICENSE | 21 + node_modules/error-ex/README.md | 144 + node_modules/error-ex/index.js | 141 + node_modules/error-ex/package.json | 46 + node_modules/escalade/dist/index.js | 22 + node_modules/escalade/dist/index.mjs | 22 + node_modules/escalade/index.d.ts | 3 + node_modules/escalade/license | 9 + node_modules/escalade/package.json | 61 + node_modules/escalade/readme.md | 211 + node_modules/escalade/sync/index.d.ts | 2 + node_modules/escalade/sync/index.js | 18 + node_modules/escalade/sync/index.mjs | 18 + node_modules/escape-string-regexp/index.d.ts | 18 + node_modules/escape-string-regexp/index.js | 11 + node_modules/escape-string-regexp/license | 9 + .../escape-string-regexp/package.json | 43 + node_modules/escape-string-regexp/readme.md | 29 + node_modules/esprima/ChangeLog | 235 + node_modules/esprima/LICENSE.BSD | 21 + node_modules/esprima/README.md | 46 + node_modules/esprima/bin/esparse.js | 139 + node_modules/esprima/bin/esvalidate.js | 236 + node_modules/esprima/dist/esprima.js | 6709 +++++++ node_modules/esprima/package.json | 112 + node_modules/execa/index.d.ts | 564 + node_modules/execa/index.js | 268 + node_modules/execa/lib/command.js | 52 + node_modules/execa/lib/error.js | 88 + node_modules/execa/lib/kill.js | 115 + node_modules/execa/lib/promise.js | 46 + node_modules/execa/lib/stdio.js | 52 + node_modules/execa/lib/stream.js | 97 + node_modules/execa/license | 9 + node_modules/execa/package.json | 74 + node_modules/execa/readme.md | 663 + node_modules/exit/.jshintrc | 14 + node_modules/exit/.npmignore | 0 node_modules/exit/.travis.yml | 6 + node_modules/exit/Gruntfile.js | 48 + node_modules/exit/LICENSE-MIT | 22 + node_modules/exit/README.md | 75 + node_modules/exit/lib/exit.js | 41 + node_modules/exit/package.json | 47 + node_modules/exit/test/exit_test.js | 121 + node_modules/exit/test/fixtures/10-stderr.txt | 10 + .../exit/test/fixtures/10-stdout-stderr.txt | 20 + node_modules/exit/test/fixtures/10-stdout.txt | 10 + .../exit/test/fixtures/100-stderr.txt | 100 + .../exit/test/fixtures/100-stdout-stderr.txt | 200 + .../exit/test/fixtures/100-stdout.txt | 100 + .../exit/test/fixtures/1000-stderr.txt | 1000 ++ .../exit/test/fixtures/1000-stdout-stderr.txt | 2000 +++ .../exit/test/fixtures/1000-stdout.txt | 1000 ++ .../exit/test/fixtures/create-files.sh | 8 + node_modules/exit/test/fixtures/log-broken.js | 23 + node_modules/exit/test/fixtures/log.js | 25 + node_modules/expect/LICENSE | 21 + node_modules/expect/README.md | 3 + .../expect/build/asymmetricMatchers.js | 375 + .../build/extractExpectedAssertionsErrors.js | 86 + node_modules/expect/build/index.d.ts | 370 + node_modules/expect/build/index.js | 410 + .../expect/build/jestMatchersObject.js | 123 + node_modules/expect/build/matchers.js | 1292 ++ node_modules/expect/build/print.js | 122 + node_modules/expect/build/spyMatchers.js | 1254 ++ node_modules/expect/build/toThrowMatchers.js | 481 + node_modules/expect/build/types.js | 3 + node_modules/expect/package.json | 43 + .../fast-json-stable-stringify/.eslintrc.yml | 26 + .../.github/FUNDING.yml | 1 + .../fast-json-stable-stringify/.travis.yml | 8 + .../fast-json-stable-stringify/LICENSE | 21 + .../fast-json-stable-stringify/README.md | 131 + .../benchmark/index.js | 31 + .../benchmark/test.json | 137 + .../example/key_cmp.js | 7 + .../example/nested.js | 3 + .../fast-json-stable-stringify/example/str.js | 3 + .../example/value_cmp.js | 7 + .../fast-json-stable-stringify/index.d.ts | 4 + .../fast-json-stable-stringify/index.js | 59 + .../fast-json-stable-stringify/package.json | 52 + .../fast-json-stable-stringify/test/cmp.js | 13 + .../fast-json-stable-stringify/test/nested.js | 44 + .../fast-json-stable-stringify/test/str.js | 46 + .../test/to-json.js | 22 + node_modules/fb-watchman/README.md | 34 + node_modules/fb-watchman/index.js | 327 + node_modules/fb-watchman/package.json | 35 + node_modules/fill-range/LICENSE | 21 + node_modules/fill-range/README.md | 237 + node_modules/fill-range/index.js | 249 + node_modules/fill-range/package.json | 69 + node_modules/find-up/index.d.ts | 137 + node_modules/find-up/index.js | 89 + node_modules/find-up/license | 9 + node_modules/find-up/package.json | 53 + node_modules/find-up/readme.md | 156 + node_modules/fs.realpath/LICENSE | 43 + node_modules/fs.realpath/README.md | 33 + node_modules/fs.realpath/index.js | 66 + node_modules/fs.realpath/old.js | 303 + node_modules/fs.realpath/package.json | 26 + node_modules/gensync/LICENSE | 7 + node_modules/gensync/README.md | 196 + node_modules/gensync/index.js | 373 + node_modules/gensync/index.js.flow | 32 + node_modules/gensync/package.json | 37 + node_modules/gensync/test/.babelrc | 5 + node_modules/gensync/test/index.test.js | 489 + node_modules/get-caller-file/LICENSE.md | 6 + node_modules/get-caller-file/README.md | 41 + node_modules/get-caller-file/index.d.ts | 2 + node_modules/get-caller-file/index.js | 22 + node_modules/get-caller-file/index.js.map | 1 + node_modules/get-caller-file/package.json | 42 + node_modules/get-package-type/CHANGELOG.md | 10 + node_modules/get-package-type/LICENSE | 21 + node_modules/get-package-type/README.md | 32 + node_modules/get-package-type/async.cjs | 52 + node_modules/get-package-type/cache.cjs | 3 + node_modules/get-package-type/index.cjs | 7 + .../get-package-type/is-node-modules.cjs | 15 + node_modules/get-package-type/package.json | 35 + node_modules/get-package-type/sync.cjs | 42 + node_modules/get-stream/buffer-stream.js | 52 + node_modules/get-stream/index.d.ts | 105 + node_modules/get-stream/index.js | 61 + node_modules/get-stream/license | 9 + node_modules/get-stream/package.json | 47 + node_modules/get-stream/readme.md | 124 + node_modules/glob/LICENSE | 21 + node_modules/glob/README.md | 378 + node_modules/glob/common.js | 238 + node_modules/glob/glob.js | 790 + node_modules/glob/package.json | 55 + node_modules/glob/sync.js | 486 + node_modules/globals/globals.json | 1563 ++ node_modules/globals/index.js | 2 + node_modules/globals/license | 9 + node_modules/globals/package.json | 41 + node_modules/globals/readme.md | 41 + node_modules/graceful-fs/LICENSE | 15 + node_modules/graceful-fs/README.md | 143 + node_modules/graceful-fs/clone.js | 23 + node_modules/graceful-fs/graceful-fs.js | 448 + node_modules/graceful-fs/legacy-streams.js | 118 + node_modules/graceful-fs/package.json | 53 + node_modules/graceful-fs/polyfills.js | 355 + node_modules/has-flag/index.d.ts | 39 + node_modules/has-flag/index.js | 8 + node_modules/has-flag/license | 9 + node_modules/has-flag/package.json | 46 + node_modules/has-flag/readme.md | 89 + node_modules/has/LICENSE-MIT | 22 + node_modules/has/README.md | 18 + node_modules/has/package.json | 45 + node_modules/has/src/index.js | 8 + node_modules/has/test/index.js | 16 + node_modules/html-escaper/LICENSE.txt | 19 + node_modules/html-escaper/README.md | 97 + node_modules/html-escaper/cjs/index.js | 65 + node_modules/html-escaper/cjs/package.json | 1 + node_modules/html-escaper/esm/index.js | 62 + node_modules/html-escaper/index.js | 70 + node_modules/html-escaper/min.js | 1 + node_modules/html-escaper/package.json | 42 + node_modules/html-escaper/test/index.js | 23 + node_modules/html-escaper/test/package.json | 1 + node_modules/human-signals/CHANGELOG.md | 11 + node_modules/human-signals/LICENSE | 201 + node_modules/human-signals/README.md | 165 + node_modules/human-signals/build/src/core.js | 273 + .../human-signals/build/src/core.js.map | 1 + .../human-signals/build/src/main.d.ts | 52 + node_modules/human-signals/build/src/main.js | 71 + .../human-signals/build/src/main.js.map | 1 + .../human-signals/build/src/realtime.js | 19 + .../human-signals/build/src/realtime.js.map | 1 + .../human-signals/build/src/signals.js | 35 + .../human-signals/build/src/signals.js.map | 1 + node_modules/human-signals/package.json | 64 + node_modules/import-local/fixtures/cli.js | 7 + node_modules/import-local/index.js | 24 + node_modules/import-local/license | 9 + node_modules/import-local/package.json | 52 + node_modules/import-local/readme.md | 37 + node_modules/imurmurhash/README.md | 122 + node_modules/imurmurhash/imurmurhash.js | 138 + node_modules/imurmurhash/imurmurhash.min.js | 12 + node_modules/imurmurhash/package.json | 40 + node_modules/inflight/LICENSE | 15 + node_modules/inflight/README.md | 37 + node_modules/inflight/inflight.js | 54 + node_modules/inflight/package.json | 29 + node_modules/inherits/LICENSE | 16 + node_modules/inherits/README.md | 42 + node_modules/inherits/inherits.js | 9 + node_modules/inherits/inherits_browser.js | 27 + node_modules/inherits/package.json | 29 + node_modules/is-arrayish/.editorconfig | 18 + node_modules/is-arrayish/.istanbul.yml | 4 + node_modules/is-arrayish/.npmignore | 5 + node_modules/is-arrayish/.travis.yml | 17 + node_modules/is-arrayish/LICENSE | 21 + node_modules/is-arrayish/README.md | 16 + node_modules/is-arrayish/index.js | 10 + node_modules/is-arrayish/package.json | 34 + node_modules/is-core-module/.eslintrc | 18 + node_modules/is-core-module/.nycrc | 9 + node_modules/is-core-module/CHANGELOG.md | 173 + node_modules/is-core-module/LICENSE | 20 + node_modules/is-core-module/README.md | 40 + node_modules/is-core-module/core.json | 158 + node_modules/is-core-module/index.js | 69 + node_modules/is-core-module/package.json | 73 + node_modules/is-core-module/test/index.js | 133 + .../is-fullwidth-code-point/index.d.ts | 17 + node_modules/is-fullwidth-code-point/index.js | 50 + node_modules/is-fullwidth-code-point/license | 9 + .../is-fullwidth-code-point/package.json | 42 + .../is-fullwidth-code-point/readme.md | 39 + node_modules/is-generator-fn/index.d.ts | 24 + node_modules/is-generator-fn/index.js | 14 + node_modules/is-generator-fn/license | 9 + node_modules/is-generator-fn/package.json | 38 + node_modules/is-generator-fn/readme.md | 33 + 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/is-stream/index.d.ts | 79 + node_modules/is-stream/index.js | 28 + node_modules/is-stream/license | 9 + node_modules/is-stream/package.json | 42 + node_modules/is-stream/readme.md | 60 + node_modules/isexe/.npmignore | 2 + node_modules/isexe/LICENSE | 15 + node_modules/isexe/README.md | 51 + node_modules/isexe/index.js | 57 + node_modules/isexe/mode.js | 41 + node_modules/isexe/package.json | 31 + node_modules/isexe/test/basic.js | 221 + node_modules/isexe/windows.js | 42 + .../istanbul-lib-coverage/CHANGELOG.md | 193 + node_modules/istanbul-lib-coverage/LICENSE | 24 + node_modules/istanbul-lib-coverage/README.md | 29 + node_modules/istanbul-lib-coverage/index.js | 64 + .../istanbul-lib-coverage/lib/coverage-map.js | 134 + .../lib/coverage-summary.js | 112 + .../lib/data-properties.js | 12 + .../lib/file-coverage.js | 345 + .../istanbul-lib-coverage/lib/percent.js | 15 + .../istanbul-lib-coverage/package.json | 47 + .../istanbul-lib-instrument/CHANGELOG.md | 650 + node_modules/istanbul-lib-instrument/LICENSE | 24 + .../istanbul-lib-instrument/README.md | 22 + .../node_modules/.bin/semver | 12 + .../node_modules/.bin/semver.cmd | 17 + .../node_modules/.bin/semver.ps1 | 28 + .../node_modules/lru-cache/LICENSE | 15 + .../node_modules/lru-cache/README.md | 166 + .../node_modules/lru-cache/index.js | 334 + .../node_modules/lru-cache/package.json | 34 + .../node_modules/semver/LICENSE | 15 + .../node_modules/semver/README.md | 637 + .../node_modules/semver/bin/semver.js | 197 + .../node_modules/semver/classes/comparator.js | 141 + .../node_modules/semver/classes/index.js | 5 + .../node_modules/semver/classes/range.js | 539 + .../node_modules/semver/classes/semver.js | 302 + .../node_modules/semver/functions/clean.js | 6 + .../node_modules/semver/functions/cmp.js | 52 + .../node_modules/semver/functions/coerce.js | 52 + .../semver/functions/compare-build.js | 7 + .../semver/functions/compare-loose.js | 3 + .../node_modules/semver/functions/compare.js | 5 + .../node_modules/semver/functions/diff.js | 65 + .../node_modules/semver/functions/eq.js | 3 + .../node_modules/semver/functions/gt.js | 3 + .../node_modules/semver/functions/gte.js | 3 + .../node_modules/semver/functions/inc.js | 19 + .../node_modules/semver/functions/lt.js | 3 + .../node_modules/semver/functions/lte.js | 3 + .../node_modules/semver/functions/major.js | 3 + .../node_modules/semver/functions/minor.js | 3 + .../node_modules/semver/functions/neq.js | 3 + .../node_modules/semver/functions/parse.js | 16 + .../node_modules/semver/functions/patch.js | 3 + .../semver/functions/prerelease.js | 6 + .../node_modules/semver/functions/rcompare.js | 3 + .../node_modules/semver/functions/rsort.js | 3 + .../semver/functions/satisfies.js | 10 + .../node_modules/semver/functions/sort.js | 3 + .../node_modules/semver/functions/valid.js | 6 + .../node_modules/semver/index.js | 89 + .../node_modules/semver/internal/constants.js | 35 + .../node_modules/semver/internal/debug.js | 9 + .../semver/internal/identifiers.js | 23 + .../semver/internal/parse-options.js | 15 + .../node_modules/semver/internal/re.js | 212 + .../node_modules/semver/package.json | 87 + .../node_modules/semver/preload.js | 2 + .../node_modules/semver/range.bnf | 16 + .../node_modules/semver/ranges/gtr.js | 4 + .../node_modules/semver/ranges/intersects.js | 7 + .../node_modules/semver/ranges/ltr.js | 4 + .../semver/ranges/max-satisfying.js | 25 + .../semver/ranges/min-satisfying.js | 24 + .../node_modules/semver/ranges/min-version.js | 61 + .../node_modules/semver/ranges/outside.js | 80 + .../node_modules/semver/ranges/simplify.js | 47 + .../node_modules/semver/ranges/subset.js | 247 + .../semver/ranges/to-comparators.js | 8 + .../node_modules/semver/ranges/valid.js | 11 + .../node_modules/yallist/LICENSE | 15 + .../node_modules/yallist/README.md | 204 + .../node_modules/yallist/iterator.js | 8 + .../node_modules/yallist/package.json | 29 + .../node_modules/yallist/yallist.js | 426 + .../istanbul-lib-instrument/package.json | 50 + .../istanbul-lib-instrument/src/constants.js | 14 + .../istanbul-lib-instrument/src/index.js | 21 + .../src/instrumenter.js | 162 + .../src/read-coverage.js | 77 + .../src/source-coverage.js | 135 + .../istanbul-lib-instrument/src/visitor.js | 843 + node_modules/istanbul-lib-report/CHANGELOG.md | 192 + node_modules/istanbul-lib-report/LICENSE | 24 + node_modules/istanbul-lib-report/README.md | 43 + node_modules/istanbul-lib-report/index.js | 40 + .../istanbul-lib-report/lib/context.js | 132 + .../istanbul-lib-report/lib/file-writer.js | 189 + node_modules/istanbul-lib-report/lib/path.js | 169 + .../istanbul-lib-report/lib/report-base.js | 16 + .../lib/summarizer-factory.js | 284 + node_modules/istanbul-lib-report/lib/tree.js | 137 + .../istanbul-lib-report/lib/watermarks.js | 15 + .../istanbul-lib-report/lib/xml-writer.js | 90 + node_modules/istanbul-lib-report/package.json | 44 + .../istanbul-lib-source-maps/CHANGELOG.md | 295 + node_modules/istanbul-lib-source-maps/LICENSE | 24 + .../istanbul-lib-source-maps/README.md | 11 + .../istanbul-lib-source-maps/index.js | 15 + .../lib/get-mapping.js | 182 + .../istanbul-lib-source-maps/lib/map-store.js | 226 + .../istanbul-lib-source-maps/lib/mapped.js | 113 + .../istanbul-lib-source-maps/lib/pathutils.js | 21 + .../lib/transform-utils.js | 21 + .../lib/transformer.js | 147 + .../istanbul-lib-source-maps/package.json | 45 + node_modules/istanbul-reports/CHANGELOG.md | 457 + node_modules/istanbul-reports/LICENSE | 24 + node_modules/istanbul-reports/README.md | 13 + node_modules/istanbul-reports/index.js | 24 + .../istanbul-reports/lib/clover/index.js | 163 + .../istanbul-reports/lib/cobertura/index.js | 151 + .../istanbul-reports/lib/html-spa/.babelrc | 3 + .../lib/html-spa/assets/bundle.js | 30 + .../lib/html-spa/assets/sort-arrow-sprite.png | Bin 0 -> 138 bytes .../lib/html-spa/assets/spa.css | 298 + .../istanbul-reports/lib/html-spa/index.js | 176 + .../lib/html-spa/src/fileBreadcrumbs.js | 31 + .../lib/html-spa/src/filterToggle.js | 50 + .../lib/html-spa/src/flattenToggle.js | 25 + .../lib/html-spa/src/getChildData.js | 155 + .../lib/html-spa/src/index.js | 160 + .../lib/html-spa/src/routing.js | 52 + .../lib/html-spa/src/summaryHeader.js | 63 + .../lib/html-spa/src/summaryTableHeader.js | 130 + .../lib/html-spa/src/summaryTableLine.js | 159 + .../lib/html-spa/webpack.config.js | 22 + .../istanbul-reports/lib/html/annotator.js | 305 + .../istanbul-reports/lib/html/assets/base.css | 224 + .../lib/html/assets/block-navigation.js | 86 + .../lib/html/assets/favicon.png | Bin 0 -> 445 bytes .../lib/html/assets/sort-arrow-sprite.png | Bin 0 -> 138 bytes .../lib/html/assets/sorter.js | 195 + .../lib/html/assets/vendor/prettify.css | 1 + .../lib/html/assets/vendor/prettify.js | 1 + .../istanbul-reports/lib/html/index.js | 421 + .../lib/html/insertion-text.js | 114 + .../lib/json-summary/index.js | 56 + .../istanbul-reports/lib/json/index.js | 44 + .../istanbul-reports/lib/lcov/index.js | 33 + .../istanbul-reports/lib/lcovonly/index.js | 77 + .../istanbul-reports/lib/none/index.js | 10 + .../istanbul-reports/lib/teamcity/index.js | 67 + .../istanbul-reports/lib/text-lcov/index.js | 17 + .../lib/text-summary/index.js | 62 + .../istanbul-reports/lib/text/index.js | 298 + node_modules/istanbul-reports/package.json | 60 + node_modules/jest-changed-files/LICENSE | 21 + node_modules/jest-changed-files/README.md | 95 + node_modules/jest-changed-files/build/git.js | 169 + node_modules/jest-changed-files/build/hg.js | 130 + .../jest-changed-files/build/index.d.ts | 36 + .../jest-changed-files/build/index.js | 82 + node_modules/jest-changed-files/build/sl.js | 134 + .../jest-changed-files/build/types.js | 1 + node_modules/jest-changed-files/package.json | 31 + node_modules/jest-circus/LICENSE | 21 + node_modules/jest-circus/README.md | 65 + .../jest-circus/build/eventHandler.js | 281 + .../build/formatNodeAssertErrors.js | 186 + .../jest-circus/build/globalErrorHandlers.js | 44 + node_modules/jest-circus/build/index.d.ts | 72 + node_modules/jest-circus/build/index.js | 238 + .../legacy-code-todo-rewrite/jestAdapter.js | 117 + .../jestAdapterInit.js | 240 + node_modules/jest-circus/build/run.js | 350 + .../jest-circus/build/shuffleArray.js | 41 + node_modules/jest-circus/build/state.js | 80 + .../build/testCaseReportHandler.js | 32 + node_modules/jest-circus/build/types.js | 27 + node_modules/jest-circus/build/utils.js | 511 + node_modules/jest-circus/package.json | 59 + node_modules/jest-circus/runner.js | 10 + node_modules/jest-cli/LICENSE | 21 + node_modules/jest-cli/README.md | 11 + node_modules/jest-cli/bin/jest.js | 17 + node_modules/jest-cli/build/args.js | 731 + node_modules/jest-cli/build/index.d.ts | 18 + node_modules/jest-cli/build/index.js | 19 + node_modules/jest-cli/build/run.js | 239 + node_modules/jest-cli/package.json | 88 + node_modules/jest-config/LICENSE | 21 + node_modules/jest-config/build/Defaults.js | 129 + node_modules/jest-config/build/Deprecated.js | 85 + .../jest-config/build/Descriptions.js | 104 + .../build/ReporterValidationErrors.js | 122 + node_modules/jest-config/build/ValidConfig.js | 342 + node_modules/jest-config/build/color.js | 31 + node_modules/jest-config/build/constants.js | 96 + .../jest-config/build/getCacheDirectory.js | 91 + .../jest-config/build/getMaxWorkers.js | 56 + node_modules/jest-config/build/index.d.ts | 147 + node_modules/jest-config/build/index.js | 494 + node_modules/jest-config/build/normalize.js | 1180 ++ .../jest-config/build/parseShardPair.js | 41 + .../build/readConfigFileAndSetRootDir.js | 195 + .../jest-config/build/resolveConfigPath.js | 217 + node_modules/jest-config/build/setFromArgv.js | 58 + .../jest-config/build/stringToBytes.js | 79 + node_modules/jest-config/build/utils.js | 172 + .../jest-config/build/validatePattern.js | 24 + node_modules/jest-config/package.json | 71 + node_modules/jest-diff/LICENSE | 21 + node_modules/jest-diff/README.md | 671 + .../jest-diff/build/cleanupSemantic.js | 599 + node_modules/jest-diff/build/constants.js | 19 + node_modules/jest-diff/build/diffLines.js | 193 + node_modules/jest-diff/build/diffStrings.js | 66 + .../jest-diff/build/getAlignedDiffs.js | 223 + node_modules/jest-diff/build/index.d.ts | 93 + node_modules/jest-diff/build/index.js | 232 + .../jest-diff/build/joinAlignedDiffs.js | 271 + .../jest-diff/build/normalizeDiffOptions.js | 59 + node_modules/jest-diff/build/printDiffs.js | 79 + node_modules/jest-diff/build/types.js | 1 + node_modules/jest-diff/package.json | 36 + node_modules/jest-docblock/LICENSE | 21 + node_modules/jest-docblock/README.md | 108 + node_modules/jest-docblock/build/index.d.ts | 29 + node_modules/jest-docblock/build/index.js | 130 + node_modules/jest-docblock/package.json | 32 + node_modules/jest-each/LICENSE | 21 + node_modules/jest-each/README.md | 548 + node_modules/jest-each/build/bind.js | 81 + node_modules/jest-each/build/index.d.ts | 141 + node_modules/jest-each/build/index.js | 83 + node_modules/jest-each/build/table/array.js | 130 + .../jest-each/build/table/interpolation.js | 53 + .../jest-each/build/table/template.js | 44 + node_modules/jest-each/build/validation.js | 107 + node_modules/jest-each/package.json | 41 + node_modules/jest-environment-node/LICENSE | 21 + .../jest-environment-node/build/index.d.ts | 42 + .../jest-environment-node/build/index.js | 212 + .../jest-environment-node/package.json | 37 + node_modules/jest-get-type/LICENSE | 21 + node_modules/jest-get-type/build/index.d.ts | 27 + node_modules/jest-get-type/build/index.js | 53 + node_modules/jest-get-type/package.json | 27 + node_modules/jest-haste-map/LICENSE | 21 + node_modules/jest-haste-map/build/HasteFS.js | 139 + .../jest-haste-map/build/ModuleMap.js | 249 + .../jest-haste-map/build/blacklist.js | 64 + .../jest-haste-map/build/constants.js | 46 + .../jest-haste-map/build/crawlers/node.js | 269 + .../jest-haste-map/build/crawlers/watchman.js | 339 + .../jest-haste-map/build/getMockName.js | 69 + node_modules/jest-haste-map/build/index.d.ts | 242 + node_modules/jest-haste-map/build/index.js | 1107 ++ .../build/lib/dependencyExtractor.js | 84 + .../jest-haste-map/build/lib/fast_path.js | 76 + .../build/lib/getPlatformExtension.js | 30 + .../build/lib/isWatchmanInstalled.js | 37 + .../build/lib/normalizePathSep.js | 68 + node_modules/jest-haste-map/build/types.js | 1 + .../build/watchers/FSEventsWatcher.js | 244 + .../build/watchers/NodeWatcher.js | 369 + .../build/watchers/RecrawlWarning.js | 49 + .../build/watchers/WatchmanWatcher.js | 383 + .../jest-haste-map/build/watchers/common.js | 111 + node_modules/jest-haste-map/build/worker.js | 180 + node_modules/jest-haste-map/package.json | 47 + node_modules/jest-leak-detector/LICENSE | 21 + node_modules/jest-leak-detector/README.md | 27 + .../jest-leak-detector/build/index.d.ts | 19 + .../jest-leak-detector/build/index.js | 99 + node_modules/jest-leak-detector/package.json | 33 + node_modules/jest-matcher-utils/LICENSE | 21 + node_modules/jest-matcher-utils/README.md | 24 + .../jest-matcher-utils/build/Replaceable.js | 64 + .../build/deepCyclicCopyReplaceable.js | 111 + .../jest-matcher-utils/build/index.d.ts | 138 + .../jest-matcher-utils/build/index.js | 542 + node_modules/jest-matcher-utils/package.json | 37 + node_modules/jest-message-util/LICENSE | 21 + .../jest-message-util/build/index.d.ts | 68 + node_modules/jest-message-util/build/index.js | 518 + node_modules/jest-message-util/build/types.js | 1 + node_modules/jest-message-util/package.json | 43 + node_modules/jest-mock/LICENSE | 21 + node_modules/jest-mock/README.md | 106 + node_modules/jest-mock/build/index.d.ts | 406 + node_modules/jest-mock/build/index.js | 978 ++ node_modules/jest-mock/package.json | 35 + node_modules/jest-pnp-resolver/README.md | 34 + .../jest-pnp-resolver/createRequire.js | 25 + .../jest-pnp-resolver/getDefaultResolver.js | 13 + node_modules/jest-pnp-resolver/index.d.ts | 10 + node_modules/jest-pnp-resolver/index.js | 50 + node_modules/jest-pnp-resolver/package.json | 31 + node_modules/jest-regex-util/LICENSE | 21 + node_modules/jest-regex-util/build/index.d.ts | 20 + node_modules/jest-regex-util/build/index.js | 40 + node_modules/jest-regex-util/package.json | 29 + .../jest-resolve-dependencies/LICENSE | 21 + .../build/index.d.ts | 43 + .../jest-resolve-dependencies/build/index.js | 197 + .../jest-resolve-dependencies/package.json | 37 + node_modules/jest-resolve/LICENSE | 21 + .../jest-resolve/build/ModuleNotFoundError.js | 108 + .../jest-resolve/build/defaultResolver.js | 240 + .../jest-resolve/build/fileWalkers.js | 178 + node_modules/jest-resolve/build/index.d.ts | 320 + node_modules/jest-resolve/build/index.js | 31 + .../jest-resolve/build/isBuiltinModule.js | 27 + .../jest-resolve/build/nodeModulesPaths.js | 131 + node_modules/jest-resolve/build/resolver.js | 796 + .../jest-resolve/build/shouldLoadAsEsm.js | 90 + node_modules/jest-resolve/build/types.js | 1 + node_modules/jest-resolve/build/utils.js | 233 + node_modules/jest-resolve/package.json | 44 + node_modules/jest-runner/LICENSE | 21 + node_modules/jest-runner/build/index.d.ts | 127 + node_modules/jest-runner/build/index.js | 219 + node_modules/jest-runner/build/runTest.js | 462 + node_modules/jest-runner/build/testWorker.js | 123 + node_modules/jest-runner/build/types.js | 28 + node_modules/jest-runner/package.json | 58 + node_modules/jest-runtime/LICENSE | 21 + node_modules/jest-runtime/build/helpers.js | 134 + node_modules/jest-runtime/build/index.d.ts | 193 + node_modules/jest-runtime/build/index.js | 2316 +++ node_modules/jest-runtime/package.json | 56 + node_modules/jest-snapshot/LICENSE | 21 + .../jest-snapshot/build/InlineSnapshots.js | 421 + .../jest-snapshot/build/SnapshotResolver.js | 153 + node_modules/jest-snapshot/build/State.js | 288 + node_modules/jest-snapshot/build/colors.js | 39 + .../jest-snapshot/build/dedentLines.js | 132 + node_modules/jest-snapshot/build/index.d.ts | 186 + node_modules/jest-snapshot/build/index.js | 591 + .../jest-snapshot/build/mockSerializer.js | 47 + node_modules/jest-snapshot/build/plugins.js | 43 + .../jest-snapshot/build/printSnapshot.js | 340 + node_modules/jest-snapshot/build/types.js | 1 + node_modules/jest-snapshot/build/utils.js | 320 + .../jest-snapshot/node_modules/.bin/semver | 12 + .../node_modules/.bin/semver.cmd | 17 + .../node_modules/.bin/semver.ps1 | 28 + .../node_modules/lru-cache/LICENSE | 15 + .../node_modules/lru-cache/README.md | 166 + .../node_modules/lru-cache/index.js | 334 + .../node_modules/lru-cache/package.json | 34 + .../jest-snapshot/node_modules/semver/LICENSE | 15 + .../node_modules/semver/README.md | 637 + .../node_modules/semver/bin/semver.js | 197 + .../node_modules/semver/classes/comparator.js | 141 + .../node_modules/semver/classes/index.js | 5 + .../node_modules/semver/classes/range.js | 539 + .../node_modules/semver/classes/semver.js | 302 + .../node_modules/semver/functions/clean.js | 6 + .../node_modules/semver/functions/cmp.js | 52 + .../node_modules/semver/functions/coerce.js | 52 + .../semver/functions/compare-build.js | 7 + .../semver/functions/compare-loose.js | 3 + .../node_modules/semver/functions/compare.js | 5 + .../node_modules/semver/functions/diff.js | 65 + .../node_modules/semver/functions/eq.js | 3 + .../node_modules/semver/functions/gt.js | 3 + .../node_modules/semver/functions/gte.js | 3 + .../node_modules/semver/functions/inc.js | 19 + .../node_modules/semver/functions/lt.js | 3 + .../node_modules/semver/functions/lte.js | 3 + .../node_modules/semver/functions/major.js | 3 + .../node_modules/semver/functions/minor.js | 3 + .../node_modules/semver/functions/neq.js | 3 + .../node_modules/semver/functions/parse.js | 16 + .../node_modules/semver/functions/patch.js | 3 + .../semver/functions/prerelease.js | 6 + .../node_modules/semver/functions/rcompare.js | 3 + .../node_modules/semver/functions/rsort.js | 3 + .../semver/functions/satisfies.js | 10 + .../node_modules/semver/functions/sort.js | 3 + .../node_modules/semver/functions/valid.js | 6 + .../node_modules/semver/index.js | 89 + .../node_modules/semver/internal/constants.js | 35 + .../node_modules/semver/internal/debug.js | 9 + .../semver/internal/identifiers.js | 23 + .../semver/internal/parse-options.js | 15 + .../node_modules/semver/internal/re.js | 212 + .../node_modules/semver/package.json | 87 + .../node_modules/semver/preload.js | 2 + .../node_modules/semver/range.bnf | 16 + .../node_modules/semver/ranges/gtr.js | 4 + .../node_modules/semver/ranges/intersects.js | 7 + .../node_modules/semver/ranges/ltr.js | 4 + .../semver/ranges/max-satisfying.js | 25 + .../semver/ranges/min-satisfying.js | 24 + .../node_modules/semver/ranges/min-version.js | 61 + .../node_modules/semver/ranges/outside.js | 80 + .../node_modules/semver/ranges/simplify.js | 47 + .../node_modules/semver/ranges/subset.js | 247 + .../semver/ranges/to-comparators.js | 8 + .../node_modules/semver/ranges/valid.js | 11 + .../node_modules/yallist/LICENSE | 15 + .../node_modules/yallist/README.md | 204 + .../node_modules/yallist/iterator.js | 8 + .../node_modules/yallist/package.json | 29 + .../node_modules/yallist/yallist.js | 426 + node_modules/jest-snapshot/package.json | 63 + node_modules/jest-util/LICENSE | 21 + node_modules/jest-util/Readme.md | 87 + .../jest-util/build/ErrorWithStack.js | 28 + node_modules/jest-util/build/clearLine.js | 18 + .../build/convertDescriptorToString.js | 30 + .../jest-util/build/createDirectory.js | 71 + .../jest-util/build/createProcessObject.js | 109 + .../jest-util/build/deepCyclicCopy.js | 76 + node_modules/jest-util/build/formatTime.js | 24 + .../jest-util/build/globsToMatcher.js | 98 + node_modules/jest-util/build/index.d.ts | 136 + node_modules/jest-util/build/index.js | 199 + .../jest-util/build/installCommonGlobals.js | 115 + .../jest-util/build/interopRequireDefault.js | 22 + node_modules/jest-util/build/invariant.js | 18 + node_modules/jest-util/build/isInteractive.js | 22 + node_modules/jest-util/build/isNonNullable.js | 16 + node_modules/jest-util/build/isPromise.js | 20 + node_modules/jest-util/build/pluralize.js | 16 + node_modules/jest-util/build/preRunMessage.js | 38 + .../jest-util/build/replacePathSepForGlob.js | 16 + .../jest-util/build/requireOrImportModule.js | 77 + node_modules/jest-util/build/setGlobal.js | 17 + node_modules/jest-util/build/specialChars.js | 25 + .../build/testPathPatternToRegExp.js | 19 + node_modules/jest-util/build/tryRealpath.js | 30 + node_modules/jest-util/package.json | 38 + node_modules/jest-validate/LICENSE | 21 + node_modules/jest-validate/README.md | 216 + node_modules/jest-validate/build/condition.js | 44 + .../jest-validate/build/defaultConfig.js | 37 + .../jest-validate/build/deprecated.js | 28 + node_modules/jest-validate/build/errors.js | 64 + .../jest-validate/build/exampleConfig.js | 38 + node_modules/jest-validate/build/index.d.ts | 89 + node_modules/jest-validate/build/index.js | 56 + node_modules/jest-validate/build/types.js | 1 + node_modules/jest-validate/build/utils.js | 100 + node_modules/jest-validate/build/validate.js | 117 + .../jest-validate/build/validateCLIOptions.js | 127 + node_modules/jest-validate/build/warnings.js | 41 + .../node_modules/camelcase/index.d.ts | 103 + .../node_modules/camelcase/index.js | 113 + .../node_modules/camelcase/license | 9 + .../node_modules/camelcase/package.json | 44 + .../node_modules/camelcase/readme.md | 144 + node_modules/jest-validate/package.json | 37 + node_modules/jest-watcher/LICENSE | 21 + .../jest-watcher/build/BaseWatchPlugin.js | 35 + node_modules/jest-watcher/build/JestHooks.js | 63 + .../jest-watcher/build/PatternPrompt.js | 74 + .../jest-watcher/build/TestWatcher.js | 45 + node_modules/jest-watcher/build/constants.js | 27 + node_modules/jest-watcher/build/index.d.ts | 222 + node_modules/jest-watcher/build/index.js | 74 + node_modules/jest-watcher/build/lib/Prompt.js | 113 + .../jest-watcher/build/lib/colorize.js | 30 + .../build/lib/formatTestNameByPattern.js | 67 + .../build/lib/patternModeHelpers.js | 54 + node_modules/jest-watcher/build/lib/scroll.js | 31 + node_modules/jest-watcher/build/types.js | 1 + node_modules/jest-watcher/package.json | 41 + node_modules/jest-worker/LICENSE | 21 + node_modules/jest-worker/README.md | 272 + node_modules/jest-worker/build/Farm.js | 152 + node_modules/jest-worker/build/FifoQueue.js | 89 + .../jest-worker/build/PriorityQueue.js | 137 + node_modules/jest-worker/build/WorkerPool.js | 34 + .../jest-worker/build/base/BaseWorkerPool.js | 156 + node_modules/jest-worker/build/index.d.ts | 355 + node_modules/jest-worker/build/index.js | 192 + node_modules/jest-worker/build/types.js | 72 + .../build/workers/ChildProcessWorker.js | 490 + .../build/workers/NodeThreadsWorker.js | 359 + .../build/workers/WorkerAbstract.js | 135 + .../build/workers/messageParent.js | 33 + .../jest-worker/build/workers/processChild.js | 159 + .../jest-worker/build/workers/threadChild.js | 177 + .../node_modules/supports-color/browser.js | 24 + .../node_modules/supports-color/index.js | 152 + .../node_modules/supports-color/license | 9 + .../node_modules/supports-color/package.json | 58 + .../node_modules/supports-color/readme.md | 77 + node_modules/jest-worker/package.json | 42 + node_modules/jest/LICENSE | 21 + node_modules/jest/README.md | 11 + node_modules/jest/bin/jest.js | 13 + node_modules/jest/build/index.d.ts | 26 + node_modules/jest/build/index.js | 49 + node_modules/jest/package.json | 74 + node_modules/js-tokens/CHANGELOG.md | 151 + node_modules/js-tokens/LICENSE | 21 + node_modules/js-tokens/README.md | 240 + node_modules/js-tokens/index.js | 23 + node_modules/js-tokens/package.json | 30 + node_modules/js-yaml/CHANGELOG.md | 557 + node_modules/js-yaml/LICENSE | 21 + node_modules/js-yaml/README.md | 299 + node_modules/js-yaml/bin/js-yaml.js | 132 + node_modules/js-yaml/dist/js-yaml.js | 3989 +++++ node_modules/js-yaml/dist/js-yaml.min.js | 1 + node_modules/js-yaml/index.js | 7 + node_modules/js-yaml/lib/js-yaml.js | 39 + node_modules/js-yaml/lib/js-yaml/common.js | 59 + node_modules/js-yaml/lib/js-yaml/dumper.js | 850 + node_modules/js-yaml/lib/js-yaml/exception.js | 43 + node_modules/js-yaml/lib/js-yaml/loader.js | 1644 ++ node_modules/js-yaml/lib/js-yaml/mark.js | 76 + node_modules/js-yaml/lib/js-yaml/schema.js | 108 + .../js-yaml/lib/js-yaml/schema/core.js | 18 + .../lib/js-yaml/schema/default_full.js | 25 + .../lib/js-yaml/schema/default_safe.js | 28 + .../js-yaml/lib/js-yaml/schema/failsafe.js | 17 + .../js-yaml/lib/js-yaml/schema/json.js | 25 + node_modules/js-yaml/lib/js-yaml/type.js | 61 + .../js-yaml/lib/js-yaml/type/binary.js | 138 + node_modules/js-yaml/lib/js-yaml/type/bool.js | 35 + .../js-yaml/lib/js-yaml/type/float.js | 116 + node_modules/js-yaml/lib/js-yaml/type/int.js | 173 + .../js-yaml/lib/js-yaml/type/js/function.js | 93 + .../js-yaml/lib/js-yaml/type/js/regexp.js | 60 + .../js-yaml/lib/js-yaml/type/js/undefined.js | 28 + node_modules/js-yaml/lib/js-yaml/type/map.js | 8 + .../js-yaml/lib/js-yaml/type/merge.js | 12 + node_modules/js-yaml/lib/js-yaml/type/null.js | 34 + node_modules/js-yaml/lib/js-yaml/type/omap.js | 44 + .../js-yaml/lib/js-yaml/type/pairs.js | 53 + node_modules/js-yaml/lib/js-yaml/type/seq.js | 8 + node_modules/js-yaml/lib/js-yaml/type/set.js | 29 + node_modules/js-yaml/lib/js-yaml/type/str.js | 8 + .../js-yaml/lib/js-yaml/type/timestamp.js | 88 + node_modules/js-yaml/package.json | 49 + node_modules/jsesc/LICENSE-MIT.txt | 20 + node_modules/jsesc/README.md | 421 + node_modules/jsesc/bin/jsesc | 148 + node_modules/jsesc/jsesc.js | 329 + node_modules/jsesc/man/jsesc.1 | 94 + node_modules/jsesc/package.json | 54 + .../CHANGELOG.md | 50 + .../json-parse-even-better-errors/LICENSE.md | 25 + .../json-parse-even-better-errors/README.md | 96 + .../json-parse-even-better-errors/index.js | 121 + .../package.json | 33 + node_modules/json5/LICENSE.md | 23 + node_modules/json5/README.md | 282 + node_modules/json5/dist/index.js | 1737 ++ node_modules/json5/dist/index.min.js | 1 + node_modules/json5/dist/index.min.mjs | 1 + node_modules/json5/dist/index.mjs | 1426 ++ node_modules/json5/lib/cli.js | 152 + node_modules/json5/lib/index.d.ts | 4 + node_modules/json5/lib/index.js | 9 + node_modules/json5/lib/parse.d.ts | 15 + node_modules/json5/lib/parse.js | 1114 ++ node_modules/json5/lib/register.js | 13 + node_modules/json5/lib/require.js | 4 + node_modules/json5/lib/stringify.d.ts | 89 + node_modules/json5/lib/stringify.js | 261 + node_modules/json5/lib/unicode.d.ts | 3 + node_modules/json5/lib/unicode.js | 4 + node_modules/json5/lib/util.d.ts | 5 + node_modules/json5/lib/util.js | 35 + node_modules/json5/package.json | 72 + node_modules/kleur/index.js | 104 + node_modules/kleur/kleur.d.ts | 45 + node_modules/kleur/license | 21 + node_modules/kleur/package.json | 35 + node_modules/kleur/readme.md | 172 + node_modules/leven/index.d.ts | 21 + node_modules/leven/index.js | 77 + node_modules/leven/license | 9 + node_modules/leven/package.json | 57 + node_modules/leven/readme.md | 50 + 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/locate-path/index.d.ts | 83 + node_modules/locate-path/index.js | 65 + node_modules/locate-path/license | 9 + node_modules/locate-path/package.json | 45 + node_modules/locate-path/readme.md | 122 + node_modules/lru-cache/LICENSE | 15 + node_modules/lru-cache/README.md | 166 + node_modules/lru-cache/index.js | 334 + node_modules/lru-cache/package.json | 32 + node_modules/make-dir/index.d.ts | 66 + node_modules/make-dir/index.js | 155 + node_modules/make-dir/license | 9 + .../make-dir/node_modules/.bin/semver | 12 + .../make-dir/node_modules/.bin/semver.cmd | 17 + .../make-dir/node_modules/.bin/semver.ps1 | 28 + .../make-dir/node_modules/lru-cache/LICENSE | 15 + .../make-dir/node_modules/lru-cache/README.md | 166 + .../make-dir/node_modules/lru-cache/index.js | 334 + .../node_modules/lru-cache/package.json | 34 + .../make-dir/node_modules/semver/LICENSE | 15 + .../make-dir/node_modules/semver/README.md | 637 + .../node_modules/semver/bin/semver.js | 197 + .../node_modules/semver/classes/comparator.js | 141 + .../node_modules/semver/classes/index.js | 5 + .../node_modules/semver/classes/range.js | 539 + .../node_modules/semver/classes/semver.js | 302 + .../node_modules/semver/functions/clean.js | 6 + .../node_modules/semver/functions/cmp.js | 52 + .../node_modules/semver/functions/coerce.js | 52 + .../semver/functions/compare-build.js | 7 + .../semver/functions/compare-loose.js | 3 + .../node_modules/semver/functions/compare.js | 5 + .../node_modules/semver/functions/diff.js | 65 + .../node_modules/semver/functions/eq.js | 3 + .../node_modules/semver/functions/gt.js | 3 + .../node_modules/semver/functions/gte.js | 3 + .../node_modules/semver/functions/inc.js | 19 + .../node_modules/semver/functions/lt.js | 3 + .../node_modules/semver/functions/lte.js | 3 + .../node_modules/semver/functions/major.js | 3 + .../node_modules/semver/functions/minor.js | 3 + .../node_modules/semver/functions/neq.js | 3 + .../node_modules/semver/functions/parse.js | 16 + .../node_modules/semver/functions/patch.js | 3 + .../semver/functions/prerelease.js | 6 + .../node_modules/semver/functions/rcompare.js | 3 + .../node_modules/semver/functions/rsort.js | 3 + .../semver/functions/satisfies.js | 10 + .../node_modules/semver/functions/sort.js | 3 + .../node_modules/semver/functions/valid.js | 6 + .../make-dir/node_modules/semver/index.js | 89 + .../node_modules/semver/internal/constants.js | 35 + .../node_modules/semver/internal/debug.js | 9 + .../semver/internal/identifiers.js | 23 + .../semver/internal/parse-options.js | 15 + .../node_modules/semver/internal/re.js | 212 + .../make-dir/node_modules/semver/package.json | 87 + .../make-dir/node_modules/semver/preload.js | 2 + .../make-dir/node_modules/semver/range.bnf | 16 + .../node_modules/semver/ranges/gtr.js | 4 + .../node_modules/semver/ranges/intersects.js | 7 + .../node_modules/semver/ranges/ltr.js | 4 + .../semver/ranges/max-satisfying.js | 25 + .../semver/ranges/min-satisfying.js | 24 + .../node_modules/semver/ranges/min-version.js | 61 + .../node_modules/semver/ranges/outside.js | 80 + .../node_modules/semver/ranges/simplify.js | 47 + .../node_modules/semver/ranges/subset.js | 247 + .../semver/ranges/to-comparators.js | 8 + .../node_modules/semver/ranges/valid.js | 11 + .../make-dir/node_modules/yallist/LICENSE | 15 + .../make-dir/node_modules/yallist/README.md | 204 + .../make-dir/node_modules/yallist/iterator.js | 8 + .../node_modules/yallist/package.json | 29 + .../make-dir/node_modules/yallist/yallist.js | 426 + node_modules/make-dir/package.json | 63 + node_modules/make-dir/readme.md | 125 + node_modules/makeerror/.travis.yml | 3 + node_modules/makeerror/lib/makeerror.js | 87 + node_modules/makeerror/license | 28 + node_modules/makeerror/package.json | 21 + node_modules/makeerror/readme.md | 77 + node_modules/merge-stream/LICENSE | 21 + node_modules/merge-stream/README.md | 78 + node_modules/merge-stream/index.js | 41 + node_modules/merge-stream/package.json | 19 + node_modules/micromatch/LICENSE | 21 + node_modules/micromatch/README.md | 1011 ++ node_modules/micromatch/index.js | 467 + node_modules/micromatch/package.json | 119 + node_modules/mimic-fn/index.d.ts | 54 + node_modules/mimic-fn/index.js | 13 + node_modules/mimic-fn/license | 9 + node_modules/mimic-fn/package.json | 42 + node_modules/mimic-fn/readme.md | 69 + node_modules/minimatch/LICENSE | 15 + node_modules/minimatch/README.md | 230 + node_modules/minimatch/minimatch.js | 947 + node_modules/minimatch/package.json | 33 + node_modules/ms/index.js | 162 + node_modules/ms/license.md | 21 + node_modules/ms/package.json | 37 + node_modules/ms/readme.md | 60 + node_modules/natural-compare/README.md | 125 + node_modules/natural-compare/index.js | 57 + node_modules/natural-compare/package.json | 42 + node_modules/node-int64/.npmignore | 3 + node_modules/node-int64/Int64.js | 268 + node_modules/node-int64/LICENSE | 19 + node_modules/node-int64/README.md | 78 + node_modules/node-int64/package.json | 27 + node_modules/node-int64/test.js | 120 + node_modules/node-releases/LICENSE | 21 + node_modules/node-releases/README.md | 12 + .../node-releases/data/processed/envs.json | 1 + .../release-schedule/release-schedule.json | 1 + node_modules/node-releases/package.json | 19 + node_modules/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/npm-run-path/index.d.ts | 89 + node_modules/npm-run-path/index.js | 47 + node_modules/npm-run-path/license | 9 + node_modules/npm-run-path/package.json | 44 + node_modules/npm-run-path/readme.md | 115 + node_modules/onetime/index.d.ts | 64 + node_modules/onetime/index.js | 44 + node_modules/onetime/license | 9 + node_modules/onetime/package.json | 43 + node_modules/onetime/readme.md | 94 + node_modules/p-limit/index.d.ts | 42 + node_modules/p-limit/index.js | 71 + node_modules/p-limit/license | 9 + node_modules/p-limit/package.json | 52 + node_modules/p-limit/readme.md | 101 + node_modules/p-locate/index.d.ts | 64 + node_modules/p-locate/index.js | 52 + node_modules/p-locate/license | 9 + .../p-locate/node_modules/p-limit/index.d.ts | 38 + .../p-locate/node_modules/p-limit/index.js | 57 + .../p-locate/node_modules/p-limit/license | 9 + .../node_modules/p-limit/package.json | 52 + .../p-locate/node_modules/p-limit/readme.md | 101 + node_modules/p-locate/package.json | 53 + node_modules/p-locate/readme.md | 90 + node_modules/p-try/index.d.ts | 39 + node_modules/p-try/index.js | 9 + node_modules/p-try/license | 9 + node_modules/p-try/package.json | 42 + node_modules/p-try/readme.md | 58 + node_modules/parse-json/index.js | 54 + node_modules/parse-json/license | 9 + node_modules/parse-json/package.json | 45 + node_modules/parse-json/readme.md | 119 + node_modules/path-exists/index.d.ts | 28 + node_modules/path-exists/index.js | 23 + node_modules/path-exists/license | 9 + node_modules/path-exists/package.json | 39 + node_modules/path-exists/readme.md | 52 + node_modules/path-is-absolute/index.js | 20 + node_modules/path-is-absolute/license | 21 + node_modules/path-is-absolute/package.json | 43 + node_modules/path-is-absolute/readme.md | 59 + node_modules/path-key/index.d.ts | 40 + node_modules/path-key/index.js | 16 + node_modules/path-key/license | 9 + node_modules/path-key/package.json | 39 + node_modules/path-key/readme.md | 61 + node_modules/path-parse/LICENSE | 21 + node_modules/path-parse/README.md | 42 + node_modules/path-parse/index.js | 75 + node_modules/path-parse/package.json | 33 + node_modules/picocolors/LICENSE | 15 + node_modules/picocolors/README.md | 21 + node_modules/picocolors/package.json | 25 + node_modules/picocolors/picocolors.browser.js | 4 + node_modules/picocolors/picocolors.d.ts | 5 + node_modules/picocolors/picocolors.js | 58 + node_modules/picocolors/types.ts | 30 + node_modules/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/pirates/LICENSE | 21 + node_modules/pirates/README.md | 69 + node_modules/pirates/index.d.ts | 82 + node_modules/pirates/lib/index.js | 139 + node_modules/pirates/package.json | 74 + node_modules/pkg-dir/index.d.ts | 44 + node_modules/pkg-dir/index.js | 17 + node_modules/pkg-dir/license | 9 + node_modules/pkg-dir/package.json | 56 + node_modules/pkg-dir/readme.md | 66 + node_modules/pretty-format/LICENSE | 21 + node_modules/pretty-format/README.md | 463 + .../pretty-format/build/collections.js | 180 + node_modules/pretty-format/build/index.d.ts | 163 + node_modules/pretty-format/build/index.js | 478 + .../build/plugins/AsymmetricMatcher.js | 89 + .../build/plugins/DOMCollection.js | 67 + .../pretty-format/build/plugins/DOMElement.js | 101 + .../pretty-format/build/plugins/Immutable.js | 217 + .../build/plugins/ReactElement.js | 143 + .../build/plugins/ReactTestComponent.js | 66 + .../build/plugins/lib/escapeHTML.js | 16 + .../pretty-format/build/plugins/lib/markup.js | 113 + node_modules/pretty-format/build/types.js | 1 + .../node_modules/ansi-styles/index.d.ts | 167 + .../node_modules/ansi-styles/index.js | 164 + .../node_modules/ansi-styles/license | 9 + .../node_modules/ansi-styles/package.json | 52 + .../node_modules/ansi-styles/readme.md | 144 + node_modules/pretty-format/package.json | 43 + .../prompts/dist/dateparts/datepart.js | 39 + node_modules/prompts/dist/dateparts/day.js | 35 + node_modules/prompts/dist/dateparts/hours.js | 30 + node_modules/prompts/dist/dateparts/index.js | 13 + .../prompts/dist/dateparts/meridiem.js | 25 + .../prompts/dist/dateparts/milliseconds.js | 28 + .../prompts/dist/dateparts/minutes.js | 29 + node_modules/prompts/dist/dateparts/month.js | 31 + .../prompts/dist/dateparts/seconds.js | 29 + node_modules/prompts/dist/dateparts/year.js | 29 + .../prompts/dist/elements/autocomplete.js | 285 + .../dist/elements/autocompleteMultiselect.js | 201 + node_modules/prompts/dist/elements/confirm.js | 93 + node_modules/prompts/dist/elements/date.js | 250 + node_modules/prompts/dist/elements/index.js | 13 + .../prompts/dist/elements/multiselect.js | 289 + node_modules/prompts/dist/elements/number.js | 250 + node_modules/prompts/dist/elements/prompt.js | 82 + node_modules/prompts/dist/elements/select.js | 190 + node_modules/prompts/dist/elements/text.js | 245 + node_modules/prompts/dist/elements/toggle.js | 124 + node_modules/prompts/dist/index.js | 154 + node_modules/prompts/dist/prompts.js | 222 + node_modules/prompts/dist/util/action.js | 38 + node_modules/prompts/dist/util/clear.js | 42 + .../prompts/dist/util/entriesToDisplay.js | 21 + node_modules/prompts/dist/util/figures.js | 32 + node_modules/prompts/dist/util/index.js | 12 + node_modules/prompts/dist/util/lines.js | 14 + node_modules/prompts/dist/util/strip.js | 7 + node_modules/prompts/dist/util/style.js | 51 + node_modules/prompts/dist/util/wrap.js | 16 + node_modules/prompts/index.js | 14 + .../prompts/lib/dateparts/datepart.js | 35 + node_modules/prompts/lib/dateparts/day.js | 42 + node_modules/prompts/lib/dateparts/hours.js | 30 + node_modules/prompts/lib/dateparts/index.js | 13 + .../prompts/lib/dateparts/meridiem.js | 24 + .../prompts/lib/dateparts/milliseconds.js | 28 + node_modules/prompts/lib/dateparts/minutes.js | 28 + node_modules/prompts/lib/dateparts/month.js | 33 + node_modules/prompts/lib/dateparts/seconds.js | 28 + node_modules/prompts/lib/dateparts/year.js | 28 + .../prompts/lib/elements/autocomplete.js | 264 + .../lib/elements/autocompleteMultiselect.js | 194 + node_modules/prompts/lib/elements/confirm.js | 89 + node_modules/prompts/lib/elements/date.js | 209 + node_modules/prompts/lib/elements/index.js | 13 + .../prompts/lib/elements/multiselect.js | 271 + node_modules/prompts/lib/elements/number.js | 213 + node_modules/prompts/lib/elements/prompt.js | 68 + node_modules/prompts/lib/elements/select.js | 175 + node_modules/prompts/lib/elements/text.js | 208 + node_modules/prompts/lib/elements/toggle.js | 118 + node_modules/prompts/lib/index.js | 98 + node_modules/prompts/lib/prompts.js | 206 + node_modules/prompts/lib/util/action.js | 39 + node_modules/prompts/lib/util/clear.js | 22 + .../prompts/lib/util/entriesToDisplay.js | 21 + node_modules/prompts/lib/util/figures.js | 33 + node_modules/prompts/lib/util/index.js | 12 + node_modules/prompts/lib/util/lines.js | 15 + node_modules/prompts/lib/util/strip.js | 11 + node_modules/prompts/lib/util/style.js | 40 + node_modules/prompts/lib/util/wrap.js | 27 + node_modules/prompts/license | 21 + node_modules/prompts/package.json | 53 + node_modules/prompts/readme.md | 882 + node_modules/pure-rand/CHANGELOG.md | 79 + node_modules/pure-rand/LICENSE | 21 + node_modules/pure-rand/README.md | 208 + .../lib/distribution/Distribution.js | 2 + .../UniformArrayIntDistribution.js | 15 + .../distribution/UniformBigIntDistribution.js | 15 + .../distribution/UniformIntDistribution.js | 15 + .../UnsafeUniformArrayIntDistribution.js | 12 + .../UnsafeUniformBigIntDistribution.js | 28 + .../UnsafeUniformIntDistribution.js | 34 + .../lib/distribution/internals/ArrayInt.js | 141 + ...safeUniformArrayIntDistributionInternal.js | 25 + .../UnsafeUniformIntDistributionInternal.js | 12 + .../lib/esm/distribution/Distribution.js | 1 + .../UniformArrayIntDistribution.js | 12 + .../distribution/UniformBigIntDistribution.js | 12 + .../distribution/UniformIntDistribution.js | 12 + .../UnsafeUniformArrayIntDistribution.js | 8 + .../UnsafeUniformBigIntDistribution.js | 24 + .../UnsafeUniformIntDistribution.js | 30 + .../esm/distribution/internals/ArrayInt.js | 132 + ...safeUniformArrayIntDistributionInternal.js | 21 + .../UnsafeUniformIntDistributionInternal.js | 8 + .../lib/esm/generator/LinearCongruential.js | 37 + .../lib/esm/generator/MersenneTwister.js | 69 + .../lib/esm/generator/RandomGenerator.js | 22 + .../pure-rand/lib/esm/generator/XorShift.js | 59 + .../pure-rand/lib/esm/generator/XoroShiro.js | 59 + node_modules/pure-rand/lib/esm/package.json | 3 + .../pure-rand/lib/esm/pure-rand-default.js | 15 + node_modules/pure-rand/lib/esm/pure-rand.js | 3 + .../esm/types/distribution/Distribution.d.ts | 2 + .../UniformArrayIntDistribution.d.ts | 6 + .../UniformBigIntDistribution.d.ts | 5 + .../distribution/UniformIntDistribution.d.ts | 5 + .../UnsafeUniformArrayIntDistribution.d.ts | 3 + .../UnsafeUniformBigIntDistribution.d.ts | 2 + .../UnsafeUniformIntDistribution.d.ts | 2 + .../distribution/internals/ArrayInt.d.ts | 13 + ...feUniformArrayIntDistributionInternal.d.ts | 3 + .../UnsafeUniformIntDistributionInternal.d.ts | 2 + .../types/generator/LinearCongruential.d.ts | 2 + .../esm/types/generator/MersenneTwister.d.ts | 2 + .../esm/types/generator/RandomGenerator.d.ts | 11 + .../lib/esm/types/generator/XorShift.d.ts | 2 + .../lib/esm/types/generator/XoroShiro.d.ts | 2 + .../lib/esm/types/pure-rand-default.d.ts | 16 + .../pure-rand/lib/esm/types/pure-rand.d.ts | 3 + .../lib/generator/LinearCongruential.js | 41 + .../lib/generator/MersenneTwister.js | 72 + .../lib/generator/RandomGenerator.js | 29 + .../pure-rand/lib/generator/XorShift.js | 63 + .../pure-rand/lib/generator/XoroShiro.js | 63 + .../pure-rand/lib/pure-rand-default.js | 34 + node_modules/pure-rand/lib/pure-rand.js | 19 + .../lib/types/distribution/Distribution.d.ts | 2 + .../UniformArrayIntDistribution.d.ts | 6 + .../UniformBigIntDistribution.d.ts | 5 + .../distribution/UniformIntDistribution.d.ts | 5 + .../UnsafeUniformArrayIntDistribution.d.ts | 3 + .../UnsafeUniformBigIntDistribution.d.ts | 2 + .../UnsafeUniformIntDistribution.d.ts | 2 + .../distribution/internals/ArrayInt.d.ts | 13 + ...feUniformArrayIntDistributionInternal.d.ts | 3 + .../UnsafeUniformIntDistributionInternal.d.ts | 2 + .../types/generator/LinearCongruential.d.ts | 2 + .../lib/types/generator/MersenneTwister.d.ts | 2 + .../lib/types/generator/RandomGenerator.d.ts | 11 + .../lib/types/generator/XorShift.d.ts | 2 + .../lib/types/generator/XoroShiro.d.ts | 2 + .../lib/types/pure-rand-default.d.ts | 16 + .../pure-rand/lib/types/pure-rand.d.ts | 3 + node_modules/pure-rand/package.json | 85 + node_modules/react-is/LICENSE | 21 + node_modules/react-is/README.md | 104 + .../react-is/cjs/react-is.development.js | 221 + .../react-is/cjs/react-is.production.min.js | 14 + node_modules/react-is/index.js | 7 + node_modules/react-is/package.json | 26 + .../react-is/umd/react-is.development.js | 220 + .../react-is/umd/react-is.production.min.js | 15 + node_modules/require-directory/.jshintrc | 67 + node_modules/require-directory/.npmignore | 1 + node_modules/require-directory/.travis.yml | 3 + node_modules/require-directory/LICENSE | 22 + .../require-directory/README.markdown | 184 + node_modules/require-directory/index.js | 86 + node_modules/require-directory/package.json | 40 + node_modules/resolve-cwd/index.d.ts | 48 + node_modules/resolve-cwd/index.js | 5 + node_modules/resolve-cwd/license | 9 + node_modules/resolve-cwd/package.json | 43 + node_modules/resolve-cwd/readme.md | 58 + node_modules/resolve-from/index.d.ts | 31 + node_modules/resolve-from/index.js | 47 + node_modules/resolve-from/license | 9 + node_modules/resolve-from/package.json | 36 + node_modules/resolve-from/readme.md | 72 + node_modules/resolve.exports/dist/index.js | 1 + node_modules/resolve.exports/dist/index.mjs | 1 + node_modules/resolve.exports/index.d.ts | 100 + node_modules/resolve.exports/license | 21 + node_modules/resolve.exports/package.json | 50 + node_modules/resolve.exports/readme.md | 458 + node_modules/resolve/.editorconfig | 37 + node_modules/resolve/.eslintrc | 65 + node_modules/resolve/.github/FUNDING.yml | 12 + node_modules/resolve/LICENSE | 21 + node_modules/resolve/SECURITY.md | 3 + node_modules/resolve/async.js | 3 + node_modules/resolve/bin/resolve | 50 + node_modules/resolve/example/async.js | 5 + node_modules/resolve/example/sync.js | 3 + node_modules/resolve/index.js | 6 + node_modules/resolve/lib/async.js | 329 + node_modules/resolve/lib/caller.js | 8 + node_modules/resolve/lib/core.js | 12 + node_modules/resolve/lib/core.json | 158 + node_modules/resolve/lib/homedir.js | 24 + node_modules/resolve/lib/is-core.js | 5 + .../resolve/lib/node-modules-paths.js | 42 + node_modules/resolve/lib/normalize-options.js | 10 + node_modules/resolve/lib/sync.js | 208 + node_modules/resolve/package.json | 72 + node_modules/resolve/readme.markdown | 301 + node_modules/resolve/sync.js | 3 + node_modules/resolve/test/core.js | 88 + node_modules/resolve/test/dotdot.js | 29 + node_modules/resolve/test/dotdot/abc/index.js | 2 + node_modules/resolve/test/dotdot/index.js | 1 + node_modules/resolve/test/faulty_basedir.js | 29 + node_modules/resolve/test/filter.js | 34 + node_modules/resolve/test/filter_sync.js | 33 + node_modules/resolve/test/home_paths.js | 127 + node_modules/resolve/test/home_paths_sync.js | 114 + node_modules/resolve/test/mock.js | 315 + node_modules/resolve/test/mock_sync.js | 214 + node_modules/resolve/test/module_dir.js | 56 + .../test/module_dir/xmodules/aaa/index.js | 1 + .../test/module_dir/ymodules/aaa/index.js | 1 + .../test/module_dir/zmodules/bbb/main.js | 1 + .../test/module_dir/zmodules/bbb/package.json | 3 + .../resolve/test/node-modules-paths.js | 143 + node_modules/resolve/test/node_path.js | 70 + .../resolve/test/node_path/x/aaa/index.js | 1 + .../resolve/test/node_path/x/ccc/index.js | 1 + .../resolve/test/node_path/y/bbb/index.js | 1 + .../resolve/test/node_path/y/ccc/index.js | 1 + node_modules/resolve/test/nonstring.js | 9 + node_modules/resolve/test/pathfilter.js | 75 + .../resolve/test/pathfilter/deep_ref/main.js | 0 node_modules/resolve/test/precedence.js | 23 + node_modules/resolve/test/precedence/aaa.js | 1 + .../resolve/test/precedence/aaa/index.js | 1 + .../resolve/test/precedence/aaa/main.js | 1 + node_modules/resolve/test/precedence/bbb.js | 1 + .../resolve/test/precedence/bbb/main.js | 1 + node_modules/resolve/test/resolver.js | 597 + .../resolve/test/resolver/baz/doom.js | 0 .../resolve/test/resolver/baz/package.json | 4 + .../resolve/test/resolver/baz/quux.js | 1 + .../resolve/test/resolver/browser_field/a.js | 0 .../resolve/test/resolver/browser_field/b.js | 0 .../test/resolver/browser_field/package.json | 5 + node_modules/resolve/test/resolver/cup.coffee | 1 + .../resolve/test/resolver/dot_main/index.js | 1 + .../test/resolver/dot_main/package.json | 3 + .../test/resolver/dot_slash_main/index.js | 1 + .../test/resolver/dot_slash_main/package.json | 3 + .../resolve/test/resolver/false_main/index.js | 0 .../test/resolver/false_main/package.json | 4 + node_modules/resolve/test/resolver/foo.js | 1 + .../test/resolver/incorrect_main/index.js | 2 + .../test/resolver/incorrect_main/package.json | 3 + .../test/resolver/invalid_main/package.json | 7 + node_modules/resolve/test/resolver/mug.coffee | 0 node_modules/resolve/test/resolver/mug.js | 0 .../test/resolver/multirepo/lerna.json | 6 + .../test/resolver/multirepo/package.json | 20 + .../multirepo/packages/package-a/index.js | 35 + .../multirepo/packages/package-a/package.json | 14 + .../multirepo/packages/package-b/index.js | 0 .../multirepo/packages/package-b/package.json | 14 + .../resolver/nested_symlinks/mylib/async.js | 26 + .../nested_symlinks/mylib/package.json | 15 + .../resolver/nested_symlinks/mylib/sync.js | 12 + .../test/resolver/other_path/lib/other-lib.js | 0 .../resolve/test/resolver/other_path/root.js | 0 .../resolve/test/resolver/quux/foo/index.js | 1 + .../resolve/test/resolver/same_names/foo.js | 1 + .../test/resolver/same_names/foo/index.js | 1 + .../resolver/symlinked/_/node_modules/foo.js | 0 .../symlinked/_/symlink_target/.gitkeep | 0 .../test/resolver/symlinked/package/bar.js | 1 + .../resolver/symlinked/package/package.json | 3 + .../test/resolver/without_basedir/main.js | 5 + node_modules/resolve/test/resolver_sync.js | 730 + node_modules/resolve/test/shadowed_core.js | 54 + .../shadowed_core/node_modules/util/index.js | 0 node_modules/resolve/test/subdirs.js | 13 + node_modules/resolve/test/symlinks.js | 176 + node_modules/semver/LICENSE | 15 + node_modules/semver/README.md | 443 + node_modules/semver/bin/semver.js | 174 + node_modules/semver/package.json | 38 + node_modules/semver/range.bnf | 16 + node_modules/semver/semver.js | 1643 ++ node_modules/shebang-command/index.js | 19 + node_modules/shebang-command/license | 9 + node_modules/shebang-command/package.json | 34 + node_modules/shebang-command/readme.md | 34 + node_modules/shebang-regex/index.d.ts | 22 + node_modules/shebang-regex/index.js | 2 + node_modules/shebang-regex/license | 9 + node_modules/shebang-regex/package.json | 35 + node_modules/shebang-regex/readme.md | 33 + node_modules/signal-exit/LICENSE.txt | 16 + node_modules/signal-exit/README.md | 39 + node_modules/signal-exit/index.js | 202 + node_modules/signal-exit/package.json | 38 + node_modules/signal-exit/signals.js | 53 + node_modules/sisteransi/license | 21 + node_modules/sisteransi/package.json | 34 + node_modules/sisteransi/readme.md | 113 + node_modules/sisteransi/src/index.js | 58 + node_modules/sisteransi/src/sisteransi.d.ts | 35 + node_modules/slash/index.d.ts | 25 + node_modules/slash/index.js | 11 + node_modules/slash/license | 9 + node_modules/slash/package.json | 35 + node_modules/slash/readme.md | 44 + node_modules/source-map-support/LICENSE.md | 21 + node_modules/source-map-support/README.md | 284 + .../browser-source-map-support.js | 113 + node_modules/source-map-support/package.json | 31 + node_modules/source-map-support/register.js | 1 + .../source-map-support/source-map-support.js | 567 + node_modules/source-map/CHANGELOG.md | 301 + node_modules/source-map/LICENSE | 28 + node_modules/source-map/README.md | 742 + .../source-map/dist/source-map.debug.js | 3234 ++++ node_modules/source-map/dist/source-map.js | 3233 ++++ .../source-map/dist/source-map.min.js | 2 + .../source-map/dist/source-map.min.js.map | 1 + node_modules/source-map/lib/array-set.js | 121 + node_modules/source-map/lib/base64-vlq.js | 140 + node_modules/source-map/lib/base64.js | 67 + node_modules/source-map/lib/binary-search.js | 111 + node_modules/source-map/lib/mapping-list.js | 79 + node_modules/source-map/lib/quick-sort.js | 114 + .../source-map/lib/source-map-consumer.js | 1145 ++ .../source-map/lib/source-map-generator.js | 425 + node_modules/source-map/lib/source-node.js | 413 + node_modules/source-map/lib/util.js | 488 + node_modules/source-map/package.json | 73 + node_modules/source-map/source-map.d.ts | 98 + node_modules/source-map/source-map.js | 8 + node_modules/sprintf-js/.npmignore | 1 + node_modules/sprintf-js/LICENSE | 24 + node_modules/sprintf-js/README.md | 88 + node_modules/sprintf-js/bower.json | 14 + node_modules/sprintf-js/demo/angular.html | 20 + .../sprintf-js/dist/angular-sprintf.min.js | 4 + .../dist/angular-sprintf.min.js.map | 1 + .../sprintf-js/dist/angular-sprintf.min.map | 1 + node_modules/sprintf-js/dist/sprintf.min.js | 4 + .../sprintf-js/dist/sprintf.min.js.map | 1 + node_modules/sprintf-js/dist/sprintf.min.map | 1 + node_modules/sprintf-js/gruntfile.js | 36 + node_modules/sprintf-js/package.json | 22 + .../sprintf-js/src/angular-sprintf.js | 18 + node_modules/sprintf-js/src/sprintf.js | 208 + node_modules/sprintf-js/test/test.js | 82 + node_modules/stack-utils/LICENSE.md | 21 + node_modules/stack-utils/index.js | 344 + node_modules/stack-utils/package.json | 39 + node_modules/stack-utils/readme.md | 143 + node_modules/string-length/index.d.ts | 22 + node_modules/string-length/index.js | 19 + node_modules/string-length/license | 9 + node_modules/string-length/package.json | 45 + node_modules/string-length/readme.md | 43 + node_modules/string-width/index.d.ts | 29 + node_modules/string-width/index.js | 47 + node_modules/string-width/license | 9 + node_modules/string-width/package.json | 56 + node_modules/string-width/readme.md | 50 + node_modules/strip-ansi/index.d.ts | 17 + node_modules/strip-ansi/index.js | 4 + node_modules/strip-ansi/license | 9 + node_modules/strip-ansi/package.json | 54 + node_modules/strip-ansi/readme.md | 46 + node_modules/strip-bom/index.d.ts | 14 + node_modules/strip-bom/index.js | 15 + node_modules/strip-bom/license | 9 + node_modules/strip-bom/package.json | 42 + node_modules/strip-bom/readme.md | 54 + node_modules/strip-final-newline/index.js | 16 + node_modules/strip-final-newline/license | 9 + node_modules/strip-final-newline/package.json | 40 + node_modules/strip-final-newline/readme.md | 30 + node_modules/strip-json-comments/index.d.ts | 36 + node_modules/strip-json-comments/index.js | 77 + node_modules/strip-json-comments/license | 9 + node_modules/strip-json-comments/package.json | 47 + node_modules/strip-json-comments/readme.md | 78 + node_modules/supports-color/browser.js | 5 + node_modules/supports-color/index.js | 135 + node_modules/supports-color/license | 9 + node_modules/supports-color/package.json | 53 + node_modules/supports-color/readme.md | 76 + .../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/test-exclude/CHANGELOG.md | 352 + node_modules/test-exclude/LICENSE.txt | 14 + node_modules/test-exclude/README.md | 96 + node_modules/test-exclude/index.js | 161 + .../test-exclude/is-outside-dir-posix.js | 7 + .../test-exclude/is-outside-dir-win32.js | 10 + node_modules/test-exclude/is-outside-dir.js | 7 + node_modules/test-exclude/package.json | 45 + node_modules/tmpl/lib/tmpl.js | 17 + node_modules/tmpl/license | 28 + node_modules/tmpl/package.json | 19 + node_modules/tmpl/readme.md | 10 + node_modules/to-fast-properties/index.js | 27 + node_modules/to-fast-properties/license | 10 + node_modules/to-fast-properties/package.json | 35 + node_modules/to-fast-properties/readme.md | 37 + 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/type-detect/LICENSE | 19 + node_modules/type-detect/README.md | 228 + node_modules/type-detect/index.js | 378 + node_modules/type-detect/package.json | 1 + node_modules/type-detect/type-detect.js | 388 + node_modules/type-fest/base.d.ts | 39 + node_modules/type-fest/index.d.ts | 2 + node_modules/type-fest/license | 9 + node_modules/type-fest/package.json | 58 + node_modules/type-fest/readme.md | 760 + .../type-fest/source/async-return-type.d.ts | 23 + node_modules/type-fest/source/asyncify.d.ts | 31 + node_modules/type-fest/source/basic.d.ts | 51 + .../type-fest/source/conditional-except.d.ts | 43 + .../type-fest/source/conditional-keys.d.ts | 43 + .../type-fest/source/conditional-pick.d.ts | 42 + node_modules/type-fest/source/entries.d.ts | 57 + node_modules/type-fest/source/entry.d.ts | 60 + node_modules/type-fest/source/except.d.ts | 22 + .../type-fest/source/fixed-length-array.d.ts | 38 + .../type-fest/source/iterable-element.d.ts | 46 + .../type-fest/source/literal-union.d.ts | 33 + .../type-fest/source/merge-exclusive.d.ts | 39 + node_modules/type-fest/source/merge.d.ts | 25 + node_modules/type-fest/source/mutable.d.ts | 38 + node_modules/type-fest/source/opaque.d.ts | 65 + .../type-fest/source/package-json.d.ts | 611 + .../type-fest/source/partial-deep.d.ts | 72 + node_modules/type-fest/source/promisable.d.ts | 23 + .../type-fest/source/promise-value.d.ts | 27 + .../type-fest/source/readonly-deep.d.ts | 59 + .../source/require-at-least-one.d.ts | 33 + .../type-fest/source/require-exactly-one.d.ts | 35 + .../type-fest/source/set-optional.d.ts | 33 + .../type-fest/source/set-required.d.ts | 33 + .../type-fest/source/set-return-type.d.ts | 29 + node_modules/type-fest/source/simplify.d.ts | 4 + .../type-fest/source/stringified.d.ts | 21 + .../type-fest/source/tsconfig-json.d.ts | 870 + .../type-fest/source/typed-array.d.ts | 15 + .../source/union-to-intersection.d.ts | 58 + node_modules/type-fest/source/utilities.d.ts | 5 + node_modules/type-fest/source/value-of.d.ts | 40 + node_modules/type-fest/ts41/camel-case.d.ts | 64 + .../type-fest/ts41/delimiter-case.d.ts | 85 + node_modules/type-fest/ts41/get.d.ts | 131 + node_modules/type-fest/ts41/index.d.ts | 10 + node_modules/type-fest/ts41/kebab-case.d.ts | 36 + node_modules/type-fest/ts41/pascal-case.d.ts | 36 + node_modules/type-fest/ts41/snake-case.d.ts | 35 + node_modules/type-fest/ts41/utilities.d.ts | 8 + node_modules/update-browserslist-db/LICENSE | 20 + node_modules/update-browserslist-db/README.md | 22 + .../check-npm-version.js | 16 + node_modules/update-browserslist-db/cli.js | 42 + .../update-browserslist-db/index.d.ts | 6 + node_modules/update-browserslist-db/index.js | 322 + .../update-browserslist-db/package.json | 40 + node_modules/update-browserslist-db/utils.js | 22 + node_modules/v8-to-istanbul/CHANGELOG.md | 431 + node_modules/v8-to-istanbul/LICENSE.txt | 14 + node_modules/v8-to-istanbul/README.md | 86 + node_modules/v8-to-istanbul/index.d.ts | 25 + node_modules/v8-to-istanbul/index.js | 5 + node_modules/v8-to-istanbul/lib/branch.js | 28 + node_modules/v8-to-istanbul/lib/function.js | 29 + node_modules/v8-to-istanbul/lib/line.js | 34 + node_modules/v8-to-istanbul/lib/range.js | 35 + node_modules/v8-to-istanbul/lib/source.js | 245 + .../v8-to-istanbul/lib/v8-to-istanbul.js | 323 + node_modules/v8-to-istanbul/package.json | 49 + node_modules/walker/.travis.yml | 3 + node_modules/walker/LICENSE | 13 + node_modules/walker/lib/walker.js | 111 + node_modules/walker/package.json | 27 + node_modules/walker/readme.md | 52 + node_modules/which/CHANGELOG.md | 166 + node_modules/which/LICENSE | 15 + node_modules/which/README.md | 54 + node_modules/which/bin/node-which | 52 + node_modules/which/package.json | 43 + node_modules/which/which.js | 125 + node_modules/wrap-ansi/index.js | 216 + node_modules/wrap-ansi/license | 9 + node_modules/wrap-ansi/package.json | 62 + node_modules/wrap-ansi/readme.md | 91 + node_modules/write-file-atomic/LICENSE.md | 6 + node_modules/write-file-atomic/README.md | 91 + node_modules/write-file-atomic/lib/index.js | 267 + node_modules/write-file-atomic/package.json | 55 + node_modules/y18n/CHANGELOG.md | 100 + node_modules/y18n/LICENSE | 13 + node_modules/y18n/README.md | 127 + node_modules/y18n/build/index.cjs | 203 + node_modules/y18n/build/lib/cjs.js | 6 + node_modules/y18n/build/lib/index.js | 174 + .../y18n/build/lib/platform-shims/node.js | 19 + node_modules/y18n/index.mjs | 8 + node_modules/y18n/package.json | 70 + node_modules/yallist/LICENSE | 15 + node_modules/yallist/README.md | 204 + node_modules/yallist/iterator.js | 8 + node_modules/yallist/package.json | 29 + node_modules/yallist/yallist.js | 426 + node_modules/yargs-parser/CHANGELOG.md | 308 + node_modules/yargs-parser/LICENSE.txt | 14 + node_modules/yargs-parser/README.md | 518 + node_modules/yargs-parser/browser.js | 29 + node_modules/yargs-parser/build/index.cjs | 1050 ++ node_modules/yargs-parser/build/lib/index.js | 62 + .../yargs-parser/build/lib/string-utils.js | 65 + .../build/lib/tokenize-arg-string.js | 40 + .../build/lib/yargs-parser-types.js | 12 + .../yargs-parser/build/lib/yargs-parser.js | 1045 ++ node_modules/yargs-parser/package.json | 92 + node_modules/yargs/LICENSE | 21 + node_modules/yargs/README.md | 204 + node_modules/yargs/browser.d.ts | 5 + node_modules/yargs/browser.mjs | 7 + node_modules/yargs/build/index.cjs | 1 + node_modules/yargs/build/lib/argsert.js | 62 + node_modules/yargs/build/lib/command.js | 449 + .../yargs/build/lib/completion-templates.js | 48 + node_modules/yargs/build/lib/completion.js | 243 + node_modules/yargs/build/lib/middleware.js | 88 + node_modules/yargs/build/lib/parse-command.js | 32 + .../yargs/build/lib/typings/common-types.js | 9 + .../build/lib/typings/yargs-parser-types.js | 1 + node_modules/yargs/build/lib/usage.js | 584 + .../yargs/build/lib/utils/apply-extends.js | 59 + .../yargs/build/lib/utils/is-promise.js | 5 + .../yargs/build/lib/utils/levenshtein.js | 34 + .../build/lib/utils/maybe-async-result.js | 17 + .../yargs/build/lib/utils/obj-filter.js | 10 + .../yargs/build/lib/utils/process-argv.js | 17 + .../yargs/build/lib/utils/set-blocking.js | 12 + .../yargs/build/lib/utils/which-module.js | 10 + node_modules/yargs/build/lib/validation.js | 305 + node_modules/yargs/build/lib/yargs-factory.js | 1512 ++ node_modules/yargs/build/lib/yerror.js | 9 + node_modules/yargs/helpers/helpers.mjs | 10 + node_modules/yargs/helpers/index.js | 14 + node_modules/yargs/helpers/package.json | 3 + node_modules/yargs/index.cjs | 53 + node_modules/yargs/index.mjs | 8 + .../yargs/lib/platform-shims/browser.mjs | 95 + node_modules/yargs/lib/platform-shims/esm.mjs | 73 + node_modules/yargs/locales/be.json | 46 + node_modules/yargs/locales/cs.json | 51 + node_modules/yargs/locales/de.json | 46 + node_modules/yargs/locales/en.json | 55 + node_modules/yargs/locales/es.json | 46 + node_modules/yargs/locales/fi.json | 49 + node_modules/yargs/locales/fr.json | 53 + node_modules/yargs/locales/hi.json | 49 + node_modules/yargs/locales/hu.json | 46 + node_modules/yargs/locales/id.json | 50 + node_modules/yargs/locales/it.json | 46 + node_modules/yargs/locales/ja.json | 51 + node_modules/yargs/locales/ko.json | 49 + node_modules/yargs/locales/nb.json | 44 + node_modules/yargs/locales/nl.json | 49 + node_modules/yargs/locales/nn.json | 44 + node_modules/yargs/locales/pirate.json | 13 + node_modules/yargs/locales/pl.json | 49 + node_modules/yargs/locales/pt.json | 45 + node_modules/yargs/locales/pt_BR.json | 48 + node_modules/yargs/locales/ru.json | 51 + node_modules/yargs/locales/th.json | 46 + node_modules/yargs/locales/tr.json | 48 + node_modules/yargs/locales/uk_UA.json | 51 + node_modules/yargs/locales/uz.json | 52 + node_modules/yargs/locales/zh_CN.json | 48 + node_modules/yargs/locales/zh_TW.json | 51 + node_modules/yargs/package.json | 123 + node_modules/yargs/yargs | 9 + node_modules/yargs/yargs.mjs | 10 + node_modules/yocto-queue/index.d.ts | 56 + node_modules/yocto-queue/index.js | 68 + node_modules/yocto-queue/license | 9 + node_modules/yocto-queue/package.json | 43 + node_modules/yocto-queue/readme.md | 64 + package-lock.json | 6734 ++++++- package.json | 6 +- 3959 files changed, 348973 insertions(+), 502 deletions(-) create mode 100644 evaluate-dependencies.js create mode 100644 evaluate-dependencies.test.js create mode 100644 node_modules/.bin/browserslist create mode 100644 node_modules/.bin/browserslist.cmd create mode 100644 node_modules/.bin/browserslist.ps1 create mode 100644 node_modules/.bin/create-jest create mode 100644 node_modules/.bin/create-jest.cmd create mode 100644 node_modules/.bin/create-jest.ps1 create mode 100644 node_modules/.bin/esparse create mode 100644 node_modules/.bin/esparse.cmd create mode 100644 node_modules/.bin/esparse.ps1 create mode 100644 node_modules/.bin/esvalidate create mode 100644 node_modules/.bin/esvalidate.cmd create mode 100644 node_modules/.bin/esvalidate.ps1 create mode 100644 node_modules/.bin/import-local-fixture create mode 100644 node_modules/.bin/import-local-fixture.cmd create mode 100644 node_modules/.bin/import-local-fixture.ps1 create mode 100644 node_modules/.bin/jest create mode 100644 node_modules/.bin/jest.cmd create mode 100644 node_modules/.bin/jest.ps1 create mode 100644 node_modules/.bin/js-yaml create mode 100644 node_modules/.bin/js-yaml.cmd create mode 100644 node_modules/.bin/js-yaml.ps1 create mode 100644 node_modules/.bin/jsesc create mode 100644 node_modules/.bin/jsesc.cmd create mode 100644 node_modules/.bin/jsesc.ps1 create mode 100644 node_modules/.bin/json5 create mode 100644 node_modules/.bin/json5.cmd create mode 100644 node_modules/.bin/json5.ps1 create mode 100644 node_modules/.bin/node-which create mode 100644 node_modules/.bin/node-which.cmd create mode 100644 node_modules/.bin/node-which.ps1 create mode 100644 node_modules/.bin/parser create mode 100644 node_modules/.bin/parser.cmd create mode 100644 node_modules/.bin/parser.ps1 create mode 100644 node_modules/.bin/resolve create mode 100644 node_modules/.bin/resolve.cmd create mode 100644 node_modules/.bin/resolve.ps1 create mode 100644 node_modules/.bin/semver create mode 100644 node_modules/.bin/semver.cmd create mode 100644 node_modules/.bin/semver.ps1 create mode 100644 node_modules/.bin/update-browserslist-db create mode 100644 node_modules/.bin/update-browserslist-db.cmd create mode 100644 node_modules/.bin/update-browserslist-db.ps1 create mode 100644 node_modules/.bin/uuid.cmd create mode 100644 node_modules/.bin/uuid.ps1 create mode 100644 node_modules/@ampproject/remapping/LICENSE create mode 100644 node_modules/@ampproject/remapping/README.md create mode 100644 node_modules/@ampproject/remapping/dist/remapping.mjs create mode 100644 node_modules/@ampproject/remapping/dist/remapping.mjs.map create mode 100644 node_modules/@ampproject/remapping/dist/remapping.umd.js create mode 100644 node_modules/@ampproject/remapping/dist/remapping.umd.js.map create mode 100644 node_modules/@ampproject/remapping/dist/types/build-source-map-tree.d.ts create mode 100644 node_modules/@ampproject/remapping/dist/types/remapping.d.ts create mode 100644 node_modules/@ampproject/remapping/dist/types/source-map-tree.d.ts create mode 100644 node_modules/@ampproject/remapping/dist/types/source-map.d.ts create mode 100644 node_modules/@ampproject/remapping/dist/types/types.d.ts create mode 100644 node_modules/@ampproject/remapping/package.json create mode 100644 node_modules/@babel/code-frame/LICENSE create mode 100644 node_modules/@babel/code-frame/README.md create mode 100644 node_modules/@babel/code-frame/lib/index.js create mode 100644 node_modules/@babel/code-frame/lib/index.js.map create mode 100644 node_modules/@babel/code-frame/node_modules/ansi-styles/index.js create mode 100644 node_modules/@babel/code-frame/node_modules/ansi-styles/license create mode 100644 node_modules/@babel/code-frame/node_modules/ansi-styles/package.json create mode 100644 node_modules/@babel/code-frame/node_modules/ansi-styles/readme.md create mode 100644 node_modules/@babel/code-frame/node_modules/chalk/index.js create mode 100644 node_modules/@babel/code-frame/node_modules/chalk/index.js.flow create mode 100644 node_modules/@babel/code-frame/node_modules/chalk/license create mode 100644 node_modules/@babel/code-frame/node_modules/chalk/package.json create mode 100644 node_modules/@babel/code-frame/node_modules/chalk/readme.md create mode 100644 node_modules/@babel/code-frame/node_modules/chalk/templates.js create mode 100644 node_modules/@babel/code-frame/node_modules/chalk/types/index.d.ts create mode 100644 node_modules/@babel/code-frame/node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/@babel/code-frame/node_modules/color-convert/LICENSE create mode 100644 node_modules/@babel/code-frame/node_modules/color-convert/README.md create mode 100644 node_modules/@babel/code-frame/node_modules/color-convert/conversions.js create mode 100644 node_modules/@babel/code-frame/node_modules/color-convert/index.js create mode 100644 node_modules/@babel/code-frame/node_modules/color-convert/package.json create mode 100644 node_modules/@babel/code-frame/node_modules/color-convert/route.js create mode 100644 node_modules/@babel/code-frame/node_modules/color-name/.eslintrc.json create mode 100644 node_modules/@babel/code-frame/node_modules/color-name/.npmignore create mode 100644 node_modules/@babel/code-frame/node_modules/color-name/LICENSE create mode 100644 node_modules/@babel/code-frame/node_modules/color-name/README.md create mode 100644 node_modules/@babel/code-frame/node_modules/color-name/index.js create mode 100644 node_modules/@babel/code-frame/node_modules/color-name/package.json create mode 100644 node_modules/@babel/code-frame/node_modules/color-name/test.js create mode 100644 node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js create mode 100644 node_modules/@babel/code-frame/node_modules/escape-string-regexp/license create mode 100644 node_modules/@babel/code-frame/node_modules/escape-string-regexp/package.json create mode 100644 node_modules/@babel/code-frame/node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/@babel/code-frame/node_modules/has-flag/index.js create mode 100644 node_modules/@babel/code-frame/node_modules/has-flag/license create mode 100644 node_modules/@babel/code-frame/node_modules/has-flag/package.json create mode 100644 node_modules/@babel/code-frame/node_modules/has-flag/readme.md create mode 100644 node_modules/@babel/code-frame/node_modules/supports-color/browser.js create mode 100644 node_modules/@babel/code-frame/node_modules/supports-color/index.js create mode 100644 node_modules/@babel/code-frame/node_modules/supports-color/license create mode 100644 node_modules/@babel/code-frame/node_modules/supports-color/package.json create mode 100644 node_modules/@babel/code-frame/node_modules/supports-color/readme.md create mode 100644 node_modules/@babel/code-frame/package.json create mode 100644 node_modules/@babel/compat-data/LICENSE create mode 100644 node_modules/@babel/compat-data/README.md create mode 100644 node_modules/@babel/compat-data/corejs2-built-ins.js create mode 100644 node_modules/@babel/compat-data/corejs3-shipped-proposals.js create mode 100644 node_modules/@babel/compat-data/data/corejs2-built-ins.json create mode 100644 node_modules/@babel/compat-data/data/corejs3-shipped-proposals.json create mode 100644 node_modules/@babel/compat-data/data/native-modules.json create mode 100644 node_modules/@babel/compat-data/data/overlapping-plugins.json create mode 100644 node_modules/@babel/compat-data/data/plugin-bugfixes.json create mode 100644 node_modules/@babel/compat-data/data/plugins.json create mode 100644 node_modules/@babel/compat-data/native-modules.js create mode 100644 node_modules/@babel/compat-data/overlapping-plugins.js create mode 100644 node_modules/@babel/compat-data/package.json create mode 100644 node_modules/@babel/compat-data/plugin-bugfixes.js create mode 100644 node_modules/@babel/compat-data/plugins.js create mode 100644 node_modules/@babel/core/LICENSE create mode 100644 node_modules/@babel/core/README.md create mode 100644 node_modules/@babel/core/cjs-proxy.cjs create mode 100644 node_modules/@babel/core/lib/config/cache-contexts.js create mode 100644 node_modules/@babel/core/lib/config/cache-contexts.js.map create mode 100644 node_modules/@babel/core/lib/config/caching.js create mode 100644 node_modules/@babel/core/lib/config/caching.js.map create mode 100644 node_modules/@babel/core/lib/config/config-chain.js create mode 100644 node_modules/@babel/core/lib/config/config-chain.js.map create mode 100644 node_modules/@babel/core/lib/config/config-descriptors.js create mode 100644 node_modules/@babel/core/lib/config/config-descriptors.js.map create mode 100644 node_modules/@babel/core/lib/config/files/configuration.js create mode 100644 node_modules/@babel/core/lib/config/files/configuration.js.map create mode 100644 node_modules/@babel/core/lib/config/files/import.cjs create mode 100644 node_modules/@babel/core/lib/config/files/import.cjs.map create mode 100644 node_modules/@babel/core/lib/config/files/index-browser.js create mode 100644 node_modules/@babel/core/lib/config/files/index-browser.js.map create mode 100644 node_modules/@babel/core/lib/config/files/index.js create mode 100644 node_modules/@babel/core/lib/config/files/index.js.map create mode 100644 node_modules/@babel/core/lib/config/files/module-types.js create mode 100644 node_modules/@babel/core/lib/config/files/module-types.js.map create mode 100644 node_modules/@babel/core/lib/config/files/package.js create mode 100644 node_modules/@babel/core/lib/config/files/package.js.map create mode 100644 node_modules/@babel/core/lib/config/files/plugins.js create mode 100644 node_modules/@babel/core/lib/config/files/plugins.js.map create mode 100644 node_modules/@babel/core/lib/config/files/types.js create mode 100644 node_modules/@babel/core/lib/config/files/types.js.map create mode 100644 node_modules/@babel/core/lib/config/files/utils.js create mode 100644 node_modules/@babel/core/lib/config/files/utils.js.map create mode 100644 node_modules/@babel/core/lib/config/full.js create mode 100644 node_modules/@babel/core/lib/config/full.js.map create mode 100644 node_modules/@babel/core/lib/config/helpers/config-api.js create mode 100644 node_modules/@babel/core/lib/config/helpers/config-api.js.map create mode 100644 node_modules/@babel/core/lib/config/helpers/deep-array.js create mode 100644 node_modules/@babel/core/lib/config/helpers/deep-array.js.map create mode 100644 node_modules/@babel/core/lib/config/helpers/environment.js create mode 100644 node_modules/@babel/core/lib/config/helpers/environment.js.map create mode 100644 node_modules/@babel/core/lib/config/index.js create mode 100644 node_modules/@babel/core/lib/config/index.js.map create mode 100644 node_modules/@babel/core/lib/config/item.js create mode 100644 node_modules/@babel/core/lib/config/item.js.map create mode 100644 node_modules/@babel/core/lib/config/partial.js create mode 100644 node_modules/@babel/core/lib/config/partial.js.map create mode 100644 node_modules/@babel/core/lib/config/pattern-to-regex.js create mode 100644 node_modules/@babel/core/lib/config/pattern-to-regex.js.map create mode 100644 node_modules/@babel/core/lib/config/plugin.js create mode 100644 node_modules/@babel/core/lib/config/plugin.js.map create mode 100644 node_modules/@babel/core/lib/config/printer.js create mode 100644 node_modules/@babel/core/lib/config/printer.js.map create mode 100644 node_modules/@babel/core/lib/config/resolve-targets-browser.js create mode 100644 node_modules/@babel/core/lib/config/resolve-targets-browser.js.map create mode 100644 node_modules/@babel/core/lib/config/resolve-targets.js create mode 100644 node_modules/@babel/core/lib/config/resolve-targets.js.map create mode 100644 node_modules/@babel/core/lib/config/util.js create mode 100644 node_modules/@babel/core/lib/config/util.js.map create mode 100644 node_modules/@babel/core/lib/config/validation/option-assertions.js create mode 100644 node_modules/@babel/core/lib/config/validation/option-assertions.js.map create mode 100644 node_modules/@babel/core/lib/config/validation/options.js create mode 100644 node_modules/@babel/core/lib/config/validation/options.js.map create mode 100644 node_modules/@babel/core/lib/config/validation/plugins.js create mode 100644 node_modules/@babel/core/lib/config/validation/plugins.js.map create mode 100644 node_modules/@babel/core/lib/config/validation/removed.js create mode 100644 node_modules/@babel/core/lib/config/validation/removed.js.map create mode 100644 node_modules/@babel/core/lib/errors/config-error.js create mode 100644 node_modules/@babel/core/lib/errors/config-error.js.map create mode 100644 node_modules/@babel/core/lib/errors/rewrite-stack-trace.js create mode 100644 node_modules/@babel/core/lib/errors/rewrite-stack-trace.js.map create mode 100644 node_modules/@babel/core/lib/gensync-utils/async.js create mode 100644 node_modules/@babel/core/lib/gensync-utils/async.js.map create mode 100644 node_modules/@babel/core/lib/gensync-utils/fs.js create mode 100644 node_modules/@babel/core/lib/gensync-utils/fs.js.map create mode 100644 node_modules/@babel/core/lib/gensync-utils/functional.js create mode 100644 node_modules/@babel/core/lib/gensync-utils/functional.js.map create mode 100644 node_modules/@babel/core/lib/index.js create mode 100644 node_modules/@babel/core/lib/index.js.map create mode 100644 node_modules/@babel/core/lib/parse.js create mode 100644 node_modules/@babel/core/lib/parse.js.map create mode 100644 node_modules/@babel/core/lib/parser/index.js create mode 100644 node_modules/@babel/core/lib/parser/index.js.map create mode 100644 node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js create mode 100644 node_modules/@babel/core/lib/parser/util/missing-plugin-helper.js.map create mode 100644 node_modules/@babel/core/lib/tools/build-external-helpers.js create mode 100644 node_modules/@babel/core/lib/tools/build-external-helpers.js.map create mode 100644 node_modules/@babel/core/lib/transform-ast.js create mode 100644 node_modules/@babel/core/lib/transform-ast.js.map create mode 100644 node_modules/@babel/core/lib/transform-file-browser.js create mode 100644 node_modules/@babel/core/lib/transform-file-browser.js.map create mode 100644 node_modules/@babel/core/lib/transform-file.js create mode 100644 node_modules/@babel/core/lib/transform-file.js.map create mode 100644 node_modules/@babel/core/lib/transform.js create mode 100644 node_modules/@babel/core/lib/transform.js.map create mode 100644 node_modules/@babel/core/lib/transformation/block-hoist-plugin.js create mode 100644 node_modules/@babel/core/lib/transformation/block-hoist-plugin.js.map create mode 100644 node_modules/@babel/core/lib/transformation/file/file.js create mode 100644 node_modules/@babel/core/lib/transformation/file/file.js.map create mode 100644 node_modules/@babel/core/lib/transformation/file/generate.js create mode 100644 node_modules/@babel/core/lib/transformation/file/generate.js.map create mode 100644 node_modules/@babel/core/lib/transformation/file/merge-map.js create mode 100644 node_modules/@babel/core/lib/transformation/file/merge-map.js.map create mode 100644 node_modules/@babel/core/lib/transformation/index.js create mode 100644 node_modules/@babel/core/lib/transformation/index.js.map create mode 100644 node_modules/@babel/core/lib/transformation/normalize-file.js create mode 100644 node_modules/@babel/core/lib/transformation/normalize-file.js.map create mode 100644 node_modules/@babel/core/lib/transformation/normalize-opts.js create mode 100644 node_modules/@babel/core/lib/transformation/normalize-opts.js.map create mode 100644 node_modules/@babel/core/lib/transformation/plugin-pass.js create mode 100644 node_modules/@babel/core/lib/transformation/plugin-pass.js.map create mode 100644 node_modules/@babel/core/lib/transformation/util/clone-deep.js create mode 100644 node_modules/@babel/core/lib/transformation/util/clone-deep.js.map create mode 100644 node_modules/@babel/core/lib/vendor/import-meta-resolve.js create mode 100644 node_modules/@babel/core/lib/vendor/import-meta-resolve.js.map create mode 100644 node_modules/@babel/core/package.json create mode 100644 node_modules/@babel/core/src/config/files/index-browser.ts create mode 100644 node_modules/@babel/core/src/config/files/index.ts create mode 100644 node_modules/@babel/core/src/config/resolve-targets-browser.ts create mode 100644 node_modules/@babel/core/src/config/resolve-targets.ts create mode 100644 node_modules/@babel/core/src/transform-file-browser.ts create mode 100644 node_modules/@babel/core/src/transform-file.ts create mode 100644 node_modules/@babel/generator/LICENSE create mode 100644 node_modules/@babel/generator/README.md create mode 100644 node_modules/@babel/generator/lib/buffer.js create mode 100644 node_modules/@babel/generator/lib/buffer.js.map create mode 100644 node_modules/@babel/generator/lib/generators/base.js create mode 100644 node_modules/@babel/generator/lib/generators/base.js.map create mode 100644 node_modules/@babel/generator/lib/generators/classes.js create mode 100644 node_modules/@babel/generator/lib/generators/classes.js.map create mode 100644 node_modules/@babel/generator/lib/generators/expressions.js create mode 100644 node_modules/@babel/generator/lib/generators/expressions.js.map create mode 100644 node_modules/@babel/generator/lib/generators/flow.js create mode 100644 node_modules/@babel/generator/lib/generators/flow.js.map create mode 100644 node_modules/@babel/generator/lib/generators/index.js create mode 100644 node_modules/@babel/generator/lib/generators/index.js.map create mode 100644 node_modules/@babel/generator/lib/generators/jsx.js create mode 100644 node_modules/@babel/generator/lib/generators/jsx.js.map create mode 100644 node_modules/@babel/generator/lib/generators/methods.js create mode 100644 node_modules/@babel/generator/lib/generators/methods.js.map create mode 100644 node_modules/@babel/generator/lib/generators/modules.js create mode 100644 node_modules/@babel/generator/lib/generators/modules.js.map create mode 100644 node_modules/@babel/generator/lib/generators/statements.js create mode 100644 node_modules/@babel/generator/lib/generators/statements.js.map create mode 100644 node_modules/@babel/generator/lib/generators/template-literals.js create mode 100644 node_modules/@babel/generator/lib/generators/template-literals.js.map create mode 100644 node_modules/@babel/generator/lib/generators/types.js create mode 100644 node_modules/@babel/generator/lib/generators/types.js.map create mode 100644 node_modules/@babel/generator/lib/generators/typescript.js create mode 100644 node_modules/@babel/generator/lib/generators/typescript.js.map create mode 100644 node_modules/@babel/generator/lib/index.js create mode 100644 node_modules/@babel/generator/lib/index.js.map create mode 100644 node_modules/@babel/generator/lib/node/index.js create mode 100644 node_modules/@babel/generator/lib/node/index.js.map create mode 100644 node_modules/@babel/generator/lib/node/parentheses.js create mode 100644 node_modules/@babel/generator/lib/node/parentheses.js.map create mode 100644 node_modules/@babel/generator/lib/node/whitespace.js create mode 100644 node_modules/@babel/generator/lib/node/whitespace.js.map create mode 100644 node_modules/@babel/generator/lib/printer.js create mode 100644 node_modules/@babel/generator/lib/printer.js.map create mode 100644 node_modules/@babel/generator/lib/source-map.js create mode 100644 node_modules/@babel/generator/lib/source-map.js.map create mode 100644 node_modules/@babel/generator/package.json create mode 100644 node_modules/@babel/helper-compilation-targets/LICENSE create mode 100644 node_modules/@babel/helper-compilation-targets/README.md create mode 100644 node_modules/@babel/helper-compilation-targets/lib/debug.js create mode 100644 node_modules/@babel/helper-compilation-targets/lib/debug.js.map create mode 100644 node_modules/@babel/helper-compilation-targets/lib/filter-items.js create mode 100644 node_modules/@babel/helper-compilation-targets/lib/filter-items.js.map create mode 100644 node_modules/@babel/helper-compilation-targets/lib/index.js create mode 100644 node_modules/@babel/helper-compilation-targets/lib/index.js.map create mode 100644 node_modules/@babel/helper-compilation-targets/lib/options.js create mode 100644 node_modules/@babel/helper-compilation-targets/lib/options.js.map create mode 100644 node_modules/@babel/helper-compilation-targets/lib/pretty.js create mode 100644 node_modules/@babel/helper-compilation-targets/lib/pretty.js.map create mode 100644 node_modules/@babel/helper-compilation-targets/lib/targets.js create mode 100644 node_modules/@babel/helper-compilation-targets/lib/targets.js.map create mode 100644 node_modules/@babel/helper-compilation-targets/lib/utils.js create mode 100644 node_modules/@babel/helper-compilation-targets/lib/utils.js.map create mode 100644 node_modules/@babel/helper-compilation-targets/package.json create mode 100644 node_modules/@babel/helper-environment-visitor/LICENSE create mode 100644 node_modules/@babel/helper-environment-visitor/README.md create mode 100644 node_modules/@babel/helper-environment-visitor/lib/index.js create mode 100644 node_modules/@babel/helper-environment-visitor/lib/index.js.map create mode 100644 node_modules/@babel/helper-environment-visitor/package.json create mode 100644 node_modules/@babel/helper-function-name/LICENSE create mode 100644 node_modules/@babel/helper-function-name/README.md create mode 100644 node_modules/@babel/helper-function-name/lib/index.js create mode 100644 node_modules/@babel/helper-function-name/lib/index.js.map create mode 100644 node_modules/@babel/helper-function-name/package.json create mode 100644 node_modules/@babel/helper-hoist-variables/LICENSE create mode 100644 node_modules/@babel/helper-hoist-variables/README.md create mode 100644 node_modules/@babel/helper-hoist-variables/lib/index.js create mode 100644 node_modules/@babel/helper-hoist-variables/lib/index.js.map create mode 100644 node_modules/@babel/helper-hoist-variables/package.json create mode 100644 node_modules/@babel/helper-module-imports/LICENSE create mode 100644 node_modules/@babel/helper-module-imports/README.md create mode 100644 node_modules/@babel/helper-module-imports/lib/import-builder.js create mode 100644 node_modules/@babel/helper-module-imports/lib/import-builder.js.map create mode 100644 node_modules/@babel/helper-module-imports/lib/import-injector.js create mode 100644 node_modules/@babel/helper-module-imports/lib/import-injector.js.map create mode 100644 node_modules/@babel/helper-module-imports/lib/index.js create mode 100644 node_modules/@babel/helper-module-imports/lib/index.js.map create mode 100644 node_modules/@babel/helper-module-imports/lib/is-module.js create mode 100644 node_modules/@babel/helper-module-imports/lib/is-module.js.map create mode 100644 node_modules/@babel/helper-module-imports/package.json create mode 100644 node_modules/@babel/helper-module-transforms/LICENSE create mode 100644 node_modules/@babel/helper-module-transforms/README.md create mode 100644 node_modules/@babel/helper-module-transforms/lib/dynamic-import.js create mode 100644 node_modules/@babel/helper-module-transforms/lib/dynamic-import.js.map create mode 100644 node_modules/@babel/helper-module-transforms/lib/get-module-name.js create mode 100644 node_modules/@babel/helper-module-transforms/lib/get-module-name.js.map create mode 100644 node_modules/@babel/helper-module-transforms/lib/index.js create mode 100644 node_modules/@babel/helper-module-transforms/lib/index.js.map create mode 100644 node_modules/@babel/helper-module-transforms/lib/lazy-modules.js create mode 100644 node_modules/@babel/helper-module-transforms/lib/lazy-modules.js.map create mode 100644 node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js create mode 100644 node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js.map create mode 100644 node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js create mode 100644 node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js.map create mode 100644 node_modules/@babel/helper-module-transforms/lib/rewrite-this.js create mode 100644 node_modules/@babel/helper-module-transforms/lib/rewrite-this.js.map create mode 100644 node_modules/@babel/helper-module-transforms/package.json create mode 100644 node_modules/@babel/helper-plugin-utils/LICENSE create mode 100644 node_modules/@babel/helper-plugin-utils/README.md create mode 100644 node_modules/@babel/helper-plugin-utils/lib/index.js create mode 100644 node_modules/@babel/helper-plugin-utils/lib/index.js.map create mode 100644 node_modules/@babel/helper-plugin-utils/package.json create mode 100644 node_modules/@babel/helper-simple-access/LICENSE create mode 100644 node_modules/@babel/helper-simple-access/README.md create mode 100644 node_modules/@babel/helper-simple-access/lib/index.js create mode 100644 node_modules/@babel/helper-simple-access/lib/index.js.map create mode 100644 node_modules/@babel/helper-simple-access/package.json create mode 100644 node_modules/@babel/helper-split-export-declaration/LICENSE create mode 100644 node_modules/@babel/helper-split-export-declaration/README.md create mode 100644 node_modules/@babel/helper-split-export-declaration/lib/index.js create mode 100644 node_modules/@babel/helper-split-export-declaration/lib/index.js.map create mode 100644 node_modules/@babel/helper-split-export-declaration/package.json create mode 100644 node_modules/@babel/helper-string-parser/LICENSE create mode 100644 node_modules/@babel/helper-string-parser/README.md create mode 100644 node_modules/@babel/helper-string-parser/lib/index.js create mode 100644 node_modules/@babel/helper-string-parser/lib/index.js.map create mode 100644 node_modules/@babel/helper-string-parser/package.json create mode 100644 node_modules/@babel/helper-validator-identifier/LICENSE create mode 100644 node_modules/@babel/helper-validator-identifier/README.md create mode 100644 node_modules/@babel/helper-validator-identifier/lib/identifier.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/identifier.js.map create mode 100644 node_modules/@babel/helper-validator-identifier/lib/index.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/index.js.map create mode 100644 node_modules/@babel/helper-validator-identifier/lib/keyword.js create mode 100644 node_modules/@babel/helper-validator-identifier/lib/keyword.js.map create mode 100644 node_modules/@babel/helper-validator-identifier/package.json create mode 100644 node_modules/@babel/helper-validator-identifier/scripts/generate-identifier-regex.js create mode 100644 node_modules/@babel/helper-validator-option/LICENSE create mode 100644 node_modules/@babel/helper-validator-option/README.md create mode 100644 node_modules/@babel/helper-validator-option/lib/find-suggestion.js create mode 100644 node_modules/@babel/helper-validator-option/lib/find-suggestion.js.map create mode 100644 node_modules/@babel/helper-validator-option/lib/index.js create mode 100644 node_modules/@babel/helper-validator-option/lib/index.js.map create mode 100644 node_modules/@babel/helper-validator-option/lib/validator.js create mode 100644 node_modules/@babel/helper-validator-option/lib/validator.js.map create mode 100644 node_modules/@babel/helper-validator-option/package.json create mode 100644 node_modules/@babel/helpers/LICENSE create mode 100644 node_modules/@babel/helpers/README.md create mode 100644 node_modules/@babel/helpers/lib/helpers-generated.js create mode 100644 node_modules/@babel/helpers/lib/helpers-generated.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers.js create mode 100644 node_modules/@babel/helpers/lib/helpers.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/AsyncGenerator.js create mode 100644 node_modules/@babel/helpers/lib/helpers/AsyncGenerator.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/OverloadYield.js create mode 100644 node_modules/@babel/helpers/lib/helpers/OverloadYield.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/applyDecs.js create mode 100644 node_modules/@babel/helpers/lib/helpers/applyDecs.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/applyDecs2203.js create mode 100644 node_modules/@babel/helpers/lib/helpers/applyDecs2203.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/applyDecs2203R.js create mode 100644 node_modules/@babel/helpers/lib/helpers/applyDecs2203R.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/applyDecs2301.js create mode 100644 node_modules/@babel/helpers/lib/helpers/applyDecs2301.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/applyDecs2305.js create mode 100644 node_modules/@babel/helpers/lib/helpers/applyDecs2305.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/asyncGeneratorDelegate.js create mode 100644 node_modules/@babel/helpers/lib/helpers/asyncGeneratorDelegate.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/asyncIterator.js create mode 100644 node_modules/@babel/helpers/lib/helpers/asyncIterator.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/awaitAsyncGenerator.js create mode 100644 node_modules/@babel/helpers/lib/helpers/awaitAsyncGenerator.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/checkInRHS.js create mode 100644 node_modules/@babel/helpers/lib/helpers/checkInRHS.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/defineAccessor.js create mode 100644 node_modules/@babel/helpers/lib/helpers/defineAccessor.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/dispose.js create mode 100644 node_modules/@babel/helpers/lib/helpers/dispose.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/importDeferProxy.js create mode 100644 node_modules/@babel/helpers/lib/helpers/importDeferProxy.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/interopRequireWildcard.js create mode 100644 node_modules/@babel/helpers/lib/helpers/interopRequireWildcard.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/iterableToArrayLimit.js create mode 100644 node_modules/@babel/helpers/lib/helpers/iterableToArrayLimit.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/iterableToArrayLimitLoose.js create mode 100644 node_modules/@babel/helpers/lib/helpers/iterableToArrayLimitLoose.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/jsx.js create mode 100644 node_modules/@babel/helpers/lib/helpers/jsx.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/objectSpread2.js create mode 100644 node_modules/@babel/helpers/lib/helpers/objectSpread2.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js create mode 100644 node_modules/@babel/helpers/lib/helpers/regeneratorRuntime.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/typeof.js create mode 100644 node_modules/@babel/helpers/lib/helpers/typeof.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/using.js create mode 100644 node_modules/@babel/helpers/lib/helpers/using.js.map create mode 100644 node_modules/@babel/helpers/lib/helpers/wrapRegExp.js create mode 100644 node_modules/@babel/helpers/lib/helpers/wrapRegExp.js.map create mode 100644 node_modules/@babel/helpers/lib/index.js create mode 100644 node_modules/@babel/helpers/lib/index.js.map create mode 100644 node_modules/@babel/helpers/package.json create mode 100644 node_modules/@babel/helpers/scripts/generate-helpers.js create mode 100644 node_modules/@babel/helpers/scripts/generate-regenerator-runtime.js create mode 100644 node_modules/@babel/helpers/scripts/package.json create mode 100644 node_modules/@babel/highlight/LICENSE create mode 100644 node_modules/@babel/highlight/README.md create mode 100644 node_modules/@babel/highlight/lib/index.js create mode 100644 node_modules/@babel/highlight/lib/index.js.map create mode 100644 node_modules/@babel/highlight/node_modules/ansi-styles/index.js create mode 100644 node_modules/@babel/highlight/node_modules/ansi-styles/license create mode 100644 node_modules/@babel/highlight/node_modules/ansi-styles/package.json create mode 100644 node_modules/@babel/highlight/node_modules/ansi-styles/readme.md create mode 100644 node_modules/@babel/highlight/node_modules/chalk/index.js create mode 100644 node_modules/@babel/highlight/node_modules/chalk/index.js.flow create mode 100644 node_modules/@babel/highlight/node_modules/chalk/license create mode 100644 node_modules/@babel/highlight/node_modules/chalk/package.json create mode 100644 node_modules/@babel/highlight/node_modules/chalk/readme.md create mode 100644 node_modules/@babel/highlight/node_modules/chalk/templates.js create mode 100644 node_modules/@babel/highlight/node_modules/chalk/types/index.d.ts create mode 100644 node_modules/@babel/highlight/node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/@babel/highlight/node_modules/color-convert/LICENSE create mode 100644 node_modules/@babel/highlight/node_modules/color-convert/README.md create mode 100644 node_modules/@babel/highlight/node_modules/color-convert/conversions.js create mode 100644 node_modules/@babel/highlight/node_modules/color-convert/index.js create mode 100644 node_modules/@babel/highlight/node_modules/color-convert/package.json create mode 100644 node_modules/@babel/highlight/node_modules/color-convert/route.js create mode 100644 node_modules/@babel/highlight/node_modules/color-name/.eslintrc.json create mode 100644 node_modules/@babel/highlight/node_modules/color-name/.npmignore create mode 100644 node_modules/@babel/highlight/node_modules/color-name/LICENSE create mode 100644 node_modules/@babel/highlight/node_modules/color-name/README.md create mode 100644 node_modules/@babel/highlight/node_modules/color-name/index.js create mode 100644 node_modules/@babel/highlight/node_modules/color-name/package.json create mode 100644 node_modules/@babel/highlight/node_modules/color-name/test.js create mode 100644 node_modules/@babel/highlight/node_modules/escape-string-regexp/index.js create mode 100644 node_modules/@babel/highlight/node_modules/escape-string-regexp/license create mode 100644 node_modules/@babel/highlight/node_modules/escape-string-regexp/package.json create mode 100644 node_modules/@babel/highlight/node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/@babel/highlight/node_modules/has-flag/index.js create mode 100644 node_modules/@babel/highlight/node_modules/has-flag/license create mode 100644 node_modules/@babel/highlight/node_modules/has-flag/package.json create mode 100644 node_modules/@babel/highlight/node_modules/has-flag/readme.md create mode 100644 node_modules/@babel/highlight/node_modules/supports-color/browser.js create mode 100644 node_modules/@babel/highlight/node_modules/supports-color/index.js create mode 100644 node_modules/@babel/highlight/node_modules/supports-color/license create mode 100644 node_modules/@babel/highlight/node_modules/supports-color/package.json create mode 100644 node_modules/@babel/highlight/node_modules/supports-color/readme.md create mode 100644 node_modules/@babel/highlight/package.json create mode 100644 node_modules/@babel/parser/CHANGELOG.md create mode 100644 node_modules/@babel/parser/LICENSE create mode 100644 node_modules/@babel/parser/README.md create mode 100644 node_modules/@babel/parser/bin/babel-parser.js create mode 100644 node_modules/@babel/parser/index.cjs create mode 100644 node_modules/@babel/parser/lib/index.js create mode 100644 node_modules/@babel/parser/lib/index.js.map create mode 100644 node_modules/@babel/parser/package.json create mode 100644 node_modules/@babel/parser/typings/babel-parser.d.ts create mode 100644 node_modules/@babel/plugin-syntax-async-generators/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-async-generators/README.md create mode 100644 node_modules/@babel/plugin-syntax-async-generators/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-async-generators/package.json create mode 100644 node_modules/@babel/plugin-syntax-bigint/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-bigint/README.md create mode 100644 node_modules/@babel/plugin-syntax-bigint/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-bigint/package.json create mode 100644 node_modules/@babel/plugin-syntax-class-properties/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-class-properties/README.md create mode 100644 node_modules/@babel/plugin-syntax-class-properties/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-class-properties/package.json create mode 100644 node_modules/@babel/plugin-syntax-import-meta/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-import-meta/README.md create mode 100644 node_modules/@babel/plugin-syntax-import-meta/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-import-meta/package.json create mode 100644 node_modules/@babel/plugin-syntax-json-strings/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-json-strings/README.md create mode 100644 node_modules/@babel/plugin-syntax-json-strings/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-json-strings/package.json create mode 100644 node_modules/@babel/plugin-syntax-jsx/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-jsx/README.md create mode 100644 node_modules/@babel/plugin-syntax-jsx/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-jsx/lib/index.js.map create mode 100644 node_modules/@babel/plugin-syntax-jsx/package.json create mode 100644 node_modules/@babel/plugin-syntax-logical-assignment-operators/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-logical-assignment-operators/README.md create mode 100644 node_modules/@babel/plugin-syntax-logical-assignment-operators/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-logical-assignment-operators/package.json create mode 100644 node_modules/@babel/plugin-syntax-nullish-coalescing-operator/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-nullish-coalescing-operator/README.md create mode 100644 node_modules/@babel/plugin-syntax-nullish-coalescing-operator/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-nullish-coalescing-operator/package.json create mode 100644 node_modules/@babel/plugin-syntax-numeric-separator/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-numeric-separator/README.md create mode 100644 node_modules/@babel/plugin-syntax-numeric-separator/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-numeric-separator/package.json create mode 100644 node_modules/@babel/plugin-syntax-object-rest-spread/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-object-rest-spread/README.md create mode 100644 node_modules/@babel/plugin-syntax-object-rest-spread/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-object-rest-spread/package.json create mode 100644 node_modules/@babel/plugin-syntax-optional-catch-binding/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-optional-catch-binding/README.md create mode 100644 node_modules/@babel/plugin-syntax-optional-catch-binding/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-optional-catch-binding/package.json create mode 100644 node_modules/@babel/plugin-syntax-optional-chaining/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-optional-chaining/README.md create mode 100644 node_modules/@babel/plugin-syntax-optional-chaining/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-optional-chaining/package.json create mode 100644 node_modules/@babel/plugin-syntax-top-level-await/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-top-level-await/README.md create mode 100644 node_modules/@babel/plugin-syntax-top-level-await/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-top-level-await/package.json create mode 100644 node_modules/@babel/plugin-syntax-typescript/LICENSE create mode 100644 node_modules/@babel/plugin-syntax-typescript/README.md create mode 100644 node_modules/@babel/plugin-syntax-typescript/lib/index.js create mode 100644 node_modules/@babel/plugin-syntax-typescript/lib/index.js.map create mode 100644 node_modules/@babel/plugin-syntax-typescript/package.json create mode 100644 node_modules/@babel/template/LICENSE create mode 100644 node_modules/@babel/template/README.md create mode 100644 node_modules/@babel/template/lib/builder.js create mode 100644 node_modules/@babel/template/lib/builder.js.map create mode 100644 node_modules/@babel/template/lib/formatters.js create mode 100644 node_modules/@babel/template/lib/formatters.js.map create mode 100644 node_modules/@babel/template/lib/index.js create mode 100644 node_modules/@babel/template/lib/index.js.map create mode 100644 node_modules/@babel/template/lib/literal.js create mode 100644 node_modules/@babel/template/lib/literal.js.map create mode 100644 node_modules/@babel/template/lib/options.js create mode 100644 node_modules/@babel/template/lib/options.js.map create mode 100644 node_modules/@babel/template/lib/parse.js create mode 100644 node_modules/@babel/template/lib/parse.js.map create mode 100644 node_modules/@babel/template/lib/populate.js create mode 100644 node_modules/@babel/template/lib/populate.js.map create mode 100644 node_modules/@babel/template/lib/string.js create mode 100644 node_modules/@babel/template/lib/string.js.map create mode 100644 node_modules/@babel/template/package.json create mode 100644 node_modules/@babel/traverse/LICENSE create mode 100644 node_modules/@babel/traverse/README.md create mode 100644 node_modules/@babel/traverse/lib/cache.js create mode 100644 node_modules/@babel/traverse/lib/cache.js.map create mode 100644 node_modules/@babel/traverse/lib/context.js create mode 100644 node_modules/@babel/traverse/lib/context.js.map create mode 100644 node_modules/@babel/traverse/lib/hub.js create mode 100644 node_modules/@babel/traverse/lib/hub.js.map create mode 100644 node_modules/@babel/traverse/lib/index.js create mode 100644 node_modules/@babel/traverse/lib/index.js.map create mode 100644 node_modules/@babel/traverse/lib/path/ancestry.js create mode 100644 node_modules/@babel/traverse/lib/path/ancestry.js.map create mode 100644 node_modules/@babel/traverse/lib/path/comments.js create mode 100644 node_modules/@babel/traverse/lib/path/comments.js.map create mode 100644 node_modules/@babel/traverse/lib/path/context.js create mode 100644 node_modules/@babel/traverse/lib/path/context.js.map create mode 100644 node_modules/@babel/traverse/lib/path/conversion.js create mode 100644 node_modules/@babel/traverse/lib/path/conversion.js.map create mode 100644 node_modules/@babel/traverse/lib/path/evaluation.js create mode 100644 node_modules/@babel/traverse/lib/path/evaluation.js.map create mode 100644 node_modules/@babel/traverse/lib/path/family.js create mode 100644 node_modules/@babel/traverse/lib/path/family.js.map create mode 100644 node_modules/@babel/traverse/lib/path/index.js create mode 100644 node_modules/@babel/traverse/lib/path/index.js.map create mode 100644 node_modules/@babel/traverse/lib/path/inference/index.js create mode 100644 node_modules/@babel/traverse/lib/path/inference/index.js.map create mode 100644 node_modules/@babel/traverse/lib/path/inference/inferer-reference.js create mode 100644 node_modules/@babel/traverse/lib/path/inference/inferer-reference.js.map create mode 100644 node_modules/@babel/traverse/lib/path/inference/inferers.js create mode 100644 node_modules/@babel/traverse/lib/path/inference/inferers.js.map create mode 100644 node_modules/@babel/traverse/lib/path/inference/util.js create mode 100644 node_modules/@babel/traverse/lib/path/inference/util.js.map create mode 100644 node_modules/@babel/traverse/lib/path/introspection.js create mode 100644 node_modules/@babel/traverse/lib/path/introspection.js.map create mode 100644 node_modules/@babel/traverse/lib/path/lib/hoister.js create mode 100644 node_modules/@babel/traverse/lib/path/lib/hoister.js.map create mode 100644 node_modules/@babel/traverse/lib/path/lib/removal-hooks.js create mode 100644 node_modules/@babel/traverse/lib/path/lib/removal-hooks.js.map create mode 100644 node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js create mode 100644 node_modules/@babel/traverse/lib/path/lib/virtual-types-validator.js.map create mode 100644 node_modules/@babel/traverse/lib/path/lib/virtual-types.js create mode 100644 node_modules/@babel/traverse/lib/path/lib/virtual-types.js.map create mode 100644 node_modules/@babel/traverse/lib/path/modification.js create mode 100644 node_modules/@babel/traverse/lib/path/modification.js.map create mode 100644 node_modules/@babel/traverse/lib/path/removal.js create mode 100644 node_modules/@babel/traverse/lib/path/removal.js.map create mode 100644 node_modules/@babel/traverse/lib/path/replacement.js create mode 100644 node_modules/@babel/traverse/lib/path/replacement.js.map create mode 100644 node_modules/@babel/traverse/lib/scope/binding.js create mode 100644 node_modules/@babel/traverse/lib/scope/binding.js.map create mode 100644 node_modules/@babel/traverse/lib/scope/index.js create mode 100644 node_modules/@babel/traverse/lib/scope/index.js.map create mode 100644 node_modules/@babel/traverse/lib/scope/lib/renamer.js create mode 100644 node_modules/@babel/traverse/lib/scope/lib/renamer.js.map create mode 100644 node_modules/@babel/traverse/lib/traverse-node.js create mode 100644 node_modules/@babel/traverse/lib/traverse-node.js.map create mode 100644 node_modules/@babel/traverse/lib/types.js create mode 100644 node_modules/@babel/traverse/lib/types.js.map create mode 100644 node_modules/@babel/traverse/lib/visitors.js create mode 100644 node_modules/@babel/traverse/lib/visitors.js.map create mode 100644 node_modules/@babel/traverse/package.json create mode 100644 node_modules/@babel/types/LICENSE create mode 100644 node_modules/@babel/types/README.md create mode 100644 node_modules/@babel/types/lib/asserts/assertNode.js create mode 100644 node_modules/@babel/types/lib/asserts/assertNode.js.map create mode 100644 node_modules/@babel/types/lib/asserts/generated/index.js create mode 100644 node_modules/@babel/types/lib/asserts/generated/index.js.map create mode 100644 node_modules/@babel/types/lib/ast-types/generated/index.js create mode 100644 node_modules/@babel/types/lib/ast-types/generated/index.js.map create mode 100644 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js create mode 100644 node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js.map create mode 100644 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js create mode 100644 node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTypeof.js.map create mode 100644 node_modules/@babel/types/lib/builders/generated/index.js create mode 100644 node_modules/@babel/types/lib/builders/generated/index.js.map create mode 100644 node_modules/@babel/types/lib/builders/generated/uppercase.js create mode 100644 node_modules/@babel/types/lib/builders/generated/uppercase.js.map create mode 100644 node_modules/@babel/types/lib/builders/productions.js create mode 100644 node_modules/@babel/types/lib/builders/productions.js.map create mode 100644 node_modules/@babel/types/lib/builders/react/buildChildren.js create mode 100644 node_modules/@babel/types/lib/builders/react/buildChildren.js.map create mode 100644 node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js create mode 100644 node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js.map create mode 100644 node_modules/@babel/types/lib/builders/validateNode.js create mode 100644 node_modules/@babel/types/lib/builders/validateNode.js.map create mode 100644 node_modules/@babel/types/lib/clone/clone.js create mode 100644 node_modules/@babel/types/lib/clone/clone.js.map create mode 100644 node_modules/@babel/types/lib/clone/cloneDeep.js create mode 100644 node_modules/@babel/types/lib/clone/cloneDeep.js.map create mode 100644 node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js create mode 100644 node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js.map create mode 100644 node_modules/@babel/types/lib/clone/cloneNode.js create mode 100644 node_modules/@babel/types/lib/clone/cloneNode.js.map create mode 100644 node_modules/@babel/types/lib/clone/cloneWithoutLoc.js create mode 100644 node_modules/@babel/types/lib/clone/cloneWithoutLoc.js.map create mode 100644 node_modules/@babel/types/lib/comments/addComment.js create mode 100644 node_modules/@babel/types/lib/comments/addComment.js.map create mode 100644 node_modules/@babel/types/lib/comments/addComments.js create mode 100644 node_modules/@babel/types/lib/comments/addComments.js.map create mode 100644 node_modules/@babel/types/lib/comments/inheritInnerComments.js create mode 100644 node_modules/@babel/types/lib/comments/inheritInnerComments.js.map create mode 100644 node_modules/@babel/types/lib/comments/inheritLeadingComments.js create mode 100644 node_modules/@babel/types/lib/comments/inheritLeadingComments.js.map create mode 100644 node_modules/@babel/types/lib/comments/inheritTrailingComments.js create mode 100644 node_modules/@babel/types/lib/comments/inheritTrailingComments.js.map create mode 100644 node_modules/@babel/types/lib/comments/inheritsComments.js create mode 100644 node_modules/@babel/types/lib/comments/inheritsComments.js.map create mode 100644 node_modules/@babel/types/lib/comments/removeComments.js create mode 100644 node_modules/@babel/types/lib/comments/removeComments.js.map create mode 100644 node_modules/@babel/types/lib/constants/generated/index.js create mode 100644 node_modules/@babel/types/lib/constants/generated/index.js.map create mode 100644 node_modules/@babel/types/lib/constants/index.js create mode 100644 node_modules/@babel/types/lib/constants/index.js.map create mode 100644 node_modules/@babel/types/lib/converters/ensureBlock.js create mode 100644 node_modules/@babel/types/lib/converters/ensureBlock.js.map create mode 100644 node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js create mode 100644 node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js.map create mode 100644 node_modules/@babel/types/lib/converters/toBindingIdentifierName.js create mode 100644 node_modules/@babel/types/lib/converters/toBindingIdentifierName.js.map create mode 100644 node_modules/@babel/types/lib/converters/toBlock.js create mode 100644 node_modules/@babel/types/lib/converters/toBlock.js.map create mode 100644 node_modules/@babel/types/lib/converters/toComputedKey.js create mode 100644 node_modules/@babel/types/lib/converters/toComputedKey.js.map create mode 100644 node_modules/@babel/types/lib/converters/toExpression.js create mode 100644 node_modules/@babel/types/lib/converters/toExpression.js.map create mode 100644 node_modules/@babel/types/lib/converters/toIdentifier.js create mode 100644 node_modules/@babel/types/lib/converters/toIdentifier.js.map create mode 100644 node_modules/@babel/types/lib/converters/toKeyAlias.js create mode 100644 node_modules/@babel/types/lib/converters/toKeyAlias.js.map create mode 100644 node_modules/@babel/types/lib/converters/toSequenceExpression.js create mode 100644 node_modules/@babel/types/lib/converters/toSequenceExpression.js.map create mode 100644 node_modules/@babel/types/lib/converters/toStatement.js create mode 100644 node_modules/@babel/types/lib/converters/toStatement.js.map create mode 100644 node_modules/@babel/types/lib/converters/valueToNode.js create mode 100644 node_modules/@babel/types/lib/converters/valueToNode.js.map create mode 100644 node_modules/@babel/types/lib/definitions/core.js create mode 100644 node_modules/@babel/types/lib/definitions/core.js.map create mode 100644 node_modules/@babel/types/lib/definitions/deprecated-aliases.js create mode 100644 node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map create mode 100644 node_modules/@babel/types/lib/definitions/experimental.js create mode 100644 node_modules/@babel/types/lib/definitions/experimental.js.map create mode 100644 node_modules/@babel/types/lib/definitions/flow.js create mode 100644 node_modules/@babel/types/lib/definitions/flow.js.map create mode 100644 node_modules/@babel/types/lib/definitions/index.js create mode 100644 node_modules/@babel/types/lib/definitions/index.js.map create mode 100644 node_modules/@babel/types/lib/definitions/jsx.js create mode 100644 node_modules/@babel/types/lib/definitions/jsx.js.map create mode 100644 node_modules/@babel/types/lib/definitions/misc.js create mode 100644 node_modules/@babel/types/lib/definitions/misc.js.map create mode 100644 node_modules/@babel/types/lib/definitions/placeholders.js create mode 100644 node_modules/@babel/types/lib/definitions/placeholders.js.map create mode 100644 node_modules/@babel/types/lib/definitions/typescript.js create mode 100644 node_modules/@babel/types/lib/definitions/typescript.js.map create mode 100644 node_modules/@babel/types/lib/definitions/utils.js create mode 100644 node_modules/@babel/types/lib/definitions/utils.js.map create mode 100644 node_modules/@babel/types/lib/index-legacy.d.ts create mode 100644 node_modules/@babel/types/lib/index.d.ts create mode 100644 node_modules/@babel/types/lib/index.js create mode 100644 node_modules/@babel/types/lib/index.js.flow create mode 100644 node_modules/@babel/types/lib/index.js.map create mode 100644 node_modules/@babel/types/lib/modifications/appendToMemberExpression.js create mode 100644 node_modules/@babel/types/lib/modifications/appendToMemberExpression.js.map create mode 100644 node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js create mode 100644 node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js.map create mode 100644 node_modules/@babel/types/lib/modifications/inherits.js create mode 100644 node_modules/@babel/types/lib/modifications/inherits.js.map create mode 100644 node_modules/@babel/types/lib/modifications/prependToMemberExpression.js create mode 100644 node_modules/@babel/types/lib/modifications/prependToMemberExpression.js.map create mode 100644 node_modules/@babel/types/lib/modifications/removeProperties.js create mode 100644 node_modules/@babel/types/lib/modifications/removeProperties.js.map create mode 100644 node_modules/@babel/types/lib/modifications/removePropertiesDeep.js create mode 100644 node_modules/@babel/types/lib/modifications/removePropertiesDeep.js.map create mode 100644 node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js create mode 100644 node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicates.js.map create mode 100644 node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js create mode 100644 node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js.map create mode 100644 node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js create mode 100644 node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js.map create mode 100644 node_modules/@babel/types/lib/traverse/traverse.js create mode 100644 node_modules/@babel/types/lib/traverse/traverse.js.map create mode 100644 node_modules/@babel/types/lib/traverse/traverseFast.js create mode 100644 node_modules/@babel/types/lib/traverse/traverseFast.js.map create mode 100644 node_modules/@babel/types/lib/utils/deprecationWarning.js create mode 100644 node_modules/@babel/types/lib/utils/deprecationWarning.js.map create mode 100644 node_modules/@babel/types/lib/utils/inherit.js create mode 100644 node_modules/@babel/types/lib/utils/inherit.js.map create mode 100644 node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js create mode 100644 node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js.map create mode 100644 node_modules/@babel/types/lib/utils/shallowEqual.js create mode 100644 node_modules/@babel/types/lib/utils/shallowEqual.js.map create mode 100644 node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js create mode 100644 node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js.map create mode 100644 node_modules/@babel/types/lib/validators/generated/index.js create mode 100644 node_modules/@babel/types/lib/validators/generated/index.js.map create mode 100644 node_modules/@babel/types/lib/validators/is.js create mode 100644 node_modules/@babel/types/lib/validators/is.js.map create mode 100644 node_modules/@babel/types/lib/validators/isBinding.js create mode 100644 node_modules/@babel/types/lib/validators/isBinding.js.map create mode 100644 node_modules/@babel/types/lib/validators/isBlockScoped.js create mode 100644 node_modules/@babel/types/lib/validators/isBlockScoped.js.map create mode 100644 node_modules/@babel/types/lib/validators/isImmutable.js create mode 100644 node_modules/@babel/types/lib/validators/isImmutable.js.map create mode 100644 node_modules/@babel/types/lib/validators/isLet.js create mode 100644 node_modules/@babel/types/lib/validators/isLet.js.map create mode 100644 node_modules/@babel/types/lib/validators/isNode.js create mode 100644 node_modules/@babel/types/lib/validators/isNode.js.map create mode 100644 node_modules/@babel/types/lib/validators/isNodesEquivalent.js create mode 100644 node_modules/@babel/types/lib/validators/isNodesEquivalent.js.map create mode 100644 node_modules/@babel/types/lib/validators/isPlaceholderType.js create mode 100644 node_modules/@babel/types/lib/validators/isPlaceholderType.js.map create mode 100644 node_modules/@babel/types/lib/validators/isReferenced.js create mode 100644 node_modules/@babel/types/lib/validators/isReferenced.js.map create mode 100644 node_modules/@babel/types/lib/validators/isScope.js create mode 100644 node_modules/@babel/types/lib/validators/isScope.js.map create mode 100644 node_modules/@babel/types/lib/validators/isSpecifierDefault.js create mode 100644 node_modules/@babel/types/lib/validators/isSpecifierDefault.js.map create mode 100644 node_modules/@babel/types/lib/validators/isType.js create mode 100644 node_modules/@babel/types/lib/validators/isType.js.map create mode 100644 node_modules/@babel/types/lib/validators/isValidES3Identifier.js create mode 100644 node_modules/@babel/types/lib/validators/isValidES3Identifier.js.map create mode 100644 node_modules/@babel/types/lib/validators/isValidIdentifier.js create mode 100644 node_modules/@babel/types/lib/validators/isValidIdentifier.js.map create mode 100644 node_modules/@babel/types/lib/validators/isVar.js create mode 100644 node_modules/@babel/types/lib/validators/isVar.js.map create mode 100644 node_modules/@babel/types/lib/validators/matchesPattern.js create mode 100644 node_modules/@babel/types/lib/validators/matchesPattern.js.map create mode 100644 node_modules/@babel/types/lib/validators/react/isCompatTag.js create mode 100644 node_modules/@babel/types/lib/validators/react/isCompatTag.js.map create mode 100644 node_modules/@babel/types/lib/validators/react/isReactComponent.js create mode 100644 node_modules/@babel/types/lib/validators/react/isReactComponent.js.map create mode 100644 node_modules/@babel/types/lib/validators/validate.js create mode 100644 node_modules/@babel/types/lib/validators/validate.js.map create mode 100644 node_modules/@babel/types/package.json create mode 100644 node_modules/@bcoe/v8-coverage/.editorconfig create mode 100644 node_modules/@bcoe/v8-coverage/.gitattributes create mode 100644 node_modules/@bcoe/v8-coverage/CHANGELOG.md create mode 100644 node_modules/@bcoe/v8-coverage/LICENSE.md create mode 100644 node_modules/@bcoe/v8-coverage/LICENSE.txt create mode 100644 node_modules/@bcoe/v8-coverage/README.md create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/CHANGELOG.md create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/LICENSE.md create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/README.md create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/_src/ascii.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/_src/clone.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/_src/compare.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/_src/index.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/_src/merge.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/_src/normalize.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/_src/range-tree.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/_src/types.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/ascii.d.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/ascii.js create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/ascii.mjs create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/clone.d.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/clone.js create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/clone.mjs create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/compare.d.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/compare.js create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/compare.mjs create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/index.d.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/index.js create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/index.mjs create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/merge.d.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/merge.js create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/merge.mjs create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/normalize.d.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/normalize.js create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/normalize.mjs create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/package.json create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/range-tree.d.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/range-tree.js create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/range-tree.mjs create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/tsconfig.json create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/types.d.ts create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/types.js create mode 100644 node_modules/@bcoe/v8-coverage/dist/lib/types.mjs create mode 100644 node_modules/@bcoe/v8-coverage/gulpfile.ts create mode 100644 node_modules/@bcoe/v8-coverage/package.json create mode 100644 node_modules/@bcoe/v8-coverage/src/lib/ascii.ts create mode 100644 node_modules/@bcoe/v8-coverage/src/lib/clone.ts create mode 100644 node_modules/@bcoe/v8-coverage/src/lib/compare.ts create mode 100644 node_modules/@bcoe/v8-coverage/src/lib/index.ts create mode 100644 node_modules/@bcoe/v8-coverage/src/lib/merge.ts create mode 100644 node_modules/@bcoe/v8-coverage/src/lib/normalize.ts create mode 100644 node_modules/@bcoe/v8-coverage/src/lib/range-tree.ts create mode 100644 node_modules/@bcoe/v8-coverage/src/lib/types.ts create mode 100644 node_modules/@bcoe/v8-coverage/src/test/merge.spec.ts create mode 100644 node_modules/@bcoe/v8-coverage/tsconfig.json create mode 100644 node_modules/@istanbuljs/load-nyc-config/CHANGELOG.md create mode 100644 node_modules/@istanbuljs/load-nyc-config/LICENSE create mode 100644 node_modules/@istanbuljs/load-nyc-config/README.md create mode 100644 node_modules/@istanbuljs/load-nyc-config/index.js create mode 100644 node_modules/@istanbuljs/load-nyc-config/load-esm.js create mode 100644 node_modules/@istanbuljs/load-nyc-config/package.json create mode 100644 node_modules/@istanbuljs/schema/CHANGELOG.md create mode 100644 node_modules/@istanbuljs/schema/LICENSE create mode 100644 node_modules/@istanbuljs/schema/README.md create mode 100644 node_modules/@istanbuljs/schema/default-exclude.js create mode 100644 node_modules/@istanbuljs/schema/default-extension.js create mode 100644 node_modules/@istanbuljs/schema/index.js create mode 100644 node_modules/@istanbuljs/schema/package.json create mode 100644 node_modules/@jest/console/LICENSE create mode 100644 node_modules/@jest/console/build/BufferedConsole.js create mode 100644 node_modules/@jest/console/build/CustomConsole.js create mode 100644 node_modules/@jest/console/build/NullConsole.js create mode 100644 node_modules/@jest/console/build/getConsoleOutput.js create mode 100644 node_modules/@jest/console/build/index.d.ts create mode 100644 node_modules/@jest/console/build/index.js create mode 100644 node_modules/@jest/console/build/types.js create mode 100644 node_modules/@jest/console/package.json create mode 100644 node_modules/@jest/core/LICENSE create mode 100644 node_modules/@jest/core/README.md create mode 100644 node_modules/@jest/core/build/FailedTestsCache.js create mode 100644 node_modules/@jest/core/build/FailedTestsInteractiveMode.js create mode 100644 node_modules/@jest/core/build/ReporterDispatcher.js create mode 100644 node_modules/@jest/core/build/SearchSource.js create mode 100644 node_modules/@jest/core/build/SnapshotInteractiveMode.js create mode 100644 node_modules/@jest/core/build/TestNamePatternPrompt.js create mode 100644 node_modules/@jest/core/build/TestPathPatternPrompt.js create mode 100644 node_modules/@jest/core/build/TestScheduler.js create mode 100644 node_modules/@jest/core/build/cli/index.js create mode 100644 node_modules/@jest/core/build/collectHandles.js create mode 100644 node_modules/@jest/core/build/getChangedFilesPromise.js create mode 100644 node_modules/@jest/core/build/getConfigsOfProjectsToRun.js create mode 100644 node_modules/@jest/core/build/getNoTestFound.js create mode 100644 node_modules/@jest/core/build/getNoTestFoundFailed.js create mode 100644 node_modules/@jest/core/build/getNoTestFoundPassWithNoTests.js create mode 100644 node_modules/@jest/core/build/getNoTestFoundRelatedToChangedFiles.js create mode 100644 node_modules/@jest/core/build/getNoTestFoundVerbose.js create mode 100644 node_modules/@jest/core/build/getNoTestsFoundMessage.js create mode 100644 node_modules/@jest/core/build/getProjectDisplayName.js create mode 100644 node_modules/@jest/core/build/getProjectNamesMissingWarning.js create mode 100644 node_modules/@jest/core/build/getSelectProjectsMessage.js create mode 100644 node_modules/@jest/core/build/index.d.ts create mode 100644 node_modules/@jest/core/build/index.js create mode 100644 node_modules/@jest/core/build/lib/activeFiltersMessage.js create mode 100644 node_modules/@jest/core/build/lib/createContext.js create mode 100644 node_modules/@jest/core/build/lib/handleDeprecationWarnings.js create mode 100644 node_modules/@jest/core/build/lib/isValidPath.js create mode 100644 node_modules/@jest/core/build/lib/logDebugMessages.js create mode 100644 node_modules/@jest/core/build/lib/updateGlobalConfig.js create mode 100644 node_modules/@jest/core/build/lib/watchPluginsHelpers.js create mode 100644 node_modules/@jest/core/build/plugins/FailedTestsInteractive.js create mode 100644 node_modules/@jest/core/build/plugins/Quit.js create mode 100644 node_modules/@jest/core/build/plugins/TestNamePattern.js create mode 100644 node_modules/@jest/core/build/plugins/TestPathPattern.js create mode 100644 node_modules/@jest/core/build/plugins/UpdateSnapshots.js create mode 100644 node_modules/@jest/core/build/plugins/UpdateSnapshotsInteractive.js create mode 100644 node_modules/@jest/core/build/runGlobalHook.js create mode 100644 node_modules/@jest/core/build/runJest.js create mode 100644 node_modules/@jest/core/build/testSchedulerHelper.js create mode 100644 node_modules/@jest/core/build/types.js create mode 100644 node_modules/@jest/core/build/version.js create mode 100644 node_modules/@jest/core/build/watch.js create mode 100644 node_modules/@jest/core/package.json create mode 100644 node_modules/@jest/environment/LICENSE create mode 100644 node_modules/@jest/environment/build/index.d.ts create mode 100644 node_modules/@jest/environment/build/index.js create mode 100644 node_modules/@jest/environment/package.json create mode 100644 node_modules/@jest/expect-utils/LICENSE create mode 100644 node_modules/@jest/expect-utils/README.md create mode 100644 node_modules/@jest/expect-utils/build/immutableUtils.js create mode 100644 node_modules/@jest/expect-utils/build/index.d.ts create mode 100644 node_modules/@jest/expect-utils/build/index.js create mode 100644 node_modules/@jest/expect-utils/build/jasmineUtils.js create mode 100644 node_modules/@jest/expect-utils/build/types.js create mode 100644 node_modules/@jest/expect-utils/build/utils.js create mode 100644 node_modules/@jest/expect-utils/package.json create mode 100644 node_modules/@jest/expect/LICENSE create mode 100644 node_modules/@jest/expect/README.md create mode 100644 node_modules/@jest/expect/build/index.d.ts create mode 100644 node_modules/@jest/expect/build/index.js create mode 100644 node_modules/@jest/expect/build/types.js create mode 100644 node_modules/@jest/expect/package.json create mode 100644 node_modules/@jest/fake-timers/LICENSE create mode 100644 node_modules/@jest/fake-timers/build/index.d.ts create mode 100644 node_modules/@jest/fake-timers/build/index.js create mode 100644 node_modules/@jest/fake-timers/build/legacyFakeTimers.js create mode 100644 node_modules/@jest/fake-timers/build/modernFakeTimers.js create mode 100644 node_modules/@jest/fake-timers/package.json create mode 100644 node_modules/@jest/globals/LICENSE create mode 100644 node_modules/@jest/globals/build/index.d.ts create mode 100644 node_modules/@jest/globals/build/index.js create mode 100644 node_modules/@jest/globals/package.json create mode 100644 node_modules/@jest/reporters/LICENSE create mode 100644 node_modules/@jest/reporters/assets/jest_logo.png create mode 100644 node_modules/@jest/reporters/build/BaseReporter.js create mode 100644 node_modules/@jest/reporters/build/CoverageReporter.js create mode 100644 node_modules/@jest/reporters/build/CoverageWorker.js create mode 100644 node_modules/@jest/reporters/build/DefaultReporter.js create mode 100644 node_modules/@jest/reporters/build/GitHubActionsReporter.js create mode 100644 node_modules/@jest/reporters/build/NotifyReporter.js create mode 100644 node_modules/@jest/reporters/build/Status.js create mode 100644 node_modules/@jest/reporters/build/SummaryReporter.js create mode 100644 node_modules/@jest/reporters/build/VerboseReporter.js create mode 100644 node_modules/@jest/reporters/build/formatTestPath.js create mode 100644 node_modules/@jest/reporters/build/generateEmptyCoverage.js create mode 100644 node_modules/@jest/reporters/build/getResultHeader.js create mode 100644 node_modules/@jest/reporters/build/getSnapshotStatus.js create mode 100644 node_modules/@jest/reporters/build/getSnapshotSummary.js create mode 100644 node_modules/@jest/reporters/build/getSummary.js create mode 100644 node_modules/@jest/reporters/build/getWatermarks.js create mode 100644 node_modules/@jest/reporters/build/index.d.ts create mode 100644 node_modules/@jest/reporters/build/index.js create mode 100644 node_modules/@jest/reporters/build/printDisplayName.js create mode 100644 node_modules/@jest/reporters/build/relativePath.js create mode 100644 node_modules/@jest/reporters/build/trimAndFormatPath.js create mode 100644 node_modules/@jest/reporters/build/types.js create mode 100644 node_modules/@jest/reporters/build/wrapAnsiString.js create mode 100644 node_modules/@jest/reporters/package.json create mode 100644 node_modules/@jest/schemas/LICENSE create mode 100644 node_modules/@jest/schemas/README.md create mode 100644 node_modules/@jest/schemas/build/index.d.ts create mode 100644 node_modules/@jest/schemas/build/index.js create mode 100644 node_modules/@jest/schemas/package.json create mode 100644 node_modules/@jest/source-map/LICENSE create mode 100644 node_modules/@jest/source-map/build/getCallsite.js create mode 100644 node_modules/@jest/source-map/build/index.d.ts create mode 100644 node_modules/@jest/source-map/build/index.js create mode 100644 node_modules/@jest/source-map/build/types.js create mode 100644 node_modules/@jest/source-map/package.json create mode 100644 node_modules/@jest/test-result/LICENSE create mode 100644 node_modules/@jest/test-result/build/formatTestResults.js create mode 100644 node_modules/@jest/test-result/build/helpers.js create mode 100644 node_modules/@jest/test-result/build/index.d.ts create mode 100644 node_modules/@jest/test-result/build/index.js create mode 100644 node_modules/@jest/test-result/build/types.js create mode 100644 node_modules/@jest/test-result/package.json create mode 100644 node_modules/@jest/test-sequencer/LICENSE create mode 100644 node_modules/@jest/test-sequencer/build/index.d.ts create mode 100644 node_modules/@jest/test-sequencer/build/index.js create mode 100644 node_modules/@jest/test-sequencer/package.json create mode 100644 node_modules/@jest/transform/LICENSE create mode 100644 node_modules/@jest/transform/build/ScriptTransformer.js create mode 100644 node_modules/@jest/transform/build/enhanceUnexpectedTokenMessage.js create mode 100644 node_modules/@jest/transform/build/index.d.ts create mode 100644 node_modules/@jest/transform/build/index.js create mode 100644 node_modules/@jest/transform/build/runtimeErrorsAndWarnings.js create mode 100644 node_modules/@jest/transform/build/shouldInstrument.js create mode 100644 node_modules/@jest/transform/build/types.js create mode 100644 node_modules/@jest/transform/package.json create mode 100644 node_modules/@jest/types/LICENSE create mode 100644 node_modules/@jest/types/README.md create mode 100644 node_modules/@jest/types/build/Circus.js create mode 100644 node_modules/@jest/types/build/Config.js create mode 100644 node_modules/@jest/types/build/Global.js create mode 100644 node_modules/@jest/types/build/TestResult.js create mode 100644 node_modules/@jest/types/build/Transform.js create mode 100644 node_modules/@jest/types/build/index.d.ts create mode 100644 node_modules/@jest/types/build/index.js create mode 100644 node_modules/@jest/types/package.json create mode 100644 node_modules/@jridgewell/gen-mapping/LICENSE create mode 100644 node_modules/@jridgewell/gen-mapping/README.md create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs.map create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js create mode 100644 node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js.map create mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts create mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts create mode 100644 node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts create mode 100644 node_modules/@jridgewell/gen-mapping/package.json create mode 100644 node_modules/@jridgewell/resolve-uri/LICENSE create mode 100644 node_modules/@jridgewell/resolve-uri/README.md create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs.map create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js create mode 100644 node_modules/@jridgewell/resolve-uri/dist/resolve-uri.umd.js.map create mode 100644 node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts create mode 100644 node_modules/@jridgewell/resolve-uri/package.json create mode 100644 node_modules/@jridgewell/set-array/LICENSE create mode 100644 node_modules/@jridgewell/set-array/README.md create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.mjs create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.mjs.map create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.umd.js create mode 100644 node_modules/@jridgewell/set-array/dist/set-array.umd.js.map create mode 100644 node_modules/@jridgewell/set-array/dist/types/set-array.d.ts create mode 100644 node_modules/@jridgewell/set-array/package.json create mode 100644 node_modules/@jridgewell/set-array/src/set-array.ts create mode 100644 node_modules/@jridgewell/sourcemap-codec/LICENSE create mode 100644 node_modules/@jridgewell/sourcemap-codec/README.md create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs.map create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.js.map create mode 100644 node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts create mode 100644 node_modules/@jridgewell/sourcemap-codec/package.json create mode 100644 node_modules/@jridgewell/trace-mapping/LICENSE create mode 100644 node_modules/@jridgewell/trace-mapping/README.md create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs.map create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js create mode 100644 node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js.map create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/any-map.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/binary-search.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/by-source.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/resolve.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/sort.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/sourcemap-segment.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/strip-filename.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/trace-mapping.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/dist/types/types.d.ts create mode 100644 node_modules/@jridgewell/trace-mapping/package.json create mode 100644 node_modules/@sinclair/typebox/compiler/compiler.d.ts create mode 100644 node_modules/@sinclair/typebox/compiler/compiler.js create mode 100644 node_modules/@sinclair/typebox/compiler/index.d.ts create mode 100644 node_modules/@sinclair/typebox/compiler/index.js create mode 100644 node_modules/@sinclair/typebox/errors/errors.d.ts create mode 100644 node_modules/@sinclair/typebox/errors/errors.js create mode 100644 node_modules/@sinclair/typebox/errors/index.d.ts create mode 100644 node_modules/@sinclair/typebox/errors/index.js create mode 100644 node_modules/@sinclair/typebox/license create mode 100644 node_modules/@sinclair/typebox/package.json create mode 100644 node_modules/@sinclair/typebox/readme.md create mode 100644 node_modules/@sinclair/typebox/system/index.d.ts create mode 100644 node_modules/@sinclair/typebox/system/index.js create mode 100644 node_modules/@sinclair/typebox/system/system.d.ts create mode 100644 node_modules/@sinclair/typebox/system/system.js create mode 100644 node_modules/@sinclair/typebox/typebox.d.ts create mode 100644 node_modules/@sinclair/typebox/typebox.js create mode 100644 node_modules/@sinclair/typebox/value/cast.d.ts create mode 100644 node_modules/@sinclair/typebox/value/cast.js create mode 100644 node_modules/@sinclair/typebox/value/check.d.ts create mode 100644 node_modules/@sinclair/typebox/value/check.js create mode 100644 node_modules/@sinclair/typebox/value/clone.d.ts create mode 100644 node_modules/@sinclair/typebox/value/clone.js create mode 100644 node_modules/@sinclair/typebox/value/convert.d.ts create mode 100644 node_modules/@sinclair/typebox/value/convert.js create mode 100644 node_modules/@sinclair/typebox/value/create.d.ts create mode 100644 node_modules/@sinclair/typebox/value/create.js create mode 100644 node_modules/@sinclair/typebox/value/delta.d.ts create mode 100644 node_modules/@sinclair/typebox/value/delta.js create mode 100644 node_modules/@sinclair/typebox/value/equal.d.ts create mode 100644 node_modules/@sinclair/typebox/value/equal.js create mode 100644 node_modules/@sinclair/typebox/value/hash.d.ts create mode 100644 node_modules/@sinclair/typebox/value/hash.js create mode 100644 node_modules/@sinclair/typebox/value/index.d.ts create mode 100644 node_modules/@sinclair/typebox/value/index.js create mode 100644 node_modules/@sinclair/typebox/value/is.d.ts create mode 100644 node_modules/@sinclair/typebox/value/is.js create mode 100644 node_modules/@sinclair/typebox/value/mutate.d.ts create mode 100644 node_modules/@sinclair/typebox/value/mutate.js create mode 100644 node_modules/@sinclair/typebox/value/pointer.d.ts create mode 100644 node_modules/@sinclair/typebox/value/pointer.js create mode 100644 node_modules/@sinclair/typebox/value/value.d.ts create mode 100644 node_modules/@sinclair/typebox/value/value.js create mode 100644 node_modules/@sinonjs/commons/LICENSE create mode 100644 node_modules/@sinonjs/commons/README.md create mode 100644 node_modules/@sinonjs/commons/lib/called-in-order.js create mode 100644 node_modules/@sinonjs/commons/lib/called-in-order.test.js create mode 100644 node_modules/@sinonjs/commons/lib/class-name.js create mode 100644 node_modules/@sinonjs/commons/lib/class-name.test.js create mode 100644 node_modules/@sinonjs/commons/lib/deprecated.js create mode 100644 node_modules/@sinonjs/commons/lib/deprecated.test.js create mode 100644 node_modules/@sinonjs/commons/lib/every.js create mode 100644 node_modules/@sinonjs/commons/lib/every.test.js create mode 100644 node_modules/@sinonjs/commons/lib/function-name.js create mode 100644 node_modules/@sinonjs/commons/lib/function-name.test.js create mode 100644 node_modules/@sinonjs/commons/lib/global.js create mode 100644 node_modules/@sinonjs/commons/lib/global.test.js create mode 100644 node_modules/@sinonjs/commons/lib/index.js create mode 100644 node_modules/@sinonjs/commons/lib/index.test.js create mode 100644 node_modules/@sinonjs/commons/lib/order-by-first-call.js create mode 100644 node_modules/@sinonjs/commons/lib/order-by-first-call.test.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/README.md create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/array.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/copy-prototype-methods.test.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/function.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/index.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/index.test.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/map.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/object.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/set.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/string.js create mode 100644 node_modules/@sinonjs/commons/lib/prototypes/throws-on-proto.js create mode 100644 node_modules/@sinonjs/commons/lib/type-of.js create mode 100644 node_modules/@sinonjs/commons/lib/type-of.test.js create mode 100644 node_modules/@sinonjs/commons/lib/value-to-string.js create mode 100644 node_modules/@sinonjs/commons/lib/value-to-string.test.js create mode 100644 node_modules/@sinonjs/commons/package.json create mode 100644 node_modules/@sinonjs/commons/types/called-in-order.d.ts create mode 100644 node_modules/@sinonjs/commons/types/class-name.d.ts create mode 100644 node_modules/@sinonjs/commons/types/deprecated.d.ts create mode 100644 node_modules/@sinonjs/commons/types/every.d.ts create mode 100644 node_modules/@sinonjs/commons/types/function-name.d.ts create mode 100644 node_modules/@sinonjs/commons/types/global.d.ts create mode 100644 node_modules/@sinonjs/commons/types/index.d.ts create mode 100644 node_modules/@sinonjs/commons/types/order-by-first-call.d.ts create mode 100644 node_modules/@sinonjs/commons/types/prototypes/array.d.ts create mode 100644 node_modules/@sinonjs/commons/types/prototypes/copy-prototype-methods.d.ts create mode 100644 node_modules/@sinonjs/commons/types/prototypes/function.d.ts create mode 100644 node_modules/@sinonjs/commons/types/prototypes/index.d.ts create mode 100644 node_modules/@sinonjs/commons/types/prototypes/map.d.ts create mode 100644 node_modules/@sinonjs/commons/types/prototypes/object.d.ts create mode 100644 node_modules/@sinonjs/commons/types/prototypes/set.d.ts create mode 100644 node_modules/@sinonjs/commons/types/prototypes/string.d.ts create mode 100644 node_modules/@sinonjs/commons/types/prototypes/throws-on-proto.d.ts create mode 100644 node_modules/@sinonjs/commons/types/type-of.d.ts create mode 100644 node_modules/@sinonjs/commons/types/value-to-string.d.ts create mode 100644 node_modules/@sinonjs/fake-timers/LICENSE create mode 100644 node_modules/@sinonjs/fake-timers/README.md create mode 100644 node_modules/@sinonjs/fake-timers/package.json create mode 100644 node_modules/@sinonjs/fake-timers/src/fake-timers-src.js create mode 100644 node_modules/@types/babel__core/LICENSE create mode 100644 node_modules/@types/babel__core/README.md create mode 100644 node_modules/@types/babel__core/index.d.ts create mode 100644 node_modules/@types/babel__core/package.json create mode 100644 node_modules/@types/babel__generator/LICENSE create mode 100644 node_modules/@types/babel__generator/README.md create mode 100644 node_modules/@types/babel__generator/index.d.ts create mode 100644 node_modules/@types/babel__generator/package.json create mode 100644 node_modules/@types/babel__template/LICENSE create mode 100644 node_modules/@types/babel__template/README.md create mode 100644 node_modules/@types/babel__template/index.d.ts create mode 100644 node_modules/@types/babel__template/package.json create mode 100644 node_modules/@types/babel__traverse/LICENSE create mode 100644 node_modules/@types/babel__traverse/README.md create mode 100644 node_modules/@types/babel__traverse/index.d.ts create mode 100644 node_modules/@types/babel__traverse/package.json create mode 100644 node_modules/@types/graceful-fs/LICENSE create mode 100644 node_modules/@types/graceful-fs/README.md create mode 100644 node_modules/@types/graceful-fs/index.d.ts create mode 100644 node_modules/@types/graceful-fs/package.json create mode 100644 node_modules/@types/istanbul-lib-coverage/LICENSE create mode 100644 node_modules/@types/istanbul-lib-coverage/README.md create mode 100644 node_modules/@types/istanbul-lib-coverage/index.d.ts create mode 100644 node_modules/@types/istanbul-lib-coverage/package.json create mode 100644 node_modules/@types/istanbul-lib-report/LICENSE create mode 100644 node_modules/@types/istanbul-lib-report/README.md create mode 100644 node_modules/@types/istanbul-lib-report/index.d.ts create mode 100644 node_modules/@types/istanbul-lib-report/package.json create mode 100644 node_modules/@types/istanbul-reports/LICENSE create mode 100644 node_modules/@types/istanbul-reports/README.md create mode 100644 node_modules/@types/istanbul-reports/index.d.ts create mode 100644 node_modules/@types/istanbul-reports/package.json create mode 100644 node_modules/@types/stack-utils/LICENSE create mode 100644 node_modules/@types/stack-utils/README.md create mode 100644 node_modules/@types/stack-utils/index.d.ts create mode 100644 node_modules/@types/stack-utils/package.json create mode 100644 node_modules/@types/yargs-parser/LICENSE create mode 100644 node_modules/@types/yargs-parser/README.md create mode 100644 node_modules/@types/yargs-parser/index.d.ts create mode 100644 node_modules/@types/yargs-parser/package.json create mode 100644 node_modules/@types/yargs/LICENSE create mode 100644 node_modules/@types/yargs/README.md create mode 100644 node_modules/@types/yargs/helpers.d.mts create mode 100644 node_modules/@types/yargs/helpers.d.ts create mode 100644 node_modules/@types/yargs/index.d.mts create mode 100644 node_modules/@types/yargs/index.d.ts create mode 100644 node_modules/@types/yargs/package.json create mode 100644 node_modules/@types/yargs/yargs.d.ts create mode 100644 node_modules/ansi-escapes/index.d.ts create mode 100644 node_modules/ansi-escapes/index.js create mode 100644 node_modules/ansi-escapes/license create mode 100644 node_modules/ansi-escapes/package.json create mode 100644 node_modules/ansi-escapes/readme.md create mode 100644 node_modules/ansi-regex/index.d.ts create mode 100644 node_modules/ansi-regex/index.js create mode 100644 node_modules/ansi-regex/license create mode 100644 node_modules/ansi-regex/package.json create mode 100644 node_modules/ansi-regex/readme.md create mode 100644 node_modules/ansi-styles/index.d.ts create mode 100644 node_modules/ansi-styles/index.js create mode 100644 node_modules/ansi-styles/license create mode 100644 node_modules/ansi-styles/package.json create mode 100644 node_modules/ansi-styles/readme.md create mode 100644 node_modules/anymatch/LICENSE create mode 100644 node_modules/anymatch/README.md create mode 100644 node_modules/anymatch/index.d.ts create mode 100644 node_modules/anymatch/index.js create mode 100644 node_modules/anymatch/package.json create mode 100644 node_modules/argparse/CHANGELOG.md create mode 100644 node_modules/argparse/LICENSE create mode 100644 node_modules/argparse/README.md create mode 100644 node_modules/argparse/index.js create mode 100644 node_modules/argparse/lib/action.js create mode 100644 node_modules/argparse/lib/action/append.js create mode 100644 node_modules/argparse/lib/action/append/constant.js create mode 100644 node_modules/argparse/lib/action/count.js create mode 100644 node_modules/argparse/lib/action/help.js create mode 100644 node_modules/argparse/lib/action/store.js create mode 100644 node_modules/argparse/lib/action/store/constant.js create mode 100644 node_modules/argparse/lib/action/store/false.js create mode 100644 node_modules/argparse/lib/action/store/true.js create mode 100644 node_modules/argparse/lib/action/subparsers.js create mode 100644 node_modules/argparse/lib/action/version.js create mode 100644 node_modules/argparse/lib/action_container.js create mode 100644 node_modules/argparse/lib/argparse.js create mode 100644 node_modules/argparse/lib/argument/error.js create mode 100644 node_modules/argparse/lib/argument/exclusive.js create mode 100644 node_modules/argparse/lib/argument/group.js create mode 100644 node_modules/argparse/lib/argument_parser.js create mode 100644 node_modules/argparse/lib/const.js create mode 100644 node_modules/argparse/lib/help/added_formatters.js create mode 100644 node_modules/argparse/lib/help/formatter.js create mode 100644 node_modules/argparse/lib/namespace.js create mode 100644 node_modules/argparse/lib/utils.js create mode 100644 node_modules/argparse/package.json create mode 100644 node_modules/babel-jest/LICENSE create mode 100644 node_modules/babel-jest/README.md create mode 100644 node_modules/babel-jest/build/index.d.ts create mode 100644 node_modules/babel-jest/build/index.js create mode 100644 node_modules/babel-jest/build/loadBabelConfig.js create mode 100644 node_modules/babel-jest/package.json create mode 100644 node_modules/babel-plugin-istanbul/CHANGELOG.md create mode 100644 node_modules/babel-plugin-istanbul/LICENSE create mode 100644 node_modules/babel-plugin-istanbul/README.md create mode 100644 node_modules/babel-plugin-istanbul/lib/index.js create mode 100644 node_modules/babel-plugin-istanbul/lib/load-nyc-config-sync.js create mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/CHANGELOG.md create mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/LICENSE create mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/README.md create mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/package.json create mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/constants.js create mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/index.js create mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/instrumenter.js create mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/read-coverage.js create mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/source-coverage.js create mode 100644 node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument/src/visitor.js create mode 100644 node_modules/babel-plugin-istanbul/package.json create mode 100644 node_modules/babel-plugin-jest-hoist/LICENSE create mode 100644 node_modules/babel-plugin-jest-hoist/README.md create mode 100644 node_modules/babel-plugin-jest-hoist/build/index.d.ts create mode 100644 node_modules/babel-plugin-jest-hoist/build/index.js create mode 100644 node_modules/babel-plugin-jest-hoist/package.json create mode 100644 node_modules/babel-preset-current-node-syntax/LICENSE create mode 100644 node_modules/babel-preset-current-node-syntax/README.md create mode 100644 node_modules/babel-preset-current-node-syntax/package.json create mode 100644 node_modules/babel-preset-current-node-syntax/scripts/check-yarn-bug.sh create mode 100644 node_modules/babel-preset-current-node-syntax/src/index.js create mode 100644 node_modules/babel-preset-jest/LICENSE create mode 100644 node_modules/babel-preset-jest/README.md create mode 100644 node_modules/babel-preset-jest/index.js create mode 100644 node_modules/babel-preset-jest/package.json create mode 100644 node_modules/balanced-match/.github/FUNDING.yml create mode 100644 node_modules/balanced-match/LICENSE.md create mode 100644 node_modules/balanced-match/README.md create mode 100644 node_modules/balanced-match/index.js create mode 100644 node_modules/balanced-match/package.json create mode 100644 node_modules/brace-expansion/LICENSE create mode 100644 node_modules/brace-expansion/README.md create mode 100644 node_modules/brace-expansion/index.js create mode 100644 node_modules/brace-expansion/package.json create mode 100644 node_modules/braces/CHANGELOG.md create mode 100644 node_modules/braces/LICENSE create mode 100644 node_modules/braces/README.md create mode 100644 node_modules/braces/index.js create mode 100644 node_modules/braces/lib/compile.js create mode 100644 node_modules/braces/lib/constants.js create mode 100644 node_modules/braces/lib/expand.js create mode 100644 node_modules/braces/lib/parse.js create mode 100644 node_modules/braces/lib/stringify.js create mode 100644 node_modules/braces/lib/utils.js create mode 100644 node_modules/braces/package.json create mode 100644 node_modules/browserslist/LICENSE create mode 100644 node_modules/browserslist/README.md create mode 100644 node_modules/browserslist/browser.js create mode 100644 node_modules/browserslist/cli.js create mode 100644 node_modules/browserslist/error.d.ts create mode 100644 node_modules/browserslist/error.js create mode 100644 node_modules/browserslist/index.d.ts create mode 100644 node_modules/browserslist/index.js create mode 100644 node_modules/browserslist/node.js create mode 100644 node_modules/browserslist/package.json create mode 100644 node_modules/browserslist/parse.js create mode 100644 node_modules/bser/README.md create mode 100644 node_modules/bser/index.js create mode 100644 node_modules/bser/package.json create mode 100644 node_modules/buffer-from/LICENSE create mode 100644 node_modules/buffer-from/index.js create mode 100644 node_modules/buffer-from/package.json create mode 100644 node_modules/buffer-from/readme.md create mode 100644 node_modules/callsites/index.d.ts create mode 100644 node_modules/callsites/index.js create mode 100644 node_modules/callsites/license create mode 100644 node_modules/callsites/package.json create mode 100644 node_modules/callsites/readme.md create mode 100644 node_modules/camelcase/index.d.ts create mode 100644 node_modules/camelcase/index.js create mode 100644 node_modules/camelcase/license create mode 100644 node_modules/camelcase/package.json create mode 100644 node_modules/camelcase/readme.md create mode 100644 node_modules/caniuse-lite/LICENSE create mode 100644 node_modules/caniuse-lite/README.md create mode 100644 node_modules/caniuse-lite/data/agents.js create mode 100644 node_modules/caniuse-lite/data/browserVersions.js create mode 100644 node_modules/caniuse-lite/data/browsers.js create mode 100644 node_modules/caniuse-lite/data/features.js create mode 100644 node_modules/caniuse-lite/data/features/aac.js create mode 100644 node_modules/caniuse-lite/data/features/abortcontroller.js create mode 100644 node_modules/caniuse-lite/data/features/ac3-ec3.js create mode 100644 node_modules/caniuse-lite/data/features/accelerometer.js create mode 100644 node_modules/caniuse-lite/data/features/addeventlistener.js create mode 100644 node_modules/caniuse-lite/data/features/alternate-stylesheet.js create mode 100644 node_modules/caniuse-lite/data/features/ambient-light.js create mode 100644 node_modules/caniuse-lite/data/features/apng.js create mode 100644 node_modules/caniuse-lite/data/features/array-find-index.js create mode 100644 node_modules/caniuse-lite/data/features/array-find.js create mode 100644 node_modules/caniuse-lite/data/features/array-flat.js create mode 100644 node_modules/caniuse-lite/data/features/array-includes.js create mode 100644 node_modules/caniuse-lite/data/features/arrow-functions.js create mode 100644 node_modules/caniuse-lite/data/features/asmjs.js create mode 100644 node_modules/caniuse-lite/data/features/async-clipboard.js create mode 100644 node_modules/caniuse-lite/data/features/async-functions.js create mode 100644 node_modules/caniuse-lite/data/features/atob-btoa.js create mode 100644 node_modules/caniuse-lite/data/features/audio-api.js create mode 100644 node_modules/caniuse-lite/data/features/audio.js create mode 100644 node_modules/caniuse-lite/data/features/audiotracks.js create mode 100644 node_modules/caniuse-lite/data/features/autofocus.js create mode 100644 node_modules/caniuse-lite/data/features/auxclick.js create mode 100644 node_modules/caniuse-lite/data/features/av1.js create mode 100644 node_modules/caniuse-lite/data/features/avif.js create mode 100644 node_modules/caniuse-lite/data/features/background-attachment.js create mode 100644 node_modules/caniuse-lite/data/features/background-clip-text.js create mode 100644 node_modules/caniuse-lite/data/features/background-img-opts.js create mode 100644 node_modules/caniuse-lite/data/features/background-position-x-y.js create mode 100644 node_modules/caniuse-lite/data/features/background-repeat-round-space.js create mode 100644 node_modules/caniuse-lite/data/features/background-sync.js create mode 100644 node_modules/caniuse-lite/data/features/battery-status.js create mode 100644 node_modules/caniuse-lite/data/features/beacon.js create mode 100644 node_modules/caniuse-lite/data/features/beforeafterprint.js create mode 100644 node_modules/caniuse-lite/data/features/bigint.js create mode 100644 node_modules/caniuse-lite/data/features/blobbuilder.js create mode 100644 node_modules/caniuse-lite/data/features/bloburls.js create mode 100644 node_modules/caniuse-lite/data/features/border-image.js create mode 100644 node_modules/caniuse-lite/data/features/border-radius.js create mode 100644 node_modules/caniuse-lite/data/features/broadcastchannel.js create mode 100644 node_modules/caniuse-lite/data/features/brotli.js create mode 100644 node_modules/caniuse-lite/data/features/calc.js create mode 100644 node_modules/caniuse-lite/data/features/canvas-blending.js create mode 100644 node_modules/caniuse-lite/data/features/canvas-text.js create mode 100644 node_modules/caniuse-lite/data/features/canvas.js create mode 100644 node_modules/caniuse-lite/data/features/ch-unit.js create mode 100644 node_modules/caniuse-lite/data/features/chacha20-poly1305.js create mode 100644 node_modules/caniuse-lite/data/features/channel-messaging.js create mode 100644 node_modules/caniuse-lite/data/features/childnode-remove.js create mode 100644 node_modules/caniuse-lite/data/features/classlist.js create mode 100644 node_modules/caniuse-lite/data/features/client-hints-dpr-width-viewport.js create mode 100644 node_modules/caniuse-lite/data/features/clipboard.js create mode 100644 node_modules/caniuse-lite/data/features/colr-v1.js create mode 100644 node_modules/caniuse-lite/data/features/colr.js create mode 100644 node_modules/caniuse-lite/data/features/comparedocumentposition.js create mode 100644 node_modules/caniuse-lite/data/features/console-basic.js create mode 100644 node_modules/caniuse-lite/data/features/console-time.js create mode 100644 node_modules/caniuse-lite/data/features/const.js create mode 100644 node_modules/caniuse-lite/data/features/constraint-validation.js create mode 100644 node_modules/caniuse-lite/data/features/contenteditable.js create mode 100644 node_modules/caniuse-lite/data/features/contentsecuritypolicy.js create mode 100644 node_modules/caniuse-lite/data/features/contentsecuritypolicy2.js create mode 100644 node_modules/caniuse-lite/data/features/cookie-store-api.js create mode 100644 node_modules/caniuse-lite/data/features/cors.js create mode 100644 node_modules/caniuse-lite/data/features/createimagebitmap.js create mode 100644 node_modules/caniuse-lite/data/features/credential-management.js create mode 100644 node_modules/caniuse-lite/data/features/cryptography.js create mode 100644 node_modules/caniuse-lite/data/features/css-all.js create mode 100644 node_modules/caniuse-lite/data/features/css-anchor-positioning.js create mode 100644 node_modules/caniuse-lite/data/features/css-animation.js create mode 100644 node_modules/caniuse-lite/data/features/css-any-link.js create mode 100644 node_modules/caniuse-lite/data/features/css-appearance.js create mode 100644 node_modules/caniuse-lite/data/features/css-at-counter-style.js create mode 100644 node_modules/caniuse-lite/data/features/css-autofill.js create mode 100644 node_modules/caniuse-lite/data/features/css-backdrop-filter.js create mode 100644 node_modules/caniuse-lite/data/features/css-background-offsets.js create mode 100644 node_modules/caniuse-lite/data/features/css-backgroundblendmode.js create mode 100644 node_modules/caniuse-lite/data/features/css-boxdecorationbreak.js create mode 100644 node_modules/caniuse-lite/data/features/css-boxshadow.js create mode 100644 node_modules/caniuse-lite/data/features/css-canvas.js create mode 100644 node_modules/caniuse-lite/data/features/css-caret-color.js create mode 100644 node_modules/caniuse-lite/data/features/css-cascade-layers.js create mode 100644 node_modules/caniuse-lite/data/features/css-cascade-scope.js create mode 100644 node_modules/caniuse-lite/data/features/css-case-insensitive.js create mode 100644 node_modules/caniuse-lite/data/features/css-clip-path.js create mode 100644 node_modules/caniuse-lite/data/features/css-color-adjust.js create mode 100644 node_modules/caniuse-lite/data/features/css-color-function.js create mode 100644 node_modules/caniuse-lite/data/features/css-conic-gradients.js create mode 100644 node_modules/caniuse-lite/data/features/css-container-queries-style.js create mode 100644 node_modules/caniuse-lite/data/features/css-container-queries.js create mode 100644 node_modules/caniuse-lite/data/features/css-container-query-units.js create mode 100644 node_modules/caniuse-lite/data/features/css-containment.js create mode 100644 node_modules/caniuse-lite/data/features/css-content-visibility.js create mode 100644 node_modules/caniuse-lite/data/features/css-counters.js create mode 100644 node_modules/caniuse-lite/data/features/css-crisp-edges.js create mode 100644 node_modules/caniuse-lite/data/features/css-cross-fade.js create mode 100644 node_modules/caniuse-lite/data/features/css-default-pseudo.js create mode 100644 node_modules/caniuse-lite/data/features/css-descendant-gtgt.js create mode 100644 node_modules/caniuse-lite/data/features/css-deviceadaptation.js create mode 100644 node_modules/caniuse-lite/data/features/css-dir-pseudo.js create mode 100644 node_modules/caniuse-lite/data/features/css-display-contents.js create mode 100644 node_modules/caniuse-lite/data/features/css-element-function.js create mode 100644 node_modules/caniuse-lite/data/features/css-env-function.js create mode 100644 node_modules/caniuse-lite/data/features/css-exclusions.js create mode 100644 node_modules/caniuse-lite/data/features/css-featurequeries.js create mode 100644 node_modules/caniuse-lite/data/features/css-file-selector-button.js create mode 100644 node_modules/caniuse-lite/data/features/css-filter-function.js create mode 100644 node_modules/caniuse-lite/data/features/css-filters.js create mode 100644 node_modules/caniuse-lite/data/features/css-first-letter.js create mode 100644 node_modules/caniuse-lite/data/features/css-first-line.js create mode 100644 node_modules/caniuse-lite/data/features/css-fixed.js create mode 100644 node_modules/caniuse-lite/data/features/css-focus-visible.js create mode 100644 node_modules/caniuse-lite/data/features/css-focus-within.js create mode 100644 node_modules/caniuse-lite/data/features/css-font-palette.js create mode 100644 node_modules/caniuse-lite/data/features/css-font-rendering-controls.js create mode 100644 node_modules/caniuse-lite/data/features/css-font-stretch.js create mode 100644 node_modules/caniuse-lite/data/features/css-gencontent.js create mode 100644 node_modules/caniuse-lite/data/features/css-gradients.js create mode 100644 node_modules/caniuse-lite/data/features/css-grid-animation.js create mode 100644 node_modules/caniuse-lite/data/features/css-grid.js create mode 100644 node_modules/caniuse-lite/data/features/css-hanging-punctuation.js create mode 100644 node_modules/caniuse-lite/data/features/css-has.js create mode 100644 node_modules/caniuse-lite/data/features/css-hyphens.js create mode 100644 node_modules/caniuse-lite/data/features/css-image-orientation.js create mode 100644 node_modules/caniuse-lite/data/features/css-image-set.js create mode 100644 node_modules/caniuse-lite/data/features/css-in-out-of-range.js create mode 100644 node_modules/caniuse-lite/data/features/css-indeterminate-pseudo.js create mode 100644 node_modules/caniuse-lite/data/features/css-initial-letter.js create mode 100644 node_modules/caniuse-lite/data/features/css-initial-value.js create mode 100644 node_modules/caniuse-lite/data/features/css-lch-lab.js create mode 100644 node_modules/caniuse-lite/data/features/css-letter-spacing.js create mode 100644 node_modules/caniuse-lite/data/features/css-line-clamp.js create mode 100644 node_modules/caniuse-lite/data/features/css-logical-props.js create mode 100644 node_modules/caniuse-lite/data/features/css-marker-pseudo.js create mode 100644 node_modules/caniuse-lite/data/features/css-masks.js create mode 100644 node_modules/caniuse-lite/data/features/css-matches-pseudo.js create mode 100644 node_modules/caniuse-lite/data/features/css-math-functions.js create mode 100644 node_modules/caniuse-lite/data/features/css-media-interaction.js create mode 100644 node_modules/caniuse-lite/data/features/css-media-range-syntax.js create mode 100644 node_modules/caniuse-lite/data/features/css-media-resolution.js create mode 100644 node_modules/caniuse-lite/data/features/css-media-scripting.js create mode 100644 node_modules/caniuse-lite/data/features/css-mediaqueries.js create mode 100644 node_modules/caniuse-lite/data/features/css-mixblendmode.js create mode 100644 node_modules/caniuse-lite/data/features/css-motion-paths.js create mode 100644 node_modules/caniuse-lite/data/features/css-namespaces.js create mode 100644 node_modules/caniuse-lite/data/features/css-nesting.js create mode 100644 node_modules/caniuse-lite/data/features/css-not-sel-list.js create mode 100644 node_modules/caniuse-lite/data/features/css-nth-child-of.js create mode 100644 node_modules/caniuse-lite/data/features/css-opacity.js create mode 100644 node_modules/caniuse-lite/data/features/css-optional-pseudo.js create mode 100644 node_modules/caniuse-lite/data/features/css-overflow-anchor.js create mode 100644 node_modules/caniuse-lite/data/features/css-overflow-overlay.js create mode 100644 node_modules/caniuse-lite/data/features/css-overflow.js create mode 100644 node_modules/caniuse-lite/data/features/css-overscroll-behavior.js create mode 100644 node_modules/caniuse-lite/data/features/css-page-break.js create mode 100644 node_modules/caniuse-lite/data/features/css-paged-media.js create mode 100644 node_modules/caniuse-lite/data/features/css-paint-api.js create mode 100644 node_modules/caniuse-lite/data/features/css-placeholder-shown.js create mode 100644 node_modules/caniuse-lite/data/features/css-placeholder.js create mode 100644 node_modules/caniuse-lite/data/features/css-print-color-adjust.js create mode 100644 node_modules/caniuse-lite/data/features/css-read-only-write.js create mode 100644 node_modules/caniuse-lite/data/features/css-rebeccapurple.js create mode 100644 node_modules/caniuse-lite/data/features/css-reflections.js create mode 100644 node_modules/caniuse-lite/data/features/css-regions.js create mode 100644 node_modules/caniuse-lite/data/features/css-relative-colors.js create mode 100644 node_modules/caniuse-lite/data/features/css-repeating-gradients.js create mode 100644 node_modules/caniuse-lite/data/features/css-resize.js create mode 100644 node_modules/caniuse-lite/data/features/css-revert-value.js create mode 100644 node_modules/caniuse-lite/data/features/css-rrggbbaa.js create mode 100644 node_modules/caniuse-lite/data/features/css-scroll-behavior.js create mode 100644 node_modules/caniuse-lite/data/features/css-scroll-timeline.js create mode 100644 node_modules/caniuse-lite/data/features/css-scrollbar.js create mode 100644 node_modules/caniuse-lite/data/features/css-sel2.js create mode 100644 node_modules/caniuse-lite/data/features/css-sel3.js create mode 100644 node_modules/caniuse-lite/data/features/css-selection.js create mode 100644 node_modules/caniuse-lite/data/features/css-shapes.js create mode 100644 node_modules/caniuse-lite/data/features/css-snappoints.js create mode 100644 node_modules/caniuse-lite/data/features/css-sticky.js create mode 100644 node_modules/caniuse-lite/data/features/css-subgrid.js create mode 100644 node_modules/caniuse-lite/data/features/css-supports-api.js create mode 100644 node_modules/caniuse-lite/data/features/css-table.js create mode 100644 node_modules/caniuse-lite/data/features/css-text-align-last.js create mode 100644 node_modules/caniuse-lite/data/features/css-text-box-trim.js create mode 100644 node_modules/caniuse-lite/data/features/css-text-indent.js create mode 100644 node_modules/caniuse-lite/data/features/css-text-justify.js create mode 100644 node_modules/caniuse-lite/data/features/css-text-orientation.js create mode 100644 node_modules/caniuse-lite/data/features/css-text-spacing.js create mode 100644 node_modules/caniuse-lite/data/features/css-text-wrap-balance.js create mode 100644 node_modules/caniuse-lite/data/features/css-textshadow.js create mode 100644 node_modules/caniuse-lite/data/features/css-touch-action.js create mode 100644 node_modules/caniuse-lite/data/features/css-transitions.js create mode 100644 node_modules/caniuse-lite/data/features/css-unicode-bidi.js create mode 100644 node_modules/caniuse-lite/data/features/css-unset-value.js create mode 100644 node_modules/caniuse-lite/data/features/css-variables.js create mode 100644 node_modules/caniuse-lite/data/features/css-when-else.js create mode 100644 node_modules/caniuse-lite/data/features/css-widows-orphans.js create mode 100644 node_modules/caniuse-lite/data/features/css-width-stretch.js create mode 100644 node_modules/caniuse-lite/data/features/css-writing-mode.js create mode 100644 node_modules/caniuse-lite/data/features/css-zoom.js create mode 100644 node_modules/caniuse-lite/data/features/css3-attr.js create mode 100644 node_modules/caniuse-lite/data/features/css3-boxsizing.js create mode 100644 node_modules/caniuse-lite/data/features/css3-colors.js create mode 100644 node_modules/caniuse-lite/data/features/css3-cursors-grab.js create mode 100644 node_modules/caniuse-lite/data/features/css3-cursors-newer.js create mode 100644 node_modules/caniuse-lite/data/features/css3-cursors.js create mode 100644 node_modules/caniuse-lite/data/features/css3-tabsize.js create mode 100644 node_modules/caniuse-lite/data/features/currentcolor.js create mode 100644 node_modules/caniuse-lite/data/features/custom-elements.js create mode 100644 node_modules/caniuse-lite/data/features/custom-elementsv1.js create mode 100644 node_modules/caniuse-lite/data/features/customevent.js create mode 100644 node_modules/caniuse-lite/data/features/datalist.js create mode 100644 node_modules/caniuse-lite/data/features/dataset.js create mode 100644 node_modules/caniuse-lite/data/features/datauri.js create mode 100644 node_modules/caniuse-lite/data/features/date-tolocaledatestring.js create mode 100644 node_modules/caniuse-lite/data/features/declarative-shadow-dom.js create mode 100644 node_modules/caniuse-lite/data/features/decorators.js create mode 100644 node_modules/caniuse-lite/data/features/details.js create mode 100644 node_modules/caniuse-lite/data/features/deviceorientation.js create mode 100644 node_modules/caniuse-lite/data/features/devicepixelratio.js create mode 100644 node_modules/caniuse-lite/data/features/dialog.js create mode 100644 node_modules/caniuse-lite/data/features/dispatchevent.js create mode 100644 node_modules/caniuse-lite/data/features/dnssec.js create mode 100644 node_modules/caniuse-lite/data/features/do-not-track.js create mode 100644 node_modules/caniuse-lite/data/features/document-currentscript.js create mode 100644 node_modules/caniuse-lite/data/features/document-evaluate-xpath.js create mode 100644 node_modules/caniuse-lite/data/features/document-execcommand.js create mode 100644 node_modules/caniuse-lite/data/features/document-policy.js create mode 100644 node_modules/caniuse-lite/data/features/document-scrollingelement.js create mode 100644 node_modules/caniuse-lite/data/features/documenthead.js create mode 100644 node_modules/caniuse-lite/data/features/dom-manip-convenience.js create mode 100644 node_modules/caniuse-lite/data/features/dom-range.js create mode 100644 node_modules/caniuse-lite/data/features/domcontentloaded.js create mode 100644 node_modules/caniuse-lite/data/features/dommatrix.js create mode 100644 node_modules/caniuse-lite/data/features/download.js create mode 100644 node_modules/caniuse-lite/data/features/dragndrop.js create mode 100644 node_modules/caniuse-lite/data/features/element-closest.js create mode 100644 node_modules/caniuse-lite/data/features/element-from-point.js create mode 100644 node_modules/caniuse-lite/data/features/element-scroll-methods.js create mode 100644 node_modules/caniuse-lite/data/features/eme.js create mode 100644 node_modules/caniuse-lite/data/features/eot.js create mode 100644 node_modules/caniuse-lite/data/features/es5.js create mode 100644 node_modules/caniuse-lite/data/features/es6-class.js create mode 100644 node_modules/caniuse-lite/data/features/es6-generators.js create mode 100644 node_modules/caniuse-lite/data/features/es6-module-dynamic-import.js create mode 100644 node_modules/caniuse-lite/data/features/es6-module.js create mode 100644 node_modules/caniuse-lite/data/features/es6-number.js create mode 100644 node_modules/caniuse-lite/data/features/es6-string-includes.js create mode 100644 node_modules/caniuse-lite/data/features/es6.js create mode 100644 node_modules/caniuse-lite/data/features/eventsource.js create mode 100644 node_modules/caniuse-lite/data/features/extended-system-fonts.js create mode 100644 node_modules/caniuse-lite/data/features/feature-policy.js create mode 100644 node_modules/caniuse-lite/data/features/fetch.js create mode 100644 node_modules/caniuse-lite/data/features/fieldset-disabled.js create mode 100644 node_modules/caniuse-lite/data/features/fileapi.js create mode 100644 node_modules/caniuse-lite/data/features/filereader.js create mode 100644 node_modules/caniuse-lite/data/features/filereadersync.js create mode 100644 node_modules/caniuse-lite/data/features/filesystem.js create mode 100644 node_modules/caniuse-lite/data/features/flac.js create mode 100644 node_modules/caniuse-lite/data/features/flexbox-gap.js create mode 100644 node_modules/caniuse-lite/data/features/flexbox.js create mode 100644 node_modules/caniuse-lite/data/features/flow-root.js create mode 100644 node_modules/caniuse-lite/data/features/focusin-focusout-events.js create mode 100644 node_modules/caniuse-lite/data/features/font-family-system-ui.js create mode 100644 node_modules/caniuse-lite/data/features/font-feature.js create mode 100644 node_modules/caniuse-lite/data/features/font-kerning.js create mode 100644 node_modules/caniuse-lite/data/features/font-loading.js create mode 100644 node_modules/caniuse-lite/data/features/font-size-adjust.js create mode 100644 node_modules/caniuse-lite/data/features/font-smooth.js create mode 100644 node_modules/caniuse-lite/data/features/font-unicode-range.js create mode 100644 node_modules/caniuse-lite/data/features/font-variant-alternates.js create mode 100644 node_modules/caniuse-lite/data/features/font-variant-numeric.js create mode 100644 node_modules/caniuse-lite/data/features/fontface.js create mode 100644 node_modules/caniuse-lite/data/features/form-attribute.js create mode 100644 node_modules/caniuse-lite/data/features/form-submit-attributes.js create mode 100644 node_modules/caniuse-lite/data/features/form-validation.js create mode 100644 node_modules/caniuse-lite/data/features/forms.js create mode 100644 node_modules/caniuse-lite/data/features/fullscreen.js create mode 100644 node_modules/caniuse-lite/data/features/gamepad.js create mode 100644 node_modules/caniuse-lite/data/features/geolocation.js create mode 100644 node_modules/caniuse-lite/data/features/getboundingclientrect.js create mode 100644 node_modules/caniuse-lite/data/features/getcomputedstyle.js create mode 100644 node_modules/caniuse-lite/data/features/getelementsbyclassname.js create mode 100644 node_modules/caniuse-lite/data/features/getrandomvalues.js create mode 100644 node_modules/caniuse-lite/data/features/gyroscope.js create mode 100644 node_modules/caniuse-lite/data/features/hardwareconcurrency.js create mode 100644 node_modules/caniuse-lite/data/features/hashchange.js create mode 100644 node_modules/caniuse-lite/data/features/heif.js create mode 100644 node_modules/caniuse-lite/data/features/hevc.js create mode 100644 node_modules/caniuse-lite/data/features/hidden.js create mode 100644 node_modules/caniuse-lite/data/features/high-resolution-time.js create mode 100644 node_modules/caniuse-lite/data/features/history.js create mode 100644 node_modules/caniuse-lite/data/features/html-media-capture.js create mode 100644 node_modules/caniuse-lite/data/features/html5semantic.js create mode 100644 node_modules/caniuse-lite/data/features/http-live-streaming.js create mode 100644 node_modules/caniuse-lite/data/features/http2.js create mode 100644 node_modules/caniuse-lite/data/features/http3.js create mode 100644 node_modules/caniuse-lite/data/features/iframe-sandbox.js create mode 100644 node_modules/caniuse-lite/data/features/iframe-seamless.js create mode 100644 node_modules/caniuse-lite/data/features/iframe-srcdoc.js create mode 100644 node_modules/caniuse-lite/data/features/imagecapture.js create mode 100644 node_modules/caniuse-lite/data/features/ime.js create mode 100644 node_modules/caniuse-lite/data/features/img-naturalwidth-naturalheight.js create mode 100644 node_modules/caniuse-lite/data/features/import-maps.js create mode 100644 node_modules/caniuse-lite/data/features/imports.js create mode 100644 node_modules/caniuse-lite/data/features/indeterminate-checkbox.js create mode 100644 node_modules/caniuse-lite/data/features/indexeddb.js create mode 100644 node_modules/caniuse-lite/data/features/indexeddb2.js create mode 100644 node_modules/caniuse-lite/data/features/inline-block.js create mode 100644 node_modules/caniuse-lite/data/features/innertext.js create mode 100644 node_modules/caniuse-lite/data/features/input-autocomplete-onoff.js create mode 100644 node_modules/caniuse-lite/data/features/input-color.js create mode 100644 node_modules/caniuse-lite/data/features/input-datetime.js create mode 100644 node_modules/caniuse-lite/data/features/input-email-tel-url.js create mode 100644 node_modules/caniuse-lite/data/features/input-event.js create mode 100644 node_modules/caniuse-lite/data/features/input-file-accept.js create mode 100644 node_modules/caniuse-lite/data/features/input-file-directory.js create mode 100644 node_modules/caniuse-lite/data/features/input-file-multiple.js create mode 100644 node_modules/caniuse-lite/data/features/input-inputmode.js create mode 100644 node_modules/caniuse-lite/data/features/input-minlength.js create mode 100644 node_modules/caniuse-lite/data/features/input-number.js create mode 100644 node_modules/caniuse-lite/data/features/input-pattern.js create mode 100644 node_modules/caniuse-lite/data/features/input-placeholder.js create mode 100644 node_modules/caniuse-lite/data/features/input-range.js create mode 100644 node_modules/caniuse-lite/data/features/input-search.js create mode 100644 node_modules/caniuse-lite/data/features/input-selection.js create mode 100644 node_modules/caniuse-lite/data/features/insert-adjacent.js create mode 100644 node_modules/caniuse-lite/data/features/insertadjacenthtml.js create mode 100644 node_modules/caniuse-lite/data/features/internationalization.js create mode 100644 node_modules/caniuse-lite/data/features/intersectionobserver-v2.js create mode 100644 node_modules/caniuse-lite/data/features/intersectionobserver.js create mode 100644 node_modules/caniuse-lite/data/features/intl-pluralrules.js create mode 100644 node_modules/caniuse-lite/data/features/intrinsic-width.js create mode 100644 node_modules/caniuse-lite/data/features/jpeg2000.js create mode 100644 node_modules/caniuse-lite/data/features/jpegxl.js create mode 100644 node_modules/caniuse-lite/data/features/jpegxr.js create mode 100644 node_modules/caniuse-lite/data/features/js-regexp-lookbehind.js create mode 100644 node_modules/caniuse-lite/data/features/json.js create mode 100644 node_modules/caniuse-lite/data/features/justify-content-space-evenly.js create mode 100644 node_modules/caniuse-lite/data/features/kerning-pairs-ligatures.js create mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-charcode.js create mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-code.js create mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-getmodifierstate.js create mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-key.js create mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-location.js create mode 100644 node_modules/caniuse-lite/data/features/keyboardevent-which.js create mode 100644 node_modules/caniuse-lite/data/features/lazyload.js create mode 100644 node_modules/caniuse-lite/data/features/let.js create mode 100644 node_modules/caniuse-lite/data/features/link-icon-png.js create mode 100644 node_modules/caniuse-lite/data/features/link-icon-svg.js create mode 100644 node_modules/caniuse-lite/data/features/link-rel-dns-prefetch.js create mode 100644 node_modules/caniuse-lite/data/features/link-rel-modulepreload.js create mode 100644 node_modules/caniuse-lite/data/features/link-rel-preconnect.js create mode 100644 node_modules/caniuse-lite/data/features/link-rel-prefetch.js create mode 100644 node_modules/caniuse-lite/data/features/link-rel-preload.js create mode 100644 node_modules/caniuse-lite/data/features/link-rel-prerender.js create mode 100644 node_modules/caniuse-lite/data/features/loading-lazy-attr.js create mode 100644 node_modules/caniuse-lite/data/features/localecompare.js create mode 100644 node_modules/caniuse-lite/data/features/magnetometer.js create mode 100644 node_modules/caniuse-lite/data/features/matchesselector.js create mode 100644 node_modules/caniuse-lite/data/features/matchmedia.js create mode 100644 node_modules/caniuse-lite/data/features/mathml.js create mode 100644 node_modules/caniuse-lite/data/features/maxlength.js create mode 100644 node_modules/caniuse-lite/data/features/mdn-css-backdrop-pseudo-element.js create mode 100644 node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate-override.js create mode 100644 node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-isolate.js create mode 100644 node_modules/caniuse-lite/data/features/mdn-css-unicode-bidi-plaintext.js create mode 100644 node_modules/caniuse-lite/data/features/mdn-text-decoration-color.js create mode 100644 node_modules/caniuse-lite/data/features/mdn-text-decoration-line.js create mode 100644 node_modules/caniuse-lite/data/features/mdn-text-decoration-shorthand.js create mode 100644 node_modules/caniuse-lite/data/features/mdn-text-decoration-style.js create mode 100644 node_modules/caniuse-lite/data/features/media-fragments.js create mode 100644 node_modules/caniuse-lite/data/features/mediacapture-fromelement.js create mode 100644 node_modules/caniuse-lite/data/features/mediarecorder.js create mode 100644 node_modules/caniuse-lite/data/features/mediasource.js create mode 100644 node_modules/caniuse-lite/data/features/menu.js create mode 100644 node_modules/caniuse-lite/data/features/meta-theme-color.js create mode 100644 node_modules/caniuse-lite/data/features/meter.js create mode 100644 node_modules/caniuse-lite/data/features/midi.js create mode 100644 node_modules/caniuse-lite/data/features/minmaxwh.js create mode 100644 node_modules/caniuse-lite/data/features/mp3.js create mode 100644 node_modules/caniuse-lite/data/features/mpeg-dash.js create mode 100644 node_modules/caniuse-lite/data/features/mpeg4.js create mode 100644 node_modules/caniuse-lite/data/features/multibackgrounds.js create mode 100644 node_modules/caniuse-lite/data/features/multicolumn.js create mode 100644 node_modules/caniuse-lite/data/features/mutation-events.js create mode 100644 node_modules/caniuse-lite/data/features/mutationobserver.js create mode 100644 node_modules/caniuse-lite/data/features/namevalue-storage.js create mode 100644 node_modules/caniuse-lite/data/features/native-filesystem-api.js create mode 100644 node_modules/caniuse-lite/data/features/nav-timing.js create mode 100644 node_modules/caniuse-lite/data/features/netinfo.js create mode 100644 node_modules/caniuse-lite/data/features/notifications.js create mode 100644 node_modules/caniuse-lite/data/features/object-entries.js create mode 100644 node_modules/caniuse-lite/data/features/object-fit.js create mode 100644 node_modules/caniuse-lite/data/features/object-observe.js create mode 100644 node_modules/caniuse-lite/data/features/object-values.js create mode 100644 node_modules/caniuse-lite/data/features/objectrtc.js create mode 100644 node_modules/caniuse-lite/data/features/offline-apps.js create mode 100644 node_modules/caniuse-lite/data/features/offscreencanvas.js create mode 100644 node_modules/caniuse-lite/data/features/ogg-vorbis.js create mode 100644 node_modules/caniuse-lite/data/features/ogv.js create mode 100644 node_modules/caniuse-lite/data/features/ol-reversed.js create mode 100644 node_modules/caniuse-lite/data/features/once-event-listener.js create mode 100644 node_modules/caniuse-lite/data/features/online-status.js create mode 100644 node_modules/caniuse-lite/data/features/opus.js create mode 100644 node_modules/caniuse-lite/data/features/orientation-sensor.js create mode 100644 node_modules/caniuse-lite/data/features/outline.js create mode 100644 node_modules/caniuse-lite/data/features/pad-start-end.js create mode 100644 node_modules/caniuse-lite/data/features/page-transition-events.js create mode 100644 node_modules/caniuse-lite/data/features/pagevisibility.js create mode 100644 node_modules/caniuse-lite/data/features/passive-event-listener.js create mode 100644 node_modules/caniuse-lite/data/features/passkeys.js create mode 100644 node_modules/caniuse-lite/data/features/passwordrules.js create mode 100644 node_modules/caniuse-lite/data/features/path2d.js create mode 100644 node_modules/caniuse-lite/data/features/payment-request.js create mode 100644 node_modules/caniuse-lite/data/features/pdf-viewer.js create mode 100644 node_modules/caniuse-lite/data/features/permissions-api.js create mode 100644 node_modules/caniuse-lite/data/features/permissions-policy.js create mode 100644 node_modules/caniuse-lite/data/features/picture-in-picture.js create mode 100644 node_modules/caniuse-lite/data/features/picture.js create mode 100644 node_modules/caniuse-lite/data/features/ping.js create mode 100644 node_modules/caniuse-lite/data/features/png-alpha.js create mode 100644 node_modules/caniuse-lite/data/features/pointer-events.js create mode 100644 node_modules/caniuse-lite/data/features/pointer.js create mode 100644 node_modules/caniuse-lite/data/features/pointerlock.js create mode 100644 node_modules/caniuse-lite/data/features/portals.js create mode 100644 node_modules/caniuse-lite/data/features/prefers-color-scheme.js create mode 100644 node_modules/caniuse-lite/data/features/prefers-reduced-motion.js create mode 100644 node_modules/caniuse-lite/data/features/progress.js create mode 100644 node_modules/caniuse-lite/data/features/promise-finally.js create mode 100644 node_modules/caniuse-lite/data/features/promises.js create mode 100644 node_modules/caniuse-lite/data/features/proximity.js create mode 100644 node_modules/caniuse-lite/data/features/proxy.js create mode 100644 node_modules/caniuse-lite/data/features/publickeypinning.js create mode 100644 node_modules/caniuse-lite/data/features/push-api.js create mode 100644 node_modules/caniuse-lite/data/features/queryselector.js create mode 100644 node_modules/caniuse-lite/data/features/readonly-attr.js create mode 100644 node_modules/caniuse-lite/data/features/referrer-policy.js create mode 100644 node_modules/caniuse-lite/data/features/registerprotocolhandler.js create mode 100644 node_modules/caniuse-lite/data/features/rel-noopener.js create mode 100644 node_modules/caniuse-lite/data/features/rel-noreferrer.js create mode 100644 node_modules/caniuse-lite/data/features/rellist.js create mode 100644 node_modules/caniuse-lite/data/features/rem.js create mode 100644 node_modules/caniuse-lite/data/features/requestanimationframe.js create mode 100644 node_modules/caniuse-lite/data/features/requestidlecallback.js create mode 100644 node_modules/caniuse-lite/data/features/resizeobserver.js create mode 100644 node_modules/caniuse-lite/data/features/resource-timing.js create mode 100644 node_modules/caniuse-lite/data/features/rest-parameters.js create mode 100644 node_modules/caniuse-lite/data/features/rtcpeerconnection.js create mode 100644 node_modules/caniuse-lite/data/features/ruby.js create mode 100644 node_modules/caniuse-lite/data/features/run-in.js create mode 100644 node_modules/caniuse-lite/data/features/same-site-cookie-attribute.js create mode 100644 node_modules/caniuse-lite/data/features/screen-orientation.js create mode 100644 node_modules/caniuse-lite/data/features/script-async.js create mode 100644 node_modules/caniuse-lite/data/features/script-defer.js create mode 100644 node_modules/caniuse-lite/data/features/scrollintoview.js create mode 100644 node_modules/caniuse-lite/data/features/scrollintoviewifneeded.js create mode 100644 node_modules/caniuse-lite/data/features/sdch.js create mode 100644 node_modules/caniuse-lite/data/features/selection-api.js create mode 100644 node_modules/caniuse-lite/data/features/server-timing.js create mode 100644 node_modules/caniuse-lite/data/features/serviceworkers.js create mode 100644 node_modules/caniuse-lite/data/features/setimmediate.js create mode 100644 node_modules/caniuse-lite/data/features/shadowdom.js create mode 100644 node_modules/caniuse-lite/data/features/shadowdomv1.js create mode 100644 node_modules/caniuse-lite/data/features/sharedarraybuffer.js create mode 100644 node_modules/caniuse-lite/data/features/sharedworkers.js create mode 100644 node_modules/caniuse-lite/data/features/sni.js create mode 100644 node_modules/caniuse-lite/data/features/spdy.js create mode 100644 node_modules/caniuse-lite/data/features/speech-recognition.js create mode 100644 node_modules/caniuse-lite/data/features/speech-synthesis.js create mode 100644 node_modules/caniuse-lite/data/features/spellcheck-attribute.js create mode 100644 node_modules/caniuse-lite/data/features/sql-storage.js create mode 100644 node_modules/caniuse-lite/data/features/srcset.js create mode 100644 node_modules/caniuse-lite/data/features/stream.js create mode 100644 node_modules/caniuse-lite/data/features/streams.js create mode 100644 node_modules/caniuse-lite/data/features/stricttransportsecurity.js create mode 100644 node_modules/caniuse-lite/data/features/style-scoped.js create mode 100644 node_modules/caniuse-lite/data/features/subresource-bundling.js create mode 100644 node_modules/caniuse-lite/data/features/subresource-integrity.js create mode 100644 node_modules/caniuse-lite/data/features/svg-css.js create mode 100644 node_modules/caniuse-lite/data/features/svg-filters.js create mode 100644 node_modules/caniuse-lite/data/features/svg-fonts.js create mode 100644 node_modules/caniuse-lite/data/features/svg-fragment.js create mode 100644 node_modules/caniuse-lite/data/features/svg-html.js create mode 100644 node_modules/caniuse-lite/data/features/svg-html5.js create mode 100644 node_modules/caniuse-lite/data/features/svg-img.js create mode 100644 node_modules/caniuse-lite/data/features/svg-smil.js create mode 100644 node_modules/caniuse-lite/data/features/svg.js create mode 100644 node_modules/caniuse-lite/data/features/sxg.js create mode 100644 node_modules/caniuse-lite/data/features/tabindex-attr.js create mode 100644 node_modules/caniuse-lite/data/features/template-literals.js create mode 100644 node_modules/caniuse-lite/data/features/template.js create mode 100644 node_modules/caniuse-lite/data/features/temporal.js create mode 100644 node_modules/caniuse-lite/data/features/testfeat.js create mode 100644 node_modules/caniuse-lite/data/features/text-decoration.js create mode 100644 node_modules/caniuse-lite/data/features/text-emphasis.js create mode 100644 node_modules/caniuse-lite/data/features/text-overflow.js create mode 100644 node_modules/caniuse-lite/data/features/text-size-adjust.js create mode 100644 node_modules/caniuse-lite/data/features/text-stroke.js create mode 100644 node_modules/caniuse-lite/data/features/textcontent.js create mode 100644 node_modules/caniuse-lite/data/features/textencoder.js create mode 100644 node_modules/caniuse-lite/data/features/tls1-1.js create mode 100644 node_modules/caniuse-lite/data/features/tls1-2.js create mode 100644 node_modules/caniuse-lite/data/features/tls1-3.js create mode 100644 node_modules/caniuse-lite/data/features/touch.js create mode 100644 node_modules/caniuse-lite/data/features/transforms2d.js create mode 100644 node_modules/caniuse-lite/data/features/transforms3d.js create mode 100644 node_modules/caniuse-lite/data/features/trusted-types.js create mode 100644 node_modules/caniuse-lite/data/features/ttf.js create mode 100644 node_modules/caniuse-lite/data/features/typedarrays.js create mode 100644 node_modules/caniuse-lite/data/features/u2f.js create mode 100644 node_modules/caniuse-lite/data/features/unhandledrejection.js create mode 100644 node_modules/caniuse-lite/data/features/upgradeinsecurerequests.js create mode 100644 node_modules/caniuse-lite/data/features/url-scroll-to-text-fragment.js create mode 100644 node_modules/caniuse-lite/data/features/url.js create mode 100644 node_modules/caniuse-lite/data/features/urlsearchparams.js create mode 100644 node_modules/caniuse-lite/data/features/use-strict.js create mode 100644 node_modules/caniuse-lite/data/features/user-select-none.js create mode 100644 node_modules/caniuse-lite/data/features/user-timing.js create mode 100644 node_modules/caniuse-lite/data/features/variable-fonts.js create mode 100644 node_modules/caniuse-lite/data/features/vector-effect.js create mode 100644 node_modules/caniuse-lite/data/features/vibration.js create mode 100644 node_modules/caniuse-lite/data/features/video.js create mode 100644 node_modules/caniuse-lite/data/features/videotracks.js create mode 100644 node_modules/caniuse-lite/data/features/view-transitions.js create mode 100644 node_modules/caniuse-lite/data/features/viewport-unit-variants.js create mode 100644 node_modules/caniuse-lite/data/features/viewport-units.js create mode 100644 node_modules/caniuse-lite/data/features/wai-aria.js create mode 100644 node_modules/caniuse-lite/data/features/wake-lock.js create mode 100644 node_modules/caniuse-lite/data/features/wasm.js create mode 100644 node_modules/caniuse-lite/data/features/wav.js create mode 100644 node_modules/caniuse-lite/data/features/wbr-element.js create mode 100644 node_modules/caniuse-lite/data/features/web-animation.js create mode 100644 node_modules/caniuse-lite/data/features/web-app-manifest.js create mode 100644 node_modules/caniuse-lite/data/features/web-bluetooth.js create mode 100644 node_modules/caniuse-lite/data/features/web-serial.js create mode 100644 node_modules/caniuse-lite/data/features/web-share.js create mode 100644 node_modules/caniuse-lite/data/features/webauthn.js create mode 100644 node_modules/caniuse-lite/data/features/webcodecs.js create mode 100644 node_modules/caniuse-lite/data/features/webgl.js create mode 100644 node_modules/caniuse-lite/data/features/webgl2.js create mode 100644 node_modules/caniuse-lite/data/features/webgpu.js create mode 100644 node_modules/caniuse-lite/data/features/webhid.js create mode 100644 node_modules/caniuse-lite/data/features/webkit-user-drag.js create mode 100644 node_modules/caniuse-lite/data/features/webm.js create mode 100644 node_modules/caniuse-lite/data/features/webnfc.js create mode 100644 node_modules/caniuse-lite/data/features/webp.js create mode 100644 node_modules/caniuse-lite/data/features/websockets.js create mode 100644 node_modules/caniuse-lite/data/features/webtransport.js create mode 100644 node_modules/caniuse-lite/data/features/webusb.js create mode 100644 node_modules/caniuse-lite/data/features/webvr.js create mode 100644 node_modules/caniuse-lite/data/features/webvtt.js create mode 100644 node_modules/caniuse-lite/data/features/webworkers.js create mode 100644 node_modules/caniuse-lite/data/features/webxr.js create mode 100644 node_modules/caniuse-lite/data/features/will-change.js create mode 100644 node_modules/caniuse-lite/data/features/woff.js create mode 100644 node_modules/caniuse-lite/data/features/woff2.js create mode 100644 node_modules/caniuse-lite/data/features/word-break.js create mode 100644 node_modules/caniuse-lite/data/features/wordwrap.js create mode 100644 node_modules/caniuse-lite/data/features/x-doc-messaging.js create mode 100644 node_modules/caniuse-lite/data/features/x-frame-options.js create mode 100644 node_modules/caniuse-lite/data/features/xhr2.js create mode 100644 node_modules/caniuse-lite/data/features/xhtml.js create mode 100644 node_modules/caniuse-lite/data/features/xhtmlsmil.js create mode 100644 node_modules/caniuse-lite/data/features/xml-serializer.js create mode 100644 node_modules/caniuse-lite/data/features/zstd.js create mode 100644 node_modules/caniuse-lite/data/regions/AD.js create mode 100644 node_modules/caniuse-lite/data/regions/AE.js create mode 100644 node_modules/caniuse-lite/data/regions/AF.js create mode 100644 node_modules/caniuse-lite/data/regions/AG.js create mode 100644 node_modules/caniuse-lite/data/regions/AI.js create mode 100644 node_modules/caniuse-lite/data/regions/AL.js create mode 100644 node_modules/caniuse-lite/data/regions/AM.js create mode 100644 node_modules/caniuse-lite/data/regions/AO.js create mode 100644 node_modules/caniuse-lite/data/regions/AR.js create mode 100644 node_modules/caniuse-lite/data/regions/AS.js create mode 100644 node_modules/caniuse-lite/data/regions/AT.js create mode 100644 node_modules/caniuse-lite/data/regions/AU.js create mode 100644 node_modules/caniuse-lite/data/regions/AW.js create mode 100644 node_modules/caniuse-lite/data/regions/AX.js create mode 100644 node_modules/caniuse-lite/data/regions/AZ.js create mode 100644 node_modules/caniuse-lite/data/regions/BA.js create mode 100644 node_modules/caniuse-lite/data/regions/BB.js create mode 100644 node_modules/caniuse-lite/data/regions/BD.js create mode 100644 node_modules/caniuse-lite/data/regions/BE.js create mode 100644 node_modules/caniuse-lite/data/regions/BF.js create mode 100644 node_modules/caniuse-lite/data/regions/BG.js create mode 100644 node_modules/caniuse-lite/data/regions/BH.js create mode 100644 node_modules/caniuse-lite/data/regions/BI.js create mode 100644 node_modules/caniuse-lite/data/regions/BJ.js create mode 100644 node_modules/caniuse-lite/data/regions/BM.js create mode 100644 node_modules/caniuse-lite/data/regions/BN.js create mode 100644 node_modules/caniuse-lite/data/regions/BO.js create mode 100644 node_modules/caniuse-lite/data/regions/BR.js create mode 100644 node_modules/caniuse-lite/data/regions/BS.js create mode 100644 node_modules/caniuse-lite/data/regions/BT.js create mode 100644 node_modules/caniuse-lite/data/regions/BW.js create mode 100644 node_modules/caniuse-lite/data/regions/BY.js create mode 100644 node_modules/caniuse-lite/data/regions/BZ.js create mode 100644 node_modules/caniuse-lite/data/regions/CA.js create mode 100644 node_modules/caniuse-lite/data/regions/CD.js create mode 100644 node_modules/caniuse-lite/data/regions/CF.js create mode 100644 node_modules/caniuse-lite/data/regions/CG.js create mode 100644 node_modules/caniuse-lite/data/regions/CH.js create mode 100644 node_modules/caniuse-lite/data/regions/CI.js create mode 100644 node_modules/caniuse-lite/data/regions/CK.js create mode 100644 node_modules/caniuse-lite/data/regions/CL.js create mode 100644 node_modules/caniuse-lite/data/regions/CM.js create mode 100644 node_modules/caniuse-lite/data/regions/CN.js create mode 100644 node_modules/caniuse-lite/data/regions/CO.js create mode 100644 node_modules/caniuse-lite/data/regions/CR.js create mode 100644 node_modules/caniuse-lite/data/regions/CU.js create mode 100644 node_modules/caniuse-lite/data/regions/CV.js create mode 100644 node_modules/caniuse-lite/data/regions/CX.js create mode 100644 node_modules/caniuse-lite/data/regions/CY.js create mode 100644 node_modules/caniuse-lite/data/regions/CZ.js create mode 100644 node_modules/caniuse-lite/data/regions/DE.js create mode 100644 node_modules/caniuse-lite/data/regions/DJ.js create mode 100644 node_modules/caniuse-lite/data/regions/DK.js create mode 100644 node_modules/caniuse-lite/data/regions/DM.js create mode 100644 node_modules/caniuse-lite/data/regions/DO.js create mode 100644 node_modules/caniuse-lite/data/regions/DZ.js create mode 100644 node_modules/caniuse-lite/data/regions/EC.js create mode 100644 node_modules/caniuse-lite/data/regions/EE.js create mode 100644 node_modules/caniuse-lite/data/regions/EG.js create mode 100644 node_modules/caniuse-lite/data/regions/ER.js create mode 100644 node_modules/caniuse-lite/data/regions/ES.js create mode 100644 node_modules/caniuse-lite/data/regions/ET.js create mode 100644 node_modules/caniuse-lite/data/regions/FI.js create mode 100644 node_modules/caniuse-lite/data/regions/FJ.js create mode 100644 node_modules/caniuse-lite/data/regions/FK.js create mode 100644 node_modules/caniuse-lite/data/regions/FM.js create mode 100644 node_modules/caniuse-lite/data/regions/FO.js create mode 100644 node_modules/caniuse-lite/data/regions/FR.js create mode 100644 node_modules/caniuse-lite/data/regions/GA.js create mode 100644 node_modules/caniuse-lite/data/regions/GB.js create mode 100644 node_modules/caniuse-lite/data/regions/GD.js create mode 100644 node_modules/caniuse-lite/data/regions/GE.js create mode 100644 node_modules/caniuse-lite/data/regions/GF.js create mode 100644 node_modules/caniuse-lite/data/regions/GG.js create mode 100644 node_modules/caniuse-lite/data/regions/GH.js create mode 100644 node_modules/caniuse-lite/data/regions/GI.js create mode 100644 node_modules/caniuse-lite/data/regions/GL.js create mode 100644 node_modules/caniuse-lite/data/regions/GM.js create mode 100644 node_modules/caniuse-lite/data/regions/GN.js create mode 100644 node_modules/caniuse-lite/data/regions/GP.js create mode 100644 node_modules/caniuse-lite/data/regions/GQ.js create mode 100644 node_modules/caniuse-lite/data/regions/GR.js create mode 100644 node_modules/caniuse-lite/data/regions/GT.js create mode 100644 node_modules/caniuse-lite/data/regions/GU.js create mode 100644 node_modules/caniuse-lite/data/regions/GW.js create mode 100644 node_modules/caniuse-lite/data/regions/GY.js create mode 100644 node_modules/caniuse-lite/data/regions/HK.js create mode 100644 node_modules/caniuse-lite/data/regions/HN.js create mode 100644 node_modules/caniuse-lite/data/regions/HR.js create mode 100644 node_modules/caniuse-lite/data/regions/HT.js create mode 100644 node_modules/caniuse-lite/data/regions/HU.js create mode 100644 node_modules/caniuse-lite/data/regions/ID.js create mode 100644 node_modules/caniuse-lite/data/regions/IE.js create mode 100644 node_modules/caniuse-lite/data/regions/IL.js create mode 100644 node_modules/caniuse-lite/data/regions/IM.js create mode 100644 node_modules/caniuse-lite/data/regions/IN.js create mode 100644 node_modules/caniuse-lite/data/regions/IQ.js create mode 100644 node_modules/caniuse-lite/data/regions/IR.js create mode 100644 node_modules/caniuse-lite/data/regions/IS.js create mode 100644 node_modules/caniuse-lite/data/regions/IT.js create mode 100644 node_modules/caniuse-lite/data/regions/JE.js create mode 100644 node_modules/caniuse-lite/data/regions/JM.js create mode 100644 node_modules/caniuse-lite/data/regions/JO.js create mode 100644 node_modules/caniuse-lite/data/regions/JP.js create mode 100644 node_modules/caniuse-lite/data/regions/KE.js create mode 100644 node_modules/caniuse-lite/data/regions/KG.js create mode 100644 node_modules/caniuse-lite/data/regions/KH.js create mode 100644 node_modules/caniuse-lite/data/regions/KI.js create mode 100644 node_modules/caniuse-lite/data/regions/KM.js create mode 100644 node_modules/caniuse-lite/data/regions/KN.js create mode 100644 node_modules/caniuse-lite/data/regions/KP.js create mode 100644 node_modules/caniuse-lite/data/regions/KR.js create mode 100644 node_modules/caniuse-lite/data/regions/KW.js create mode 100644 node_modules/caniuse-lite/data/regions/KY.js create mode 100644 node_modules/caniuse-lite/data/regions/KZ.js create mode 100644 node_modules/caniuse-lite/data/regions/LA.js create mode 100644 node_modules/caniuse-lite/data/regions/LB.js create mode 100644 node_modules/caniuse-lite/data/regions/LC.js create mode 100644 node_modules/caniuse-lite/data/regions/LI.js create mode 100644 node_modules/caniuse-lite/data/regions/LK.js create mode 100644 node_modules/caniuse-lite/data/regions/LR.js create mode 100644 node_modules/caniuse-lite/data/regions/LS.js create mode 100644 node_modules/caniuse-lite/data/regions/LT.js create mode 100644 node_modules/caniuse-lite/data/regions/LU.js create mode 100644 node_modules/caniuse-lite/data/regions/LV.js create mode 100644 node_modules/caniuse-lite/data/regions/LY.js create mode 100644 node_modules/caniuse-lite/data/regions/MA.js create mode 100644 node_modules/caniuse-lite/data/regions/MC.js create mode 100644 node_modules/caniuse-lite/data/regions/MD.js create mode 100644 node_modules/caniuse-lite/data/regions/ME.js create mode 100644 node_modules/caniuse-lite/data/regions/MG.js create mode 100644 node_modules/caniuse-lite/data/regions/MH.js create mode 100644 node_modules/caniuse-lite/data/regions/MK.js create mode 100644 node_modules/caniuse-lite/data/regions/ML.js create mode 100644 node_modules/caniuse-lite/data/regions/MM.js create mode 100644 node_modules/caniuse-lite/data/regions/MN.js create mode 100644 node_modules/caniuse-lite/data/regions/MO.js create mode 100644 node_modules/caniuse-lite/data/regions/MP.js create mode 100644 node_modules/caniuse-lite/data/regions/MQ.js create mode 100644 node_modules/caniuse-lite/data/regions/MR.js create mode 100644 node_modules/caniuse-lite/data/regions/MS.js create mode 100644 node_modules/caniuse-lite/data/regions/MT.js create mode 100644 node_modules/caniuse-lite/data/regions/MU.js create mode 100644 node_modules/caniuse-lite/data/regions/MV.js create mode 100644 node_modules/caniuse-lite/data/regions/MW.js create mode 100644 node_modules/caniuse-lite/data/regions/MX.js create mode 100644 node_modules/caniuse-lite/data/regions/MY.js create mode 100644 node_modules/caniuse-lite/data/regions/MZ.js create mode 100644 node_modules/caniuse-lite/data/regions/NA.js create mode 100644 node_modules/caniuse-lite/data/regions/NC.js create mode 100644 node_modules/caniuse-lite/data/regions/NE.js create mode 100644 node_modules/caniuse-lite/data/regions/NF.js create mode 100644 node_modules/caniuse-lite/data/regions/NG.js create mode 100644 node_modules/caniuse-lite/data/regions/NI.js create mode 100644 node_modules/caniuse-lite/data/regions/NL.js create mode 100644 node_modules/caniuse-lite/data/regions/NO.js create mode 100644 node_modules/caniuse-lite/data/regions/NP.js create mode 100644 node_modules/caniuse-lite/data/regions/NR.js create mode 100644 node_modules/caniuse-lite/data/regions/NU.js create mode 100644 node_modules/caniuse-lite/data/regions/NZ.js create mode 100644 node_modules/caniuse-lite/data/regions/OM.js create mode 100644 node_modules/caniuse-lite/data/regions/PA.js create mode 100644 node_modules/caniuse-lite/data/regions/PE.js create mode 100644 node_modules/caniuse-lite/data/regions/PF.js create mode 100644 node_modules/caniuse-lite/data/regions/PG.js create mode 100644 node_modules/caniuse-lite/data/regions/PH.js create mode 100644 node_modules/caniuse-lite/data/regions/PK.js create mode 100644 node_modules/caniuse-lite/data/regions/PL.js create mode 100644 node_modules/caniuse-lite/data/regions/PM.js create mode 100644 node_modules/caniuse-lite/data/regions/PN.js create mode 100644 node_modules/caniuse-lite/data/regions/PR.js create mode 100644 node_modules/caniuse-lite/data/regions/PS.js create mode 100644 node_modules/caniuse-lite/data/regions/PT.js create mode 100644 node_modules/caniuse-lite/data/regions/PW.js create mode 100644 node_modules/caniuse-lite/data/regions/PY.js create mode 100644 node_modules/caniuse-lite/data/regions/QA.js create mode 100644 node_modules/caniuse-lite/data/regions/RE.js create mode 100644 node_modules/caniuse-lite/data/regions/RO.js create mode 100644 node_modules/caniuse-lite/data/regions/RS.js create mode 100644 node_modules/caniuse-lite/data/regions/RU.js create mode 100644 node_modules/caniuse-lite/data/regions/RW.js create mode 100644 node_modules/caniuse-lite/data/regions/SA.js create mode 100644 node_modules/caniuse-lite/data/regions/SB.js create mode 100644 node_modules/caniuse-lite/data/regions/SC.js create mode 100644 node_modules/caniuse-lite/data/regions/SD.js create mode 100644 node_modules/caniuse-lite/data/regions/SE.js create mode 100644 node_modules/caniuse-lite/data/regions/SG.js create mode 100644 node_modules/caniuse-lite/data/regions/SH.js create mode 100644 node_modules/caniuse-lite/data/regions/SI.js create mode 100644 node_modules/caniuse-lite/data/regions/SK.js create mode 100644 node_modules/caniuse-lite/data/regions/SL.js create mode 100644 node_modules/caniuse-lite/data/regions/SM.js create mode 100644 node_modules/caniuse-lite/data/regions/SN.js create mode 100644 node_modules/caniuse-lite/data/regions/SO.js create mode 100644 node_modules/caniuse-lite/data/regions/SR.js create mode 100644 node_modules/caniuse-lite/data/regions/ST.js create mode 100644 node_modules/caniuse-lite/data/regions/SV.js create mode 100644 node_modules/caniuse-lite/data/regions/SY.js create mode 100644 node_modules/caniuse-lite/data/regions/SZ.js create mode 100644 node_modules/caniuse-lite/data/regions/TC.js create mode 100644 node_modules/caniuse-lite/data/regions/TD.js create mode 100644 node_modules/caniuse-lite/data/regions/TG.js create mode 100644 node_modules/caniuse-lite/data/regions/TH.js create mode 100644 node_modules/caniuse-lite/data/regions/TJ.js create mode 100644 node_modules/caniuse-lite/data/regions/TK.js create mode 100644 node_modules/caniuse-lite/data/regions/TL.js create mode 100644 node_modules/caniuse-lite/data/regions/TM.js create mode 100644 node_modules/caniuse-lite/data/regions/TN.js create mode 100644 node_modules/caniuse-lite/data/regions/TO.js create mode 100644 node_modules/caniuse-lite/data/regions/TR.js create mode 100644 node_modules/caniuse-lite/data/regions/TT.js create mode 100644 node_modules/caniuse-lite/data/regions/TV.js create mode 100644 node_modules/caniuse-lite/data/regions/TW.js create mode 100644 node_modules/caniuse-lite/data/regions/TZ.js create mode 100644 node_modules/caniuse-lite/data/regions/UA.js create mode 100644 node_modules/caniuse-lite/data/regions/UG.js create mode 100644 node_modules/caniuse-lite/data/regions/US.js create mode 100644 node_modules/caniuse-lite/data/regions/UY.js create mode 100644 node_modules/caniuse-lite/data/regions/UZ.js create mode 100644 node_modules/caniuse-lite/data/regions/VA.js create mode 100644 node_modules/caniuse-lite/data/regions/VC.js create mode 100644 node_modules/caniuse-lite/data/regions/VE.js create mode 100644 node_modules/caniuse-lite/data/regions/VG.js create mode 100644 node_modules/caniuse-lite/data/regions/VI.js create mode 100644 node_modules/caniuse-lite/data/regions/VN.js create mode 100644 node_modules/caniuse-lite/data/regions/VU.js create mode 100644 node_modules/caniuse-lite/data/regions/WF.js create mode 100644 node_modules/caniuse-lite/data/regions/WS.js create mode 100644 node_modules/caniuse-lite/data/regions/YE.js create mode 100644 node_modules/caniuse-lite/data/regions/YT.js create mode 100644 node_modules/caniuse-lite/data/regions/ZA.js create mode 100644 node_modules/caniuse-lite/data/regions/ZM.js create mode 100644 node_modules/caniuse-lite/data/regions/ZW.js create mode 100644 node_modules/caniuse-lite/data/regions/alt-af.js create mode 100644 node_modules/caniuse-lite/data/regions/alt-an.js create mode 100644 node_modules/caniuse-lite/data/regions/alt-as.js create mode 100644 node_modules/caniuse-lite/data/regions/alt-eu.js create mode 100644 node_modules/caniuse-lite/data/regions/alt-na.js create mode 100644 node_modules/caniuse-lite/data/regions/alt-oc.js create mode 100644 node_modules/caniuse-lite/data/regions/alt-sa.js create mode 100644 node_modules/caniuse-lite/data/regions/alt-ww.js create mode 100644 node_modules/caniuse-lite/dist/lib/statuses.js create mode 100644 node_modules/caniuse-lite/dist/lib/supported.js create mode 100644 node_modules/caniuse-lite/dist/unpacker/agents.js create mode 100644 node_modules/caniuse-lite/dist/unpacker/browserVersions.js create mode 100644 node_modules/caniuse-lite/dist/unpacker/browsers.js create mode 100644 node_modules/caniuse-lite/dist/unpacker/feature.js create mode 100644 node_modules/caniuse-lite/dist/unpacker/features.js create mode 100644 node_modules/caniuse-lite/dist/unpacker/index.js create mode 100644 node_modules/caniuse-lite/dist/unpacker/region.js create mode 100644 node_modules/caniuse-lite/package.json create mode 100644 node_modules/chalk/index.d.ts create mode 100644 node_modules/chalk/license create mode 100644 node_modules/chalk/package.json create mode 100644 node_modules/chalk/readme.md create mode 100644 node_modules/chalk/source/index.js create mode 100644 node_modules/chalk/source/templates.js create mode 100644 node_modules/chalk/source/util.js create mode 100644 node_modules/char-regex/LICENSE create mode 100644 node_modules/char-regex/README.md create mode 100644 node_modules/char-regex/index.d.ts create mode 100644 node_modules/char-regex/index.js create mode 100644 node_modules/char-regex/package.json create mode 100644 node_modules/ci-info/CHANGELOG.md create mode 100644 node_modules/ci-info/LICENSE create mode 100644 node_modules/ci-info/README.md create mode 100644 node_modules/ci-info/index.d.ts create mode 100644 node_modules/ci-info/index.js create mode 100644 node_modules/ci-info/package.json create mode 100644 node_modules/ci-info/vendors.json create mode 100644 node_modules/cjs-module-lexer/LICENSE create mode 100644 node_modules/cjs-module-lexer/README.md create mode 100644 node_modules/cjs-module-lexer/dist/lexer.js create mode 100644 node_modules/cjs-module-lexer/dist/lexer.mjs create mode 100644 node_modules/cjs-module-lexer/lexer.d.ts create mode 100644 node_modules/cjs-module-lexer/lexer.js create mode 100644 node_modules/cjs-module-lexer/package.json create mode 100644 node_modules/cliui/CHANGELOG.md create mode 100644 node_modules/cliui/LICENSE.txt create mode 100644 node_modules/cliui/README.md create mode 100644 node_modules/cliui/build/index.cjs create mode 100644 node_modules/cliui/build/index.d.cts create mode 100644 node_modules/cliui/build/lib/index.js create mode 100644 node_modules/cliui/build/lib/string-utils.js create mode 100644 node_modules/cliui/index.mjs create mode 100644 node_modules/cliui/package.json create mode 100644 node_modules/co/History.md create mode 100644 node_modules/co/LICENSE create mode 100644 node_modules/co/Readme.md create mode 100644 node_modules/co/index.js create mode 100644 node_modules/co/package.json create mode 100644 node_modules/collect-v8-coverage/CHANGELOG.md create mode 100644 node_modules/collect-v8-coverage/LICENSE create mode 100644 node_modules/collect-v8-coverage/README.md create mode 100644 node_modules/collect-v8-coverage/index.d.ts create mode 100644 node_modules/collect-v8-coverage/index.js create mode 100644 node_modules/collect-v8-coverage/package.json create mode 100644 node_modules/color-convert/CHANGELOG.md create mode 100644 node_modules/color-convert/LICENSE create mode 100644 node_modules/color-convert/README.md create mode 100644 node_modules/color-convert/conversions.js create mode 100644 node_modules/color-convert/index.js create mode 100644 node_modules/color-convert/package.json create mode 100644 node_modules/color-convert/route.js create mode 100644 node_modules/color-name/LICENSE create mode 100644 node_modules/color-name/README.md create mode 100644 node_modules/color-name/index.js create mode 100644 node_modules/color-name/package.json create mode 100644 node_modules/concat-map/.travis.yml create mode 100644 node_modules/concat-map/LICENSE create mode 100644 node_modules/concat-map/README.markdown create mode 100644 node_modules/concat-map/example/map.js create mode 100644 node_modules/concat-map/index.js create mode 100644 node_modules/concat-map/package.json create mode 100644 node_modules/concat-map/test/map.js create mode 100644 node_modules/convert-source-map/LICENSE create mode 100644 node_modules/convert-source-map/README.md create mode 100644 node_modules/convert-source-map/index.js create mode 100644 node_modules/convert-source-map/package.json create mode 100644 node_modules/create-jest/LICENSE create mode 100644 node_modules/create-jest/README.md create mode 100644 node_modules/create-jest/bin/create-jest.js create mode 100644 node_modules/create-jest/build/errors.js create mode 100644 node_modules/create-jest/build/generateConfigFile.js create mode 100644 node_modules/create-jest/build/index.d.ts create mode 100644 node_modules/create-jest/build/index.js create mode 100644 node_modules/create-jest/build/modifyPackageJson.js create mode 100644 node_modules/create-jest/build/questions.js create mode 100644 node_modules/create-jest/build/runCreate.js create mode 100644 node_modules/create-jest/build/types.js create mode 100644 node_modules/create-jest/package.json create mode 100644 node_modules/cross-spawn/CHANGELOG.md create mode 100644 node_modules/cross-spawn/LICENSE create mode 100644 node_modules/cross-spawn/README.md create mode 100644 node_modules/cross-spawn/index.js create mode 100644 node_modules/cross-spawn/lib/enoent.js create mode 100644 node_modules/cross-spawn/lib/parse.js create mode 100644 node_modules/cross-spawn/lib/util/escape.js create mode 100644 node_modules/cross-spawn/lib/util/readShebang.js create mode 100644 node_modules/cross-spawn/lib/util/resolveCommand.js create mode 100644 node_modules/cross-spawn/package.json create mode 100644 node_modules/debug/LICENSE create mode 100644 node_modules/debug/README.md create mode 100644 node_modules/debug/package.json create mode 100644 node_modules/debug/src/browser.js create mode 100644 node_modules/debug/src/common.js create mode 100644 node_modules/debug/src/index.js create mode 100644 node_modules/debug/src/node.js create mode 100644 node_modules/dedent/LICENSE create mode 100644 node_modules/dedent/README.md create mode 100644 node_modules/dedent/dist/dedent.d.mts create mode 100644 node_modules/dedent/dist/dedent.d.ts create mode 100644 node_modules/dedent/dist/dedent.js create mode 100644 node_modules/dedent/dist/dedent.mjs create mode 100644 node_modules/dedent/macro.d.ts create mode 100644 node_modules/dedent/macro.js create mode 100644 node_modules/dedent/package.json create mode 100644 node_modules/deepmerge/.editorconfig create mode 100644 node_modules/deepmerge/.eslintcache create mode 100644 node_modules/deepmerge/changelog.md create mode 100644 node_modules/deepmerge/dist/cjs.js create mode 100644 node_modules/deepmerge/dist/umd.js create mode 100644 node_modules/deepmerge/index.d.ts create mode 100644 node_modules/deepmerge/index.js create mode 100644 node_modules/deepmerge/license.txt create mode 100644 node_modules/deepmerge/package.json create mode 100644 node_modules/deepmerge/readme.md create mode 100644 node_modules/deepmerge/rollup.config.js create mode 100644 node_modules/detect-newline/index.d.ts create mode 100644 node_modules/detect-newline/index.js create mode 100644 node_modules/detect-newline/license create mode 100644 node_modules/detect-newline/package.json create mode 100644 node_modules/detect-newline/readme.md create mode 100644 node_modules/diff-sequences/LICENSE create mode 100644 node_modules/diff-sequences/README.md create mode 100644 node_modules/diff-sequences/build/index.d.ts create mode 100644 node_modules/diff-sequences/build/index.js create mode 100644 node_modules/diff-sequences/package.json create mode 100644 node_modules/electron-to-chromium/CHANGELOG.md create mode 100644 node_modules/electron-to-chromium/LICENSE create mode 100644 node_modules/electron-to-chromium/README.md create mode 100644 node_modules/electron-to-chromium/chromium-versions.js create mode 100644 node_modules/electron-to-chromium/chromium-versions.json create mode 100644 node_modules/electron-to-chromium/full-chromium-versions.js create mode 100644 node_modules/electron-to-chromium/full-chromium-versions.json create mode 100644 node_modules/electron-to-chromium/full-versions.js create mode 100644 node_modules/electron-to-chromium/full-versions.json create mode 100644 node_modules/electron-to-chromium/index.js create mode 100644 node_modules/electron-to-chromium/package.json create mode 100644 node_modules/electron-to-chromium/versions.js create mode 100644 node_modules/electron-to-chromium/versions.json create mode 100644 node_modules/emittery/index.d.ts create mode 100644 node_modules/emittery/index.js create mode 100644 node_modules/emittery/license create mode 100644 node_modules/emittery/maps.js create mode 100644 node_modules/emittery/package.json create mode 100644 node_modules/emittery/readme.md create mode 100644 node_modules/emoji-regex/LICENSE-MIT.txt create mode 100644 node_modules/emoji-regex/README.md create mode 100644 node_modules/emoji-regex/es2015/index.js create mode 100644 node_modules/emoji-regex/es2015/text.js create mode 100644 node_modules/emoji-regex/index.d.ts create mode 100644 node_modules/emoji-regex/index.js create mode 100644 node_modules/emoji-regex/package.json create mode 100644 node_modules/emoji-regex/text.js create mode 100644 node_modules/error-ex/LICENSE create mode 100644 node_modules/error-ex/README.md create mode 100644 node_modules/error-ex/index.js create mode 100644 node_modules/error-ex/package.json create mode 100644 node_modules/escalade/dist/index.js create mode 100644 node_modules/escalade/dist/index.mjs create mode 100644 node_modules/escalade/index.d.ts create mode 100644 node_modules/escalade/license create mode 100644 node_modules/escalade/package.json create mode 100644 node_modules/escalade/readme.md create mode 100644 node_modules/escalade/sync/index.d.ts create mode 100644 node_modules/escalade/sync/index.js create mode 100644 node_modules/escalade/sync/index.mjs create mode 100644 node_modules/escape-string-regexp/index.d.ts create mode 100644 node_modules/escape-string-regexp/index.js create mode 100644 node_modules/escape-string-regexp/license create mode 100644 node_modules/escape-string-regexp/package.json create mode 100644 node_modules/escape-string-regexp/readme.md create mode 100644 node_modules/esprima/ChangeLog create mode 100644 node_modules/esprima/LICENSE.BSD create mode 100644 node_modules/esprima/README.md create mode 100644 node_modules/esprima/bin/esparse.js create mode 100644 node_modules/esprima/bin/esvalidate.js create mode 100644 node_modules/esprima/dist/esprima.js create mode 100644 node_modules/esprima/package.json create mode 100644 node_modules/execa/index.d.ts create mode 100644 node_modules/execa/index.js create mode 100644 node_modules/execa/lib/command.js create mode 100644 node_modules/execa/lib/error.js create mode 100644 node_modules/execa/lib/kill.js create mode 100644 node_modules/execa/lib/promise.js create mode 100644 node_modules/execa/lib/stdio.js create mode 100644 node_modules/execa/lib/stream.js create mode 100644 node_modules/execa/license create mode 100644 node_modules/execa/package.json create mode 100644 node_modules/execa/readme.md create mode 100644 node_modules/exit/.jshintrc create mode 100644 node_modules/exit/.npmignore create mode 100644 node_modules/exit/.travis.yml create mode 100644 node_modules/exit/Gruntfile.js create mode 100644 node_modules/exit/LICENSE-MIT create mode 100644 node_modules/exit/README.md create mode 100644 node_modules/exit/lib/exit.js create mode 100644 node_modules/exit/package.json create mode 100644 node_modules/exit/test/exit_test.js create mode 100644 node_modules/exit/test/fixtures/10-stderr.txt create mode 100644 node_modules/exit/test/fixtures/10-stdout-stderr.txt create mode 100644 node_modules/exit/test/fixtures/10-stdout.txt create mode 100644 node_modules/exit/test/fixtures/100-stderr.txt create mode 100644 node_modules/exit/test/fixtures/100-stdout-stderr.txt create mode 100644 node_modules/exit/test/fixtures/100-stdout.txt create mode 100644 node_modules/exit/test/fixtures/1000-stderr.txt create mode 100644 node_modules/exit/test/fixtures/1000-stdout-stderr.txt create mode 100644 node_modules/exit/test/fixtures/1000-stdout.txt create mode 100644 node_modules/exit/test/fixtures/create-files.sh create mode 100644 node_modules/exit/test/fixtures/log-broken.js create mode 100644 node_modules/exit/test/fixtures/log.js create mode 100644 node_modules/expect/LICENSE create mode 100644 node_modules/expect/README.md create mode 100644 node_modules/expect/build/asymmetricMatchers.js create mode 100644 node_modules/expect/build/extractExpectedAssertionsErrors.js create mode 100644 node_modules/expect/build/index.d.ts create mode 100644 node_modules/expect/build/index.js create mode 100644 node_modules/expect/build/jestMatchersObject.js create mode 100644 node_modules/expect/build/matchers.js create mode 100644 node_modules/expect/build/print.js create mode 100644 node_modules/expect/build/spyMatchers.js create mode 100644 node_modules/expect/build/toThrowMatchers.js create mode 100644 node_modules/expect/build/types.js create mode 100644 node_modules/expect/package.json create mode 100644 node_modules/fast-json-stable-stringify/.eslintrc.yml create mode 100644 node_modules/fast-json-stable-stringify/.github/FUNDING.yml create mode 100644 node_modules/fast-json-stable-stringify/.travis.yml create mode 100644 node_modules/fast-json-stable-stringify/LICENSE create mode 100644 node_modules/fast-json-stable-stringify/README.md create mode 100644 node_modules/fast-json-stable-stringify/benchmark/index.js create mode 100644 node_modules/fast-json-stable-stringify/benchmark/test.json create mode 100644 node_modules/fast-json-stable-stringify/example/key_cmp.js create mode 100644 node_modules/fast-json-stable-stringify/example/nested.js create mode 100644 node_modules/fast-json-stable-stringify/example/str.js create mode 100644 node_modules/fast-json-stable-stringify/example/value_cmp.js create mode 100644 node_modules/fast-json-stable-stringify/index.d.ts create mode 100644 node_modules/fast-json-stable-stringify/index.js create mode 100644 node_modules/fast-json-stable-stringify/package.json create mode 100644 node_modules/fast-json-stable-stringify/test/cmp.js create mode 100644 node_modules/fast-json-stable-stringify/test/nested.js create mode 100644 node_modules/fast-json-stable-stringify/test/str.js create mode 100644 node_modules/fast-json-stable-stringify/test/to-json.js create mode 100644 node_modules/fb-watchman/README.md create mode 100644 node_modules/fb-watchman/index.js create mode 100644 node_modules/fb-watchman/package.json create mode 100644 node_modules/fill-range/LICENSE create mode 100644 node_modules/fill-range/README.md create mode 100644 node_modules/fill-range/index.js create mode 100644 node_modules/fill-range/package.json create mode 100644 node_modules/find-up/index.d.ts create mode 100644 node_modules/find-up/index.js create mode 100644 node_modules/find-up/license create mode 100644 node_modules/find-up/package.json create mode 100644 node_modules/find-up/readme.md create mode 100644 node_modules/fs.realpath/LICENSE create mode 100644 node_modules/fs.realpath/README.md create mode 100644 node_modules/fs.realpath/index.js create mode 100644 node_modules/fs.realpath/old.js create mode 100644 node_modules/fs.realpath/package.json create mode 100644 node_modules/gensync/LICENSE create mode 100644 node_modules/gensync/README.md create mode 100644 node_modules/gensync/index.js create mode 100644 node_modules/gensync/index.js.flow create mode 100644 node_modules/gensync/package.json create mode 100644 node_modules/gensync/test/.babelrc create mode 100644 node_modules/gensync/test/index.test.js create mode 100644 node_modules/get-caller-file/LICENSE.md create mode 100644 node_modules/get-caller-file/README.md create mode 100644 node_modules/get-caller-file/index.d.ts create mode 100644 node_modules/get-caller-file/index.js create mode 100644 node_modules/get-caller-file/index.js.map create mode 100644 node_modules/get-caller-file/package.json create mode 100644 node_modules/get-package-type/CHANGELOG.md create mode 100644 node_modules/get-package-type/LICENSE create mode 100644 node_modules/get-package-type/README.md create mode 100644 node_modules/get-package-type/async.cjs create mode 100644 node_modules/get-package-type/cache.cjs create mode 100644 node_modules/get-package-type/index.cjs create mode 100644 node_modules/get-package-type/is-node-modules.cjs create mode 100644 node_modules/get-package-type/package.json create mode 100644 node_modules/get-package-type/sync.cjs create mode 100644 node_modules/get-stream/buffer-stream.js create mode 100644 node_modules/get-stream/index.d.ts create mode 100644 node_modules/get-stream/index.js create mode 100644 node_modules/get-stream/license create mode 100644 node_modules/get-stream/package.json create mode 100644 node_modules/get-stream/readme.md create mode 100644 node_modules/glob/LICENSE create mode 100644 node_modules/glob/README.md create mode 100644 node_modules/glob/common.js create mode 100644 node_modules/glob/glob.js create mode 100644 node_modules/glob/package.json create mode 100644 node_modules/glob/sync.js create mode 100644 node_modules/globals/globals.json create mode 100644 node_modules/globals/index.js create mode 100644 node_modules/globals/license create mode 100644 node_modules/globals/package.json create mode 100644 node_modules/globals/readme.md create mode 100644 node_modules/graceful-fs/LICENSE create mode 100644 node_modules/graceful-fs/README.md create mode 100644 node_modules/graceful-fs/clone.js create mode 100644 node_modules/graceful-fs/graceful-fs.js create mode 100644 node_modules/graceful-fs/legacy-streams.js create mode 100644 node_modules/graceful-fs/package.json create mode 100644 node_modules/graceful-fs/polyfills.js create mode 100644 node_modules/has-flag/index.d.ts create mode 100644 node_modules/has-flag/index.js create mode 100644 node_modules/has-flag/license create mode 100644 node_modules/has-flag/package.json create mode 100644 node_modules/has-flag/readme.md create mode 100644 node_modules/has/LICENSE-MIT create mode 100644 node_modules/has/README.md create mode 100644 node_modules/has/package.json create mode 100644 node_modules/has/src/index.js create mode 100644 node_modules/has/test/index.js create mode 100644 node_modules/html-escaper/LICENSE.txt create mode 100644 node_modules/html-escaper/README.md create mode 100644 node_modules/html-escaper/cjs/index.js create mode 100644 node_modules/html-escaper/cjs/package.json create mode 100644 node_modules/html-escaper/esm/index.js create mode 100644 node_modules/html-escaper/index.js create mode 100644 node_modules/html-escaper/min.js create mode 100644 node_modules/html-escaper/package.json create mode 100644 node_modules/html-escaper/test/index.js create mode 100644 node_modules/html-escaper/test/package.json create mode 100644 node_modules/human-signals/CHANGELOG.md create mode 100644 node_modules/human-signals/LICENSE create mode 100644 node_modules/human-signals/README.md create mode 100644 node_modules/human-signals/build/src/core.js create mode 100644 node_modules/human-signals/build/src/core.js.map create mode 100644 node_modules/human-signals/build/src/main.d.ts create mode 100644 node_modules/human-signals/build/src/main.js create mode 100644 node_modules/human-signals/build/src/main.js.map create mode 100644 node_modules/human-signals/build/src/realtime.js create mode 100644 node_modules/human-signals/build/src/realtime.js.map create mode 100644 node_modules/human-signals/build/src/signals.js create mode 100644 node_modules/human-signals/build/src/signals.js.map create mode 100644 node_modules/human-signals/package.json create mode 100644 node_modules/import-local/fixtures/cli.js create mode 100644 node_modules/import-local/index.js create mode 100644 node_modules/import-local/license create mode 100644 node_modules/import-local/package.json create mode 100644 node_modules/import-local/readme.md create mode 100644 node_modules/imurmurhash/README.md create mode 100644 node_modules/imurmurhash/imurmurhash.js create mode 100644 node_modules/imurmurhash/imurmurhash.min.js create mode 100644 node_modules/imurmurhash/package.json create mode 100644 node_modules/inflight/LICENSE create mode 100644 node_modules/inflight/README.md create mode 100644 node_modules/inflight/inflight.js create mode 100644 node_modules/inflight/package.json create mode 100644 node_modules/inherits/LICENSE create mode 100644 node_modules/inherits/README.md create mode 100644 node_modules/inherits/inherits.js create mode 100644 node_modules/inherits/inherits_browser.js create mode 100644 node_modules/inherits/package.json create mode 100644 node_modules/is-arrayish/.editorconfig create mode 100644 node_modules/is-arrayish/.istanbul.yml create mode 100644 node_modules/is-arrayish/.npmignore create mode 100644 node_modules/is-arrayish/.travis.yml create mode 100644 node_modules/is-arrayish/LICENSE create mode 100644 node_modules/is-arrayish/README.md create mode 100644 node_modules/is-arrayish/index.js create mode 100644 node_modules/is-arrayish/package.json create mode 100644 node_modules/is-core-module/.eslintrc create mode 100644 node_modules/is-core-module/.nycrc create mode 100644 node_modules/is-core-module/CHANGELOG.md create mode 100644 node_modules/is-core-module/LICENSE create mode 100644 node_modules/is-core-module/README.md create mode 100644 node_modules/is-core-module/core.json create mode 100644 node_modules/is-core-module/index.js create mode 100644 node_modules/is-core-module/package.json create mode 100644 node_modules/is-core-module/test/index.js create mode 100644 node_modules/is-fullwidth-code-point/index.d.ts create mode 100644 node_modules/is-fullwidth-code-point/index.js create mode 100644 node_modules/is-fullwidth-code-point/license create mode 100644 node_modules/is-fullwidth-code-point/package.json create mode 100644 node_modules/is-fullwidth-code-point/readme.md create mode 100644 node_modules/is-generator-fn/index.d.ts create mode 100644 node_modules/is-generator-fn/index.js create mode 100644 node_modules/is-generator-fn/license create mode 100644 node_modules/is-generator-fn/package.json create mode 100644 node_modules/is-generator-fn/readme.md create mode 100644 node_modules/is-number/LICENSE create mode 100644 node_modules/is-number/README.md create mode 100644 node_modules/is-number/index.js create mode 100644 node_modules/is-number/package.json create mode 100644 node_modules/is-stream/index.d.ts create mode 100644 node_modules/is-stream/index.js create mode 100644 node_modules/is-stream/license create mode 100644 node_modules/is-stream/package.json create mode 100644 node_modules/is-stream/readme.md create mode 100644 node_modules/isexe/.npmignore create mode 100644 node_modules/isexe/LICENSE create mode 100644 node_modules/isexe/README.md create mode 100644 node_modules/isexe/index.js create mode 100644 node_modules/isexe/mode.js create mode 100644 node_modules/isexe/package.json create mode 100644 node_modules/isexe/test/basic.js create mode 100644 node_modules/isexe/windows.js create mode 100644 node_modules/istanbul-lib-coverage/CHANGELOG.md create mode 100644 node_modules/istanbul-lib-coverage/LICENSE create mode 100644 node_modules/istanbul-lib-coverage/README.md create mode 100644 node_modules/istanbul-lib-coverage/index.js create mode 100644 node_modules/istanbul-lib-coverage/lib/coverage-map.js create mode 100644 node_modules/istanbul-lib-coverage/lib/coverage-summary.js create mode 100644 node_modules/istanbul-lib-coverage/lib/data-properties.js create mode 100644 node_modules/istanbul-lib-coverage/lib/file-coverage.js create mode 100644 node_modules/istanbul-lib-coverage/lib/percent.js create mode 100644 node_modules/istanbul-lib-coverage/package.json create mode 100644 node_modules/istanbul-lib-instrument/CHANGELOG.md create mode 100644 node_modules/istanbul-lib-instrument/LICENSE create mode 100644 node_modules/istanbul-lib-instrument/README.md create mode 100644 node_modules/istanbul-lib-instrument/node_modules/.bin/semver create mode 100644 node_modules/istanbul-lib-instrument/node_modules/.bin/semver.cmd create mode 100644 node_modules/istanbul-lib-instrument/node_modules/.bin/semver.ps1 create mode 100644 node_modules/istanbul-lib-instrument/node_modules/lru-cache/LICENSE create mode 100644 node_modules/istanbul-lib-instrument/node_modules/lru-cache/README.md create mode 100644 node_modules/istanbul-lib-instrument/node_modules/lru-cache/index.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/lru-cache/package.json create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/LICENSE create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/README.md create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/bin/semver.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/classes/comparator.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/classes/index.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/classes/range.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/classes/semver.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/clean.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/cmp.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/coerce.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/compare-build.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/compare-loose.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/compare.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/diff.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/eq.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/gt.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/gte.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/inc.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/lt.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/lte.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/major.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/minor.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/neq.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/parse.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/patch.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/prerelease.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/rcompare.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/rsort.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/satisfies.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/sort.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/functions/valid.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/index.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/internal/constants.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/internal/debug.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/internal/identifiers.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/internal/parse-options.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/internal/re.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/package.json create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/preload.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/range.bnf create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/gtr.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/intersects.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/ltr.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/max-satisfying.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/min-satisfying.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/min-version.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/outside.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/simplify.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/subset.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/to-comparators.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/semver/ranges/valid.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/yallist/LICENSE create mode 100644 node_modules/istanbul-lib-instrument/node_modules/yallist/README.md create mode 100644 node_modules/istanbul-lib-instrument/node_modules/yallist/iterator.js create mode 100644 node_modules/istanbul-lib-instrument/node_modules/yallist/package.json create mode 100644 node_modules/istanbul-lib-instrument/node_modules/yallist/yallist.js create mode 100644 node_modules/istanbul-lib-instrument/package.json create mode 100644 node_modules/istanbul-lib-instrument/src/constants.js create mode 100644 node_modules/istanbul-lib-instrument/src/index.js create mode 100644 node_modules/istanbul-lib-instrument/src/instrumenter.js create mode 100644 node_modules/istanbul-lib-instrument/src/read-coverage.js create mode 100644 node_modules/istanbul-lib-instrument/src/source-coverage.js create mode 100644 node_modules/istanbul-lib-instrument/src/visitor.js create mode 100644 node_modules/istanbul-lib-report/CHANGELOG.md create mode 100644 node_modules/istanbul-lib-report/LICENSE create mode 100644 node_modules/istanbul-lib-report/README.md create mode 100644 node_modules/istanbul-lib-report/index.js create mode 100644 node_modules/istanbul-lib-report/lib/context.js create mode 100644 node_modules/istanbul-lib-report/lib/file-writer.js create mode 100644 node_modules/istanbul-lib-report/lib/path.js create mode 100644 node_modules/istanbul-lib-report/lib/report-base.js create mode 100644 node_modules/istanbul-lib-report/lib/summarizer-factory.js create mode 100644 node_modules/istanbul-lib-report/lib/tree.js create mode 100644 node_modules/istanbul-lib-report/lib/watermarks.js create mode 100644 node_modules/istanbul-lib-report/lib/xml-writer.js create mode 100644 node_modules/istanbul-lib-report/package.json create mode 100644 node_modules/istanbul-lib-source-maps/CHANGELOG.md create mode 100644 node_modules/istanbul-lib-source-maps/LICENSE create mode 100644 node_modules/istanbul-lib-source-maps/README.md create mode 100644 node_modules/istanbul-lib-source-maps/index.js create mode 100644 node_modules/istanbul-lib-source-maps/lib/get-mapping.js create mode 100644 node_modules/istanbul-lib-source-maps/lib/map-store.js create mode 100644 node_modules/istanbul-lib-source-maps/lib/mapped.js create mode 100644 node_modules/istanbul-lib-source-maps/lib/pathutils.js create mode 100644 node_modules/istanbul-lib-source-maps/lib/transform-utils.js create mode 100644 node_modules/istanbul-lib-source-maps/lib/transformer.js create mode 100644 node_modules/istanbul-lib-source-maps/package.json create mode 100644 node_modules/istanbul-reports/CHANGELOG.md create mode 100644 node_modules/istanbul-reports/LICENSE create mode 100644 node_modules/istanbul-reports/README.md create mode 100644 node_modules/istanbul-reports/index.js create mode 100644 node_modules/istanbul-reports/lib/clover/index.js create mode 100644 node_modules/istanbul-reports/lib/cobertura/index.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/.babelrc create mode 100644 node_modules/istanbul-reports/lib/html-spa/assets/bundle.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/assets/sort-arrow-sprite.png create mode 100644 node_modules/istanbul-reports/lib/html-spa/assets/spa.css create mode 100644 node_modules/istanbul-reports/lib/html-spa/index.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/src/fileBreadcrumbs.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/src/filterToggle.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/src/flattenToggle.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/src/getChildData.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/src/index.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/src/routing.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/src/summaryHeader.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/src/summaryTableHeader.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/src/summaryTableLine.js create mode 100644 node_modules/istanbul-reports/lib/html-spa/webpack.config.js create mode 100644 node_modules/istanbul-reports/lib/html/annotator.js create mode 100644 node_modules/istanbul-reports/lib/html/assets/base.css create mode 100644 node_modules/istanbul-reports/lib/html/assets/block-navigation.js create mode 100644 node_modules/istanbul-reports/lib/html/assets/favicon.png create mode 100644 node_modules/istanbul-reports/lib/html/assets/sort-arrow-sprite.png create mode 100644 node_modules/istanbul-reports/lib/html/assets/sorter.js create mode 100644 node_modules/istanbul-reports/lib/html/assets/vendor/prettify.css create mode 100644 node_modules/istanbul-reports/lib/html/assets/vendor/prettify.js create mode 100644 node_modules/istanbul-reports/lib/html/index.js create mode 100644 node_modules/istanbul-reports/lib/html/insertion-text.js create mode 100644 node_modules/istanbul-reports/lib/json-summary/index.js create mode 100644 node_modules/istanbul-reports/lib/json/index.js create mode 100644 node_modules/istanbul-reports/lib/lcov/index.js create mode 100644 node_modules/istanbul-reports/lib/lcovonly/index.js create mode 100644 node_modules/istanbul-reports/lib/none/index.js create mode 100644 node_modules/istanbul-reports/lib/teamcity/index.js create mode 100644 node_modules/istanbul-reports/lib/text-lcov/index.js create mode 100644 node_modules/istanbul-reports/lib/text-summary/index.js create mode 100644 node_modules/istanbul-reports/lib/text/index.js create mode 100644 node_modules/istanbul-reports/package.json create mode 100644 node_modules/jest-changed-files/LICENSE create mode 100644 node_modules/jest-changed-files/README.md create mode 100644 node_modules/jest-changed-files/build/git.js create mode 100644 node_modules/jest-changed-files/build/hg.js create mode 100644 node_modules/jest-changed-files/build/index.d.ts create mode 100644 node_modules/jest-changed-files/build/index.js create mode 100644 node_modules/jest-changed-files/build/sl.js create mode 100644 node_modules/jest-changed-files/build/types.js create mode 100644 node_modules/jest-changed-files/package.json create mode 100644 node_modules/jest-circus/LICENSE create mode 100644 node_modules/jest-circus/README.md create mode 100644 node_modules/jest-circus/build/eventHandler.js create mode 100644 node_modules/jest-circus/build/formatNodeAssertErrors.js create mode 100644 node_modules/jest-circus/build/globalErrorHandlers.js create mode 100644 node_modules/jest-circus/build/index.d.ts create mode 100644 node_modules/jest-circus/build/index.js create mode 100644 node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js create mode 100644 node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js create mode 100644 node_modules/jest-circus/build/run.js create mode 100644 node_modules/jest-circus/build/shuffleArray.js create mode 100644 node_modules/jest-circus/build/state.js create mode 100644 node_modules/jest-circus/build/testCaseReportHandler.js create mode 100644 node_modules/jest-circus/build/types.js create mode 100644 node_modules/jest-circus/build/utils.js create mode 100644 node_modules/jest-circus/package.json create mode 100644 node_modules/jest-circus/runner.js create mode 100644 node_modules/jest-cli/LICENSE create mode 100644 node_modules/jest-cli/README.md create mode 100644 node_modules/jest-cli/bin/jest.js create mode 100644 node_modules/jest-cli/build/args.js create mode 100644 node_modules/jest-cli/build/index.d.ts create mode 100644 node_modules/jest-cli/build/index.js create mode 100644 node_modules/jest-cli/build/run.js create mode 100644 node_modules/jest-cli/package.json create mode 100644 node_modules/jest-config/LICENSE create mode 100644 node_modules/jest-config/build/Defaults.js create mode 100644 node_modules/jest-config/build/Deprecated.js create mode 100644 node_modules/jest-config/build/Descriptions.js create mode 100644 node_modules/jest-config/build/ReporterValidationErrors.js create mode 100644 node_modules/jest-config/build/ValidConfig.js create mode 100644 node_modules/jest-config/build/color.js create mode 100644 node_modules/jest-config/build/constants.js create mode 100644 node_modules/jest-config/build/getCacheDirectory.js create mode 100644 node_modules/jest-config/build/getMaxWorkers.js create mode 100644 node_modules/jest-config/build/index.d.ts create mode 100644 node_modules/jest-config/build/index.js create mode 100644 node_modules/jest-config/build/normalize.js create mode 100644 node_modules/jest-config/build/parseShardPair.js create mode 100644 node_modules/jest-config/build/readConfigFileAndSetRootDir.js create mode 100644 node_modules/jest-config/build/resolveConfigPath.js create mode 100644 node_modules/jest-config/build/setFromArgv.js create mode 100644 node_modules/jest-config/build/stringToBytes.js create mode 100644 node_modules/jest-config/build/utils.js create mode 100644 node_modules/jest-config/build/validatePattern.js create mode 100644 node_modules/jest-config/package.json create mode 100644 node_modules/jest-diff/LICENSE create mode 100644 node_modules/jest-diff/README.md create mode 100644 node_modules/jest-diff/build/cleanupSemantic.js create mode 100644 node_modules/jest-diff/build/constants.js create mode 100644 node_modules/jest-diff/build/diffLines.js create mode 100644 node_modules/jest-diff/build/diffStrings.js create mode 100644 node_modules/jest-diff/build/getAlignedDiffs.js create mode 100644 node_modules/jest-diff/build/index.d.ts create mode 100644 node_modules/jest-diff/build/index.js create mode 100644 node_modules/jest-diff/build/joinAlignedDiffs.js create mode 100644 node_modules/jest-diff/build/normalizeDiffOptions.js create mode 100644 node_modules/jest-diff/build/printDiffs.js create mode 100644 node_modules/jest-diff/build/types.js create mode 100644 node_modules/jest-diff/package.json create mode 100644 node_modules/jest-docblock/LICENSE create mode 100644 node_modules/jest-docblock/README.md create mode 100644 node_modules/jest-docblock/build/index.d.ts create mode 100644 node_modules/jest-docblock/build/index.js create mode 100644 node_modules/jest-docblock/package.json create mode 100644 node_modules/jest-each/LICENSE create mode 100644 node_modules/jest-each/README.md create mode 100644 node_modules/jest-each/build/bind.js create mode 100644 node_modules/jest-each/build/index.d.ts create mode 100644 node_modules/jest-each/build/index.js create mode 100644 node_modules/jest-each/build/table/array.js create mode 100644 node_modules/jest-each/build/table/interpolation.js create mode 100644 node_modules/jest-each/build/table/template.js create mode 100644 node_modules/jest-each/build/validation.js create mode 100644 node_modules/jest-each/package.json create mode 100644 node_modules/jest-environment-node/LICENSE create mode 100644 node_modules/jest-environment-node/build/index.d.ts create mode 100644 node_modules/jest-environment-node/build/index.js create mode 100644 node_modules/jest-environment-node/package.json create mode 100644 node_modules/jest-get-type/LICENSE create mode 100644 node_modules/jest-get-type/build/index.d.ts create mode 100644 node_modules/jest-get-type/build/index.js create mode 100644 node_modules/jest-get-type/package.json create mode 100644 node_modules/jest-haste-map/LICENSE create mode 100644 node_modules/jest-haste-map/build/HasteFS.js create mode 100644 node_modules/jest-haste-map/build/ModuleMap.js create mode 100644 node_modules/jest-haste-map/build/blacklist.js create mode 100644 node_modules/jest-haste-map/build/constants.js create mode 100644 node_modules/jest-haste-map/build/crawlers/node.js create mode 100644 node_modules/jest-haste-map/build/crawlers/watchman.js create mode 100644 node_modules/jest-haste-map/build/getMockName.js create mode 100644 node_modules/jest-haste-map/build/index.d.ts create mode 100644 node_modules/jest-haste-map/build/index.js create mode 100644 node_modules/jest-haste-map/build/lib/dependencyExtractor.js create mode 100644 node_modules/jest-haste-map/build/lib/fast_path.js create mode 100644 node_modules/jest-haste-map/build/lib/getPlatformExtension.js create mode 100644 node_modules/jest-haste-map/build/lib/isWatchmanInstalled.js create mode 100644 node_modules/jest-haste-map/build/lib/normalizePathSep.js create mode 100644 node_modules/jest-haste-map/build/types.js create mode 100644 node_modules/jest-haste-map/build/watchers/FSEventsWatcher.js create mode 100644 node_modules/jest-haste-map/build/watchers/NodeWatcher.js create mode 100644 node_modules/jest-haste-map/build/watchers/RecrawlWarning.js create mode 100644 node_modules/jest-haste-map/build/watchers/WatchmanWatcher.js create mode 100644 node_modules/jest-haste-map/build/watchers/common.js create mode 100644 node_modules/jest-haste-map/build/worker.js create mode 100644 node_modules/jest-haste-map/package.json create mode 100644 node_modules/jest-leak-detector/LICENSE create mode 100644 node_modules/jest-leak-detector/README.md create mode 100644 node_modules/jest-leak-detector/build/index.d.ts create mode 100644 node_modules/jest-leak-detector/build/index.js create mode 100644 node_modules/jest-leak-detector/package.json create mode 100644 node_modules/jest-matcher-utils/LICENSE create mode 100644 node_modules/jest-matcher-utils/README.md create mode 100644 node_modules/jest-matcher-utils/build/Replaceable.js create mode 100644 node_modules/jest-matcher-utils/build/deepCyclicCopyReplaceable.js create mode 100644 node_modules/jest-matcher-utils/build/index.d.ts create mode 100644 node_modules/jest-matcher-utils/build/index.js create mode 100644 node_modules/jest-matcher-utils/package.json create mode 100644 node_modules/jest-message-util/LICENSE create mode 100644 node_modules/jest-message-util/build/index.d.ts create mode 100644 node_modules/jest-message-util/build/index.js create mode 100644 node_modules/jest-message-util/build/types.js create mode 100644 node_modules/jest-message-util/package.json create mode 100644 node_modules/jest-mock/LICENSE create mode 100644 node_modules/jest-mock/README.md create mode 100644 node_modules/jest-mock/build/index.d.ts create mode 100644 node_modules/jest-mock/build/index.js create mode 100644 node_modules/jest-mock/package.json create mode 100644 node_modules/jest-pnp-resolver/README.md create mode 100644 node_modules/jest-pnp-resolver/createRequire.js create mode 100644 node_modules/jest-pnp-resolver/getDefaultResolver.js create mode 100644 node_modules/jest-pnp-resolver/index.d.ts create mode 100644 node_modules/jest-pnp-resolver/index.js create mode 100644 node_modules/jest-pnp-resolver/package.json create mode 100644 node_modules/jest-regex-util/LICENSE create mode 100644 node_modules/jest-regex-util/build/index.d.ts create mode 100644 node_modules/jest-regex-util/build/index.js create mode 100644 node_modules/jest-regex-util/package.json create mode 100644 node_modules/jest-resolve-dependencies/LICENSE create mode 100644 node_modules/jest-resolve-dependencies/build/index.d.ts create mode 100644 node_modules/jest-resolve-dependencies/build/index.js create mode 100644 node_modules/jest-resolve-dependencies/package.json create mode 100644 node_modules/jest-resolve/LICENSE create mode 100644 node_modules/jest-resolve/build/ModuleNotFoundError.js create mode 100644 node_modules/jest-resolve/build/defaultResolver.js create mode 100644 node_modules/jest-resolve/build/fileWalkers.js create mode 100644 node_modules/jest-resolve/build/index.d.ts create mode 100644 node_modules/jest-resolve/build/index.js create mode 100644 node_modules/jest-resolve/build/isBuiltinModule.js create mode 100644 node_modules/jest-resolve/build/nodeModulesPaths.js create mode 100644 node_modules/jest-resolve/build/resolver.js create mode 100644 node_modules/jest-resolve/build/shouldLoadAsEsm.js create mode 100644 node_modules/jest-resolve/build/types.js create mode 100644 node_modules/jest-resolve/build/utils.js create mode 100644 node_modules/jest-resolve/package.json create mode 100644 node_modules/jest-runner/LICENSE create mode 100644 node_modules/jest-runner/build/index.d.ts create mode 100644 node_modules/jest-runner/build/index.js create mode 100644 node_modules/jest-runner/build/runTest.js create mode 100644 node_modules/jest-runner/build/testWorker.js create mode 100644 node_modules/jest-runner/build/types.js create mode 100644 node_modules/jest-runner/package.json create mode 100644 node_modules/jest-runtime/LICENSE create mode 100644 node_modules/jest-runtime/build/helpers.js create mode 100644 node_modules/jest-runtime/build/index.d.ts create mode 100644 node_modules/jest-runtime/build/index.js create mode 100644 node_modules/jest-runtime/package.json create mode 100644 node_modules/jest-snapshot/LICENSE create mode 100644 node_modules/jest-snapshot/build/InlineSnapshots.js create mode 100644 node_modules/jest-snapshot/build/SnapshotResolver.js create mode 100644 node_modules/jest-snapshot/build/State.js create mode 100644 node_modules/jest-snapshot/build/colors.js create mode 100644 node_modules/jest-snapshot/build/dedentLines.js create mode 100644 node_modules/jest-snapshot/build/index.d.ts create mode 100644 node_modules/jest-snapshot/build/index.js create mode 100644 node_modules/jest-snapshot/build/mockSerializer.js create mode 100644 node_modules/jest-snapshot/build/plugins.js create mode 100644 node_modules/jest-snapshot/build/printSnapshot.js create mode 100644 node_modules/jest-snapshot/build/types.js create mode 100644 node_modules/jest-snapshot/build/utils.js create mode 100644 node_modules/jest-snapshot/node_modules/.bin/semver create mode 100644 node_modules/jest-snapshot/node_modules/.bin/semver.cmd create mode 100644 node_modules/jest-snapshot/node_modules/.bin/semver.ps1 create mode 100644 node_modules/jest-snapshot/node_modules/lru-cache/LICENSE create mode 100644 node_modules/jest-snapshot/node_modules/lru-cache/README.md create mode 100644 node_modules/jest-snapshot/node_modules/lru-cache/index.js create mode 100644 node_modules/jest-snapshot/node_modules/lru-cache/package.json create mode 100644 node_modules/jest-snapshot/node_modules/semver/LICENSE create mode 100644 node_modules/jest-snapshot/node_modules/semver/README.md create mode 100644 node_modules/jest-snapshot/node_modules/semver/bin/semver.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/classes/comparator.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/classes/index.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/classes/range.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/classes/semver.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/clean.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/cmp.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/coerce.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/compare-build.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/compare-loose.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/compare.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/diff.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/eq.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/gt.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/gte.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/inc.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/lt.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/lte.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/major.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/minor.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/neq.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/parse.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/patch.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/prerelease.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/rcompare.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/rsort.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/satisfies.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/sort.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/functions/valid.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/index.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/internal/constants.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/internal/debug.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/internal/identifiers.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/internal/parse-options.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/internal/re.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/package.json create mode 100644 node_modules/jest-snapshot/node_modules/semver/preload.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/range.bnf create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/gtr.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/intersects.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/ltr.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/max-satisfying.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/min-satisfying.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/min-version.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/outside.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/simplify.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/subset.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/to-comparators.js create mode 100644 node_modules/jest-snapshot/node_modules/semver/ranges/valid.js create mode 100644 node_modules/jest-snapshot/node_modules/yallist/LICENSE create mode 100644 node_modules/jest-snapshot/node_modules/yallist/README.md create mode 100644 node_modules/jest-snapshot/node_modules/yallist/iterator.js create mode 100644 node_modules/jest-snapshot/node_modules/yallist/package.json create mode 100644 node_modules/jest-snapshot/node_modules/yallist/yallist.js create mode 100644 node_modules/jest-snapshot/package.json create mode 100644 node_modules/jest-util/LICENSE create mode 100644 node_modules/jest-util/Readme.md create mode 100644 node_modules/jest-util/build/ErrorWithStack.js create mode 100644 node_modules/jest-util/build/clearLine.js create mode 100644 node_modules/jest-util/build/convertDescriptorToString.js create mode 100644 node_modules/jest-util/build/createDirectory.js create mode 100644 node_modules/jest-util/build/createProcessObject.js create mode 100644 node_modules/jest-util/build/deepCyclicCopy.js create mode 100644 node_modules/jest-util/build/formatTime.js create mode 100644 node_modules/jest-util/build/globsToMatcher.js create mode 100644 node_modules/jest-util/build/index.d.ts create mode 100644 node_modules/jest-util/build/index.js create mode 100644 node_modules/jest-util/build/installCommonGlobals.js create mode 100644 node_modules/jest-util/build/interopRequireDefault.js create mode 100644 node_modules/jest-util/build/invariant.js create mode 100644 node_modules/jest-util/build/isInteractive.js create mode 100644 node_modules/jest-util/build/isNonNullable.js create mode 100644 node_modules/jest-util/build/isPromise.js create mode 100644 node_modules/jest-util/build/pluralize.js create mode 100644 node_modules/jest-util/build/preRunMessage.js create mode 100644 node_modules/jest-util/build/replacePathSepForGlob.js create mode 100644 node_modules/jest-util/build/requireOrImportModule.js create mode 100644 node_modules/jest-util/build/setGlobal.js create mode 100644 node_modules/jest-util/build/specialChars.js create mode 100644 node_modules/jest-util/build/testPathPatternToRegExp.js create mode 100644 node_modules/jest-util/build/tryRealpath.js create mode 100644 node_modules/jest-util/package.json create mode 100644 node_modules/jest-validate/LICENSE create mode 100644 node_modules/jest-validate/README.md create mode 100644 node_modules/jest-validate/build/condition.js create mode 100644 node_modules/jest-validate/build/defaultConfig.js create mode 100644 node_modules/jest-validate/build/deprecated.js create mode 100644 node_modules/jest-validate/build/errors.js create mode 100644 node_modules/jest-validate/build/exampleConfig.js create mode 100644 node_modules/jest-validate/build/index.d.ts create mode 100644 node_modules/jest-validate/build/index.js create mode 100644 node_modules/jest-validate/build/types.js create mode 100644 node_modules/jest-validate/build/utils.js create mode 100644 node_modules/jest-validate/build/validate.js create mode 100644 node_modules/jest-validate/build/validateCLIOptions.js create mode 100644 node_modules/jest-validate/build/warnings.js create mode 100644 node_modules/jest-validate/node_modules/camelcase/index.d.ts create mode 100644 node_modules/jest-validate/node_modules/camelcase/index.js create mode 100644 node_modules/jest-validate/node_modules/camelcase/license create mode 100644 node_modules/jest-validate/node_modules/camelcase/package.json create mode 100644 node_modules/jest-validate/node_modules/camelcase/readme.md create mode 100644 node_modules/jest-validate/package.json create mode 100644 node_modules/jest-watcher/LICENSE create mode 100644 node_modules/jest-watcher/build/BaseWatchPlugin.js create mode 100644 node_modules/jest-watcher/build/JestHooks.js create mode 100644 node_modules/jest-watcher/build/PatternPrompt.js create mode 100644 node_modules/jest-watcher/build/TestWatcher.js create mode 100644 node_modules/jest-watcher/build/constants.js create mode 100644 node_modules/jest-watcher/build/index.d.ts create mode 100644 node_modules/jest-watcher/build/index.js create mode 100644 node_modules/jest-watcher/build/lib/Prompt.js create mode 100644 node_modules/jest-watcher/build/lib/colorize.js create mode 100644 node_modules/jest-watcher/build/lib/formatTestNameByPattern.js create mode 100644 node_modules/jest-watcher/build/lib/patternModeHelpers.js create mode 100644 node_modules/jest-watcher/build/lib/scroll.js create mode 100644 node_modules/jest-watcher/build/types.js create mode 100644 node_modules/jest-watcher/package.json create mode 100644 node_modules/jest-worker/LICENSE create mode 100644 node_modules/jest-worker/README.md create mode 100644 node_modules/jest-worker/build/Farm.js create mode 100644 node_modules/jest-worker/build/FifoQueue.js create mode 100644 node_modules/jest-worker/build/PriorityQueue.js create mode 100644 node_modules/jest-worker/build/WorkerPool.js create mode 100644 node_modules/jest-worker/build/base/BaseWorkerPool.js create mode 100644 node_modules/jest-worker/build/index.d.ts create mode 100644 node_modules/jest-worker/build/index.js create mode 100644 node_modules/jest-worker/build/types.js create mode 100644 node_modules/jest-worker/build/workers/ChildProcessWorker.js create mode 100644 node_modules/jest-worker/build/workers/NodeThreadsWorker.js create mode 100644 node_modules/jest-worker/build/workers/WorkerAbstract.js create mode 100644 node_modules/jest-worker/build/workers/messageParent.js create mode 100644 node_modules/jest-worker/build/workers/processChild.js create mode 100644 node_modules/jest-worker/build/workers/threadChild.js create mode 100644 node_modules/jest-worker/node_modules/supports-color/browser.js create mode 100644 node_modules/jest-worker/node_modules/supports-color/index.js create mode 100644 node_modules/jest-worker/node_modules/supports-color/license create mode 100644 node_modules/jest-worker/node_modules/supports-color/package.json create mode 100644 node_modules/jest-worker/node_modules/supports-color/readme.md create mode 100644 node_modules/jest-worker/package.json create mode 100644 node_modules/jest/LICENSE create mode 100644 node_modules/jest/README.md create mode 100644 node_modules/jest/bin/jest.js create mode 100644 node_modules/jest/build/index.d.ts create mode 100644 node_modules/jest/build/index.js create mode 100644 node_modules/jest/package.json create mode 100644 node_modules/js-tokens/CHANGELOG.md create mode 100644 node_modules/js-tokens/LICENSE create mode 100644 node_modules/js-tokens/README.md create mode 100644 node_modules/js-tokens/index.js create mode 100644 node_modules/js-tokens/package.json create mode 100644 node_modules/js-yaml/CHANGELOG.md create mode 100644 node_modules/js-yaml/LICENSE create mode 100644 node_modules/js-yaml/README.md create mode 100644 node_modules/js-yaml/bin/js-yaml.js create mode 100644 node_modules/js-yaml/dist/js-yaml.js create mode 100644 node_modules/js-yaml/dist/js-yaml.min.js create mode 100644 node_modules/js-yaml/index.js create mode 100644 node_modules/js-yaml/lib/js-yaml.js create mode 100644 node_modules/js-yaml/lib/js-yaml/common.js create mode 100644 node_modules/js-yaml/lib/js-yaml/dumper.js create mode 100644 node_modules/js-yaml/lib/js-yaml/exception.js create mode 100644 node_modules/js-yaml/lib/js-yaml/loader.js create mode 100644 node_modules/js-yaml/lib/js-yaml/mark.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/core.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/default_full.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/default_safe.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/failsafe.js create mode 100644 node_modules/js-yaml/lib/js-yaml/schema/json.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/binary.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/bool.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/float.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/int.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/function.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/regexp.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/js/undefined.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/map.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/merge.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/null.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/omap.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/pairs.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/seq.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/set.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/str.js create mode 100644 node_modules/js-yaml/lib/js-yaml/type/timestamp.js create mode 100644 node_modules/js-yaml/package.json create mode 100644 node_modules/jsesc/LICENSE-MIT.txt create mode 100644 node_modules/jsesc/README.md create mode 100644 node_modules/jsesc/bin/jsesc create mode 100644 node_modules/jsesc/jsesc.js create mode 100644 node_modules/jsesc/man/jsesc.1 create mode 100644 node_modules/jsesc/package.json create mode 100644 node_modules/json-parse-even-better-errors/CHANGELOG.md create mode 100644 node_modules/json-parse-even-better-errors/LICENSE.md create mode 100644 node_modules/json-parse-even-better-errors/README.md create mode 100644 node_modules/json-parse-even-better-errors/index.js create mode 100644 node_modules/json-parse-even-better-errors/package.json create mode 100644 node_modules/json5/LICENSE.md create mode 100644 node_modules/json5/README.md create mode 100644 node_modules/json5/dist/index.js create mode 100644 node_modules/json5/dist/index.min.js create mode 100644 node_modules/json5/dist/index.min.mjs create mode 100644 node_modules/json5/dist/index.mjs create mode 100644 node_modules/json5/lib/cli.js create mode 100644 node_modules/json5/lib/index.d.ts create mode 100644 node_modules/json5/lib/index.js create mode 100644 node_modules/json5/lib/parse.d.ts create mode 100644 node_modules/json5/lib/parse.js create mode 100644 node_modules/json5/lib/register.js create mode 100644 node_modules/json5/lib/require.js create mode 100644 node_modules/json5/lib/stringify.d.ts create mode 100644 node_modules/json5/lib/stringify.js create mode 100644 node_modules/json5/lib/unicode.d.ts create mode 100644 node_modules/json5/lib/unicode.js create mode 100644 node_modules/json5/lib/util.d.ts create mode 100644 node_modules/json5/lib/util.js create mode 100644 node_modules/json5/package.json create mode 100644 node_modules/kleur/index.js create mode 100644 node_modules/kleur/kleur.d.ts create mode 100644 node_modules/kleur/license create mode 100644 node_modules/kleur/package.json create mode 100644 node_modules/kleur/readme.md create mode 100644 node_modules/leven/index.d.ts create mode 100644 node_modules/leven/index.js create mode 100644 node_modules/leven/license create mode 100644 node_modules/leven/package.json create mode 100644 node_modules/leven/readme.md create mode 100644 node_modules/lines-and-columns/LICENSE create mode 100644 node_modules/lines-and-columns/README.md create mode 100644 node_modules/lines-and-columns/build/index.d.ts create mode 100644 node_modules/lines-and-columns/build/index.js create mode 100644 node_modules/lines-and-columns/package.json create mode 100644 node_modules/locate-path/index.d.ts create mode 100644 node_modules/locate-path/index.js create mode 100644 node_modules/locate-path/license create mode 100644 node_modules/locate-path/package.json create mode 100644 node_modules/locate-path/readme.md create mode 100644 node_modules/lru-cache/LICENSE create mode 100644 node_modules/lru-cache/README.md create mode 100644 node_modules/lru-cache/index.js create mode 100644 node_modules/lru-cache/package.json create mode 100644 node_modules/make-dir/index.d.ts create mode 100644 node_modules/make-dir/index.js create mode 100644 node_modules/make-dir/license create mode 100644 node_modules/make-dir/node_modules/.bin/semver create mode 100644 node_modules/make-dir/node_modules/.bin/semver.cmd create mode 100644 node_modules/make-dir/node_modules/.bin/semver.ps1 create mode 100644 node_modules/make-dir/node_modules/lru-cache/LICENSE create mode 100644 node_modules/make-dir/node_modules/lru-cache/README.md create mode 100644 node_modules/make-dir/node_modules/lru-cache/index.js create mode 100644 node_modules/make-dir/node_modules/lru-cache/package.json create mode 100644 node_modules/make-dir/node_modules/semver/LICENSE create mode 100644 node_modules/make-dir/node_modules/semver/README.md create mode 100644 node_modules/make-dir/node_modules/semver/bin/semver.js create mode 100644 node_modules/make-dir/node_modules/semver/classes/comparator.js create mode 100644 node_modules/make-dir/node_modules/semver/classes/index.js create mode 100644 node_modules/make-dir/node_modules/semver/classes/range.js create mode 100644 node_modules/make-dir/node_modules/semver/classes/semver.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/clean.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/cmp.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/coerce.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/compare-build.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/compare-loose.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/compare.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/diff.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/eq.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/gt.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/gte.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/inc.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/lt.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/lte.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/major.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/minor.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/neq.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/parse.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/patch.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/prerelease.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/rcompare.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/rsort.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/satisfies.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/sort.js create mode 100644 node_modules/make-dir/node_modules/semver/functions/valid.js create mode 100644 node_modules/make-dir/node_modules/semver/index.js create mode 100644 node_modules/make-dir/node_modules/semver/internal/constants.js create mode 100644 node_modules/make-dir/node_modules/semver/internal/debug.js create mode 100644 node_modules/make-dir/node_modules/semver/internal/identifiers.js create mode 100644 node_modules/make-dir/node_modules/semver/internal/parse-options.js create mode 100644 node_modules/make-dir/node_modules/semver/internal/re.js create mode 100644 node_modules/make-dir/node_modules/semver/package.json create mode 100644 node_modules/make-dir/node_modules/semver/preload.js create mode 100644 node_modules/make-dir/node_modules/semver/range.bnf create mode 100644 node_modules/make-dir/node_modules/semver/ranges/gtr.js create mode 100644 node_modules/make-dir/node_modules/semver/ranges/intersects.js create mode 100644 node_modules/make-dir/node_modules/semver/ranges/ltr.js create mode 100644 node_modules/make-dir/node_modules/semver/ranges/max-satisfying.js create mode 100644 node_modules/make-dir/node_modules/semver/ranges/min-satisfying.js create mode 100644 node_modules/make-dir/node_modules/semver/ranges/min-version.js create mode 100644 node_modules/make-dir/node_modules/semver/ranges/outside.js create mode 100644 node_modules/make-dir/node_modules/semver/ranges/simplify.js create mode 100644 node_modules/make-dir/node_modules/semver/ranges/subset.js create mode 100644 node_modules/make-dir/node_modules/semver/ranges/to-comparators.js create mode 100644 node_modules/make-dir/node_modules/semver/ranges/valid.js create mode 100644 node_modules/make-dir/node_modules/yallist/LICENSE create mode 100644 node_modules/make-dir/node_modules/yallist/README.md create mode 100644 node_modules/make-dir/node_modules/yallist/iterator.js create mode 100644 node_modules/make-dir/node_modules/yallist/package.json create mode 100644 node_modules/make-dir/node_modules/yallist/yallist.js create mode 100644 node_modules/make-dir/package.json create mode 100644 node_modules/make-dir/readme.md create mode 100644 node_modules/makeerror/.travis.yml create mode 100644 node_modules/makeerror/lib/makeerror.js create mode 100644 node_modules/makeerror/license create mode 100644 node_modules/makeerror/package.json create mode 100644 node_modules/makeerror/readme.md create mode 100644 node_modules/merge-stream/LICENSE create mode 100644 node_modules/merge-stream/README.md create mode 100644 node_modules/merge-stream/index.js create mode 100644 node_modules/merge-stream/package.json create mode 100644 node_modules/micromatch/LICENSE create mode 100644 node_modules/micromatch/README.md create mode 100644 node_modules/micromatch/index.js create mode 100644 node_modules/micromatch/package.json create mode 100644 node_modules/mimic-fn/index.d.ts create mode 100644 node_modules/mimic-fn/index.js create mode 100644 node_modules/mimic-fn/license create mode 100644 node_modules/mimic-fn/package.json create mode 100644 node_modules/mimic-fn/readme.md create mode 100644 node_modules/minimatch/LICENSE create mode 100644 node_modules/minimatch/README.md create mode 100644 node_modules/minimatch/minimatch.js create mode 100644 node_modules/minimatch/package.json create mode 100644 node_modules/ms/index.js create mode 100644 node_modules/ms/license.md create mode 100644 node_modules/ms/package.json create mode 100644 node_modules/ms/readme.md create mode 100644 node_modules/natural-compare/README.md create mode 100644 node_modules/natural-compare/index.js create mode 100644 node_modules/natural-compare/package.json create mode 100644 node_modules/node-int64/.npmignore create mode 100644 node_modules/node-int64/Int64.js create mode 100644 node_modules/node-int64/LICENSE create mode 100644 node_modules/node-int64/README.md create mode 100644 node_modules/node-int64/package.json create mode 100644 node_modules/node-int64/test.js create mode 100644 node_modules/node-releases/LICENSE create mode 100644 node_modules/node-releases/README.md create mode 100644 node_modules/node-releases/data/processed/envs.json create mode 100644 node_modules/node-releases/data/release-schedule/release-schedule.json create mode 100644 node_modules/node-releases/package.json create mode 100644 node_modules/normalize-path/LICENSE create mode 100644 node_modules/normalize-path/README.md create mode 100644 node_modules/normalize-path/index.js create mode 100644 node_modules/normalize-path/package.json create mode 100644 node_modules/npm-run-path/index.d.ts create mode 100644 node_modules/npm-run-path/index.js create mode 100644 node_modules/npm-run-path/license create mode 100644 node_modules/npm-run-path/package.json create mode 100644 node_modules/npm-run-path/readme.md create mode 100644 node_modules/onetime/index.d.ts create mode 100644 node_modules/onetime/index.js create mode 100644 node_modules/onetime/license create mode 100644 node_modules/onetime/package.json create mode 100644 node_modules/onetime/readme.md create mode 100644 node_modules/p-limit/index.d.ts create mode 100644 node_modules/p-limit/index.js create mode 100644 node_modules/p-limit/license create mode 100644 node_modules/p-limit/package.json create mode 100644 node_modules/p-limit/readme.md create mode 100644 node_modules/p-locate/index.d.ts create mode 100644 node_modules/p-locate/index.js create mode 100644 node_modules/p-locate/license create mode 100644 node_modules/p-locate/node_modules/p-limit/index.d.ts create mode 100644 node_modules/p-locate/node_modules/p-limit/index.js create mode 100644 node_modules/p-locate/node_modules/p-limit/license create mode 100644 node_modules/p-locate/node_modules/p-limit/package.json create mode 100644 node_modules/p-locate/node_modules/p-limit/readme.md create mode 100644 node_modules/p-locate/package.json create mode 100644 node_modules/p-locate/readme.md create mode 100644 node_modules/p-try/index.d.ts create mode 100644 node_modules/p-try/index.js create mode 100644 node_modules/p-try/license create mode 100644 node_modules/p-try/package.json create mode 100644 node_modules/p-try/readme.md create mode 100644 node_modules/parse-json/index.js create mode 100644 node_modules/parse-json/license create mode 100644 node_modules/parse-json/package.json create mode 100644 node_modules/parse-json/readme.md create mode 100644 node_modules/path-exists/index.d.ts create mode 100644 node_modules/path-exists/index.js create mode 100644 node_modules/path-exists/license create mode 100644 node_modules/path-exists/package.json create mode 100644 node_modules/path-exists/readme.md create mode 100644 node_modules/path-is-absolute/index.js create mode 100644 node_modules/path-is-absolute/license create mode 100644 node_modules/path-is-absolute/package.json create mode 100644 node_modules/path-is-absolute/readme.md create mode 100644 node_modules/path-key/index.d.ts create mode 100644 node_modules/path-key/index.js create mode 100644 node_modules/path-key/license create mode 100644 node_modules/path-key/package.json create mode 100644 node_modules/path-key/readme.md create mode 100644 node_modules/path-parse/LICENSE create mode 100644 node_modules/path-parse/README.md create mode 100644 node_modules/path-parse/index.js create mode 100644 node_modules/path-parse/package.json create mode 100644 node_modules/picocolors/LICENSE create mode 100644 node_modules/picocolors/README.md create mode 100644 node_modules/picocolors/package.json create mode 100644 node_modules/picocolors/picocolors.browser.js create mode 100644 node_modules/picocolors/picocolors.d.ts create mode 100644 node_modules/picocolors/picocolors.js create mode 100644 node_modules/picocolors/types.ts create mode 100644 node_modules/picomatch/CHANGELOG.md create mode 100644 node_modules/picomatch/LICENSE create mode 100644 node_modules/picomatch/README.md create mode 100644 node_modules/picomatch/index.js create mode 100644 node_modules/picomatch/lib/constants.js create mode 100644 node_modules/picomatch/lib/parse.js create mode 100644 node_modules/picomatch/lib/picomatch.js create mode 100644 node_modules/picomatch/lib/scan.js create mode 100644 node_modules/picomatch/lib/utils.js create mode 100644 node_modules/picomatch/package.json create mode 100644 node_modules/pirates/LICENSE create mode 100644 node_modules/pirates/README.md create mode 100644 node_modules/pirates/index.d.ts create mode 100644 node_modules/pirates/lib/index.js create mode 100644 node_modules/pirates/package.json create mode 100644 node_modules/pkg-dir/index.d.ts create mode 100644 node_modules/pkg-dir/index.js create mode 100644 node_modules/pkg-dir/license create mode 100644 node_modules/pkg-dir/package.json create mode 100644 node_modules/pkg-dir/readme.md create mode 100644 node_modules/pretty-format/LICENSE create mode 100644 node_modules/pretty-format/README.md create mode 100644 node_modules/pretty-format/build/collections.js create mode 100644 node_modules/pretty-format/build/index.d.ts create mode 100644 node_modules/pretty-format/build/index.js create mode 100644 node_modules/pretty-format/build/plugins/AsymmetricMatcher.js create mode 100644 node_modules/pretty-format/build/plugins/DOMCollection.js create mode 100644 node_modules/pretty-format/build/plugins/DOMElement.js create mode 100644 node_modules/pretty-format/build/plugins/Immutable.js create mode 100644 node_modules/pretty-format/build/plugins/ReactElement.js create mode 100644 node_modules/pretty-format/build/plugins/ReactTestComponent.js create mode 100644 node_modules/pretty-format/build/plugins/lib/escapeHTML.js create mode 100644 node_modules/pretty-format/build/plugins/lib/markup.js create mode 100644 node_modules/pretty-format/build/types.js create mode 100644 node_modules/pretty-format/node_modules/ansi-styles/index.d.ts create mode 100644 node_modules/pretty-format/node_modules/ansi-styles/index.js create mode 100644 node_modules/pretty-format/node_modules/ansi-styles/license create mode 100644 node_modules/pretty-format/node_modules/ansi-styles/package.json create mode 100644 node_modules/pretty-format/node_modules/ansi-styles/readme.md create mode 100644 node_modules/pretty-format/package.json create mode 100644 node_modules/prompts/dist/dateparts/datepart.js create mode 100644 node_modules/prompts/dist/dateparts/day.js create mode 100644 node_modules/prompts/dist/dateparts/hours.js create mode 100644 node_modules/prompts/dist/dateparts/index.js create mode 100644 node_modules/prompts/dist/dateparts/meridiem.js create mode 100644 node_modules/prompts/dist/dateparts/milliseconds.js create mode 100644 node_modules/prompts/dist/dateparts/minutes.js create mode 100644 node_modules/prompts/dist/dateparts/month.js create mode 100644 node_modules/prompts/dist/dateparts/seconds.js create mode 100644 node_modules/prompts/dist/dateparts/year.js create mode 100644 node_modules/prompts/dist/elements/autocomplete.js create mode 100644 node_modules/prompts/dist/elements/autocompleteMultiselect.js create mode 100644 node_modules/prompts/dist/elements/confirm.js create mode 100644 node_modules/prompts/dist/elements/date.js create mode 100644 node_modules/prompts/dist/elements/index.js create mode 100644 node_modules/prompts/dist/elements/multiselect.js create mode 100644 node_modules/prompts/dist/elements/number.js create mode 100644 node_modules/prompts/dist/elements/prompt.js create mode 100644 node_modules/prompts/dist/elements/select.js create mode 100644 node_modules/prompts/dist/elements/text.js create mode 100644 node_modules/prompts/dist/elements/toggle.js create mode 100644 node_modules/prompts/dist/index.js create mode 100644 node_modules/prompts/dist/prompts.js create mode 100644 node_modules/prompts/dist/util/action.js create mode 100644 node_modules/prompts/dist/util/clear.js create mode 100644 node_modules/prompts/dist/util/entriesToDisplay.js create mode 100644 node_modules/prompts/dist/util/figures.js create mode 100644 node_modules/prompts/dist/util/index.js create mode 100644 node_modules/prompts/dist/util/lines.js create mode 100644 node_modules/prompts/dist/util/strip.js create mode 100644 node_modules/prompts/dist/util/style.js create mode 100644 node_modules/prompts/dist/util/wrap.js create mode 100644 node_modules/prompts/index.js create mode 100644 node_modules/prompts/lib/dateparts/datepart.js create mode 100644 node_modules/prompts/lib/dateparts/day.js create mode 100644 node_modules/prompts/lib/dateparts/hours.js create mode 100644 node_modules/prompts/lib/dateparts/index.js create mode 100644 node_modules/prompts/lib/dateparts/meridiem.js create mode 100644 node_modules/prompts/lib/dateparts/milliseconds.js create mode 100644 node_modules/prompts/lib/dateparts/minutes.js create mode 100644 node_modules/prompts/lib/dateparts/month.js create mode 100644 node_modules/prompts/lib/dateparts/seconds.js create mode 100644 node_modules/prompts/lib/dateparts/year.js create mode 100644 node_modules/prompts/lib/elements/autocomplete.js create mode 100644 node_modules/prompts/lib/elements/autocompleteMultiselect.js create mode 100644 node_modules/prompts/lib/elements/confirm.js create mode 100644 node_modules/prompts/lib/elements/date.js create mode 100644 node_modules/prompts/lib/elements/index.js create mode 100644 node_modules/prompts/lib/elements/multiselect.js create mode 100644 node_modules/prompts/lib/elements/number.js create mode 100644 node_modules/prompts/lib/elements/prompt.js create mode 100644 node_modules/prompts/lib/elements/select.js create mode 100644 node_modules/prompts/lib/elements/text.js create mode 100644 node_modules/prompts/lib/elements/toggle.js create mode 100644 node_modules/prompts/lib/index.js create mode 100644 node_modules/prompts/lib/prompts.js create mode 100644 node_modules/prompts/lib/util/action.js create mode 100644 node_modules/prompts/lib/util/clear.js create mode 100644 node_modules/prompts/lib/util/entriesToDisplay.js create mode 100644 node_modules/prompts/lib/util/figures.js create mode 100644 node_modules/prompts/lib/util/index.js create mode 100644 node_modules/prompts/lib/util/lines.js create mode 100644 node_modules/prompts/lib/util/strip.js create mode 100644 node_modules/prompts/lib/util/style.js create mode 100644 node_modules/prompts/lib/util/wrap.js create mode 100644 node_modules/prompts/license create mode 100644 node_modules/prompts/package.json create mode 100644 node_modules/prompts/readme.md create mode 100644 node_modules/pure-rand/CHANGELOG.md create mode 100644 node_modules/pure-rand/LICENSE create mode 100644 node_modules/pure-rand/README.md create mode 100644 node_modules/pure-rand/lib/distribution/Distribution.js create mode 100644 node_modules/pure-rand/lib/distribution/UniformArrayIntDistribution.js create mode 100644 node_modules/pure-rand/lib/distribution/UniformBigIntDistribution.js create mode 100644 node_modules/pure-rand/lib/distribution/UniformIntDistribution.js create mode 100644 node_modules/pure-rand/lib/distribution/UnsafeUniformArrayIntDistribution.js create mode 100644 node_modules/pure-rand/lib/distribution/UnsafeUniformBigIntDistribution.js create mode 100644 node_modules/pure-rand/lib/distribution/UnsafeUniformIntDistribution.js create mode 100644 node_modules/pure-rand/lib/distribution/internals/ArrayInt.js create mode 100644 node_modules/pure-rand/lib/distribution/internals/UnsafeUniformArrayIntDistributionInternal.js create mode 100644 node_modules/pure-rand/lib/distribution/internals/UnsafeUniformIntDistributionInternal.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/Distribution.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/UniformArrayIntDistribution.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/UniformBigIntDistribution.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/UniformIntDistribution.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/UnsafeUniformArrayIntDistribution.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/UnsafeUniformBigIntDistribution.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/UnsafeUniformIntDistribution.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/internals/ArrayInt.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformArrayIntDistributionInternal.js create mode 100644 node_modules/pure-rand/lib/esm/distribution/internals/UnsafeUniformIntDistributionInternal.js create mode 100644 node_modules/pure-rand/lib/esm/generator/LinearCongruential.js create mode 100644 node_modules/pure-rand/lib/esm/generator/MersenneTwister.js create mode 100644 node_modules/pure-rand/lib/esm/generator/RandomGenerator.js create mode 100644 node_modules/pure-rand/lib/esm/generator/XorShift.js create mode 100644 node_modules/pure-rand/lib/esm/generator/XoroShiro.js create mode 100644 node_modules/pure-rand/lib/esm/package.json create mode 100644 node_modules/pure-rand/lib/esm/pure-rand-default.js create mode 100644 node_modules/pure-rand/lib/esm/pure-rand.js create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/Distribution.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/UniformArrayIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/UniformBigIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/UniformIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/UnsafeUniformArrayIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/UnsafeUniformBigIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/UnsafeUniformIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/internals/ArrayInt.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/internals/UnsafeUniformArrayIntDistributionInternal.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/distribution/internals/UnsafeUniformIntDistributionInternal.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/generator/LinearCongruential.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/generator/MersenneTwister.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/generator/RandomGenerator.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/generator/XorShift.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/generator/XoroShiro.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/pure-rand-default.d.ts create mode 100644 node_modules/pure-rand/lib/esm/types/pure-rand.d.ts create mode 100644 node_modules/pure-rand/lib/generator/LinearCongruential.js create mode 100644 node_modules/pure-rand/lib/generator/MersenneTwister.js create mode 100644 node_modules/pure-rand/lib/generator/RandomGenerator.js create mode 100644 node_modules/pure-rand/lib/generator/XorShift.js create mode 100644 node_modules/pure-rand/lib/generator/XoroShiro.js create mode 100644 node_modules/pure-rand/lib/pure-rand-default.js create mode 100644 node_modules/pure-rand/lib/pure-rand.js create mode 100644 node_modules/pure-rand/lib/types/distribution/Distribution.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/UniformArrayIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/UniformBigIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/UniformIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/UnsafeUniformArrayIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/UnsafeUniformBigIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/UnsafeUniformIntDistribution.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/internals/ArrayInt.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/internals/UnsafeUniformArrayIntDistributionInternal.d.ts create mode 100644 node_modules/pure-rand/lib/types/distribution/internals/UnsafeUniformIntDistributionInternal.d.ts create mode 100644 node_modules/pure-rand/lib/types/generator/LinearCongruential.d.ts create mode 100644 node_modules/pure-rand/lib/types/generator/MersenneTwister.d.ts create mode 100644 node_modules/pure-rand/lib/types/generator/RandomGenerator.d.ts create mode 100644 node_modules/pure-rand/lib/types/generator/XorShift.d.ts create mode 100644 node_modules/pure-rand/lib/types/generator/XoroShiro.d.ts create mode 100644 node_modules/pure-rand/lib/types/pure-rand-default.d.ts create mode 100644 node_modules/pure-rand/lib/types/pure-rand.d.ts create mode 100644 node_modules/pure-rand/package.json create mode 100644 node_modules/react-is/LICENSE create mode 100644 node_modules/react-is/README.md create mode 100644 node_modules/react-is/cjs/react-is.development.js create mode 100644 node_modules/react-is/cjs/react-is.production.min.js create mode 100644 node_modules/react-is/index.js create mode 100644 node_modules/react-is/package.json create mode 100644 node_modules/react-is/umd/react-is.development.js create mode 100644 node_modules/react-is/umd/react-is.production.min.js create mode 100644 node_modules/require-directory/.jshintrc create mode 100644 node_modules/require-directory/.npmignore create mode 100644 node_modules/require-directory/.travis.yml create mode 100644 node_modules/require-directory/LICENSE create mode 100644 node_modules/require-directory/README.markdown create mode 100644 node_modules/require-directory/index.js create mode 100644 node_modules/require-directory/package.json create mode 100644 node_modules/resolve-cwd/index.d.ts create mode 100644 node_modules/resolve-cwd/index.js create mode 100644 node_modules/resolve-cwd/license create mode 100644 node_modules/resolve-cwd/package.json create mode 100644 node_modules/resolve-cwd/readme.md create mode 100644 node_modules/resolve-from/index.d.ts create mode 100644 node_modules/resolve-from/index.js create mode 100644 node_modules/resolve-from/license create mode 100644 node_modules/resolve-from/package.json create mode 100644 node_modules/resolve-from/readme.md create mode 100644 node_modules/resolve.exports/dist/index.js create mode 100644 node_modules/resolve.exports/dist/index.mjs create mode 100644 node_modules/resolve.exports/index.d.ts create mode 100644 node_modules/resolve.exports/license create mode 100644 node_modules/resolve.exports/package.json create mode 100644 node_modules/resolve.exports/readme.md create mode 100644 node_modules/resolve/.editorconfig create mode 100644 node_modules/resolve/.eslintrc create mode 100644 node_modules/resolve/.github/FUNDING.yml create mode 100644 node_modules/resolve/LICENSE create mode 100644 node_modules/resolve/SECURITY.md create mode 100644 node_modules/resolve/async.js create mode 100644 node_modules/resolve/bin/resolve create mode 100644 node_modules/resolve/example/async.js create mode 100644 node_modules/resolve/example/sync.js create mode 100644 node_modules/resolve/index.js create mode 100644 node_modules/resolve/lib/async.js create mode 100644 node_modules/resolve/lib/caller.js create mode 100644 node_modules/resolve/lib/core.js create mode 100644 node_modules/resolve/lib/core.json create mode 100644 node_modules/resolve/lib/homedir.js create mode 100644 node_modules/resolve/lib/is-core.js create mode 100644 node_modules/resolve/lib/node-modules-paths.js create mode 100644 node_modules/resolve/lib/normalize-options.js create mode 100644 node_modules/resolve/lib/sync.js create mode 100644 node_modules/resolve/package.json create mode 100644 node_modules/resolve/readme.markdown create mode 100644 node_modules/resolve/sync.js create mode 100644 node_modules/resolve/test/core.js create mode 100644 node_modules/resolve/test/dotdot.js create mode 100644 node_modules/resolve/test/dotdot/abc/index.js create mode 100644 node_modules/resolve/test/dotdot/index.js create mode 100644 node_modules/resolve/test/faulty_basedir.js create mode 100644 node_modules/resolve/test/filter.js create mode 100644 node_modules/resolve/test/filter_sync.js create mode 100644 node_modules/resolve/test/home_paths.js create mode 100644 node_modules/resolve/test/home_paths_sync.js create mode 100644 node_modules/resolve/test/mock.js create mode 100644 node_modules/resolve/test/mock_sync.js create mode 100644 node_modules/resolve/test/module_dir.js create mode 100644 node_modules/resolve/test/module_dir/xmodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/ymodules/aaa/index.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/main.js create mode 100644 node_modules/resolve/test/module_dir/zmodules/bbb/package.json create mode 100644 node_modules/resolve/test/node-modules-paths.js create mode 100644 node_modules/resolve/test/node_path.js create mode 100644 node_modules/resolve/test/node_path/x/aaa/index.js create mode 100644 node_modules/resolve/test/node_path/x/ccc/index.js create mode 100644 node_modules/resolve/test/node_path/y/bbb/index.js create mode 100644 node_modules/resolve/test/node_path/y/ccc/index.js create mode 100644 node_modules/resolve/test/nonstring.js create mode 100644 node_modules/resolve/test/pathfilter.js create mode 100644 node_modules/resolve/test/pathfilter/deep_ref/main.js create mode 100644 node_modules/resolve/test/precedence.js create mode 100644 node_modules/resolve/test/precedence/aaa.js create mode 100644 node_modules/resolve/test/precedence/aaa/index.js create mode 100644 node_modules/resolve/test/precedence/aaa/main.js create mode 100644 node_modules/resolve/test/precedence/bbb.js create mode 100644 node_modules/resolve/test/precedence/bbb/main.js create mode 100644 node_modules/resolve/test/resolver.js create mode 100644 node_modules/resolve/test/resolver/baz/doom.js create mode 100644 node_modules/resolve/test/resolver/baz/package.json create mode 100644 node_modules/resolve/test/resolver/baz/quux.js create mode 100644 node_modules/resolve/test/resolver/browser_field/a.js create mode 100644 node_modules/resolve/test/resolver/browser_field/b.js create mode 100644 node_modules/resolve/test/resolver/browser_field/package.json create mode 100644 node_modules/resolve/test/resolver/cup.coffee create mode 100644 node_modules/resolve/test/resolver/dot_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_main/package.json create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/index.js create mode 100644 node_modules/resolve/test/resolver/dot_slash_main/package.json create mode 100644 node_modules/resolve/test/resolver/false_main/index.js create mode 100644 node_modules/resolve/test/resolver/false_main/package.json create mode 100644 node_modules/resolve/test/resolver/foo.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/index.js create mode 100644 node_modules/resolve/test/resolver/incorrect_main/package.json create mode 100644 node_modules/resolve/test/resolver/invalid_main/package.json create mode 100644 node_modules/resolve/test/resolver/mug.coffee create mode 100644 node_modules/resolve/test/resolver/mug.js create mode 100644 node_modules/resolve/test/resolver/multirepo/lerna.json create mode 100644 node_modules/resolve/test/resolver/multirepo/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-a/package.json create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/index.js create mode 100644 node_modules/resolve/test/resolver/multirepo/packages/package-b/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/package.json create mode 100644 node_modules/resolve/test/resolver/nested_symlinks/mylib/sync.js create mode 100644 node_modules/resolve/test/resolver/other_path/lib/other-lib.js create mode 100644 node_modules/resolve/test/resolver/other_path/root.js create mode 100644 node_modules/resolve/test/resolver/quux/foo/index.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo.js create mode 100644 node_modules/resolve/test/resolver/same_names/foo/index.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/node_modules/foo.js create mode 100644 node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep create mode 100644 node_modules/resolve/test/resolver/symlinked/package/bar.js create mode 100644 node_modules/resolve/test/resolver/symlinked/package/package.json create mode 100644 node_modules/resolve/test/resolver/without_basedir/main.js create mode 100644 node_modules/resolve/test/resolver_sync.js create mode 100644 node_modules/resolve/test/shadowed_core.js create mode 100644 node_modules/resolve/test/shadowed_core/node_modules/util/index.js create mode 100644 node_modules/resolve/test/subdirs.js create mode 100644 node_modules/resolve/test/symlinks.js create mode 100644 node_modules/semver/LICENSE create mode 100644 node_modules/semver/README.md create mode 100644 node_modules/semver/bin/semver.js create mode 100644 node_modules/semver/package.json create mode 100644 node_modules/semver/range.bnf create mode 100644 node_modules/semver/semver.js create mode 100644 node_modules/shebang-command/index.js create mode 100644 node_modules/shebang-command/license create mode 100644 node_modules/shebang-command/package.json create mode 100644 node_modules/shebang-command/readme.md create mode 100644 node_modules/shebang-regex/index.d.ts create mode 100644 node_modules/shebang-regex/index.js create mode 100644 node_modules/shebang-regex/license create mode 100644 node_modules/shebang-regex/package.json create mode 100644 node_modules/shebang-regex/readme.md create mode 100644 node_modules/signal-exit/LICENSE.txt create mode 100644 node_modules/signal-exit/README.md create mode 100644 node_modules/signal-exit/index.js create mode 100644 node_modules/signal-exit/package.json create mode 100644 node_modules/signal-exit/signals.js create mode 100644 node_modules/sisteransi/license create mode 100644 node_modules/sisteransi/package.json create mode 100644 node_modules/sisteransi/readme.md create mode 100644 node_modules/sisteransi/src/index.js create mode 100644 node_modules/sisteransi/src/sisteransi.d.ts create mode 100644 node_modules/slash/index.d.ts create mode 100644 node_modules/slash/index.js create mode 100644 node_modules/slash/license create mode 100644 node_modules/slash/package.json create mode 100644 node_modules/slash/readme.md create mode 100644 node_modules/source-map-support/LICENSE.md create mode 100644 node_modules/source-map-support/README.md create mode 100644 node_modules/source-map-support/browser-source-map-support.js create mode 100644 node_modules/source-map-support/package.json create mode 100644 node_modules/source-map-support/register.js create mode 100644 node_modules/source-map-support/source-map-support.js create mode 100644 node_modules/source-map/CHANGELOG.md create mode 100644 node_modules/source-map/LICENSE create mode 100644 node_modules/source-map/README.md create mode 100644 node_modules/source-map/dist/source-map.debug.js create mode 100644 node_modules/source-map/dist/source-map.js create mode 100644 node_modules/source-map/dist/source-map.min.js create mode 100644 node_modules/source-map/dist/source-map.min.js.map create mode 100644 node_modules/source-map/lib/array-set.js create mode 100644 node_modules/source-map/lib/base64-vlq.js create mode 100644 node_modules/source-map/lib/base64.js create mode 100644 node_modules/source-map/lib/binary-search.js create mode 100644 node_modules/source-map/lib/mapping-list.js create mode 100644 node_modules/source-map/lib/quick-sort.js create mode 100644 node_modules/source-map/lib/source-map-consumer.js create mode 100644 node_modules/source-map/lib/source-map-generator.js create mode 100644 node_modules/source-map/lib/source-node.js create mode 100644 node_modules/source-map/lib/util.js create mode 100644 node_modules/source-map/package.json create mode 100644 node_modules/source-map/source-map.d.ts create mode 100644 node_modules/source-map/source-map.js create mode 100644 node_modules/sprintf-js/.npmignore create mode 100644 node_modules/sprintf-js/LICENSE create mode 100644 node_modules/sprintf-js/README.md create mode 100644 node_modules/sprintf-js/bower.json create mode 100644 node_modules/sprintf-js/demo/angular.html create mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.js create mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.js.map create mode 100644 node_modules/sprintf-js/dist/angular-sprintf.min.map create mode 100644 node_modules/sprintf-js/dist/sprintf.min.js create mode 100644 node_modules/sprintf-js/dist/sprintf.min.js.map create mode 100644 node_modules/sprintf-js/dist/sprintf.min.map create mode 100644 node_modules/sprintf-js/gruntfile.js create mode 100644 node_modules/sprintf-js/package.json create mode 100644 node_modules/sprintf-js/src/angular-sprintf.js create mode 100644 node_modules/sprintf-js/src/sprintf.js create mode 100644 node_modules/sprintf-js/test/test.js create mode 100644 node_modules/stack-utils/LICENSE.md create mode 100644 node_modules/stack-utils/index.js create mode 100644 node_modules/stack-utils/package.json create mode 100644 node_modules/stack-utils/readme.md create mode 100644 node_modules/string-length/index.d.ts create mode 100644 node_modules/string-length/index.js create mode 100644 node_modules/string-length/license create mode 100644 node_modules/string-length/package.json create mode 100644 node_modules/string-length/readme.md create mode 100644 node_modules/string-width/index.d.ts create mode 100644 node_modules/string-width/index.js create mode 100644 node_modules/string-width/license create mode 100644 node_modules/string-width/package.json create mode 100644 node_modules/string-width/readme.md create mode 100644 node_modules/strip-ansi/index.d.ts create mode 100644 node_modules/strip-ansi/index.js create mode 100644 node_modules/strip-ansi/license create mode 100644 node_modules/strip-ansi/package.json create mode 100644 node_modules/strip-ansi/readme.md create mode 100644 node_modules/strip-bom/index.d.ts create mode 100644 node_modules/strip-bom/index.js create mode 100644 node_modules/strip-bom/license create mode 100644 node_modules/strip-bom/package.json create mode 100644 node_modules/strip-bom/readme.md create mode 100644 node_modules/strip-final-newline/index.js create mode 100644 node_modules/strip-final-newline/license create mode 100644 node_modules/strip-final-newline/package.json create mode 100644 node_modules/strip-final-newline/readme.md create mode 100644 node_modules/strip-json-comments/index.d.ts create mode 100644 node_modules/strip-json-comments/index.js create mode 100644 node_modules/strip-json-comments/license create mode 100644 node_modules/strip-json-comments/package.json create mode 100644 node_modules/strip-json-comments/readme.md create mode 100644 node_modules/supports-color/browser.js create mode 100644 node_modules/supports-color/index.js create mode 100644 node_modules/supports-color/license create mode 100644 node_modules/supports-color/package.json create mode 100644 node_modules/supports-color/readme.md create mode 100644 node_modules/supports-preserve-symlinks-flag/.eslintrc create mode 100644 node_modules/supports-preserve-symlinks-flag/.github/FUNDING.yml create mode 100644 node_modules/supports-preserve-symlinks-flag/.nycrc create mode 100644 node_modules/supports-preserve-symlinks-flag/CHANGELOG.md create mode 100644 node_modules/supports-preserve-symlinks-flag/LICENSE create mode 100644 node_modules/supports-preserve-symlinks-flag/README.md create mode 100644 node_modules/supports-preserve-symlinks-flag/browser.js create mode 100644 node_modules/supports-preserve-symlinks-flag/index.js create mode 100644 node_modules/supports-preserve-symlinks-flag/package.json create mode 100644 node_modules/supports-preserve-symlinks-flag/test/index.js create mode 100644 node_modules/test-exclude/CHANGELOG.md create mode 100644 node_modules/test-exclude/LICENSE.txt create mode 100644 node_modules/test-exclude/README.md create mode 100644 node_modules/test-exclude/index.js create mode 100644 node_modules/test-exclude/is-outside-dir-posix.js create mode 100644 node_modules/test-exclude/is-outside-dir-win32.js create mode 100644 node_modules/test-exclude/is-outside-dir.js create mode 100644 node_modules/test-exclude/package.json create mode 100644 node_modules/tmpl/lib/tmpl.js create mode 100644 node_modules/tmpl/license create mode 100644 node_modules/tmpl/package.json create mode 100644 node_modules/tmpl/readme.md create mode 100644 node_modules/to-fast-properties/index.js create mode 100644 node_modules/to-fast-properties/license create mode 100644 node_modules/to-fast-properties/package.json create mode 100644 node_modules/to-fast-properties/readme.md create mode 100644 node_modules/to-regex-range/LICENSE create mode 100644 node_modules/to-regex-range/README.md create mode 100644 node_modules/to-regex-range/index.js create mode 100644 node_modules/to-regex-range/package.json create mode 100644 node_modules/type-detect/LICENSE create mode 100644 node_modules/type-detect/README.md create mode 100644 node_modules/type-detect/index.js create mode 100644 node_modules/type-detect/package.json create mode 100644 node_modules/type-detect/type-detect.js create mode 100644 node_modules/type-fest/base.d.ts create mode 100644 node_modules/type-fest/index.d.ts create mode 100644 node_modules/type-fest/license create mode 100644 node_modules/type-fest/package.json create mode 100644 node_modules/type-fest/readme.md create mode 100644 node_modules/type-fest/source/async-return-type.d.ts create mode 100644 node_modules/type-fest/source/asyncify.d.ts create mode 100644 node_modules/type-fest/source/basic.d.ts create mode 100644 node_modules/type-fest/source/conditional-except.d.ts create mode 100644 node_modules/type-fest/source/conditional-keys.d.ts create mode 100644 node_modules/type-fest/source/conditional-pick.d.ts create mode 100644 node_modules/type-fest/source/entries.d.ts create mode 100644 node_modules/type-fest/source/entry.d.ts create mode 100644 node_modules/type-fest/source/except.d.ts create mode 100644 node_modules/type-fest/source/fixed-length-array.d.ts create mode 100644 node_modules/type-fest/source/iterable-element.d.ts create mode 100644 node_modules/type-fest/source/literal-union.d.ts create mode 100644 node_modules/type-fest/source/merge-exclusive.d.ts create mode 100644 node_modules/type-fest/source/merge.d.ts create mode 100644 node_modules/type-fest/source/mutable.d.ts create mode 100644 node_modules/type-fest/source/opaque.d.ts create mode 100644 node_modules/type-fest/source/package-json.d.ts create mode 100644 node_modules/type-fest/source/partial-deep.d.ts create mode 100644 node_modules/type-fest/source/promisable.d.ts create mode 100644 node_modules/type-fest/source/promise-value.d.ts create mode 100644 node_modules/type-fest/source/readonly-deep.d.ts create mode 100644 node_modules/type-fest/source/require-at-least-one.d.ts create mode 100644 node_modules/type-fest/source/require-exactly-one.d.ts create mode 100644 node_modules/type-fest/source/set-optional.d.ts create mode 100644 node_modules/type-fest/source/set-required.d.ts create mode 100644 node_modules/type-fest/source/set-return-type.d.ts create mode 100644 node_modules/type-fest/source/simplify.d.ts create mode 100644 node_modules/type-fest/source/stringified.d.ts create mode 100644 node_modules/type-fest/source/tsconfig-json.d.ts create mode 100644 node_modules/type-fest/source/typed-array.d.ts create mode 100644 node_modules/type-fest/source/union-to-intersection.d.ts create mode 100644 node_modules/type-fest/source/utilities.d.ts create mode 100644 node_modules/type-fest/source/value-of.d.ts create mode 100644 node_modules/type-fest/ts41/camel-case.d.ts create mode 100644 node_modules/type-fest/ts41/delimiter-case.d.ts create mode 100644 node_modules/type-fest/ts41/get.d.ts create mode 100644 node_modules/type-fest/ts41/index.d.ts create mode 100644 node_modules/type-fest/ts41/kebab-case.d.ts create mode 100644 node_modules/type-fest/ts41/pascal-case.d.ts create mode 100644 node_modules/type-fest/ts41/snake-case.d.ts create mode 100644 node_modules/type-fest/ts41/utilities.d.ts create mode 100644 node_modules/update-browserslist-db/LICENSE create mode 100644 node_modules/update-browserslist-db/README.md create mode 100644 node_modules/update-browserslist-db/check-npm-version.js create mode 100644 node_modules/update-browserslist-db/cli.js create mode 100644 node_modules/update-browserslist-db/index.d.ts create mode 100644 node_modules/update-browserslist-db/index.js create mode 100644 node_modules/update-browserslist-db/package.json create mode 100644 node_modules/update-browserslist-db/utils.js create mode 100644 node_modules/v8-to-istanbul/CHANGELOG.md create mode 100644 node_modules/v8-to-istanbul/LICENSE.txt create mode 100644 node_modules/v8-to-istanbul/README.md create mode 100644 node_modules/v8-to-istanbul/index.d.ts create mode 100644 node_modules/v8-to-istanbul/index.js create mode 100644 node_modules/v8-to-istanbul/lib/branch.js create mode 100644 node_modules/v8-to-istanbul/lib/function.js create mode 100644 node_modules/v8-to-istanbul/lib/line.js create mode 100644 node_modules/v8-to-istanbul/lib/range.js create mode 100644 node_modules/v8-to-istanbul/lib/source.js create mode 100644 node_modules/v8-to-istanbul/lib/v8-to-istanbul.js create mode 100644 node_modules/v8-to-istanbul/package.json create mode 100644 node_modules/walker/.travis.yml create mode 100644 node_modules/walker/LICENSE create mode 100644 node_modules/walker/lib/walker.js create mode 100644 node_modules/walker/package.json create mode 100644 node_modules/walker/readme.md create mode 100644 node_modules/which/CHANGELOG.md create mode 100644 node_modules/which/LICENSE create mode 100644 node_modules/which/README.md create mode 100644 node_modules/which/bin/node-which create mode 100644 node_modules/which/package.json create mode 100644 node_modules/which/which.js create mode 100644 node_modules/wrap-ansi/index.js create mode 100644 node_modules/wrap-ansi/license create mode 100644 node_modules/wrap-ansi/package.json create mode 100644 node_modules/wrap-ansi/readme.md create mode 100644 node_modules/write-file-atomic/LICENSE.md create mode 100644 node_modules/write-file-atomic/README.md create mode 100644 node_modules/write-file-atomic/lib/index.js create mode 100644 node_modules/write-file-atomic/package.json create mode 100644 node_modules/y18n/CHANGELOG.md create mode 100644 node_modules/y18n/LICENSE create mode 100644 node_modules/y18n/README.md create mode 100644 node_modules/y18n/build/index.cjs create mode 100644 node_modules/y18n/build/lib/cjs.js create mode 100644 node_modules/y18n/build/lib/index.js create mode 100644 node_modules/y18n/build/lib/platform-shims/node.js create mode 100644 node_modules/y18n/index.mjs create mode 100644 node_modules/y18n/package.json create mode 100644 node_modules/yallist/LICENSE create mode 100644 node_modules/yallist/README.md create mode 100644 node_modules/yallist/iterator.js create mode 100644 node_modules/yallist/package.json create mode 100644 node_modules/yallist/yallist.js create mode 100644 node_modules/yargs-parser/CHANGELOG.md create mode 100644 node_modules/yargs-parser/LICENSE.txt create mode 100644 node_modules/yargs-parser/README.md create mode 100644 node_modules/yargs-parser/browser.js create mode 100644 node_modules/yargs-parser/build/index.cjs create mode 100644 node_modules/yargs-parser/build/lib/index.js create mode 100644 node_modules/yargs-parser/build/lib/string-utils.js create mode 100644 node_modules/yargs-parser/build/lib/tokenize-arg-string.js create mode 100644 node_modules/yargs-parser/build/lib/yargs-parser-types.js create mode 100644 node_modules/yargs-parser/build/lib/yargs-parser.js create mode 100644 node_modules/yargs-parser/package.json create mode 100644 node_modules/yargs/LICENSE create mode 100644 node_modules/yargs/README.md create mode 100644 node_modules/yargs/browser.d.ts create mode 100644 node_modules/yargs/browser.mjs create mode 100644 node_modules/yargs/build/index.cjs create mode 100644 node_modules/yargs/build/lib/argsert.js create mode 100644 node_modules/yargs/build/lib/command.js create mode 100644 node_modules/yargs/build/lib/completion-templates.js create mode 100644 node_modules/yargs/build/lib/completion.js create mode 100644 node_modules/yargs/build/lib/middleware.js create mode 100644 node_modules/yargs/build/lib/parse-command.js create mode 100644 node_modules/yargs/build/lib/typings/common-types.js create mode 100644 node_modules/yargs/build/lib/typings/yargs-parser-types.js create mode 100644 node_modules/yargs/build/lib/usage.js create mode 100644 node_modules/yargs/build/lib/utils/apply-extends.js create mode 100644 node_modules/yargs/build/lib/utils/is-promise.js create mode 100644 node_modules/yargs/build/lib/utils/levenshtein.js create mode 100644 node_modules/yargs/build/lib/utils/maybe-async-result.js create mode 100644 node_modules/yargs/build/lib/utils/obj-filter.js create mode 100644 node_modules/yargs/build/lib/utils/process-argv.js create mode 100644 node_modules/yargs/build/lib/utils/set-blocking.js create mode 100644 node_modules/yargs/build/lib/utils/which-module.js create mode 100644 node_modules/yargs/build/lib/validation.js create mode 100644 node_modules/yargs/build/lib/yargs-factory.js create mode 100644 node_modules/yargs/build/lib/yerror.js create mode 100644 node_modules/yargs/helpers/helpers.mjs create mode 100644 node_modules/yargs/helpers/index.js create mode 100644 node_modules/yargs/helpers/package.json create mode 100644 node_modules/yargs/index.cjs create mode 100644 node_modules/yargs/index.mjs create mode 100644 node_modules/yargs/lib/platform-shims/browser.mjs create mode 100644 node_modules/yargs/lib/platform-shims/esm.mjs create mode 100644 node_modules/yargs/locales/be.json create mode 100644 node_modules/yargs/locales/cs.json create mode 100644 node_modules/yargs/locales/de.json create mode 100644 node_modules/yargs/locales/en.json create mode 100644 node_modules/yargs/locales/es.json create mode 100644 node_modules/yargs/locales/fi.json create mode 100644 node_modules/yargs/locales/fr.json create mode 100644 node_modules/yargs/locales/hi.json create mode 100644 node_modules/yargs/locales/hu.json create mode 100644 node_modules/yargs/locales/id.json create mode 100644 node_modules/yargs/locales/it.json create mode 100644 node_modules/yargs/locales/ja.json create mode 100644 node_modules/yargs/locales/ko.json create mode 100644 node_modules/yargs/locales/nb.json create mode 100644 node_modules/yargs/locales/nl.json create mode 100644 node_modules/yargs/locales/nn.json create mode 100644 node_modules/yargs/locales/pirate.json create mode 100644 node_modules/yargs/locales/pl.json create mode 100644 node_modules/yargs/locales/pt.json create mode 100644 node_modules/yargs/locales/pt_BR.json create mode 100644 node_modules/yargs/locales/ru.json create mode 100644 node_modules/yargs/locales/th.json create mode 100644 node_modules/yargs/locales/tr.json create mode 100644 node_modules/yargs/locales/uk_UA.json create mode 100644 node_modules/yargs/locales/uz.json create mode 100644 node_modules/yargs/locales/zh_CN.json create mode 100644 node_modules/yargs/locales/zh_TW.json create mode 100644 node_modules/yargs/package.json create mode 100644 node_modules/yargs/yargs create mode 100644 node_modules/yargs/yargs.mjs create mode 100644 node_modules/yocto-queue/index.d.ts create mode 100644 node_modules/yocto-queue/index.js create mode 100644 node_modules/yocto-queue/license create mode 100644 node_modules/yocto-queue/package.json create mode 100644 node_modules/yocto-queue/readme.md diff --git a/evaluate-dependencies.js b/evaluate-dependencies.js new file mode 100644 index 00000000..2a733b3f --- /dev/null +++ b/evaluate-dependencies.js @@ -0,0 +1,162 @@ +const core = require('@actions/core'); +const github = require('@actions/github'); + +var customDomains = core.getInput('custom-domains')?.split(/(\s+)/) ?? []; + +const keyPhrases = 'depends on|blocked by'; +const issueTypes = 'issues|pull'; +const domainsList = ['github.com'].concat(customDomains); // add others from parameter +const domainsString = combineDomains(domainsList); + +const quickLinkRegex = new RegExp(`(${keyPhrases}) #(\\d+)`, 'gmi'); +const partialLinkRegex = new RegExp(`(${keyPhrases}) ([-_\\w]+)\\/([-._a-z0-9]+)(#)(\\d+)`, 'gmi'); +const partialUrlRegex = new RegExp(`(${keyPhrases}) ([-_\\w]+)\\/([-._a-z0-9]+)\\/(${issueTypes})\\/(\\d+)`, 'gmi'); +const fullUrlRegex = new RegExp(`(${keyPhrases}) https?:\\/\\/(?:${domainsString})\\/([-_\\w]+)\\/([-._a-z0-9]+)\\/(${issueTypes})\\/(\\d+)`, 'gmi'); +const markdownRegex = new RegExp(`(${keyPhrases}) \\[.*\\]\\(https?:\\/\\/(?:${domainsString})\\/([-_\\w]+)\\/([-._a-z0-9]+)\\/(${issueTypes})\\/(\\d+)\\)`, 'gmi'); + +function escapeDomainForRegex(domain) { + return domain.replace('.', '\\.'); +} + +function combineDomains(domains) { + return domains.map(x => escapeDomainForRegex(x)).join("|"); +} + +function extractFromMatch(match) { + return { + owner: match[2], + repo: match[3], + pull_number: parseInt(match[5], 10) + }; +} + +function getDependency(line) { + var match = quickLinkRegex.exec(line); + if (match !== null) { + core.info(` Found number-referenced dependency in '${line}'`); + return { + owner: github.context.repo.owner, + repo: github.context.repo.repo, + pull_number: parseInt(match[2], 10) + }; + } + + match = partialLinkRegex.exec(line); + if (match !== null) { + core.info(` Found partial-link dependency in '${line}'`); + return extractFromMatch(match); + } + + match = partialUrlRegex.exec(line); + if (match !== null) { + core.info(` Found partial-url dependency in '${line}'`); + return extractFromMatch(match); + } + + match = fullUrlRegex.exec(line); + if (match !== null) { + core.info(` Found full-url dependency in '${line}'`); + return extractFromMatch(match); + } + + match = markdownRegex.exec(line); + if (match !== null) { + core.info(` Found markdown dependency in '${line}'`); + return extractFromMatch(match); + } + + core.info(` Found no dependency in '${line}'`); + return null; +}; + +async function evaluate() { + try { + core.info('Initializing...'); + const myToken = process.env.GITHUB_TOKEN; + const octokit = github.getOctokit(myToken); + + const { data: pullRequest } = await octokit.pulls.get({ + owner: github.context.repo.owner, + repo: github.context.repo.repo, + pull_number: github.context.issue.number, + }); + + if (!pullRequest.body){ + core.info('body empty') + return; + } + + core.info('\nReading PR body...'); + const lines = pullRequest.body.split(/\r\n|\r|\n/); + + var dependencies = []; + lines.forEach(l => { + var dependency = getDependency(l); + if (dependency !== null) + dependencies.push(dependency); + }); + + core.info('\nAnalyzing lines...'); + var dependencyIssues = []; + for (var d of dependencies) { + core.info(` Fetching '${JSON.stringify(d)}'`); + var isPr = true; + var response = await octokit.pulls.get(d).catch(error => core.error(error)); + if (response === undefined) { + isPr = false; + d = { + owner: d.owner, + repo: d.repo, + issue_number: d.pull_number, + }; + core.info(` Fetching '${JSON.stringify(d)}'`); + response = await octokit.issues.get(d).catch(error => core.error(error)); + if (response === undefined) { + core.info(' Could not locate this dependency. Will need to verify manually.'); + continue; + } + } + if (isPr) { + const { data: pr } = response; + if (!pr) continue; + if (!pr.merged && !pr.closed_at) { + core.info(' PR is still open.'); + dependencyIssues.push(pr); + } else { + core.info(' PR has been closed.'); + } + } else { + const { data: issue } = response; + if (!issue) continue; + if (!issue.closed_at) { + core.info(' Issue is still open.'); + dependencyIssues.push(issue); + } else { + core.info(' Issue has been closed.'); + } + } + } + + if (dependencyIssues.length !== 0) { + var msg = '\nThe following issues need to be resolved before this PR can be merged:\n'; + for (var pr of dependencyIssues) { + msg += `\n#${pr.number} - ${pr.title}`; + } + core.setFailed(msg); + } else { + core.info("\nAll dependencies have been resolved!") + } + } catch (error) { + core.setFailed(error.message); + throw error; + } +} + +function getPullRequestBody(){ + +} + +module.exports = { + evaluate: evaluate, + getDependency: getDependency +} \ No newline at end of file diff --git a/evaluate-dependencies.test.js b/evaluate-dependencies.test.js new file mode 100644 index 00000000..7325b5c2 --- /dev/null +++ b/evaluate-dependencies.test.js @@ -0,0 +1,79 @@ +const evaluate = require('./evaluate-dependencies'); + +process.env.GITHUB_REPOSITORY = 'owner/repo'; + +const shorthand = 'Depends on #14' +test('Shorthand', () => { + expect(evaluate.getDependency(shorthand)) + .toStrictEqual({ + owner: 'owner', + repo: 'repo', + pull_number: 14 + }); +}); + +const partialLink = 'Depends on gregsdennis/dependencies-action#5' +test('partialLink', () => { + expect(evaluate.getDependency(partialLink)) + .toStrictEqual({ + owner: 'gregsdennis', + repo: 'dependencies-action', + pull_number: 5 + }); +}); + +const shorthandAndPartialLink = `Depends on #14 +Depends on gregsdennis/dependencies-action#5` +test('shorthandAndPartialLink', () => { + var lines = shorthandAndPartialLink.split(/\r\n|\r|\n/); + expect(evaluate.getDependency(lines[0])) + .toStrictEqual({ + owner: 'owner', + repo: 'repo', + pull_number: 14 + }); + expect(evaluate.getDependency(lines[1])) + .toStrictEqual({ + owner: 'gregsdennis', + repo: 'dependencies-action', + pull_number: 5 + }); +}); + +const shorthandAndPartialLinkWithBlankLineAtEnd = `Depends on #14 +Depends on gregsdennis/dependencies-action#5 +` +test('shorthandAndPartialLinkWithBlankLineAtEnd', () => { + var lines = shorthandAndPartialLinkWithBlankLineAtEnd.split(/\r\n|\r|\n/); + expect(evaluate.getDependency(lines[0])) + .toStrictEqual({ + owner: 'owner', + repo: 'repo', + pull_number: 14 + }); + expect(evaluate.getDependency(lines[1])) + .toStrictEqual({ + owner: 'gregsdennis', + repo: 'dependencies-action', + pull_number: 5 + }); +}); + +const shorthandAndPartialLinkWithBlankLineInMiddle = `Depends on #14 + +Depends on gregsdennis/dependencies-action#5` +test('shorthandAndPartialLinkWithBlankLineInMiddle', () => { + var lines = shorthandAndPartialLinkWithBlankLineInMiddle.split(/\r\n|\r|\n/); + expect(evaluate.getDependency(lines[0])) + .toStrictEqual({ + owner: 'owner', + repo: 'repo', + pull_number: 14 + }); + expect(evaluate.getDependency(lines[1])) + .toStrictEqual({ + owner: 'gregsdennis', + repo: 'dependencies-action', + pull_number: 5 + }); +}); diff --git a/index.js b/index.js index ce2c16be..107dde5f 100644 --- a/index.js +++ b/index.js @@ -1,155 +1,7 @@ -const core = require('@actions/core'); -const github = require('@actions/github'); - -var customDomains = core.getInput('custom-domains')?.split(/(\s+)/) ?? []; - -const keyPhrases = 'depends on|blocked by'; -const issueTypes = 'issues|pull'; -const domainsList = ['github.com'].concat(customDomains); // add others from parameter -const domainsString = combineDomains(domainsList); - -const quickLinkRegex = new RegExp(`(${keyPhrases}) #(\\d+)`, 'gmi'); -const partialLinkRegex = new RegExp(`(${keyPhrases}) ([-_\\w]+)\\/([-._a-z0-9]+)(#)(\\d+)`, 'gmi'); -const partialUrlRegex = new RegExp(`(${keyPhrases}) ([-_\\w]+)\\/([-._a-z0-9]+)\\/(${issueTypes})\\/(\\d+)`, 'gmi'); -const fullUrlRegex = new RegExp(`(${keyPhrases}) https?:\\/\\/(?:${domainsString})\\/([-_\\w]+)\\/([-._a-z0-9]+)\\/(${issueTypes})\\/(\\d+)`, 'gmi'); -const markdownRegex = new RegExp(`(${keyPhrases}) \\[.*\\]\\(https?:\\/\\/(?:${domainsString})\\/([-_\\w]+)\\/([-._a-z0-9]+)\\/(${issueTypes})\\/(\\d+)\\)`, 'gmi'); - -function escapeDomainForRegex(domain) { - return domain.replace('.', '\\.'); -} - -function combineDomains(domains) { - return domains.map(x => escapeDomainForRegex(x)).join("|"); -} - -function extractFromMatch(match) { - return { - owner: match[2], - repo: match[3], - pull_number: parseInt(match[5], 10) - }; -} - -function getDependency(line) { - var match = quickLinkRegex.exec(line); - if (match !== null) { - core.info(` Found number-referenced dependency in '${line}'`); - return { - owner: github.context.repo.owner, - repo: github.context.repo.repo, - pull_number: parseInt(match[2], 10) - }; - } - - match = partialLinkRegex.exec(line); - if (match !== null) { - core.info(` Found partial-link dependency in '${line}'`); - return extractFromMatch(match); - } - - match = partialUrlRegex.exec(line); - if (match !== null) { - core.info(` Found partial-url dependency in '${line}'`); - return extractFromMatch(match); - } - - match = fullUrlRegex.exec(line); - if (match !== null) { - core.info(` Found full-url dependency in '${line}'`); - return extractFromMatch(match); - } - - match = markdownRegex.exec(line); - if (match !== null) { - core.info(` Found markdown dependency in '${line}'`); - return extractFromMatch(match); - } - - core.info(` Found no dependency in '${line}'`); - return null; -}; +const evaluate = require('./evaluate-dependencies'); async function run() { - try { - core.info('Initializing...'); - const myToken = process.env.GITHUB_TOKEN; - const octokit = github.getOctokit(myToken); - - const { data: pullRequest } = await octokit.pulls.get({ - owner: github.context.repo.owner, - repo: github.context.repo.repo, - pull_number: github.context.issue.number, - }); - - if (!pullRequest.body){ - core.info('body empty') - return; - } - - core.info('\nReading PR body...'); - const lines = pullRequest.body.split(/\r\n|\r|\n/); - - var dependencies = []; - lines.forEach(l => { - var dependency = getDependency(l); - if (dependency !== null) - dependencies.push(dependency); - }); - - core.info('\nAnalyzing lines...'); - var dependencyIssues = []; - for (var d of dependencies) { - core.info(` Fetching '${JSON.stringify(d)}'`); - var isPr = true; - var response = await octokit.pulls.get(d).catch(error => core.error(error)); - if (response === undefined) { - isPr = false; - d = { - owner: d.owner, - repo: d.repo, - issue_number: d.pull_number, - }; - core.info(` Fetching '${JSON.stringify(d)}'`); - response = await octokit.issues.get(d).catch(error => core.error(error)); - if (response === undefined) { - core.info(' Could not locate this dependency. Will need to verify manually.'); - continue; - } - } - if (isPr) { - const { data: pr } = response; - if (!pr) continue; - if (!pr.merged && !pr.closed_at) { - core.info(' PR is still open.'); - dependencyIssues.push(pr); - } else { - core.info(' PR has been closed.'); - } - } else { - const { data: issue } = response; - if (!issue) continue; - if (!issue.closed_at) { - core.info(' Issue is still open.'); - dependencyIssues.push(issue); - } else { - core.info(' Issue has been closed.'); - } - } - } - - if (dependencyIssues.length !== 0) { - var msg = '\nThe following issues need to be resolved before this PR can be merged:\n'; - for (var pr of dependencyIssues) { - msg += `\n#${pr.number} - ${pr.title}`; - } - core.setFailed(msg); - } else { - core.info("\nAll dependencies have been resolved!") - } - } catch (error) { - core.setFailed(error.message); - throw error; - } + await evaluate(); } -run(); +run(); \ No newline at end of file diff --git a/node_modules/.bin/browserslist b/node_modules/.bin/browserslist new file mode 100644 index 00000000..68dd69d4 --- /dev/null +++ b/node_modules/.bin/browserslist @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../browserslist/cli.js" "$@" +else + exec node "$basedir/../browserslist/cli.js" "$@" +fi diff --git a/node_modules/.bin/browserslist.cmd b/node_modules/.bin/browserslist.cmd new file mode 100644 index 00000000..f93c251e --- /dev/null +++ b/node_modules/.bin/browserslist.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\browserslist\cli.js" %* diff --git a/node_modules/.bin/browserslist.ps1 b/node_modules/.bin/browserslist.ps1 new file mode 100644 index 00000000..01e10a08 --- /dev/null +++ b/node_modules/.bin/browserslist.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../browserslist/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../browserslist/cli.js" $args + } else { + & "node$exe" "$basedir/../browserslist/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/create-jest b/node_modules/.bin/create-jest new file mode 100644 index 00000000..311a603a --- /dev/null +++ b/node_modules/.bin/create-jest @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../create-jest/bin/create-jest.js" "$@" +else + exec node "$basedir/../create-jest/bin/create-jest.js" "$@" +fi diff --git a/node_modules/.bin/create-jest.cmd b/node_modules/.bin/create-jest.cmd new file mode 100644 index 00000000..585d1037 --- /dev/null +++ b/node_modules/.bin/create-jest.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\create-jest\bin\create-jest.js" %* diff --git a/node_modules/.bin/create-jest.ps1 b/node_modules/.bin/create-jest.ps1 new file mode 100644 index 00000000..cf4288c3 --- /dev/null +++ b/node_modules/.bin/create-jest.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../create-jest/bin/create-jest.js" $args + } else { + & "$basedir/node$exe" "$basedir/../create-jest/bin/create-jest.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../create-jest/bin/create-jest.js" $args + } else { + & "node$exe" "$basedir/../create-jest/bin/create-jest.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/esparse b/node_modules/.bin/esparse new file mode 100644 index 00000000..1cc1c96f --- /dev/null +++ b/node_modules/.bin/esparse @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@" +else + exec node "$basedir/../esprima/bin/esparse.js" "$@" +fi diff --git a/node_modules/.bin/esparse.cmd b/node_modules/.bin/esparse.cmd new file mode 100644 index 00000000..2ca6d502 --- /dev/null +++ b/node_modules/.bin/esparse.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esparse.js" %* diff --git a/node_modules/.bin/esparse.ps1 b/node_modules/.bin/esparse.ps1 new file mode 100644 index 00000000..f19ed730 --- /dev/null +++ b/node_modules/.bin/esparse.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args + } else { + & "$basedir/node$exe" "$basedir/../esprima/bin/esparse.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../esprima/bin/esparse.js" $args + } else { + & "node$exe" "$basedir/../esprima/bin/esparse.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/esvalidate b/node_modules/.bin/esvalidate new file mode 100644 index 00000000..91a4c9b5 --- /dev/null +++ b/node_modules/.bin/esvalidate @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@" +else + exec node "$basedir/../esprima/bin/esvalidate.js" "$@" +fi diff --git a/node_modules/.bin/esvalidate.cmd b/node_modules/.bin/esvalidate.cmd new file mode 100644 index 00000000..4c41643e --- /dev/null +++ b/node_modules/.bin/esvalidate.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\esprima\bin\esvalidate.js" %* diff --git a/node_modules/.bin/esvalidate.ps1 b/node_modules/.bin/esvalidate.ps1 new file mode 100644 index 00000000..23699d11 --- /dev/null +++ b/node_modules/.bin/esvalidate.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } else { + & "$basedir/node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } else { + & "node$exe" "$basedir/../esprima/bin/esvalidate.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/import-local-fixture b/node_modules/.bin/import-local-fixture new file mode 100644 index 00000000..79e31800 --- /dev/null +++ b/node_modules/.bin/import-local-fixture @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../import-local/fixtures/cli.js" "$@" +else + exec node "$basedir/../import-local/fixtures/cli.js" "$@" +fi diff --git a/node_modules/.bin/import-local-fixture.cmd b/node_modules/.bin/import-local-fixture.cmd new file mode 100644 index 00000000..5a3f6859 --- /dev/null +++ b/node_modules/.bin/import-local-fixture.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\import-local\fixtures\cli.js" %* diff --git a/node_modules/.bin/import-local-fixture.ps1 b/node_modules/.bin/import-local-fixture.ps1 new file mode 100644 index 00000000..01ef7842 --- /dev/null +++ b/node_modules/.bin/import-local-fixture.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../import-local/fixtures/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../import-local/fixtures/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../import-local/fixtures/cli.js" $args + } else { + & "node$exe" "$basedir/../import-local/fixtures/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/jest b/node_modules/.bin/jest new file mode 100644 index 00000000..e6376e84 --- /dev/null +++ b/node_modules/.bin/jest @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../jest/bin/jest.js" "$@" +else + exec node "$basedir/../jest/bin/jest.js" "$@" +fi diff --git a/node_modules/.bin/jest.cmd b/node_modules/.bin/jest.cmd new file mode 100644 index 00000000..67a602ac --- /dev/null +++ b/node_modules/.bin/jest.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jest\bin\jest.js" %* diff --git a/node_modules/.bin/jest.ps1 b/node_modules/.bin/jest.ps1 new file mode 100644 index 00000000..78a25637 --- /dev/null +++ b/node_modules/.bin/jest.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../jest/bin/jest.js" $args + } else { + & "$basedir/node$exe" "$basedir/../jest/bin/jest.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../jest/bin/jest.js" $args + } else { + & "node$exe" "$basedir/../jest/bin/jest.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/js-yaml b/node_modules/.bin/js-yaml new file mode 100644 index 00000000..ed78a868 --- /dev/null +++ b/node_modules/.bin/js-yaml @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../js-yaml/bin/js-yaml.js" "$@" +else + exec node "$basedir/../js-yaml/bin/js-yaml.js" "$@" +fi diff --git a/node_modules/.bin/js-yaml.cmd b/node_modules/.bin/js-yaml.cmd new file mode 100644 index 00000000..453312b6 --- /dev/null +++ b/node_modules/.bin/js-yaml.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\js-yaml\bin\js-yaml.js" %* diff --git a/node_modules/.bin/js-yaml.ps1 b/node_modules/.bin/js-yaml.ps1 new file mode 100644 index 00000000..2acfc61c --- /dev/null +++ b/node_modules/.bin/js-yaml.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args + } else { + & "$basedir/node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args + } else { + & "node$exe" "$basedir/../js-yaml/bin/js-yaml.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/jsesc b/node_modules/.bin/jsesc new file mode 100644 index 00000000..e7105da3 --- /dev/null +++ b/node_modules/.bin/jsesc @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../jsesc/bin/jsesc" "$@" +else + exec node "$basedir/../jsesc/bin/jsesc" "$@" +fi diff --git a/node_modules/.bin/jsesc.cmd b/node_modules/.bin/jsesc.cmd new file mode 100644 index 00000000..eb41110f --- /dev/null +++ b/node_modules/.bin/jsesc.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\jsesc\bin\jsesc" %* diff --git a/node_modules/.bin/jsesc.ps1 b/node_modules/.bin/jsesc.ps1 new file mode 100644 index 00000000..6007e022 --- /dev/null +++ b/node_modules/.bin/jsesc.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args + } else { + & "$basedir/node$exe" "$basedir/../jsesc/bin/jsesc" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../jsesc/bin/jsesc" $args + } else { + & "node$exe" "$basedir/../jsesc/bin/jsesc" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/json5 b/node_modules/.bin/json5 new file mode 100644 index 00000000..977b7507 --- /dev/null +++ b/node_modules/.bin/json5 @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../json5/lib/cli.js" "$@" +else + exec node "$basedir/../json5/lib/cli.js" "$@" +fi diff --git a/node_modules/.bin/json5.cmd b/node_modules/.bin/json5.cmd new file mode 100644 index 00000000..95c137fe --- /dev/null +++ b/node_modules/.bin/json5.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\json5\lib\cli.js" %* diff --git a/node_modules/.bin/json5.ps1 b/node_modules/.bin/json5.ps1 new file mode 100644 index 00000000..8700ddbe --- /dev/null +++ b/node_modules/.bin/json5.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../json5/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../json5/lib/cli.js" $args + } else { + & "node$exe" "$basedir/../json5/lib/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/node-which b/node_modules/.bin/node-which new file mode 100644 index 00000000..aece7353 --- /dev/null +++ b/node_modules/.bin/node-which @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../which/bin/node-which" "$@" +else + exec node "$basedir/../which/bin/node-which" "$@" +fi diff --git a/node_modules/.bin/node-which.cmd b/node_modules/.bin/node-which.cmd new file mode 100644 index 00000000..8738aed8 --- /dev/null +++ b/node_modules/.bin/node-which.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\node-which" %* diff --git a/node_modules/.bin/node-which.ps1 b/node_modules/.bin/node-which.ps1 new file mode 100644 index 00000000..cfb09e84 --- /dev/null +++ b/node_modules/.bin/node-which.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args + } else { + & "$basedir/node$exe" "$basedir/../which/bin/node-which" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../which/bin/node-which" $args + } else { + & "node$exe" "$basedir/../which/bin/node-which" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/parser b/node_modules/.bin/parser new file mode 100644 index 00000000..cb5b10d8 --- /dev/null +++ b/node_modules/.bin/parser @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../@babel/parser/bin/babel-parser.js" "$@" +else + exec node "$basedir/../@babel/parser/bin/babel-parser.js" "$@" +fi diff --git a/node_modules/.bin/parser.cmd b/node_modules/.bin/parser.cmd new file mode 100644 index 00000000..1ad5c81c --- /dev/null +++ b/node_modules/.bin/parser.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\@babel\parser\bin\babel-parser.js" %* diff --git a/node_modules/.bin/parser.ps1 b/node_modules/.bin/parser.ps1 new file mode 100644 index 00000000..8926517b --- /dev/null +++ b/node_modules/.bin/parser.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } else { + & "$basedir/node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } else { + & "node$exe" "$basedir/../@babel/parser/bin/babel-parser.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/resolve b/node_modules/.bin/resolve new file mode 100644 index 00000000..757d454a --- /dev/null +++ b/node_modules/.bin/resolve @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../resolve/bin/resolve" "$@" +else + exec node "$basedir/../resolve/bin/resolve" "$@" +fi diff --git a/node_modules/.bin/resolve.cmd b/node_modules/.bin/resolve.cmd new file mode 100644 index 00000000..1a017c40 --- /dev/null +++ b/node_modules/.bin/resolve.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\resolve\bin\resolve" %* diff --git a/node_modules/.bin/resolve.ps1 b/node_modules/.bin/resolve.ps1 new file mode 100644 index 00000000..f22b2d31 --- /dev/null +++ b/node_modules/.bin/resolve.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args + } else { + & "$basedir/node$exe" "$basedir/../resolve/bin/resolve" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../resolve/bin/resolve" $args + } else { + & "node$exe" "$basedir/../resolve/bin/resolve" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/semver b/node_modules/.bin/semver new file mode 100644 index 00000000..77443e78 --- /dev/null +++ b/node_modules/.bin/semver @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" +else + exec node "$basedir/../semver/bin/semver.js" "$@" +fi diff --git a/node_modules/.bin/semver.cmd b/node_modules/.bin/semver.cmd new file mode 100644 index 00000000..9913fa9d --- /dev/null +++ b/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/node_modules/.bin/semver.ps1 b/node_modules/.bin/semver.ps1 new file mode 100644 index 00000000..314717ad --- /dev/null +++ b/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/update-browserslist-db b/node_modules/.bin/update-browserslist-db new file mode 100644 index 00000000..8cde7e33 --- /dev/null +++ b/node_modules/.bin/update-browserslist-db @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../update-browserslist-db/cli.js" "$@" +else + exec node "$basedir/../update-browserslist-db/cli.js" "$@" +fi diff --git a/node_modules/.bin/update-browserslist-db.cmd b/node_modules/.bin/update-browserslist-db.cmd new file mode 100644 index 00000000..2e14905f --- /dev/null +++ b/node_modules/.bin/update-browserslist-db.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\update-browserslist-db\cli.js" %* diff --git a/node_modules/.bin/update-browserslist-db.ps1 b/node_modules/.bin/update-browserslist-db.ps1 new file mode 100644 index 00000000..7abdf26d --- /dev/null +++ b/node_modules/.bin/update-browserslist-db.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } else { + & "$basedir/node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } else { + & "node$exe" "$basedir/../update-browserslist-db/cli.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.bin/uuid b/node_modules/.bin/uuid index 588f70ec..c3ec0035 120000 --- a/node_modules/.bin/uuid +++ b/node_modules/.bin/uuid @@ -1 +1,12 @@ -../uuid/dist/bin/uuid \ No newline at end of file +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../uuid/dist/bin/uuid" "$@" +else + exec node "$basedir/../uuid/dist/bin/uuid" "$@" +fi diff --git a/node_modules/.bin/uuid.cmd b/node_modules/.bin/uuid.cmd new file mode 100644 index 00000000..0f2376ea --- /dev/null +++ b/node_modules/.bin/uuid.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\uuid\dist\bin\uuid" %* diff --git a/node_modules/.bin/uuid.ps1 b/node_modules/.bin/uuid.ps1 new file mode 100644 index 00000000..78046284 --- /dev/null +++ b/node_modules/.bin/uuid.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../uuid/dist/bin/uuid" $args + } else { + & "$basedir/node$exe" "$basedir/../uuid/dist/bin/uuid" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../uuid/dist/bin/uuid" $args + } else { + & "node$exe" "$basedir/../uuid/dist/bin/uuid" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 29f54eaa..1fb679c6 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -40,148 +40,3523 @@ "tunnel": "0.0.6" } }, + "node_modules/@ampproject/remapping": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", + "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.2.tgz", + "integrity": "sha512-0S9TQMmDHlqAZ2ITT95irXKfxN9bncq8ZCoJhun3nHL/lLUxd2NKBJYoNGWH7S0hz6fRQwWlAWn/ILM0C70KZQ==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz", + "integrity": "sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-module-transforms": "^7.23.0", + "@babel/helpers": "^7.23.2", + "@babel/parser": "^7.23.0", + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.2", + "@babel/types": "^7.23.0", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/generator": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", + "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", + "dev": true, + "dependencies": { + "@babel/compat-data": "^7.22.9", + "@babel/helper-validator-option": "^7.22.15", + "browserslist": "^4.21.9", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-environment-visitor": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-hoist-variables": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", + "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", + "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz", + "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", + "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.2.tgz", + "integrity": "sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==", + "dev": true, + "dependencies": { + "@babel/template": "^7.22.15", + "@babel/traverse": "^7.23.2", + "@babel/types": "^7.23.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.22.5.tgz", + "integrity": "sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.22.5.tgz", + "integrity": "sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", + "debug": "^4.1.0", + "globals": "^11.1.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@octokit/auth-token": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.4.3.tgz", "integrity": "sha512-fdGoOQ3kQJh+hrilc0Plg50xSfaCKOeYN9t6dpJKXN9BxhhfquL0OzoQXg3spLYymL5rm29uPeI3KEXRaZQ9zg==", "dependencies": { - "@octokit/types": "^5.0.0" + "@octokit/types": "^5.0.0" + } + }, + "node_modules/@octokit/core": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.2.1.tgz", + "integrity": "sha512-XfFSDDwv6tclUenS0EmB6iA7u+4aOHBT1Lz4PtQNQQg3hBbNaR/+Uv5URU+egeIuuGAiMRiDyY92G4GBOWOqDA==", + "dependencies": { + "@octokit/auth-token": "^2.4.0", + "@octokit/graphql": "^4.3.1", + "@octokit/request": "^5.4.0", + "@octokit/types": "^5.0.0", + "before-after-hook": "^2.1.0", + "universal-user-agent": "^6.0.0" + } + }, + "node_modules/@octokit/endpoint": { + "version": "6.0.9", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.9.tgz", + "integrity": "sha512-3VPLbcCuqji4IFTclNUtGdp9v7g+nspWdiCUbK3+iPMjJCZ6LEhn1ts626bWLOn0GiDb6j+uqGvPpqLnY7pBgw==", + "dependencies": { + "@octokit/types": "^5.0.0", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + } + }, + "node_modules/@octokit/graphql": { + "version": "4.5.7", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.5.7.tgz", + "integrity": "sha512-Gk0AR+DcwIK/lK/GX+OQ99UqtenQhcbrhHHfOYlrCQe17ADnX3EKAOKRsAZ9qZvpi5MuwWm/Nm+9aO2kTDSdyA==", + "dependencies": { + "@octokit/request": "^5.3.0", + "@octokit/types": "^5.0.0", + "universal-user-agent": "^6.0.0" + } + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.6.0.tgz", + "integrity": "sha512-o+O8c1PqsC5++BHXfMZabRRsBIVb34tXPWyQLyp2IXq5MmkxdipS7TXM4Y9ldL1PzY9CTrCsn/lzFFJGM3oRRA==", + "dependencies": { + "@octokit/types": "^5.5.0" + }, + "peerDependencies": { + "@octokit/core": ">=2" + } + }, + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.2.1.tgz", + "integrity": "sha512-QyFr4Bv807Pt1DXZOC5a7L5aFdrwz71UHTYoHVajYV5hsqffWm8FUl9+O7nxRu5PDMtB/IKrhFqTmdBTK5cx+A==", + "dependencies": { + "@octokit/types": "^5.5.0", + "deprecation": "^2.3.1" + } + }, + "node_modules/@octokit/request": { + "version": "5.4.10", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.10.tgz", + "integrity": "sha512-egA49HkqEORVGDZGav1mh+VD+7uLgOxtn5oODj6guJk0HCy+YBSYapFkSLFgeYj3Fr18ZULKGURkjyhkAChylw==", + "dependencies": { + "@octokit/endpoint": "^6.0.1", + "@octokit/request-error": "^2.0.0", + "@octokit/types": "^5.0.0", + "deprecation": "^2.0.0", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.1", + "once": "^1.4.0", + "universal-user-agent": "^6.0.0" + } + }, + "node_modules/@octokit/request-error": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.3.tgz", + "integrity": "sha512-GgD5z8Btm301i2zfvJLk/mkhvGCdjQ7wT8xF9ov5noQY8WbKZDH9cOBqXzoeKd1mLr1xH2FwbtGso135zGBgTA==", + "dependencies": { + "@octokit/types": "^5.0.1", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "node_modules/@octokit/types": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz", + "integrity": "sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==", + "dependencies": { + "@types/node": ">= 8" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", + "dev": true + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, + "node_modules/@types/babel__core": { + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.2.tgz", + "integrity": "sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.5", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.5.tgz", + "integrity": "sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.2.tgz", + "integrity": "sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.20.2", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.2.tgz", + "integrity": "sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.20.7" + } + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.7.tgz", + "integrity": "sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-gPQuzaPR5h/djlAv2apEG1HVOyj1IUs7GpfMZixU0/0KXT3pm64ylHuMUI1/Akh+sq/iikxg6Z2j+fcMDXaaTQ==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-kv43F9eb3Lhj+lr/Hn6OcLCs/sSM8bt+fIaP11rCYngfV6NVjzWXJ17owQtDQTL9tQ8WSLUrGsSJ6rJz0F1w1A==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/node": { + "version": "14.14.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.9.tgz", + "integrity": "sha512-JsoLXFppG62tWTklIoO4knA+oDTYsmqWxHRvd4lpmfQRNhX6osheUOWETP2jMoV/2bEHuMra8Pp3Dmo/stBFcw==" + }, + "node_modules/@types/stack-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", + "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "17.0.28", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.28.tgz", + "integrity": "sha512-N3e3fkS86hNhtk6BEnc0rj3zcehaxx8QWhCROJkqpl5Zaoi7nAic3jH8q94jVD3zu5LGk+PUB6KAiDmimYOEQw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-axdPBuLuEJt0c4yI5OZssC19K2Mq1uKdrfZBzuxLvaztgqUtFYZUNw7lETExPYJR9jdEoIg4mb7RQKRQzOkeGQ==", + "dev": true + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "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, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/before-after-hook": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", + "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001549", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001549.tgz", + "integrity": "sha512-qRp48dPYSCYaP+KurZLhDYdVE+yEyht/3NlmcJgVQ2VMGt6JL36ndQ/7rgspdZsJuxDPFIo/OzBT2+GmIJ53BA==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==", + "dev": true + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.557", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.557.tgz", + "integrity": "sha512-6x0zsxyMXpnMJnHrondrD3SuAeKcwij9S+83j2qHAQPXbGTDDfgImzzwgGlzrIcXbHQ42tkG4qA6U860cImNhw==", + "dev": true + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "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, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.1.tgz", + "integrity": "sha512-EAMEJBsYuyyztxMxW3g7ugGPkrZsV57v0Hmv3mm1uQsmB+QnZuepg731CRaIgeUVSdmsTngOkSnauNF8p7FIhA==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "dev": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", + "dev": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-snapshot/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-snapshot/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/jest-snapshot/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dev": true, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "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 + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/node-fetch": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", + "integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true + }, + "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, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-locate/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@octokit/core": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.2.1.tgz", - "integrity": "sha512-XfFSDDwv6tclUenS0EmB6iA7u+4aOHBT1Lz4PtQNQQg3hBbNaR/+Uv5URU+egeIuuGAiMRiDyY92G4GBOWOqDA==", + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, "dependencies": { - "@octokit/auth-token": "^2.4.0", - "@octokit/graphql": "^4.3.1", - "@octokit/request": "^5.4.0", - "@octokit/types": "^5.0.0", - "before-after-hook": "^2.1.0", - "universal-user-agent": "^6.0.0" + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@octokit/endpoint": { - "version": "6.0.9", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.9.tgz", - "integrity": "sha512-3VPLbcCuqji4IFTclNUtGdp9v7g+nspWdiCUbK3+iPMjJCZ6LEhn1ts626bWLOn0GiDb6j+uqGvPpqLnY7pBgw==", + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, "dependencies": { - "@octokit/types": "^5.0.0", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" } }, - "node_modules/@octokit/graphql": { - "version": "4.5.7", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.5.7.tgz", - "integrity": "sha512-Gk0AR+DcwIK/lK/GX+OQ99UqtenQhcbrhHHfOYlrCQe17ADnX3EKAOKRsAZ9qZvpi5MuwWm/Nm+9aO2kTDSdyA==", + "node_modules/pure-rand": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", + "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, + "node_modules/react-is": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "dev": true + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, "dependencies": { - "@octokit/request": "^5.3.0", - "@octokit/types": "^5.0.0", - "universal-user-agent": "^6.0.0" + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/@octokit/plugin-paginate-rest": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.6.0.tgz", - "integrity": "sha512-o+O8c1PqsC5++BHXfMZabRRsBIVb34tXPWyQLyp2IXq5MmkxdipS7TXM4Y9ldL1PzY9CTrCsn/lzFFJGM3oRRA==", + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, "dependencies": { - "@octokit/types": "^5.5.0" + "resolve-from": "^5.0.0" }, - "peerDependencies": { - "@octokit/core": ">=2" + "engines": { + "node": ">=8" } }, - "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-4.2.1.tgz", - "integrity": "sha512-QyFr4Bv807Pt1DXZOC5a7L5aFdrwz71UHTYoHVajYV5hsqffWm8FUl9+O7nxRu5PDMtB/IKrhFqTmdBTK5cx+A==", + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve.exports": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, "dependencies": { - "@octokit/types": "^5.5.0", - "deprecation": "^2.3.1" + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@octokit/request": { - "version": "5.4.10", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.4.10.tgz", - "integrity": "sha512-egA49HkqEORVGDZGav1mh+VD+7uLgOxtn5oODj6guJk0HCy+YBSYapFkSLFgeYj3Fr18ZULKGURkjyhkAChylw==", + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, "dependencies": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.0.0", - "@octokit/types": "^5.0.0", - "deprecation": "^2.0.0", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.1", - "once": "^1.4.0", - "universal-user-agent": "^6.0.0" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "node_modules/@octokit/request-error": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.0.3.tgz", - "integrity": "sha512-GgD5z8Btm301i2zfvJLk/mkhvGCdjQ7wT8xF9ov5noQY8WbKZDH9cOBqXzoeKd1mLr1xH2FwbtGso135zGBgTA==", + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, "dependencies": { - "@octokit/types": "^5.0.1", - "deprecation": "^2.0.0", - "once": "^1.4.0" + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" } }, - "node_modules/@octokit/types": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-5.5.0.tgz", - "integrity": "sha512-UZ1pErDue6bZNjYOotCNveTXArOMZQFG6hKJfOnGnulVCMcVVi7YIIuuR4WfBhjo7zgpmzn/BkPDnUXtNx+PcQ==", + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, "dependencies": { - "@types/node": ">= 8" + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" } }, - "node_modules/@types/node": { - "version": "14.14.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.9.tgz", - "integrity": "sha512-JsoLXFppG62tWTklIoO4knA+oDTYsmqWxHRvd4lpmfQRNhX6osheUOWETP2jMoV/2bEHuMra8Pp3Dmo/stBFcw==" + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } }, - "node_modules/before-after-hook": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", - "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==" + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } }, - "node_modules/deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/node-fetch": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.9.tgz", - "integrity": "sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg==", + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { - "whatwg-url": "^5.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": "4.x || >=6.0.0" + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" }, - "peerDependencies": { - "encoding": "^0.1.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "engines": { + "node": ">=8" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "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, "dependencies": { - "wrappy": "1" + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" } }, "node_modules/tr46": { @@ -197,11 +3572,62 @@ "node": ">=0.6.11 <=0.7.0 || >=0.7.3" } }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/universal-user-agent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" }, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, "node_modules/uuid": { "version": "8.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", @@ -210,6 +3636,29 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/v8-to-istanbul": { + "version": "9.1.3", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz", + "integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -224,10 +3673,109 @@ "webidl-conversions": "^3.0.0" } }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dev": true + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/node_modules/@ampproject/remapping/LICENSE b/node_modules/@ampproject/remapping/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/node_modules/@ampproject/remapping/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 at + + 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/@ampproject/remapping/README.md b/node_modules/@ampproject/remapping/README.md new file mode 100644 index 00000000..1463c9f6 --- /dev/null +++ b/node_modules/@ampproject/remapping/README.md @@ -0,0 +1,218 @@ +# @ampproject/remapping + +> Remap sequential sourcemaps through transformations to point at the original source code + +Remapping allows you to take the sourcemaps generated through transforming your code and "remap" +them to the original source locations. Think "my minified code, transformed with babel and bundled +with webpack", all pointing to the correct location in your original source code. + +With remapping, none of your source code transformations need to be aware of the input's sourcemap, +they only need to generate an output sourcemap. This greatly simplifies building custom +transformations (think a find-and-replace). + +## Installation + +```sh +npm install @ampproject/remapping +``` + +## Usage + +```typescript +function remapping( + map: SourceMap | SourceMap[], + loader: (file: string, ctx: LoaderContext) => (SourceMap | null | undefined), + options?: { excludeContent: boolean, decodedMappings: boolean } +): SourceMap; + +// LoaderContext gives the loader the importing sourcemap, tree depth, the ability to override the +// "source" location (where child sources are resolved relative to, or the location of original +// source), and the ability to override the "content" of an original source for inclusion in the +// output sourcemap. +type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; +} +``` + +`remapping` takes the final output sourcemap, and a `loader` function. For every source file pointer +in the sourcemap, the `loader` will be called with the resolved path. If the path itself represents +a transformed file (it has a sourcmap associated with it), then the `loader` should return that +sourcemap. If not, the path will be treated as an original, untransformed source code. + +```js +// Babel transformed "helloworld.js" into "transformed.js" +const transformedMap = JSON.stringify({ + file: 'transformed.js', + // 1st column of 2nd line of output file translates into the 1st source + // file, line 3, column 2 + mappings: ';CAEE', + sources: ['helloworld.js'], + version: 3, +}); + +// Uglify minified "transformed.js" into "transformed.min.js" +const minifiedTransformedMap = JSON.stringify({ + file: 'transformed.min.js', + // 0th column of 1st line of output file translates into the 1st source + // file, line 2, column 1. + mappings: 'AACC', + names: [], + sources: ['transformed.js'], + version: 3, +}); + +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + // The "transformed.js" file is an transformed file. + if (file === 'transformed.js') { + // The root importer is empty. + console.assert(ctx.importer === ''); + // The depth in the sourcemap tree we're currently loading. + // The root `minifiedTransformedMap` is depth 0, and its source children are depth 1, etc. + console.assert(ctx.depth === 1); + + return transformedMap; + } + + // Loader will be called to load transformedMap's source file pointers as well. + console.assert(file === 'helloworld.js'); + // `transformed.js`'s sourcemap points into `helloworld.js`. + console.assert(ctx.importer === 'transformed.js'); + // This is a source child of `transformed`, which is a source child of `minifiedTransformedMap`. + console.assert(ctx.depth === 2); + return null; + } +); + +console.log(remapped); +// { +// file: 'transpiled.min.js', +// mappings: 'AAEE', +// sources: ['helloworld.js'], +// version: 3, +// }; +``` + +In this example, `loader` will be called twice: + +1. `"transformed.js"`, the first source file pointer in the `minifiedTransformedMap`. We return the + associated sourcemap for it (its a transformed file, after all) so that sourcemap locations can + be traced through it into the source files it represents. +2. `"helloworld.js"`, our original, unmodified source code. This file does not have a sourcemap, so + we return `null`. + +The `remapped` sourcemap now points from `transformed.min.js` into locations in `helloworld.js`. If +you were to read the `mappings`, it says "0th column of the first line output line points to the 1st +column of the 2nd line of the file `helloworld.js`". + +### Multiple transformations of a file + +As a convenience, if you have multiple single-source transformations of a file, you may pass an +array of sourcemap files in the order of most-recent transformation sourcemap first. Note that this +changes the `importer` and `depth` of each call to our loader. So our above example could have been +written as: + +```js +const remapped = remapping( + [minifiedTransformedMap, transformedMap], + () => null +); + +console.log(remapped); +// { +// file: 'transpiled.min.js', +// mappings: 'AAEE', +// sources: ['helloworld.js'], +// version: 3, +// }; +``` + +### Advanced control of the loading graph + +#### `source` + +The `source` property can overridden to any value to change the location of the current load. Eg, +for an original source file, it allows us to change the location to the original source regardless +of what the sourcemap source entry says. And for transformed files, it allows us to change the +relative resolving location for child sources of the loaded sourcemap. + +```js +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + if (file === 'transformed.js') { + // We pretend the transformed.js file actually exists in the 'src/' directory. When the nested + // source files are loaded, they will now be relative to `src/`. + ctx.source = 'src/transformed.js'; + return transformedMap; + } + + console.assert(file === 'src/helloworld.js'); + // We could futher change the source of this original file, eg, to be inside a nested directory + // itself. This will be reflected in the remapped sourcemap. + ctx.source = 'src/nested/transformed.js'; + return null; + } +); + +console.log(remapped); +// { +// …, +// sources: ['src/nested/helloworld.js'], +// }; +``` + + +#### `content` + +The `content` property can be overridden when we encounter an original source file. Eg, this allows +you to manually provide the source content of the original file regardless of whether the +`sourcesContent` field is present in the parent sourcemap. It can also be set to `null` to remove +the source content. + +```js +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + if (file === 'transformed.js') { + // transformedMap does not include a `sourcesContent` field, so usually the remapped sourcemap + // would not include any `sourcesContent` values. + return transformedMap; + } + + console.assert(file === 'helloworld.js'); + // We can read the file to provide the source content. + ctx.content = fs.readFileSync(file, 'utf8'); + return null; + } +); + +console.log(remapped); +// { +// …, +// sourcesContent: [ +// 'console.log("Hello world!")', +// ], +// }; +``` + +### Options + +#### excludeContent + +By default, `excludeContent` is `false`. Passing `{ excludeContent: true }` will exclude the +`sourcesContent` field from the returned sourcemap. This is mainly useful when you want to reduce +the size out the sourcemap. + +#### decodedMappings + +By default, `decodedMappings` is `false`. Passing `{ decodedMappings: true }` will leave the +`mappings` field in a [decoded state](https://github.com/rich-harris/sourcemap-codec) instead of +encoding into a VLQ string. diff --git a/node_modules/@ampproject/remapping/dist/remapping.mjs b/node_modules/@ampproject/remapping/dist/remapping.mjs new file mode 100644 index 00000000..b5eddeda --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/remapping.mjs @@ -0,0 +1,191 @@ +import { decodedMappings, traceSegment, TraceMap } from '@jridgewell/trace-mapping'; +import { GenMapping, maybeAddSegment, setSourceContent, toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping'; + +const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null); +const EMPTY_SOURCES = []; +function SegmentObject(source, line, column, name, content) { + return { source, line, column, name, content }; +} +function Source(map, sources, source, content) { + return { + map, + sources, + source, + content, + }; +} +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +function MapSource(map, sources) { + return Source(map, sources, '', null); +} +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +function OriginalSource(source, content) { + return Source(null, EMPTY_SOURCES, source, content); +} +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +function traceMappings(tree) { + // TODO: Eventually support sourceRoot, which has to be removed because the sources are already + // fully resolved. We'll need to make sources relative to the sourceRoot before adding them. + const gen = new GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = decodedMappings(map); + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length !== 1) { + const source = rootSources[segment[1]]; + traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : ''); + // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a + // respective segment into an original source. + if (traced == null) + continue; + } + const { column, line, name, content, source } = traced; + maybeAddSegment(gen, i, genCol, source, line, column, name); + if (source && content != null) + setSourceContent(gen, source, content); + } + } + return gen; +} +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +function originalPositionFor(source, line, column, name) { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content); + } + const segment = traceSegment(source.map, line, column); + // If we couldn't find a segment, then this doesn't exist in the sourcemap. + if (segment == null) + return null; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length === 1) + return SOURCELESS_MAPPING; + return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name); +} + +function asArray(value) { + if (Array.isArray(value)) + return value; + return [value]; +} +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +function buildSourceMapTree(input, loader) { + const maps = asArray(input).map((m) => new TraceMap(m, '')); + const map = maps.pop(); + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error(`Transformation map ${i} must have exactly one source file.\n` + + 'Did 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 } = map; + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile, i) => { + // The loading context gives the loader more information about why this file is being loaded + // (eg, from which importer). It also allows the loader to override the location of the loaded + // sourcemap/original source, or to override the content in the sourcesContent field if it's + // an unmodified source file. + const ctx = { + importer, + depth, + source: sourceFile || '', + content: undefined, + }; + // Use the provided loader callback to retrieve the file's sourcemap. + // TODO: We should eventually support async loading of sourcemap files. + const sourceMap = loader(ctx.source, ctx); + const { source, content } = ctx; + // If there is a sourcemap, then we need to recurse into it to load its source files. + if (sourceMap) + return build(new TraceMap(sourceMap, source), loader, source, depth); + // Else, it's an an unmodified source file. + // The contents of this unmodified source file can be overridden via the loader context, + // allowing it to be explicitly null or a string. If it remains undefined, we fall back to + // the importing sourcemap's `sourcesContent` field. + const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; + return OriginalSource(source, sourceContent); + }); + return MapSource(map, children); +} + +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +class SourceMap { + constructor(map, options) { + const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map); + this.version = out.version; // SourceMap spec says this should be first. + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent; + } + } + toString() { + return JSON.stringify(this); + } +} + +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +function remapping(input, loader, options) { + const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); +} + +export { remapping as default }; +//# sourceMappingURL=remapping.mjs.map diff --git a/node_modules/@ampproject/remapping/dist/remapping.mjs.map b/node_modules/@ampproject/remapping/dist/remapping.mjs.map new file mode 100644 index 00000000..078a2b73 --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/remapping.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"remapping.mjs","sources":["../src/source-map-tree.ts","../src/build-source-map-tree.ts","../src/source-map.ts","../src/remapping.ts"],"sourcesContent":["import { GenMapping, maybeAddSegment, setSourceContent } from '@jridgewell/gen-mapping';\nimport { traceSegment, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport type { TraceMap } from '@jridgewell/trace-mapping';\n\nexport type SourceMapSegmentObject = {\n column: number;\n line: number;\n name: string;\n source: string;\n content: string | null;\n};\n\nexport type OriginalSource = {\n map: null;\n sources: Sources[];\n source: string;\n content: string | null;\n};\n\nexport type MapSource = {\n map: TraceMap;\n sources: Sources[];\n source: string;\n content: null;\n};\n\nexport type Sources = OriginalSource | MapSource;\n\nconst SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null);\nconst EMPTY_SOURCES: Sources[] = [];\n\nfunction SegmentObject(\n source: string,\n line: number,\n column: number,\n name: string,\n content: string | null\n): SourceMapSegmentObject {\n return { source, line, column, name, content };\n}\n\nfunction Source(map: TraceMap, sources: Sources[], source: '', content: null): MapSource;\nfunction Source(\n map: null,\n sources: Sources[],\n source: string,\n content: string | null\n): OriginalSource;\nfunction Source(\n map: TraceMap | null,\n sources: Sources[],\n source: string | '',\n content: string | null\n): Sources {\n return {\n map,\n sources,\n source,\n content,\n } as any;\n}\n\n/**\n * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes\n * (which may themselves be SourceMapTrees).\n */\nexport function MapSource(map: TraceMap, sources: Sources[]): MapSource {\n return Source(map, sources, '', null);\n}\n\n/**\n * A \"leaf\" node in the sourcemap tree, representing an original, unmodified source file. Recursive\n * segment tracing ends at the `OriginalSource`.\n */\nexport function OriginalSource(source: string, content: string | null): OriginalSource {\n return Source(null, EMPTY_SOURCES, source, content);\n}\n\n/**\n * traceMappings is only called on the root level SourceMapTree, and begins the process of\n * resolving each mapping in terms of the original source files.\n */\nexport function traceMappings(tree: MapSource): GenMapping {\n // TODO: Eventually support sourceRoot, which has to be removed because the sources are already\n // fully resolved. We'll need to make sources relative to the sourceRoot before adding them.\n const gen = new GenMapping({ file: tree.map.file });\n const { sources: rootSources, map } = tree;\n const rootNames = map.names;\n const rootMappings = decodedMappings(map);\n\n for (let i = 0; i < rootMappings.length; i++) {\n const segments = rootMappings[i];\n\n for (let j = 0; j < segments.length; j++) {\n const segment = segments[j];\n const genCol = segment[0];\n let traced: SourceMapSegmentObject | null = SOURCELESS_MAPPING;\n\n // 1-length segments only move the current generated column, there's no source information\n // to gather from it.\n if (segment.length !== 1) {\n const source = rootSources[segment[1]];\n traced = originalPositionFor(\n source,\n segment[2],\n segment[3],\n segment.length === 5 ? rootNames[segment[4]] : ''\n );\n\n // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a\n // respective segment into an original source.\n if (traced == null) continue;\n }\n\n const { column, line, name, content, source } = traced;\n\n maybeAddSegment(gen, i, genCol, source, line, column, name);\n if (source && content != null) setSourceContent(gen, source, content);\n }\n }\n\n return gen;\n}\n\n/**\n * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own\n * child SourceMapTrees, until we find the original source map.\n */\nexport function originalPositionFor(\n source: Sources,\n line: number,\n column: number,\n name: string\n): SourceMapSegmentObject | null {\n if (!source.map) {\n return SegmentObject(source.source, line, column, name, source.content);\n }\n\n const segment = traceSegment(source.map, line, column);\n\n // If we couldn't find a segment, then this doesn't exist in the sourcemap.\n if (segment == null) return null;\n // 1-length segments only move the current generated column, there's no source information\n // to gather from it.\n if (segment.length === 1) return SOURCELESS_MAPPING;\n\n return originalPositionFor(\n source.sources[segment[1]],\n segment[2],\n segment[3],\n segment.length === 5 ? source.map.names[segment[4]] : name\n );\n}\n","import { TraceMap } from '@jridgewell/trace-mapping';\n\nimport { OriginalSource, MapSource } from './source-map-tree';\n\nimport type { Sources, MapSource as MapSourceType } from './source-map-tree';\nimport type { SourceMapInput, SourceMapLoader, LoaderContext } from './types';\n\nfunction asArray(value: T | T[]): T[] {\n if (Array.isArray(value)) return value;\n return [value];\n}\n\n/**\n * Recursively builds a tree structure out of sourcemap files, with each node\n * being either an `OriginalSource` \"leaf\" or a `SourceMapTree` composed of\n * `OriginalSource`s and `SourceMapTree`s.\n *\n * Every sourcemap is composed of a collection of source files and mappings\n * into locations of those source files. When we generate a `SourceMapTree` for\n * the sourcemap, we attempt to load each source file's own sourcemap. If it\n * does not have an associated sourcemap, it is considered an original,\n * unmodified source file.\n */\nexport default function buildSourceMapTree(\n input: SourceMapInput | SourceMapInput[],\n loader: SourceMapLoader\n): MapSourceType {\n const maps = asArray(input).map((m) => new TraceMap(m, ''));\n const map = maps.pop()!;\n\n for (let i = 0; i < maps.length; i++) {\n if (maps[i].sources.length > 1) {\n throw new Error(\n `Transformation map ${i} must have exactly one source file.\\n` +\n 'Did you specify these with the most recent transformation maps first?'\n );\n }\n }\n\n let tree = build(map, loader, '', 0);\n for (let i = maps.length - 1; i >= 0; i--) {\n tree = MapSource(maps[i], [tree]);\n }\n return tree;\n}\n\nfunction build(\n map: TraceMap,\n loader: SourceMapLoader,\n importer: string,\n importerDepth: number\n): MapSourceType {\n const { resolvedSources, sourcesContent } = map;\n\n const depth = importerDepth + 1;\n const children = resolvedSources.map((sourceFile: string | null, i: number): Sources => {\n // The loading context gives the loader more information about why this file is being loaded\n // (eg, from which importer). It also allows the loader to override the location of the loaded\n // sourcemap/original source, or to override the content in the sourcesContent field if it's\n // an unmodified source file.\n const ctx: LoaderContext = {\n importer,\n depth,\n source: sourceFile || '',\n content: undefined,\n };\n\n // Use the provided loader callback to retrieve the file's sourcemap.\n // TODO: We should eventually support async loading of sourcemap files.\n const sourceMap = loader(ctx.source, ctx);\n\n const { source, content } = ctx;\n\n // If there is a sourcemap, then we need to recurse into it to load its source files.\n if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth);\n\n // Else, it's an an unmodified source file.\n // The contents of this unmodified source file can be overridden via the loader context,\n // allowing it to be explicitly null or a string. If it remains undefined, we fall back to\n // the importing sourcemap's `sourcesContent` field.\n const sourceContent =\n content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;\n return OriginalSource(source, sourceContent);\n });\n\n return MapSource(map, children);\n}\n","import { toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping';\n\nimport type { GenMapping } from '@jridgewell/gen-mapping';\nimport type { DecodedSourceMap, EncodedSourceMap, Options } from './types';\n\n/**\n * A SourceMap v3 compatible sourcemap, which only includes fields that were\n * provided to it.\n */\nexport default class SourceMap {\n declare file?: string | null;\n declare mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings'];\n declare sourceRoot?: string;\n declare names: string[];\n declare sources: (string | null)[];\n declare sourcesContent?: (string | null)[];\n declare version: 3;\n\n constructor(map: GenMapping, options: Options) {\n const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);\n this.version = out.version; // SourceMap spec says this should be first.\n this.file = out.file;\n this.mappings = out.mappings as SourceMap['mappings'];\n this.names = out.names as SourceMap['names'];\n\n this.sourceRoot = out.sourceRoot;\n\n this.sources = out.sources as SourceMap['sources'];\n if (!options.excludeContent) {\n this.sourcesContent = out.sourcesContent as SourceMap['sourcesContent'];\n }\n }\n\n toString(): string {\n return JSON.stringify(this);\n }\n}\n","import buildSourceMapTree from './build-source-map-tree';\nimport { traceMappings } from './source-map-tree';\nimport SourceMap from './source-map';\n\nimport type { SourceMapInput, SourceMapLoader, Options } from './types';\nexport type {\n SourceMapSegment,\n EncodedSourceMap,\n EncodedSourceMap as RawSourceMap,\n DecodedSourceMap,\n SourceMapInput,\n SourceMapLoader,\n LoaderContext,\n Options,\n} from './types';\n\n/**\n * Traces through all the mappings in the root sourcemap, through the sources\n * (and their sourcemaps), all the way back to the original source location.\n *\n * `loader` will be called every time we encounter a source file. If it returns\n * a sourcemap, we will recurse into that sourcemap to continue the trace. If\n * it returns a falsey value, that source file is treated as an original,\n * unmodified source file.\n *\n * Pass `excludeContent` to exclude any self-containing source file content\n * from the output sourcemap.\n *\n * Pass `decodedMappings` to receive a SourceMap with decoded (instead of\n * VLQ encoded) mappings.\n */\nexport default function remapping(\n input: SourceMapInput | SourceMapInput[],\n loader: SourceMapLoader,\n options?: boolean | Options\n): SourceMap {\n const opts =\n typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };\n const tree = buildSourceMapTree(input, loader);\n return new SourceMap(traceMappings(tree), opts);\n}\n"],"names":[],"mappings":";;;AA6BA,MAAM,kBAAkB,mBAAmB,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;AAC/E,MAAM,aAAa,GAAc,EAAE,CAAC;AAEpC,SAAS,aAAa,CACpB,MAAc,EACd,IAAY,EACZ,MAAc,EACd,IAAY,EACZ,OAAsB,EAAA;IAEtB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC;AASD,SAAS,MAAM,CACb,GAAoB,EACpB,OAAkB,EAClB,MAAmB,EACnB,OAAsB,EAAA;IAEtB,OAAO;QACL,GAAG;QACH,OAAO;QACP,MAAM;QACN,OAAO;KACD,CAAC;AACX,CAAC;AAED;;;AAGG;AACa,SAAA,SAAS,CAAC,GAAa,EAAE,OAAkB,EAAA;IACzD,OAAO,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC;AAED;;;AAGG;AACa,SAAA,cAAc,CAAC,MAAc,EAAE,OAAsB,EAAA;IACnE,OAAO,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACtD,CAAC;AAED;;;AAGG;AACG,SAAU,aAAa,CAAC,IAAe,EAAA;;;AAG3C,IAAA,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IACpD,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC3C,IAAA,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC;AAC5B,IAAA,MAAM,YAAY,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;AAE1C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC5C,QAAA,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;AAEjC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AACxC,YAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC5B,YAAA,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC1B,IAAI,MAAM,GAAkC,kBAAkB,CAAC;;;AAI/D,YAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;gBACxB,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACvC,gBAAA,MAAM,GAAG,mBAAmB,CAC1B,MAAM,EACN,OAAO,CAAC,CAAC,CAAC,EACV,OAAO,CAAC,CAAC,CAAC,EACV,OAAO,CAAC,MAAM,KAAK,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAClD,CAAC;;;gBAIF,IAAI,MAAM,IAAI,IAAI;oBAAE,SAAS;AAC9B,aAAA;AAED,YAAA,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;AAEvD,YAAA,eAAe,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;AAC5D,YAAA,IAAI,MAAM,IAAI,OAAO,IAAI,IAAI;AAAE,gBAAA,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AACvE,SAAA;AACF,KAAA;AAED,IAAA,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;AAGG;AACG,SAAU,mBAAmB,CACjC,MAAe,EACf,IAAY,EACZ,MAAc,EACd,IAAY,EAAA;AAEZ,IAAA,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;AACf,QAAA,OAAO,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;AACzE,KAAA;AAED,IAAA,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;;IAGvD,IAAI,OAAO,IAAI,IAAI;AAAE,QAAA,OAAO,IAAI,CAAC;;;AAGjC,IAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;AAAE,QAAA,OAAO,kBAAkB,CAAC;IAEpD,OAAO,mBAAmB,CACxB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAC1B,OAAO,CAAC,CAAC,CAAC,EACV,OAAO,CAAC,CAAC,CAAC,EACV,OAAO,CAAC,MAAM,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAC3D,CAAC;AACJ;;AClJA,SAAS,OAAO,CAAI,KAAc,EAAA;AAChC,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAAE,QAAA,OAAO,KAAK,CAAC;IACvC,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC;AAED;;;;;;;;;;AAUG;AACW,SAAU,kBAAkB,CACxC,KAAwC,EACxC,MAAuB,EAAA;IAEvB,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAC5D,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAG,CAAC;AAExB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;AAC9B,YAAA,MAAM,IAAI,KAAK,CACb,CAAA,mBAAA,EAAsB,CAAC,CAAuC,qCAAA,CAAA;AAC5D,gBAAA,uEAAuE,CAC1E,CAAC;AACH,SAAA;AACF,KAAA;AAED,IAAA,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;AACrC,IAAA,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;AACzC,QAAA,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACnC,KAAA;AACD,IAAA,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,KAAK,CACZ,GAAa,EACb,MAAuB,EACvB,QAAgB,EAChB,aAAqB,EAAA;AAErB,IAAA,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,GAAG,CAAC;AAEhD,IAAA,MAAM,KAAK,GAAG,aAAa,GAAG,CAAC,CAAC;IAChC,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,UAAyB,EAAE,CAAS,KAAa;;;;;AAKrF,QAAA,MAAM,GAAG,GAAkB;YACzB,QAAQ;YACR,KAAK;YACL,MAAM,EAAE,UAAU,IAAI,EAAE;AACxB,YAAA,OAAO,EAAE,SAAS;SACnB,CAAC;;;QAIF,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE1C,QAAA,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC;;AAGhC,QAAA,IAAI,SAAS;AAAE,YAAA,OAAO,KAAK,CAAC,IAAI,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;;;;;QAMpF,MAAM,aAAa,GACjB,OAAO,KAAK,SAAS,GAAG,OAAO,GAAG,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AAC9E,QAAA,OAAO,cAAc,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAC/C,KAAC,CAAC,CAAC;AAEH,IAAA,OAAO,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;AAClC;;ACjFA;;;AAGG;AACW,MAAO,SAAS,CAAA;IAS5B,WAAY,CAAA,GAAe,EAAE,OAAgB,EAAA;AAC3C,QAAA,MAAM,GAAG,GAAG,OAAO,CAAC,eAAe,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAC5E,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;AAC3B,QAAA,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;AACrB,QAAA,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAiC,CAAC;AACtD,QAAA,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAA2B,CAAC;AAE7C,QAAA,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;AAEjC,QAAA,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAA+B,CAAC;AACnD,QAAA,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;AAC3B,YAAA,IAAI,CAAC,cAAc,GAAG,GAAG,CAAC,cAA6C,CAAC;AACzE,SAAA;KACF;IAED,QAAQ,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;KAC7B;AACF;;ACpBD;;;;;;;;;;;;;;AAcG;AACqB,SAAA,SAAS,CAC/B,KAAwC,EACxC,MAAuB,EACvB,OAA2B,EAAA;IAE3B,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;IAChG,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC/C,OAAO,IAAI,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;AAClD;;;;"} \ No newline at end of file diff --git a/node_modules/@ampproject/remapping/dist/remapping.umd.js b/node_modules/@ampproject/remapping/dist/remapping.umd.js new file mode 100644 index 00000000..e292d4c3 --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/remapping.umd.js @@ -0,0 +1,196 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@jridgewell/trace-mapping'), require('@jridgewell/gen-mapping')) : + typeof define === 'function' && define.amd ? define(['@jridgewell/trace-mapping', '@jridgewell/gen-mapping'], factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.remapping = factory(global.traceMapping, global.genMapping)); +})(this, (function (traceMapping, genMapping) { 'use strict'; + + const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null); + const EMPTY_SOURCES = []; + function SegmentObject(source, line, column, name, content) { + return { source, line, column, name, content }; + } + function Source(map, sources, source, content) { + return { + map, + sources, + source, + content, + }; + } + /** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ + function MapSource(map, sources) { + return Source(map, sources, '', null); + } + /** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ + function OriginalSource(source, content) { + return Source(null, EMPTY_SOURCES, source, content); + } + /** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ + function traceMappings(tree) { + // TODO: Eventually support sourceRoot, which has to be removed because the sources are already + // fully resolved. We'll need to make sources relative to the sourceRoot before adding them. + const gen = new genMapping.GenMapping({ file: tree.map.file }); + const { sources: rootSources, map } = tree; + const rootNames = map.names; + const rootMappings = traceMapping.decodedMappings(map); + for (let i = 0; i < rootMappings.length; i++) { + const segments = rootMappings[i]; + for (let j = 0; j < segments.length; j++) { + const segment = segments[j]; + const genCol = segment[0]; + let traced = SOURCELESS_MAPPING; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length !== 1) { + const source = rootSources[segment[1]]; + traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : ''); + // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a + // respective segment into an original source. + if (traced == null) + continue; + } + const { column, line, name, content, source } = traced; + genMapping.maybeAddSegment(gen, i, genCol, source, line, column, name); + if (source && content != null) + genMapping.setSourceContent(gen, source, content); + } + } + return gen; + } + /** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ + function originalPositionFor(source, line, column, name) { + if (!source.map) { + return SegmentObject(source.source, line, column, name, source.content); + } + const segment = traceMapping.traceSegment(source.map, line, column); + // If we couldn't find a segment, then this doesn't exist in the sourcemap. + if (segment == null) + return null; + // 1-length segments only move the current generated column, there's no source information + // to gather from it. + if (segment.length === 1) + return SOURCELESS_MAPPING; + return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name); + } + + function asArray(value) { + if (Array.isArray(value)) + return value; + return [value]; + } + /** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ + function buildSourceMapTree(input, loader) { + const maps = asArray(input).map((m) => new traceMapping.TraceMap(m, '')); + const map = maps.pop(); + for (let i = 0; i < maps.length; i++) { + if (maps[i].sources.length > 1) { + throw new Error(`Transformation map ${i} must have exactly one source file.\n` + + 'Did 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 } = map; + const depth = importerDepth + 1; + const children = resolvedSources.map((sourceFile, i) => { + // The loading context gives the loader more information about why this file is being loaded + // (eg, from which importer). It also allows the loader to override the location of the loaded + // sourcemap/original source, or to override the content in the sourcesContent field if it's + // an unmodified source file. + const ctx = { + importer, + depth, + source: sourceFile || '', + content: undefined, + }; + // Use the provided loader callback to retrieve the file's sourcemap. + // TODO: We should eventually support async loading of sourcemap files. + const sourceMap = loader(ctx.source, ctx); + const { source, content } = ctx; + // If there is a sourcemap, then we need to recurse into it to load its source files. + if (sourceMap) + return build(new traceMapping.TraceMap(sourceMap, source), loader, source, depth); + // Else, it's an an unmodified source file. + // The contents of this unmodified source file can be overridden via the loader context, + // allowing it to be explicitly null or a string. If it remains undefined, we fall back to + // the importing sourcemap's `sourcesContent` field. + const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null; + return OriginalSource(source, sourceContent); + }); + return MapSource(map, children); + } + + /** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ + class SourceMap { + constructor(map, options) { + const out = options.decodedMappings ? genMapping.toDecodedMap(map) : genMapping.toEncodedMap(map); + this.version = out.version; // SourceMap spec says this should be first. + this.file = out.file; + this.mappings = out.mappings; + this.names = out.names; + this.sourceRoot = out.sourceRoot; + this.sources = out.sources; + if (!options.excludeContent) { + this.sourcesContent = out.sourcesContent; + } + } + toString() { + return JSON.stringify(this); + } + } + + /** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ + function remapping(input, loader, options) { + const opts = typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false }; + const tree = buildSourceMapTree(input, loader); + return new SourceMap(traceMappings(tree), opts); + } + + return remapping; + +})); +//# sourceMappingURL=remapping.umd.js.map diff --git a/node_modules/@ampproject/remapping/dist/remapping.umd.js.map b/node_modules/@ampproject/remapping/dist/remapping.umd.js.map new file mode 100644 index 00000000..9c898880 --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/remapping.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"remapping.umd.js","sources":["../src/source-map-tree.ts","../src/build-source-map-tree.ts","../src/source-map.ts","../src/remapping.ts"],"sourcesContent":["import { GenMapping, maybeAddSegment, setSourceContent } from '@jridgewell/gen-mapping';\nimport { traceSegment, decodedMappings } from '@jridgewell/trace-mapping';\n\nimport type { TraceMap } from '@jridgewell/trace-mapping';\n\nexport type SourceMapSegmentObject = {\n column: number;\n line: number;\n name: string;\n source: string;\n content: string | null;\n};\n\nexport type OriginalSource = {\n map: null;\n sources: Sources[];\n source: string;\n content: string | null;\n};\n\nexport type MapSource = {\n map: TraceMap;\n sources: Sources[];\n source: string;\n content: null;\n};\n\nexport type Sources = OriginalSource | MapSource;\n\nconst SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null);\nconst EMPTY_SOURCES: Sources[] = [];\n\nfunction SegmentObject(\n source: string,\n line: number,\n column: number,\n name: string,\n content: string | null\n): SourceMapSegmentObject {\n return { source, line, column, name, content };\n}\n\nfunction Source(map: TraceMap, sources: Sources[], source: '', content: null): MapSource;\nfunction Source(\n map: null,\n sources: Sources[],\n source: string,\n content: string | null\n): OriginalSource;\nfunction Source(\n map: TraceMap | null,\n sources: Sources[],\n source: string | '',\n content: string | null\n): Sources {\n return {\n map,\n sources,\n source,\n content,\n } as any;\n}\n\n/**\n * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes\n * (which may themselves be SourceMapTrees).\n */\nexport function MapSource(map: TraceMap, sources: Sources[]): MapSource {\n return Source(map, sources, '', null);\n}\n\n/**\n * A \"leaf\" node in the sourcemap tree, representing an original, unmodified source file. Recursive\n * segment tracing ends at the `OriginalSource`.\n */\nexport function OriginalSource(source: string, content: string | null): OriginalSource {\n return Source(null, EMPTY_SOURCES, source, content);\n}\n\n/**\n * traceMappings is only called on the root level SourceMapTree, and begins the process of\n * resolving each mapping in terms of the original source files.\n */\nexport function traceMappings(tree: MapSource): GenMapping {\n // TODO: Eventually support sourceRoot, which has to be removed because the sources are already\n // fully resolved. We'll need to make sources relative to the sourceRoot before adding them.\n const gen = new GenMapping({ file: tree.map.file });\n const { sources: rootSources, map } = tree;\n const rootNames = map.names;\n const rootMappings = decodedMappings(map);\n\n for (let i = 0; i < rootMappings.length; i++) {\n const segments = rootMappings[i];\n\n for (let j = 0; j < segments.length; j++) {\n const segment = segments[j];\n const genCol = segment[0];\n let traced: SourceMapSegmentObject | null = SOURCELESS_MAPPING;\n\n // 1-length segments only move the current generated column, there's no source information\n // to gather from it.\n if (segment.length !== 1) {\n const source = rootSources[segment[1]];\n traced = originalPositionFor(\n source,\n segment[2],\n segment[3],\n segment.length === 5 ? rootNames[segment[4]] : ''\n );\n\n // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a\n // respective segment into an original source.\n if (traced == null) continue;\n }\n\n const { column, line, name, content, source } = traced;\n\n maybeAddSegment(gen, i, genCol, source, line, column, name);\n if (source && content != null) setSourceContent(gen, source, content);\n }\n }\n\n return gen;\n}\n\n/**\n * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own\n * child SourceMapTrees, until we find the original source map.\n */\nexport function originalPositionFor(\n source: Sources,\n line: number,\n column: number,\n name: string\n): SourceMapSegmentObject | null {\n if (!source.map) {\n return SegmentObject(source.source, line, column, name, source.content);\n }\n\n const segment = traceSegment(source.map, line, column);\n\n // If we couldn't find a segment, then this doesn't exist in the sourcemap.\n if (segment == null) return null;\n // 1-length segments only move the current generated column, there's no source information\n // to gather from it.\n if (segment.length === 1) return SOURCELESS_MAPPING;\n\n return originalPositionFor(\n source.sources[segment[1]],\n segment[2],\n segment[3],\n segment.length === 5 ? source.map.names[segment[4]] : name\n );\n}\n","import { TraceMap } from '@jridgewell/trace-mapping';\n\nimport { OriginalSource, MapSource } from './source-map-tree';\n\nimport type { Sources, MapSource as MapSourceType } from './source-map-tree';\nimport type { SourceMapInput, SourceMapLoader, LoaderContext } from './types';\n\nfunction asArray(value: T | T[]): T[] {\n if (Array.isArray(value)) return value;\n return [value];\n}\n\n/**\n * Recursively builds a tree structure out of sourcemap files, with each node\n * being either an `OriginalSource` \"leaf\" or a `SourceMapTree` composed of\n * `OriginalSource`s and `SourceMapTree`s.\n *\n * Every sourcemap is composed of a collection of source files and mappings\n * into locations of those source files. When we generate a `SourceMapTree` for\n * the sourcemap, we attempt to load each source file's own sourcemap. If it\n * does not have an associated sourcemap, it is considered an original,\n * unmodified source file.\n */\nexport default function buildSourceMapTree(\n input: SourceMapInput | SourceMapInput[],\n loader: SourceMapLoader\n): MapSourceType {\n const maps = asArray(input).map((m) => new TraceMap(m, ''));\n const map = maps.pop()!;\n\n for (let i = 0; i < maps.length; i++) {\n if (maps[i].sources.length > 1) {\n throw new Error(\n `Transformation map ${i} must have exactly one source file.\\n` +\n 'Did you specify these with the most recent transformation maps first?'\n );\n }\n }\n\n let tree = build(map, loader, '', 0);\n for (let i = maps.length - 1; i >= 0; i--) {\n tree = MapSource(maps[i], [tree]);\n }\n return tree;\n}\n\nfunction build(\n map: TraceMap,\n loader: SourceMapLoader,\n importer: string,\n importerDepth: number\n): MapSourceType {\n const { resolvedSources, sourcesContent } = map;\n\n const depth = importerDepth + 1;\n const children = resolvedSources.map((sourceFile: string | null, i: number): Sources => {\n // The loading context gives the loader more information about why this file is being loaded\n // (eg, from which importer). It also allows the loader to override the location of the loaded\n // sourcemap/original source, or to override the content in the sourcesContent field if it's\n // an unmodified source file.\n const ctx: LoaderContext = {\n importer,\n depth,\n source: sourceFile || '',\n content: undefined,\n };\n\n // Use the provided loader callback to retrieve the file's sourcemap.\n // TODO: We should eventually support async loading of sourcemap files.\n const sourceMap = loader(ctx.source, ctx);\n\n const { source, content } = ctx;\n\n // If there is a sourcemap, then we need to recurse into it to load its source files.\n if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth);\n\n // Else, it's an an unmodified source file.\n // The contents of this unmodified source file can be overridden via the loader context,\n // allowing it to be explicitly null or a string. If it remains undefined, we fall back to\n // the importing sourcemap's `sourcesContent` field.\n const sourceContent =\n content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;\n return OriginalSource(source, sourceContent);\n });\n\n return MapSource(map, children);\n}\n","import { toDecodedMap, toEncodedMap } from '@jridgewell/gen-mapping';\n\nimport type { GenMapping } from '@jridgewell/gen-mapping';\nimport type { DecodedSourceMap, EncodedSourceMap, Options } from './types';\n\n/**\n * A SourceMap v3 compatible sourcemap, which only includes fields that were\n * provided to it.\n */\nexport default class SourceMap {\n declare file?: string | null;\n declare mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings'];\n declare sourceRoot?: string;\n declare names: string[];\n declare sources: (string | null)[];\n declare sourcesContent?: (string | null)[];\n declare version: 3;\n\n constructor(map: GenMapping, options: Options) {\n const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);\n this.version = out.version; // SourceMap spec says this should be first.\n this.file = out.file;\n this.mappings = out.mappings as SourceMap['mappings'];\n this.names = out.names as SourceMap['names'];\n\n this.sourceRoot = out.sourceRoot;\n\n this.sources = out.sources as SourceMap['sources'];\n if (!options.excludeContent) {\n this.sourcesContent = out.sourcesContent as SourceMap['sourcesContent'];\n }\n }\n\n toString(): string {\n return JSON.stringify(this);\n }\n}\n","import buildSourceMapTree from './build-source-map-tree';\nimport { traceMappings } from './source-map-tree';\nimport SourceMap from './source-map';\n\nimport type { SourceMapInput, SourceMapLoader, Options } from './types';\nexport type {\n SourceMapSegment,\n EncodedSourceMap,\n EncodedSourceMap as RawSourceMap,\n DecodedSourceMap,\n SourceMapInput,\n SourceMapLoader,\n LoaderContext,\n Options,\n} from './types';\n\n/**\n * Traces through all the mappings in the root sourcemap, through the sources\n * (and their sourcemaps), all the way back to the original source location.\n *\n * `loader` will be called every time we encounter a source file. If it returns\n * a sourcemap, we will recurse into that sourcemap to continue the trace. If\n * it returns a falsey value, that source file is treated as an original,\n * unmodified source file.\n *\n * Pass `excludeContent` to exclude any self-containing source file content\n * from the output sourcemap.\n *\n * Pass `decodedMappings` to receive a SourceMap with decoded (instead of\n * VLQ encoded) mappings.\n */\nexport default function remapping(\n input: SourceMapInput | SourceMapInput[],\n loader: SourceMapLoader,\n options?: boolean | Options\n): SourceMap {\n const opts =\n typeof options === 'object' ? options : { excludeContent: !!options, decodedMappings: false };\n const tree = buildSourceMapTree(input, loader);\n return new SourceMap(traceMappings(tree), opts);\n}\n"],"names":["GenMapping","decodedMappings","maybeAddSegment","setSourceContent","traceSegment","TraceMap","toDecodedMap","toEncodedMap"],"mappings":";;;;;;IA6BA,MAAM,kBAAkB,mBAAmB,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IAC/E,MAAM,aAAa,GAAc,EAAE,CAAC;IAEpC,SAAS,aAAa,CACpB,MAAc,EACd,IAAY,EACZ,MAAc,EACd,IAAY,EACZ,OAAsB,EAAA;QAEtB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IACjD,CAAC;IASD,SAAS,MAAM,CACb,GAAoB,EACpB,OAAkB,EAClB,MAAmB,EACnB,OAAsB,EAAA;QAEtB,OAAO;YACL,GAAG;YACH,OAAO;YACP,MAAM;YACN,OAAO;SACD,CAAC;IACX,CAAC;IAED;;;IAGG;IACa,SAAA,SAAS,CAAC,GAAa,EAAE,OAAkB,EAAA;QACzD,OAAO,MAAM,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IACxC,CAAC;IAED;;;IAGG;IACa,SAAA,cAAc,CAAC,MAAc,EAAE,OAAsB,EAAA;QACnE,OAAO,MAAM,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED;;;IAGG;IACG,SAAU,aAAa,CAAC,IAAe,EAAA;;;IAG3C,IAAA,MAAM,GAAG,GAAG,IAAIA,qBAAU,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACpD,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC3C,IAAA,MAAM,SAAS,GAAG,GAAG,CAAC,KAAK,CAAC;IAC5B,IAAA,MAAM,YAAY,GAAGC,4BAAe,CAAC,GAAG,CAAC,CAAC;IAE1C,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IAC5C,QAAA,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IAEjC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACxC,YAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5B,YAAA,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;gBAC1B,IAAI,MAAM,GAAkC,kBAAkB,CAAC;;;IAI/D,YAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;oBACxB,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IACvC,gBAAA,MAAM,GAAG,mBAAmB,CAC1B,MAAM,EACN,OAAO,CAAC,CAAC,CAAC,EACV,OAAO,CAAC,CAAC,CAAC,EACV,OAAO,CAAC,MAAM,KAAK,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAClD,CAAC;;;oBAIF,IAAI,MAAM,IAAI,IAAI;wBAAE,SAAS;IAC9B,aAAA;IAED,YAAA,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAEvD,YAAAC,0BAAe,CAAC,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAC5D,YAAA,IAAI,MAAM,IAAI,OAAO,IAAI,IAAI;IAAE,gBAAAC,2BAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACvE,SAAA;IACF,KAAA;IAED,IAAA,OAAO,GAAG,CAAC;IACb,CAAC;IAED;;;IAGG;IACG,SAAU,mBAAmB,CACjC,MAAe,EACf,IAAY,EACZ,MAAc,EACd,IAAY,EAAA;IAEZ,IAAA,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE;IACf,QAAA,OAAO,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACzE,KAAA;IAED,IAAA,MAAM,OAAO,GAAGC,yBAAY,CAAC,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;;QAGvD,IAAI,OAAO,IAAI,IAAI;IAAE,QAAA,OAAO,IAAI,CAAC;;;IAGjC,IAAA,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;IAAE,QAAA,OAAO,kBAAkB,CAAC;QAEpD,OAAO,mBAAmB,CACxB,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAC1B,OAAO,CAAC,CAAC,CAAC,EACV,OAAO,CAAC,CAAC,CAAC,EACV,OAAO,CAAC,MAAM,KAAK,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAC3D,CAAC;IACJ;;IClJA,SAAS,OAAO,CAAI,KAAc,EAAA;IAChC,IAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IAAE,QAAA,OAAO,KAAK,CAAC;QACvC,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED;;;;;;;;;;IAUG;IACW,SAAU,kBAAkB,CACxC,KAAwC,EACxC,MAAuB,EAAA;QAEvB,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,IAAIC,qBAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IAC5D,IAAA,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAG,CAAC;IAExB,IAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;IAC9B,YAAA,MAAM,IAAI,KAAK,CACb,CAAA,mBAAA,EAAsB,CAAC,CAAuC,qCAAA,CAAA;IAC5D,gBAAA,uEAAuE,CAC1E,CAAC;IACH,SAAA;IACF,KAAA;IAED,IAAA,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IACrC,IAAA,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE;IACzC,QAAA,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACnC,KAAA;IACD,IAAA,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,KAAK,CACZ,GAAa,EACb,MAAuB,EACvB,QAAgB,EAChB,aAAqB,EAAA;IAErB,IAAA,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,GAAG,CAAC;IAEhD,IAAA,MAAM,KAAK,GAAG,aAAa,GAAG,CAAC,CAAC;QAChC,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,UAAyB,EAAE,CAAS,KAAa;;;;;IAKrF,QAAA,MAAM,GAAG,GAAkB;gBACzB,QAAQ;gBACR,KAAK;gBACL,MAAM,EAAE,UAAU,IAAI,EAAE;IACxB,YAAA,OAAO,EAAE,SAAS;aACnB,CAAC;;;YAIF,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE1C,QAAA,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC;;IAGhC,QAAA,IAAI,SAAS;IAAE,YAAA,OAAO,KAAK,CAAC,IAAIA,qBAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;;;;;YAMpF,MAAM,aAAa,GACjB,OAAO,KAAK,SAAS,GAAG,OAAO,GAAG,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC9E,QAAA,OAAO,cAAc,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IAC/C,KAAC,CAAC,CAAC;IAEH,IAAA,OAAO,SAAS,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAClC;;ICjFA;;;IAGG;IACW,MAAO,SAAS,CAAA;QAS5B,WAAY,CAAA,GAAe,EAAE,OAAgB,EAAA;IAC3C,QAAA,MAAM,GAAG,GAAG,OAAO,CAAC,eAAe,GAAGC,uBAAY,CAAC,GAAG,CAAC,GAAGC,uBAAY,CAAC,GAAG,CAAC,CAAC;YAC5E,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;IAC3B,QAAA,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACrB,QAAA,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAiC,CAAC;IACtD,QAAA,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAA2B,CAAC;IAE7C,QAAA,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IAEjC,QAAA,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAA+B,CAAC;IACnD,QAAA,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;IAC3B,YAAA,IAAI,CAAC,cAAc,GAAG,GAAG,CAAC,cAA6C,CAAC;IACzE,SAAA;SACF;QAED,QAAQ,GAAA;IACN,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;SAC7B;IACF;;ICpBD;;;;;;;;;;;;;;IAcG;IACqB,SAAA,SAAS,CAC/B,KAAwC,EACxC,MAAuB,EACvB,OAA2B,EAAA;QAE3B,MAAM,IAAI,GACR,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,CAAC;QAChG,MAAM,IAAI,GAAG,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QAC/C,OAAO,IAAI,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAClD;;;;;;;;"} \ No newline at end of file diff --git a/node_modules/@ampproject/remapping/dist/types/build-source-map-tree.d.ts b/node_modules/@ampproject/remapping/dist/types/build-source-map-tree.d.ts new file mode 100644 index 00000000..f87fceab --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/types/build-source-map-tree.d.ts @@ -0,0 +1,14 @@ +import type { MapSource as MapSourceType } from './source-map-tree'; +import type { SourceMapInput, SourceMapLoader } from './types'; +/** + * Recursively builds a tree structure out of sourcemap files, with each node + * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of + * `OriginalSource`s and `SourceMapTree`s. + * + * Every sourcemap is composed of a collection of source files and mappings + * into locations of those source files. When we generate a `SourceMapTree` for + * the sourcemap, we attempt to load each source file's own sourcemap. If it + * does not have an associated sourcemap, it is considered an original, + * unmodified source file. + */ +export default function buildSourceMapTree(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader): MapSourceType; diff --git a/node_modules/@ampproject/remapping/dist/types/remapping.d.ts b/node_modules/@ampproject/remapping/dist/types/remapping.d.ts new file mode 100644 index 00000000..0b58ea9a --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/types/remapping.d.ts @@ -0,0 +1,19 @@ +import SourceMap from './source-map'; +import type { SourceMapInput, SourceMapLoader, Options } from './types'; +export type { SourceMapSegment, EncodedSourceMap, EncodedSourceMap as RawSourceMap, DecodedSourceMap, SourceMapInput, SourceMapLoader, LoaderContext, Options, } from './types'; +/** + * Traces through all the mappings in the root sourcemap, through the sources + * (and their sourcemaps), all the way back to the original source location. + * + * `loader` will be called every time we encounter a source file. If it returns + * a sourcemap, we will recurse into that sourcemap to continue the trace. If + * it returns a falsey value, that source file is treated as an original, + * unmodified source file. + * + * Pass `excludeContent` to exclude any self-containing source file content + * from the output sourcemap. + * + * Pass `decodedMappings` to receive a SourceMap with decoded (instead of + * VLQ encoded) mappings. + */ +export default function remapping(input: SourceMapInput | SourceMapInput[], loader: SourceMapLoader, options?: boolean | Options): SourceMap; diff --git a/node_modules/@ampproject/remapping/dist/types/source-map-tree.d.ts b/node_modules/@ampproject/remapping/dist/types/source-map-tree.d.ts new file mode 100644 index 00000000..3a9f7af6 --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/types/source-map-tree.d.ts @@ -0,0 +1,42 @@ +import { GenMapping } from '@jridgewell/gen-mapping'; +import type { TraceMap } from '@jridgewell/trace-mapping'; +export declare type SourceMapSegmentObject = { + column: number; + line: number; + name: string; + source: string; + content: string | null; +}; +export declare type OriginalSource = { + map: null; + sources: Sources[]; + source: string; + content: string | null; +}; +export declare type MapSource = { + map: TraceMap; + sources: Sources[]; + source: string; + content: null; +}; +export declare type Sources = OriginalSource | MapSource; +/** + * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes + * (which may themselves be SourceMapTrees). + */ +export declare function MapSource(map: TraceMap, sources: Sources[]): MapSource; +/** + * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive + * segment tracing ends at the `OriginalSource`. + */ +export declare function OriginalSource(source: string, content: string | null): OriginalSource; +/** + * traceMappings is only called on the root level SourceMapTree, and begins the process of + * resolving each mapping in terms of the original source files. + */ +export declare function traceMappings(tree: MapSource): GenMapping; +/** + * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own + * child SourceMapTrees, until we find the original source map. + */ +export declare function originalPositionFor(source: Sources, line: number, column: number, name: string): SourceMapSegmentObject | null; diff --git a/node_modules/@ampproject/remapping/dist/types/source-map.d.ts b/node_modules/@ampproject/remapping/dist/types/source-map.d.ts new file mode 100644 index 00000000..ef999b75 --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/types/source-map.d.ts @@ -0,0 +1,17 @@ +import type { GenMapping } from '@jridgewell/gen-mapping'; +import type { DecodedSourceMap, EncodedSourceMap, Options } from './types'; +/** + * A SourceMap v3 compatible sourcemap, which only includes fields that were + * provided to it. + */ +export default class SourceMap { + file?: string | null; + mappings: EncodedSourceMap['mappings'] | DecodedSourceMap['mappings']; + sourceRoot?: string; + names: string[]; + sources: (string | null)[]; + sourcesContent?: (string | null)[]; + version: 3; + constructor(map: GenMapping, options: Options); + toString(): string; +} diff --git a/node_modules/@ampproject/remapping/dist/types/types.d.ts b/node_modules/@ampproject/remapping/dist/types/types.d.ts new file mode 100644 index 00000000..730a9637 --- /dev/null +++ b/node_modules/@ampproject/remapping/dist/types/types.d.ts @@ -0,0 +1,14 @@ +import type { SourceMapInput } from '@jridgewell/trace-mapping'; +export type { SourceMapSegment, DecodedSourceMap, EncodedSourceMap, } from '@jridgewell/trace-mapping'; +export type { SourceMapInput }; +export declare type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; +}; +export declare type SourceMapLoader = (file: string, ctx: LoaderContext) => SourceMapInput | null | undefined | void; +export declare type Options = { + excludeContent?: boolean; + decodedMappings?: boolean; +}; diff --git a/node_modules/@ampproject/remapping/package.json b/node_modules/@ampproject/remapping/package.json new file mode 100644 index 00000000..bf3dad29 --- /dev/null +++ b/node_modules/@ampproject/remapping/package.json @@ -0,0 +1,75 @@ +{ + "name": "@ampproject/remapping", + "version": "2.2.1", + "description": "Remap sequential sourcemaps through transformations to point at the original source code", + "keywords": [ + "source", + "map", + "remap" + ], + "main": "dist/remapping.umd.js", + "module": "dist/remapping.mjs", + "types": "dist/types/remapping.d.ts", + "exports": { + ".": [ + { + "types": "./dist/types/remapping.d.ts", + "browser": "./dist/remapping.umd.js", + "require": "./dist/remapping.umd.js", + "import": "./dist/remapping.mjs" + }, + "./dist/remapping.umd.js" + ], + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "author": "Justin Ridgewell ", + "repository": { + "type": "git", + "url": "git+https://github.com/ampproject/remapping.git" + }, + "license": "Apache-2.0", + "engines": { + "node": ">=6.0.0" + }, + "scripts": { + "build": "run-s -n build:*", + "build:rollup": "rollup -c rollup.config.js", + "build:ts": "tsc --project tsconfig.build.json", + "lint": "run-s -n lint:*", + "lint:prettier": "npm run test:lint:prettier -- --write", + "lint:ts": "npm run test:lint:ts -- --fix", + "prebuild": "rm -rf dist", + "prepublishOnly": "npm run preversion", + "preversion": "run-s test build", + "test": "run-s -n test:lint test:only", + "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand", + "test:lint": "run-s -n test:lint:*", + "test:lint:prettier": "prettier --check '{src,test}/**/*.ts'", + "test:lint:ts": "eslint '{src,test}/**/*.ts'", + "test:only": "jest --coverage", + "test:watch": "jest --coverage --watch" + }, + "devDependencies": { + "@rollup/plugin-typescript": "8.3.2", + "@types/jest": "27.4.1", + "@typescript-eslint/eslint-plugin": "5.20.0", + "@typescript-eslint/parser": "5.20.0", + "eslint": "8.14.0", + "eslint-config-prettier": "8.5.0", + "jest": "27.5.1", + "jest-config": "27.5.1", + "npm-run-all": "4.1.5", + "prettier": "2.6.2", + "rollup": "2.70.2", + "ts-jest": "27.1.4", + "tslib": "2.4.0", + "typescript": "4.6.3" + }, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } +} diff --git a/node_modules/@babel/code-frame/LICENSE b/node_modules/@babel/code-frame/LICENSE new file mode 100644 index 00000000..f31575ec --- /dev/null +++ b/node_modules/@babel/code-frame/LICENSE @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2014-present Sebastian McKenzie and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/@babel/code-frame/README.md b/node_modules/@babel/code-frame/README.md new file mode 100644 index 00000000..71607551 --- /dev/null +++ b/node_modules/@babel/code-frame/README.md @@ -0,0 +1,19 @@ +# @babel/code-frame + +> Generate errors that contain a code frame that point to source locations. + +See our website [@babel/code-frame](https://babeljs.io/docs/babel-code-frame) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/code-frame +``` + +or using yarn: + +```sh +yarn add @babel/code-frame --dev +``` diff --git a/node_modules/@babel/code-frame/lib/index.js b/node_modules/@babel/code-frame/lib/index.js new file mode 100644 index 00000000..74495b0d --- /dev/null +++ b/node_modules/@babel/code-frame/lib/index.js @@ -0,0 +1,157 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.codeFrameColumns = codeFrameColumns; +exports.default = _default; +var _highlight = require("@babel/highlight"); +var _chalk = _interopRequireWildcard(require("chalk"), true); +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } +let chalkWithForcedColor = undefined; +function getChalk(forceColor) { + if (forceColor) { + var _chalkWithForcedColor; + (_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new _chalk.default.constructor({ + enabled: true, + level: 1 + }); + return chalkWithForcedColor; + } + return _chalk.default; +} +let deprecationWarningShown = false; +function getDefs(chalk) { + return { + gutter: chalk.grey, + marker: chalk.red.bold, + message: chalk.red.bold + }; +} +const NEWLINE = /\r\n|[\n\r\u2028\u2029]/; +function getMarkerLines(loc, source, opts) { + const startLoc = Object.assign({ + column: 0, + line: -1 + }, loc.start); + const endLoc = Object.assign({}, startLoc, loc.end); + const { + linesAbove = 2, + linesBelow = 3 + } = opts || {}; + const startLine = startLoc.line; + const startColumn = startLoc.column; + const endLine = endLoc.line; + const endColumn = endLoc.column; + let start = Math.max(startLine - (linesAbove + 1), 0); + let end = Math.min(source.length, endLine + linesBelow); + if (startLine === -1) { + start = 0; + } + if (endLine === -1) { + end = source.length; + } + const lineDiff = endLine - startLine; + const markerLines = {}; + if (lineDiff) { + for (let i = 0; i <= lineDiff; i++) { + const lineNumber = i + startLine; + if (!startColumn) { + markerLines[lineNumber] = true; + } else if (i === 0) { + const sourceLength = source[lineNumber - 1].length; + markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1]; + } else if (i === lineDiff) { + markerLines[lineNumber] = [0, endColumn]; + } else { + const sourceLength = source[lineNumber - i].length; + markerLines[lineNumber] = [0, sourceLength]; + } + } + } else { + if (startColumn === endColumn) { + if (startColumn) { + markerLines[startLine] = [startColumn, 0]; + } else { + markerLines[startLine] = true; + } + } else { + markerLines[startLine] = [startColumn, endColumn - startColumn]; + } + } + return { + start, + end, + markerLines + }; +} +function codeFrameColumns(rawLines, loc, opts = {}) { + const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts); + const chalk = getChalk(opts.forceColor); + const defs = getDefs(chalk); + const maybeHighlight = (chalkFn, string) => { + return highlighted ? chalkFn(string) : string; + }; + const lines = rawLines.split(NEWLINE); + const { + start, + end, + markerLines + } = getMarkerLines(loc, lines, opts); + const hasColumns = loc.start && typeof loc.start.column === "number"; + const numberMaxWidth = String(end).length; + const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines; + let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => { + const number = start + 1 + index; + const paddedNumber = ` ${number}`.slice(-numberMaxWidth); + const gutter = ` ${paddedNumber} |`; + const hasMarker = markerLines[number]; + const lastMarkerLine = !markerLines[number + 1]; + if (hasMarker) { + let markerLine = ""; + if (Array.isArray(hasMarker)) { + const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " "); + const numberOfMarkers = hasMarker[1] || 1; + markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join(""); + if (lastMarkerLine && opts.message) { + markerLine += " " + maybeHighlight(defs.message, opts.message); + } + } + return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join(""); + } else { + return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`; + } + }).join("\n"); + if (opts.message && !hasColumns) { + frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`; + } + if (highlighted) { + return chalk.reset(frame); + } else { + return frame; + } +} +function _default(rawLines, lineNumber, colNumber, opts = {}) { + if (!deprecationWarningShown) { + deprecationWarningShown = true; + const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`."; + if (process.emitWarning) { + process.emitWarning(message, "DeprecationWarning"); + } else { + const deprecationError = new Error(message); + deprecationError.name = "DeprecationWarning"; + console.warn(new Error(message)); + } + } + colNumber = Math.max(colNumber, 0); + const location = { + start: { + column: colNumber, + line: lineNumber + } + }; + return codeFrameColumns(rawLines, location, opts); +} + +//# sourceMappingURL=index.js.map diff --git a/node_modules/@babel/code-frame/lib/index.js.map b/node_modules/@babel/code-frame/lib/index.js.map new file mode 100644 index 00000000..5e9a09d3 --- /dev/null +++ b/node_modules/@babel/code-frame/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"names":["_highlight","require","_chalk","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","chalkWithForcedColor","undefined","getChalk","forceColor","_chalkWithForcedColor","chalk","constructor","enabled","level","deprecationWarningShown","getDefs","gutter","grey","marker","red","bold","message","NEWLINE","getMarkerLines","loc","source","opts","startLoc","assign","column","line","start","endLoc","end","linesAbove","linesBelow","startLine","startColumn","endLine","endColumn","Math","max","min","length","lineDiff","markerLines","i","lineNumber","sourceLength","codeFrameColumns","rawLines","highlighted","highlightCode","shouldHighlight","defs","maybeHighlight","chalkFn","string","lines","split","hasColumns","numberMaxWidth","String","highlightedLines","highlight","frame","slice","map","index","number","paddedNumber","hasMarker","lastMarkerLine","markerLine","Array","isArray","markerSpacing","replace","numberOfMarkers","repeat","join","reset","_default","colNumber","process","emitWarning","deprecationError","Error","name","console","warn","location"],"sources":["../src/index.ts"],"sourcesContent":["import highlight, { shouldHighlight } from \"@babel/highlight\";\n\nimport chalk, { Chalk as ChalkClass, type ChalkInstance as Chalk } from \"chalk\";\n\nlet chalkWithForcedColor: Chalk = undefined;\nfunction getChalk(forceColor: boolean) {\n if (forceColor) {\n chalkWithForcedColor ??= process.env.BABEL_8_BREAKING\n ? new ChalkClass({ level: 1 })\n : // @ts-expect-error .Instance was .constructor in chalk 2\n new chalk.constructor({ enabled: true, level: 1 });\n return chalkWithForcedColor;\n }\n return chalk;\n}\n\nlet deprecationWarningShown = false;\n\ntype Location = {\n column: number;\n line: number;\n};\n\ntype NodeLocation = {\n end?: Location;\n start: Location;\n};\n\nexport interface Options {\n /** Syntax highlight the code as JavaScript for terminals. default: false */\n highlightCode?: boolean;\n /** The number of lines to show above the error. default: 2 */\n linesAbove?: number;\n /** The number of lines to show below the error. default: 3 */\n linesBelow?: number;\n /**\n * Forcibly syntax highlight the code as JavaScript (for non-terminals);\n * overrides highlightCode.\n * default: false\n */\n forceColor?: boolean;\n /**\n * Pass in a string to be displayed inline (if possible) next to the\n * highlighted location in the code. If it can't be positioned inline,\n * it will be placed above the code frame.\n * default: nothing\n */\n message?: string;\n}\n\n/**\n * Chalk styles for code frame token types.\n */\nfunction getDefs(chalk: Chalk) {\n return {\n gutter: chalk.grey,\n marker: chalk.red.bold,\n message: chalk.red.bold,\n };\n}\n\n/**\n * RegExp to test for newlines in terminal.\n */\n\nconst NEWLINE = /\\r\\n|[\\n\\r\\u2028\\u2029]/;\n\n/**\n * Extract what lines should be marked and highlighted.\n */\n\ntype MarkerLines = Record;\n\nfunction getMarkerLines(\n loc: NodeLocation,\n source: Array,\n opts: Options,\n): {\n start: number;\n end: number;\n markerLines: MarkerLines;\n} {\n const startLoc: Location = {\n column: 0,\n line: -1,\n ...loc.start,\n };\n const endLoc: Location = {\n ...startLoc,\n ...loc.end,\n };\n const { linesAbove = 2, linesBelow = 3 } = opts || {};\n const startLine = startLoc.line;\n const startColumn = startLoc.column;\n const endLine = endLoc.line;\n const endColumn = endLoc.column;\n\n let start = Math.max(startLine - (linesAbove + 1), 0);\n let end = Math.min(source.length, endLine + linesBelow);\n\n if (startLine === -1) {\n start = 0;\n }\n\n if (endLine === -1) {\n end = source.length;\n }\n\n const lineDiff = endLine - startLine;\n const markerLines: MarkerLines = {};\n\n if (lineDiff) {\n for (let i = 0; i <= lineDiff; i++) {\n const lineNumber = i + startLine;\n\n if (!startColumn) {\n markerLines[lineNumber] = true;\n } else if (i === 0) {\n const sourceLength = source[lineNumber - 1].length;\n\n markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];\n } else if (i === lineDiff) {\n markerLines[lineNumber] = [0, endColumn];\n } else {\n const sourceLength = source[lineNumber - i].length;\n\n markerLines[lineNumber] = [0, sourceLength];\n }\n }\n } else {\n if (startColumn === endColumn) {\n if (startColumn) {\n markerLines[startLine] = [startColumn, 0];\n } else {\n markerLines[startLine] = true;\n }\n } else {\n markerLines[startLine] = [startColumn, endColumn - startColumn];\n }\n }\n\n return { start, end, markerLines };\n}\n\nexport function codeFrameColumns(\n rawLines: string,\n loc: NodeLocation,\n opts: Options = {},\n): string {\n const highlighted =\n (opts.highlightCode || opts.forceColor) && shouldHighlight(opts);\n const chalk = getChalk(opts.forceColor);\n const defs = getDefs(chalk);\n const maybeHighlight = (chalkFn: Chalk, string: string) => {\n return highlighted ? chalkFn(string) : string;\n };\n const lines = rawLines.split(NEWLINE);\n const { start, end, markerLines } = getMarkerLines(loc, lines, opts);\n const hasColumns = loc.start && typeof loc.start.column === \"number\";\n\n const numberMaxWidth = String(end).length;\n\n const highlightedLines = highlighted ? highlight(rawLines, opts) : rawLines;\n\n let frame = highlightedLines\n .split(NEWLINE, end)\n .slice(start, end)\n .map((line, index) => {\n const number = start + 1 + index;\n const paddedNumber = ` ${number}`.slice(-numberMaxWidth);\n const gutter = ` ${paddedNumber} |`;\n const hasMarker = markerLines[number];\n const lastMarkerLine = !markerLines[number + 1];\n if (hasMarker) {\n let markerLine = \"\";\n if (Array.isArray(hasMarker)) {\n const markerSpacing = line\n .slice(0, Math.max(hasMarker[0] - 1, 0))\n .replace(/[^\\t]/g, \" \");\n const numberOfMarkers = hasMarker[1] || 1;\n\n markerLine = [\n \"\\n \",\n maybeHighlight(defs.gutter, gutter.replace(/\\d/g, \" \")),\n \" \",\n markerSpacing,\n maybeHighlight(defs.marker, \"^\").repeat(numberOfMarkers),\n ].join(\"\");\n\n if (lastMarkerLine && opts.message) {\n markerLine += \" \" + maybeHighlight(defs.message, opts.message);\n }\n }\n return [\n maybeHighlight(defs.marker, \">\"),\n maybeHighlight(defs.gutter, gutter),\n line.length > 0 ? ` ${line}` : \"\",\n markerLine,\n ].join(\"\");\n } else {\n return ` ${maybeHighlight(defs.gutter, gutter)}${\n line.length > 0 ? ` ${line}` : \"\"\n }`;\n }\n })\n .join(\"\\n\");\n\n if (opts.message && !hasColumns) {\n frame = `${\" \".repeat(numberMaxWidth + 1)}${opts.message}\\n${frame}`;\n }\n\n if (highlighted) {\n return chalk.reset(frame);\n } else {\n return frame;\n }\n}\n\n/**\n * Create a code frame, adding line numbers, code highlighting, and pointing to a given position.\n */\n\nexport default function (\n rawLines: string,\n lineNumber: number,\n colNumber?: number | null,\n opts: Options = {},\n): string {\n if (!deprecationWarningShown) {\n deprecationWarningShown = true;\n\n const message =\n \"Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.\";\n\n if (process.emitWarning) {\n // A string is directly supplied to emitWarning, because when supplying an\n // Error object node throws in the tests because of different contexts\n process.emitWarning(message, \"DeprecationWarning\");\n } else {\n const deprecationError = new Error(message);\n deprecationError.name = \"DeprecationWarning\";\n console.warn(new Error(message));\n }\n }\n\n colNumber = Math.max(colNumber, 0);\n\n const location: NodeLocation = {\n start: { column: colNumber, line: lineNumber },\n };\n\n return codeFrameColumns(rawLines, location, opts);\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAAgF,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAEhF,IAAIW,oBAA2B,GAAGC,SAAS;AAC3C,SAASC,QAAQA,CAACC,UAAmB,EAAE;EACrC,IAAIA,UAAU,EAAE;IAAA,IAAAC,qBAAA;IACd,CAAAA,qBAAA,GAAAJ,oBAAoB,YAAAI,qBAAA,GAApBJ,oBAAoB,GAGhB,IAAIK,cAAK,CAACC,WAAW,CAAC;MAAEC,OAAO,EAAE,IAAI;MAAEC,KAAK,EAAE;IAAE,CAAC,CAAC;IACtD,OAAOR,oBAAoB;EAC7B;EACA,OAAOK,cAAK;AACd;AAEA,IAAII,uBAAuB,GAAG,KAAK;AAqCnC,SAASC,OAAOA,CAACL,KAAY,EAAE;EAC7B,OAAO;IACLM,MAAM,EAAEN,KAAK,CAACO,IAAI;IAClBC,MAAM,EAAER,KAAK,CAACS,GAAG,CAACC,IAAI;IACtBC,OAAO,EAAEX,KAAK,CAACS,GAAG,CAACC;EACrB,CAAC;AACH;AAMA,MAAME,OAAO,GAAG,yBAAyB;AAQzC,SAASC,cAAcA,CACrBC,GAAiB,EACjBC,MAAqB,EACrBC,IAAa,EAKb;EACA,MAAMC,QAAkB,GAAA/B,MAAA,CAAAgC,MAAA;IACtBC,MAAM,EAAE,CAAC;IACTC,IAAI,EAAE,CAAC;EAAC,GACLN,GAAG,CAACO,KAAK,CACb;EACD,MAAMC,MAAgB,GAAApC,MAAA,CAAAgC,MAAA,KACjBD,QAAQ,EACRH,GAAG,CAACS,GAAG,CACX;EACD,MAAM;IAAEC,UAAU,GAAG,CAAC;IAAEC,UAAU,GAAG;EAAE,CAAC,GAAGT,IAAI,IAAI,CAAC,CAAC;EACrD,MAAMU,SAAS,GAAGT,QAAQ,CAACG,IAAI;EAC/B,MAAMO,WAAW,GAAGV,QAAQ,CAACE,MAAM;EACnC,MAAMS,OAAO,GAAGN,MAAM,CAACF,IAAI;EAC3B,MAAMS,SAAS,GAAGP,MAAM,CAACH,MAAM;EAE/B,IAAIE,KAAK,GAAGS,IAAI,CAACC,GAAG,CAACL,SAAS,IAAIF,UAAU,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;EACrD,IAAID,GAAG,GAAGO,IAAI,CAACE,GAAG,CAACjB,MAAM,CAACkB,MAAM,EAAEL,OAAO,GAAGH,UAAU,CAAC;EAEvD,IAAIC,SAAS,KAAK,CAAC,CAAC,EAAE;IACpBL,KAAK,GAAG,CAAC;EACX;EAEA,IAAIO,OAAO,KAAK,CAAC,CAAC,EAAE;IAClBL,GAAG,GAAGR,MAAM,CAACkB,MAAM;EACrB;EAEA,MAAMC,QAAQ,GAAGN,OAAO,GAAGF,SAAS;EACpC,MAAMS,WAAwB,GAAG,CAAC,CAAC;EAEnC,IAAID,QAAQ,EAAE;IACZ,KAAK,IAAIE,CAAC,GAAG,CAAC,EAAEA,CAAC,IAAIF,QAAQ,EAAEE,CAAC,EAAE,EAAE;MAClC,MAAMC,UAAU,GAAGD,CAAC,GAAGV,SAAS;MAEhC,IAAI,CAACC,WAAW,EAAE;QAChBQ,WAAW,CAACE,UAAU,CAAC,GAAG,IAAI;MAChC,CAAC,MAAM,IAAID,CAAC,KAAK,CAAC,EAAE;QAClB,MAAME,YAAY,GAAGvB,MAAM,CAACsB,UAAU,GAAG,CAAC,CAAC,CAACJ,MAAM;QAElDE,WAAW,CAACE,UAAU,CAAC,GAAG,CAACV,WAAW,EAAEW,YAAY,GAAGX,WAAW,GAAG,CAAC,CAAC;MACzE,CAAC,MAAM,IAAIS,CAAC,KAAKF,QAAQ,EAAE;QACzBC,WAAW,CAACE,UAAU,CAAC,GAAG,CAAC,CAAC,EAAER,SAAS,CAAC;MAC1C,CAAC,MAAM;QACL,MAAMS,YAAY,GAAGvB,MAAM,CAACsB,UAAU,GAAGD,CAAC,CAAC,CAACH,MAAM;QAElDE,WAAW,CAACE,UAAU,CAAC,GAAG,CAAC,CAAC,EAAEC,YAAY,CAAC;MAC7C;IACF;EACF,CAAC,MAAM;IACL,IAAIX,WAAW,KAAKE,SAAS,EAAE;MAC7B,IAAIF,WAAW,EAAE;QACfQ,WAAW,CAACT,SAAS,CAAC,GAAG,CAACC,WAAW,EAAE,CAAC,CAAC;MAC3C,CAAC,MAAM;QACLQ,WAAW,CAACT,SAAS,CAAC,GAAG,IAAI;MAC/B;IACF,CAAC,MAAM;MACLS,WAAW,CAACT,SAAS,CAAC,GAAG,CAACC,WAAW,EAAEE,SAAS,GAAGF,WAAW,CAAC;IACjE;EACF;EAEA,OAAO;IAAEN,KAAK;IAAEE,GAAG;IAAEY;EAAY,CAAC;AACpC;AAEO,SAASI,gBAAgBA,CAC9BC,QAAgB,EAChB1B,GAAiB,EACjBE,IAAa,GAAG,CAAC,CAAC,EACV;EACR,MAAMyB,WAAW,GACf,CAACzB,IAAI,CAAC0B,aAAa,IAAI1B,IAAI,CAAClB,UAAU,KAAK,IAAA6C,0BAAe,EAAC3B,IAAI,CAAC;EAClE,MAAMhB,KAAK,GAAGH,QAAQ,CAACmB,IAAI,CAAClB,UAAU,CAAC;EACvC,MAAM8C,IAAI,GAAGvC,OAAO,CAACL,KAAK,CAAC;EAC3B,MAAM6C,cAAc,GAAGA,CAACC,OAAc,EAAEC,MAAc,KAAK;IACzD,OAAON,WAAW,GAAGK,OAAO,CAACC,MAAM,CAAC,GAAGA,MAAM;EAC/C,CAAC;EACD,MAAMC,KAAK,GAAGR,QAAQ,CAACS,KAAK,CAACrC,OAAO,CAAC;EACrC,MAAM;IAAES,KAAK;IAAEE,GAAG;IAAEY;EAAY,CAAC,GAAGtB,cAAc,CAACC,GAAG,EAAEkC,KAAK,EAAEhC,IAAI,CAAC;EACpE,MAAMkC,UAAU,GAAGpC,GAAG,CAACO,KAAK,IAAI,OAAOP,GAAG,CAACO,KAAK,CAACF,MAAM,KAAK,QAAQ;EAEpE,MAAMgC,cAAc,GAAGC,MAAM,CAAC7B,GAAG,CAAC,CAACU,MAAM;EAEzC,MAAMoB,gBAAgB,GAAGZ,WAAW,GAAG,IAAAa,kBAAS,EAACd,QAAQ,EAAExB,IAAI,CAAC,GAAGwB,QAAQ;EAE3E,IAAIe,KAAK,GAAGF,gBAAgB,CACzBJ,KAAK,CAACrC,OAAO,EAAEW,GAAG,CAAC,CACnBiC,KAAK,CAACnC,KAAK,EAAEE,GAAG,CAAC,CACjBkC,GAAG,CAAC,CAACrC,IAAI,EAAEsC,KAAK,KAAK;IACpB,MAAMC,MAAM,GAAGtC,KAAK,GAAG,CAAC,GAAGqC,KAAK;IAChC,MAAME,YAAY,GAAI,IAAGD,MAAO,EAAC,CAACH,KAAK,CAAC,CAACL,cAAc,CAAC;IACxD,MAAM7C,MAAM,GAAI,IAAGsD,YAAa,IAAG;IACnC,MAAMC,SAAS,GAAG1B,WAAW,CAACwB,MAAM,CAAC;IACrC,MAAMG,cAAc,GAAG,CAAC3B,WAAW,CAACwB,MAAM,GAAG,CAAC,CAAC;IAC/C,IAAIE,SAAS,EAAE;MACb,IAAIE,UAAU,GAAG,EAAE;MACnB,IAAIC,KAAK,CAACC,OAAO,CAACJ,SAAS,CAAC,EAAE;QAC5B,MAAMK,aAAa,GAAG9C,IAAI,CACvBoC,KAAK,CAAC,CAAC,EAAE1B,IAAI,CAACC,GAAG,CAAC8B,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CACvCM,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;QACzB,MAAMC,eAAe,GAAGP,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QAEzCE,UAAU,GAAG,CACX,KAAK,EACLlB,cAAc,CAACD,IAAI,CAACtC,MAAM,EAAEA,MAAM,CAAC6D,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,EACvD,GAAG,EACHD,aAAa,EACbrB,cAAc,CAACD,IAAI,CAACpC,MAAM,EAAE,GAAG,CAAC,CAAC6D,MAAM,CAACD,eAAe,CAAC,CACzD,CAACE,IAAI,CAAC,EAAE,CAAC;QAEV,IAAIR,cAAc,IAAI9C,IAAI,CAACL,OAAO,EAAE;UAClCoD,UAAU,IAAI,GAAG,GAAGlB,cAAc,CAACD,IAAI,CAACjC,OAAO,EAAEK,IAAI,CAACL,OAAO,CAAC;QAChE;MACF;MACA,OAAO,CACLkC,cAAc,CAACD,IAAI,CAACpC,MAAM,EAAE,GAAG,CAAC,EAChCqC,cAAc,CAACD,IAAI,CAACtC,MAAM,EAAEA,MAAM,CAAC,EACnCc,IAAI,CAACa,MAAM,GAAG,CAAC,GAAI,IAAGb,IAAK,EAAC,GAAG,EAAE,EACjC2C,UAAU,CACX,CAACO,IAAI,CAAC,EAAE,CAAC;IACZ,CAAC,MAAM;MACL,OAAQ,IAAGzB,cAAc,CAACD,IAAI,CAACtC,MAAM,EAAEA,MAAM,CAAE,GAC7Cc,IAAI,CAACa,MAAM,GAAG,CAAC,GAAI,IAAGb,IAAK,EAAC,GAAG,EAChC,EAAC;IACJ;EACF,CAAC,CAAC,CACDkD,IAAI,CAAC,IAAI,CAAC;EAEb,IAAItD,IAAI,CAACL,OAAO,IAAI,CAACuC,UAAU,EAAE;IAC/BK,KAAK,GAAI,GAAE,GAAG,CAACc,MAAM,CAAClB,cAAc,GAAG,CAAC,CAAE,GAAEnC,IAAI,CAACL,OAAQ,KAAI4C,KAAM,EAAC;EACtE;EAEA,IAAId,WAAW,EAAE;IACf,OAAOzC,KAAK,CAACuE,KAAK,CAAChB,KAAK,CAAC;EAC3B,CAAC,MAAM;IACL,OAAOA,KAAK;EACd;AACF;AAMe,SAAAiB,SACbhC,QAAgB,EAChBH,UAAkB,EAClBoC,SAAyB,EACzBzD,IAAa,GAAG,CAAC,CAAC,EACV;EACR,IAAI,CAACZ,uBAAuB,EAAE;IAC5BA,uBAAuB,GAAG,IAAI;IAE9B,MAAMO,OAAO,GACX,qGAAqG;IAEvG,IAAI+D,OAAO,CAACC,WAAW,EAAE;MAGvBD,OAAO,CAACC,WAAW,CAAChE,OAAO,EAAE,oBAAoB,CAAC;IACpD,CAAC,MAAM;MACL,MAAMiE,gBAAgB,GAAG,IAAIC,KAAK,CAAClE,OAAO,CAAC;MAC3CiE,gBAAgB,CAACE,IAAI,GAAG,oBAAoB;MAC5CC,OAAO,CAACC,IAAI,CAAC,IAAIH,KAAK,CAAClE,OAAO,CAAC,CAAC;IAClC;EACF;EAEA8D,SAAS,GAAG3C,IAAI,CAACC,GAAG,CAAC0C,SAAS,EAAE,CAAC,CAAC;EAElC,MAAMQ,QAAsB,GAAG;IAC7B5D,KAAK,EAAE;MAAEF,MAAM,EAAEsD,SAAS;MAAErD,IAAI,EAAEiB;IAAW;EAC/C,CAAC;EAED,OAAOE,gBAAgB,CAACC,QAAQ,EAAEyC,QAAQ,EAAEjE,IAAI,CAAC;AACnD"} \ No newline at end of file diff --git a/node_modules/@babel/code-frame/node_modules/ansi-styles/index.js b/node_modules/@babel/code-frame/node_modules/ansi-styles/index.js new file mode 100644 index 00000000..90a871c4 --- /dev/null +++ b/node_modules/@babel/code-frame/node_modules/ansi-styles/index.js @@ -0,0 +1,165 @@ +'use strict'; +const colorConvert = require('color-convert'); + +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; + +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; + +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; + +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], + + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + + // Fix humans + styles.color.grey = styles.color.gray; + + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + + for (const styleName of Object.keys(group)) { + const style = group[styleName]; + + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; + + group[styleName] = styles[styleName]; + + codes.set(style[0], style[1]); + } + + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); + + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } + + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; + + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; + + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; + + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } + + const suite = colorConvert[key]; + + if (key === 'ansi16') { + key = 'ansi'; + } + + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } + + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } + + return styles; +} + +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); diff --git a/node_modules/@babel/code-frame/node_modules/ansi-styles/license b/node_modules/@babel/code-frame/node_modules/ansi-styles/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/@babel/code-frame/node_modules/ansi-styles/license @@ -0,0 +1,9 @@ +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/@babel/code-frame/node_modules/ansi-styles/package.json b/node_modules/@babel/code-frame/node_modules/ansi-styles/package.json new file mode 100644 index 00000000..65edb48c --- /dev/null +++ b/node_modules/@babel/code-frame/node_modules/ansi-styles/package.json @@ -0,0 +1,56 @@ +{ + "name": "ansi-styles", + "version": "3.2.1", + "description": "ANSI escape codes for styling strings in the terminal", + "license": "MIT", + "repository": "chalk/ansi-styles", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && ava", + "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "color-convert": "^1.9.0" + }, + "devDependencies": { + "ava": "*", + "babel-polyfill": "^6.23.0", + "svg-term-cli": "^2.1.1", + "xo": "*" + }, + "ava": { + "require": "babel-polyfill" + } +} diff --git a/node_modules/@babel/code-frame/node_modules/ansi-styles/readme.md b/node_modules/@babel/code-frame/node_modules/ansi-styles/readme.md new file mode 100644 index 00000000..3158e2df --- /dev/null +++ b/node_modules/@babel/code-frame/node_modules/ansi-styles/readme.md @@ -0,0 +1,147 @@ +# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles) + +> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal + +You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings. + + + + +## Install + +``` +$ npm install ansi-styles +``` + + +## Usage + +```js +const style = require('ansi-styles'); + +console.log(`${style.green.open}Hello world!${style.green.close}`); + + +// Color conversion between 16/256/truecolor +// NOTE: If conversion goes to 16 colors or 256 colors, the original color +// may be degraded to fit that color palette. This means terminals +// that do not support 16 million colors will best-match the +// original color. +console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close); +console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close); +console.log(style.color.ansi16m.hex('#ABCDEF') + 'Hello world!' + style.color.close); +``` + +## API + +Each style has an `open` and `close` property. + + +## Styles + +### Modifiers + +- `reset` +- `bold` +- `dim` +- `italic` *(Not widely supported)* +- `underline` +- `inverse` +- `hidden` +- `strikethrough` *(Not widely supported)* + +### Colors + +- `black` +- `red` +- `green` +- `yellow` +- `blue` +- `magenta` +- `cyan` +- `white` +- `gray` ("bright black") +- `redBright` +- `greenBright` +- `yellowBright` +- `blueBright` +- `magentaBright` +- `cyanBright` +- `whiteBright` + +### Background colors + +- `bgBlack` +- `bgRed` +- `bgGreen` +- `bgYellow` +- `bgBlue` +- `bgMagenta` +- `bgCyan` +- `bgWhite` +- `bgBlackBright` +- `bgRedBright` +- `bgGreenBright` +- `bgYellowBright` +- `bgBlueBright` +- `bgMagentaBright` +- `bgCyanBright` +- `bgWhiteBright` + + +## Advanced usage + +By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module. + +- `style.modifier` +- `style.color` +- `style.bgColor` + +###### Example + +```js +console.log(style.color.green.open); +``` + +Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values. + +###### Example + +```js +console.log(style.codes.get(36)); +//=> 39 +``` + + +## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728) + +`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors. + +To use these, call the associated conversion function with the intended output, for example: + +```js +style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code +style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code + +style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code +style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code + +style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code +style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code +``` + + +## Related + +- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal + + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + + +## License + +MIT diff --git a/node_modules/@babel/code-frame/node_modules/chalk/index.js b/node_modules/@babel/code-frame/node_modules/chalk/index.js new file mode 100644 index 00000000..1cc5fa89 --- /dev/null +++ b/node_modules/@babel/code-frame/node_modules/chalk/index.js @@ -0,0 +1,228 @@ +'use strict'; +const escapeStringRegexp = require('escape-string-regexp'); +const ansiStyles = require('ansi-styles'); +const stdoutColor = require('supports-color').stdout; + +const template = require('./templates.js'); + +const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); + +// `supportsColor.level` → `ansiStyles.color[name]` mapping +const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m']; + +// `color-convert` models to exclude from the Chalk API due to conflicts and such +const skipModels = new Set(['gray']); + +const styles = Object.create(null); + +function applyOptions(obj, options) { + options = options || {}; + + // Detect level if not set manually + const scLevel = stdoutColor ? stdoutColor.level : 0; + obj.level = options.level === undefined ? scLevel : options.level; + obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0; +} + +function Chalk(options) { + // We check for this.template here since calling `chalk.constructor()` + // by itself will have a `this` of a previously constructed chalk object + if (!this || !(this instanceof Chalk) || this.template) { + const chalk = {}; + applyOptions(chalk, options); + + chalk.template = function () { + const args = [].slice.call(arguments); + return chalkTag.apply(null, [chalk.template].concat(args)); + }; + + Object.setPrototypeOf(chalk, Chalk.prototype); + Object.setPrototypeOf(chalk.template, chalk); + + chalk.template.constructor = Chalk; + + return chalk.template; + } + + applyOptions(this, options); +} + +// Use bright blue on Windows as the normal blue color is illegible +if (isSimpleWindowsTerm) { + ansiStyles.blue.open = '\u001B[94m'; +} + +for (const key of Object.keys(ansiStyles)) { + ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g'); + + styles[key] = { + get() { + const codes = ansiStyles[key]; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key); + } + }; +} + +styles.visible = { + get() { + return build.call(this, this._styles || [], true, 'visible'); + } +}; + +ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g'); +for (const model of Object.keys(ansiStyles.color.ansi)) { + if (skipModels.has(model)) { + continue; + } + + styles[model] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.color.close, + closeRe: ansiStyles.color.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g'); +for (const model of Object.keys(ansiStyles.bgColor.ansi)) { + if (skipModels.has(model)) { + continue; + } + + const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1); + styles[bgModel] = { + get() { + const level = this.level; + return function () { + const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments); + const codes = { + open, + close: ansiStyles.bgColor.close, + closeRe: ansiStyles.bgColor.closeRe + }; + return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model); + }; + } + }; +} + +const proto = Object.defineProperties(() => {}, styles); + +function build(_styles, _empty, key) { + const builder = function () { + return applyStyle.apply(builder, arguments); + }; + + builder._styles = _styles; + builder._empty = _empty; + + const self = this; + + Object.defineProperty(builder, 'level', { + enumerable: true, + get() { + return self.level; + }, + set(level) { + self.level = level; + } + }); + + Object.defineProperty(builder, 'enabled', { + enumerable: true, + get() { + return self.enabled; + }, + set(enabled) { + self.enabled = enabled; + } + }); + + // See below for fix regarding invisible grey/dim combination on Windows + builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey'; + + // `__proto__` is used because we must return a function, but there is + // no way to create a function with a different prototype + builder.__proto__ = proto; // eslint-disable-line no-proto + + return builder; +} + +function applyStyle() { + // Support varags, but simply cast to string in case there's only one arg + const args = arguments; + const argsLen = args.length; + let str = String(arguments[0]); + + if (argsLen === 0) { + return ''; + } + + if (argsLen > 1) { + // Don't slice `arguments`, it prevents V8 optimizations + for (let a = 1; a < argsLen; a++) { + str += ' ' + args[a]; + } + } + + if (!this.enabled || this.level <= 0 || !str) { + return this._empty ? '' : str; + } + + // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe, + // see https://github.com/chalk/chalk/issues/58 + // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop. + const originalDim = ansiStyles.dim.open; + if (isSimpleWindowsTerm && this.hasGrey) { + ansiStyles.dim.open = ''; + } + + for (const code of this._styles.slice().reverse()) { + // Replace any instances already present with a re-opening code + // otherwise only the part of the string until said closing code + // will be colored, and the rest will simply be 'plain'. + str = code.open + str.replace(code.closeRe, code.open) + code.close; + + // Close the styling before a linebreak and reopen + // after next line to fix a bleed issue on macOS + // https://github.com/chalk/chalk/pull/92 + str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`); + } + + // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue + ansiStyles.dim.open = originalDim; + + return str; +} + +function chalkTag(chalk, strings) { + if (!Array.isArray(strings)) { + // If chalk() was called by itself or with a string, + // return the string itself as a string. + return [].slice.call(arguments, 1).join(' '); + } + + const args = [].slice.call(arguments, 2); + const parts = [strings.raw[0]]; + + for (let i = 1; i < strings.length; i++) { + parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&')); + parts.push(String(strings.raw[i])); + } + + return template(chalk, parts.join('')); +} + +Object.defineProperties(Chalk.prototype, styles); + +module.exports = Chalk(); // eslint-disable-line new-cap +module.exports.supportsColor = stdoutColor; +module.exports.default = module.exports; // For TypeScript diff --git a/node_modules/@babel/code-frame/node_modules/chalk/index.js.flow b/node_modules/@babel/code-frame/node_modules/chalk/index.js.flow new file mode 100644 index 00000000..622caaa2 --- /dev/null +++ b/node_modules/@babel/code-frame/node_modules/chalk/index.js.flow @@ -0,0 +1,93 @@ +// @flow strict + +type TemplateStringsArray = $ReadOnlyArray; + +export type Level = $Values<{ + None: 0, + Basic: 1, + Ansi256: 2, + TrueColor: 3 +}>; + +export type ChalkOptions = {| + enabled?: boolean, + level?: Level +|}; + +export type ColorSupport = {| + level: Level, + hasBasic: boolean, + has256: boolean, + has16m: boolean +|}; + +export interface Chalk { + (...text: string[]): string, + (text: TemplateStringsArray, ...placeholders: string[]): string, + constructor(options?: ChalkOptions): Chalk, + enabled: boolean, + level: Level, + rgb(r: number, g: number, b: number): Chalk, + hsl(h: number, s: number, l: number): Chalk, + hsv(h: number, s: number, v: number): Chalk, + hwb(h: number, w: number, b: number): Chalk, + bgHex(color: string): Chalk, + bgKeyword(color: string): Chalk, + bgRgb(r: number, g: number, b: number): Chalk, + bgHsl(h: number, s: number, l: number): Chalk, + bgHsv(h: number, s: number, v: number): Chalk, + bgHwb(h: number, w: number, b: number): Chalk, + hex(color: string): Chalk, + keyword(color: string): Chalk, + + +reset: Chalk, + +bold: Chalk, + +dim: Chalk, + +italic: Chalk, + +underline: Chalk, + +inverse: Chalk, + +hidden: Chalk, + +strikethrough: Chalk, + + +visible: Chalk, + + +black: Chalk, + +red: Chalk, + +green: Chalk, + +yellow: Chalk, + +blue: Chalk, + +magenta: Chalk, + +cyan: Chalk, + +white: Chalk, + +gray: Chalk, + +grey: Chalk, + +blackBright: Chalk, + +redBright: Chalk, + +greenBright: Chalk, + +yellowBright: Chalk, + +blueBright: Chalk, + +magentaBright: Chalk, + +cyanBright: Chalk, + +whiteBright: Chalk, + + +bgBlack: Chalk, + +bgRed: Chalk, + +bgGreen: Chalk, + +bgYellow: Chalk, + +bgBlue: Chalk, + +bgMagenta: Chalk, + +bgCyan: Chalk, + +bgWhite: Chalk, + +bgBlackBright: Chalk, + +bgRedBright: Chalk, + +bgGreenBright: Chalk, + +bgYellowBright: Chalk, + +bgBlueBright: Chalk, + +bgMagentaBright: Chalk, + +bgCyanBright: Chalk, + +bgWhiteBrigh: Chalk, + + supportsColor: ColorSupport +}; + +declare module.exports: Chalk; diff --git a/node_modules/@babel/code-frame/node_modules/chalk/license b/node_modules/@babel/code-frame/node_modules/chalk/license new file mode 100644 index 00000000..e7af2f77 --- /dev/null +++ b/node_modules/@babel/code-frame/node_modules/chalk/license @@ -0,0 +1,9 @@ +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/@babel/code-frame/node_modules/chalk/package.json b/node_modules/@babel/code-frame/node_modules/chalk/package.json new file mode 100644 index 00000000..bc324685 --- /dev/null +++ b/node_modules/@babel/code-frame/node_modules/chalk/package.json @@ -0,0 +1,71 @@ +{ + "name": "chalk", + "version": "2.4.2", + "description": "Terminal string styling done right", + "license": "MIT", + "repository": "chalk/chalk", + "engines": { + "node": ">=4" + }, + "scripts": { + "test": "xo && tsc --project types && flow --max-warnings=0 && nyc ava", + "bench": "matcha benchmark.js", + "coveralls": "nyc report --reporter=text-lcov | coveralls" + }, + "files": [ + "index.js", + "templates.js", + "types/index.d.ts", + "index.js.flow" + ], + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "str", + "ansi", + "style", + "styles", + "tty", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "devDependencies": { + "ava": "*", + "coveralls": "^3.0.0", + "execa": "^0.9.0", + "flow-bin": "^0.68.0", + "import-fresh": "^2.0.0", + "matcha": "^0.7.0", + "nyc": "^11.0.2", + "resolve-from": "^4.0.0", + "typescript": "^2.5.3", + "xo": "*" + }, + "types": "types/index.d.ts", + "xo": { + "envs": [ + "node", + "mocha" + ], + "ignores": [ + "test/_flow.js" + ] + } +} diff --git a/node_modules/@babel/code-frame/node_modules/chalk/readme.md b/node_modules/@babel/code-frame/node_modules/chalk/readme.md new file mode 100644 index 00000000..d298e2c4 --- /dev/null +++ b/node_modules/@babel/code-frame/node_modules/chalk/readme.md @@ -0,0 +1,314 @@ +

+
+
+ Chalk +
+
+
+

+ +> Terminal string styling done right + +[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) [![Mentioned in Awesome Node.js](https://awesome.re/mentioned-badge.svg)](https://github.com/sindresorhus/awesome-nodejs) + +### [See what's new in Chalk 2](https://github.com/chalk/chalk/releases/tag/v2.0.0) + + + + +## Highlights + +- Expressive API +- Highly performant +- Ability to nest styles +- [256/Truecolor color support](#256-and-truecolor-color-support) +- Auto-detects color support +- Doesn't extend `String.prototype` +- Clean and focused +- Actively maintained +- [Used by ~23,000 packages](https://www.npmjs.com/browse/depended/chalk) as of December 31, 2017 + + +## Install + +```console +$ npm install chalk +``` + + + + + + +## Usage + +```js +const chalk = require('chalk'); + +console.log(chalk.blue('Hello world!')); +``` + +Chalk comes with an easy to use composable API where you just chain and nest the styles you want. + +```js +const chalk = require('chalk'); +const log = console.log; + +// Combine styled and normal strings +log(chalk.blue('Hello') + ' World' + chalk.red('!')); + +// Compose multiple styles using the chainable API +log(chalk.blue.bgRed.bold('Hello world!')); + +// Pass in multiple arguments +log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz')); + +// Nest styles +log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!')); + +// Nest styles of the same type even (color, underline, background) +log(chalk.green( + 'I am a green line ' + + chalk.blue.underline.bold('with a blue substring') + + ' that becomes green again!' +)); + +// ES2015 template literal +log(` +CPU: ${chalk.red('90%')} +RAM: ${chalk.green('40%')} +DISK: ${chalk.yellow('70%')} +`); + +// ES2015 tagged template literal +log(chalk` +CPU: {red ${cpu.totalPercent}%} +RAM: {green ${ram.used / ram.total * 100}%} +DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%} +`); + +// Use RGB colors in terminal emulators that support it. +log(chalk.keyword('orange')('Yay for orange colored text!')); +log(chalk.rgb(123, 45, 67).underline('Underlined reddish color')); +log(chalk.hex('#DEADED').bold('Bold gray!')); +``` + +Easily define your own themes: + +```js +const chalk = require('chalk'); + +const error = chalk.bold.red; +const warning = chalk.keyword('orange'); + +console.log(error('Error!')); +console.log(warning('Warning!')); +``` + +Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args): + +```js +const name = 'Sindre'; +console.log(chalk.green('Hello %s'), name); +//=> 'Hello Sindre' +``` + + +## API + +### chalk.` or + + `; +} + +function headerTemplate(details) { + function metricsTemplate({ pct, covered, total }, kind) { + return ` +
+ ${pct}% + ${kind} + ${covered}/${total} +
+ `; + } + + function skipTemplate(metrics) { + const statements = metrics.statements.skipped; + const branches = metrics.branches.skipped; + const functions = metrics.functions.skipped; + + const countLabel = (c, label, plural) => + c === 0 ? [] : `${c} ${label}${c === 1 ? '' : plural}`; + const skips = [].concat( + countLabel(statements, 'statement', 's'), + countLabel(functions, 'function', 's'), + countLabel(branches, 'branch', 'es') + ); + + if (skips.length === 0) { + return ''; + } + + return ` +
+ ${skips.join(', ')} + Ignored      +
+ `; + } + + return ` + + +${htmlHead(details)} + +
+
+

${details.pathHtml}

+
+ ${metricsTemplate(details.metrics.statements, 'Statements')} + ${metricsTemplate(details.metrics.branches, 'Branches')} + ${metricsTemplate(details.metrics.functions, 'Functions')} + ${metricsTemplate(details.metrics.lines, 'Lines')} + ${skipTemplate(details.metrics)} +
+

+ Press n or j to go to the next uncovered block, b, p or k for the previous block. +

+ +
+
+ `; +} + +function footerTemplate(details) { + return ` +
+
+ + + + + + + + `; +} + +function detailTemplate(data) { + const lineNumbers = new Array(data.maxLines).fill().map((_, i) => i + 1); + const lineLink = num => + `${num}`; + const lineCount = line => + `${line.hits}`; + + /* This is rendered in a `
`, need control of all whitespace. */
+    return [
+        '',
+        `${lineNumbers
+            .map(lineLink)
+            .join('\n')}`,
+        `${data.lineCoverage
+            .map(lineCount)
+            .join('\n')}`,
+        `
${data.annotatedCode.join(
+            '\n'
+        )}
`, + '' + ].join(''); +} +const summaryTableHeader = [ + '
', + '', + '', + '', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + '', + '', + '' +].join('\n'); + +function summaryLineTemplate(details) { + const { reportClasses, metrics, file, output } = details; + const percentGraph = pct => { + if (!isFinite(pct)) { + return ''; + } + + const cls = ['cover-fill']; + if (pct === 100) { + cls.push('cover-full'); + } + + pct = Math.floor(pct); + return [ + `
`, + `
` + ].join(''); + }; + const summaryType = (type, showGraph = false) => { + const info = metrics[type]; + const reportClass = reportClasses[type]; + const result = [ + ``, + `` + ]; + if (showGraph) { + result.unshift( + `` + ); + } + + return result; + }; + + return [] + .concat( + '', + ``, + summaryType('statements', true), + summaryType('branches'), + summaryType('functions'), + summaryType('lines'), + '\n' + ) + .join('\n\t'); +} + +const summaryTableFooter = ['', '
FileStatementsBranchesFunctionsLines
${info.pct}%${info.covered}/${info.total}`, + `
${percentGraph(info.pct)}
`, + `
${html.escape(file)}
', '
'].join('\n'); +const emptyClasses = { + statements: 'empty', + lines: 'empty', + functions: 'empty', + branches: 'empty' +}; + +const standardLinkMapper = { + getPath(node) { + if (typeof node === 'string') { + return node; + } + let filePath = node.getQualifiedName(); + if (node.isSummary()) { + if (filePath !== '') { + filePath += '/index.html'; + } else { + filePath = 'index.html'; + } + } else { + filePath += '.html'; + } + return filePath; + }, + + relativePath(source, target) { + const targetPath = this.getPath(target); + const sourcePath = path.dirname(this.getPath(source)); + return path.posix.relative(sourcePath, targetPath); + }, + + assetPath(node, name) { + return this.relativePath(this.getPath(node), name); + } +}; + +function fixPct(metrics) { + Object.keys(emptyClasses).forEach(key => { + metrics[key].pct = 0; + }); + return metrics; +} + +class HtmlReport extends ReportBase { + constructor(opts) { + super(); + + this.verbose = opts.verbose; + this.linkMapper = opts.linkMapper || standardLinkMapper; + this.subdir = opts.subdir || ''; + this.date = new Date().toISOString(); + this.skipEmpty = opts.skipEmpty; + } + + getBreadcrumbHtml(node) { + let parent = node.getParent(); + const nodePath = []; + + while (parent) { + nodePath.push(parent); + parent = parent.getParent(); + } + + const linkPath = nodePath.map(ancestor => { + const target = this.linkMapper.relativePath(node, ancestor); + const name = ancestor.getRelativeName() || 'All files'; + return '' + name + ''; + }); + + linkPath.reverse(); + return linkPath.length > 0 + ? linkPath.join(' / ') + ' ' + node.getRelativeName() + : 'All files'; + } + + fillTemplate(node, templateData, context) { + const linkMapper = this.linkMapper; + const summary = node.getCoverageSummary(); + templateData.entity = node.getQualifiedName() || 'All files'; + templateData.metrics = summary; + templateData.reportClass = context.classForPercent( + 'statements', + summary.statements.pct + ); + templateData.pathHtml = this.getBreadcrumbHtml(node); + templateData.base = { + css: linkMapper.assetPath(node, 'base.css') + }; + templateData.sorter = { + js: linkMapper.assetPath(node, 'sorter.js'), + image: linkMapper.assetPath(node, 'sort-arrow-sprite.png') + }; + templateData.blockNavigation = { + js: linkMapper.assetPath(node, 'block-navigation.js') + }; + templateData.prettify = { + js: linkMapper.assetPath(node, 'prettify.js'), + css: linkMapper.assetPath(node, 'prettify.css') + }; + templateData.favicon = linkMapper.assetPath(node, 'favicon.png'); + } + + getTemplateData() { + return { datetime: this.date }; + } + + getWriter(context) { + if (!this.subdir) { + return context.writer; + } + return context.writer.writerForDir(this.subdir); + } + + onStart(root, context) { + const assetHeaders = { + '.js': '/* eslint-disable */\n' + }; + + ['.', 'vendor'].forEach(subdir => { + const writer = this.getWriter(context); + const srcDir = path.resolve(__dirname, 'assets', subdir); + fs.readdirSync(srcDir).forEach(f => { + const resolvedSource = path.resolve(srcDir, f); + const resolvedDestination = '.'; + const stat = fs.statSync(resolvedSource); + let dest; + + if (stat.isFile()) { + dest = resolvedDestination + '/' + f; + if (this.verbose) { + console.log('Write asset: ' + dest); + } + writer.copyFile( + resolvedSource, + dest, + assetHeaders[path.extname(f)] + ); + } + }); + }); + } + + onSummary(node, context) { + const linkMapper = this.linkMapper; + const templateData = this.getTemplateData(); + const children = node.getChildren(); + const skipEmpty = this.skipEmpty; + + this.fillTemplate(node, templateData, context); + const cw = this.getWriter(context).writeFile(linkMapper.getPath(node)); + cw.write(headerTemplate(templateData)); + cw.write(summaryTableHeader); + children.forEach(child => { + const metrics = child.getCoverageSummary(); + const isEmpty = metrics.isEmpty(); + if (skipEmpty && isEmpty) { + return; + } + const reportClasses = isEmpty + ? emptyClasses + : { + statements: context.classForPercent( + 'statements', + metrics.statements.pct + ), + lines: context.classForPercent( + 'lines', + metrics.lines.pct + ), + functions: context.classForPercent( + 'functions', + metrics.functions.pct + ), + branches: context.classForPercent( + 'branches', + metrics.branches.pct + ) + }; + const data = { + metrics: isEmpty ? fixPct(metrics) : metrics, + reportClasses, + file: child.getRelativeName(), + output: linkMapper.relativePath(node, child) + }; + cw.write(summaryLineTemplate(data) + '\n'); + }); + cw.write(summaryTableFooter); + cw.write(footerTemplate(templateData)); + cw.close(); + } + + onDetail(node, context) { + const linkMapper = this.linkMapper; + const templateData = this.getTemplateData(); + + this.fillTemplate(node, templateData, context); + const cw = this.getWriter(context).writeFile(linkMapper.getPath(node)); + cw.write(headerTemplate(templateData)); + cw.write('
\n');
+        cw.write(detailTemplate(annotator(node.getFileCoverage(), context)));
+        cw.write('
\n'); + cw.write(footerTemplate(templateData)); + cw.close(); + } +} + +module.exports = HtmlReport; diff --git a/node_modules/istanbul-reports/lib/html/insertion-text.js b/node_modules/istanbul-reports/lib/html/insertion-text.js new file mode 100644 index 00000000..6f806424 --- /dev/null +++ b/node_modules/istanbul-reports/lib/html/insertion-text.js @@ -0,0 +1,114 @@ +'use strict'; +/* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +function InsertionText(text, consumeBlanks) { + this.text = text; + this.origLength = text.length; + this.offsets = []; + this.consumeBlanks = consumeBlanks; + this.startPos = this.findFirstNonBlank(); + this.endPos = this.findLastNonBlank(); +} + +const WHITE_RE = /[ \f\n\r\t\v\u00A0\u2028\u2029]/; + +InsertionText.prototype = { + findFirstNonBlank() { + let pos = -1; + const text = this.text; + const len = text.length; + let i; + for (i = 0; i < len; i += 1) { + if (!text.charAt(i).match(WHITE_RE)) { + pos = i; + break; + } + } + return pos; + }, + findLastNonBlank() { + const text = this.text; + const len = text.length; + let pos = text.length + 1; + let i; + for (i = len - 1; i >= 0; i -= 1) { + if (!text.charAt(i).match(WHITE_RE)) { + pos = i; + break; + } + } + return pos; + }, + originalLength() { + return this.origLength; + }, + + insertAt(col, str, insertBefore, consumeBlanks) { + consumeBlanks = + typeof consumeBlanks === 'undefined' + ? this.consumeBlanks + : consumeBlanks; + col = col > this.originalLength() ? this.originalLength() : col; + col = col < 0 ? 0 : col; + + if (consumeBlanks) { + if (col <= this.startPos) { + col = 0; + } + if (col > this.endPos) { + col = this.origLength; + } + } + + const len = str.length; + const offset = this.findOffset(col, len, insertBefore); + const realPos = col + offset; + const text = this.text; + this.text = text.substring(0, realPos) + str + text.substring(realPos); + return this; + }, + + findOffset(pos, len, insertBefore) { + const offsets = this.offsets; + let offsetObj; + let cumulativeOffset = 0; + let i; + + for (i = 0; i < offsets.length; i += 1) { + offsetObj = offsets[i]; + if ( + offsetObj.pos < pos || + (offsetObj.pos === pos && !insertBefore) + ) { + cumulativeOffset += offsetObj.len; + } + if (offsetObj.pos >= pos) { + break; + } + } + if (offsetObj && offsetObj.pos === pos) { + offsetObj.len += len; + } else { + offsets.splice(i, 0, { pos, len }); + } + return cumulativeOffset; + }, + + wrap(startPos, startText, endPos, endText, consumeBlanks) { + this.insertAt(startPos, startText, true, consumeBlanks); + this.insertAt(endPos, endText, false, consumeBlanks); + return this; + }, + + wrapLine(startText, endText) { + this.wrap(0, startText, this.originalLength(), endText); + }, + + toString() { + return this.text; + } +}; + +module.exports = InsertionText; diff --git a/node_modules/istanbul-reports/lib/json-summary/index.js b/node_modules/istanbul-reports/lib/json-summary/index.js new file mode 100644 index 00000000..318a47fa --- /dev/null +++ b/node_modules/istanbul-reports/lib/json-summary/index.js @@ -0,0 +1,56 @@ +/* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +'use strict'; +const { ReportBase } = require('istanbul-lib-report'); + +class JsonSummaryReport extends ReportBase { + constructor(opts) { + super(); + + this.file = opts.file || 'coverage-summary.json'; + this.contentWriter = null; + this.first = true; + } + + onStart(root, context) { + this.contentWriter = context.writer.writeFile(this.file); + this.contentWriter.write('{'); + } + + writeSummary(filePath, sc) { + const cw = this.contentWriter; + if (this.first) { + this.first = false; + } else { + cw.write(','); + } + cw.write(JSON.stringify(filePath)); + cw.write(': '); + cw.write(JSON.stringify(sc)); + cw.println(''); + } + + onSummary(node) { + if (!node.isRoot()) { + return; + } + this.writeSummary('total', node.getCoverageSummary()); + } + + onDetail(node) { + this.writeSummary( + node.getFileCoverage().path, + node.getCoverageSummary() + ); + } + + onEnd() { + const cw = this.contentWriter; + cw.println('}'); + cw.close(); + } +} + +module.exports = JsonSummaryReport; diff --git a/node_modules/istanbul-reports/lib/json/index.js b/node_modules/istanbul-reports/lib/json/index.js new file mode 100644 index 00000000..bcae6aea --- /dev/null +++ b/node_modules/istanbul-reports/lib/json/index.js @@ -0,0 +1,44 @@ +/* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +'use strict'; +const { ReportBase } = require('istanbul-lib-report'); + +class JsonReport extends ReportBase { + constructor(opts) { + super(); + + this.file = opts.file || 'coverage-final.json'; + this.first = true; + } + + onStart(root, context) { + this.contentWriter = context.writer.writeFile(this.file); + this.contentWriter.write('{'); + } + + onDetail(node) { + const fc = node.getFileCoverage(); + const key = fc.path; + const cw = this.contentWriter; + + if (this.first) { + this.first = false; + } else { + cw.write(','); + } + cw.write(JSON.stringify(key)); + cw.write(': '); + cw.write(JSON.stringify(fc)); + cw.println(''); + } + + onEnd() { + const cw = this.contentWriter; + cw.println('}'); + cw.close(); + } +} + +module.exports = JsonReport; diff --git a/node_modules/istanbul-reports/lib/lcov/index.js b/node_modules/istanbul-reports/lib/lcov/index.js new file mode 100644 index 00000000..383c2027 --- /dev/null +++ b/node_modules/istanbul-reports/lib/lcov/index.js @@ -0,0 +1,33 @@ +'use strict'; +/* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +const { ReportBase } = require('istanbul-lib-report'); +const LcovOnlyReport = require('../lcovonly'); +const HtmlReport = require('../html'); + +class LcovReport extends ReportBase { + constructor(opts) { + super(); + this.lcov = new LcovOnlyReport({ file: 'lcov.info', ...opts }); + this.html = new HtmlReport({ subdir: 'lcov-report' }); + } +} + +['Start', 'End', 'Summary', 'SummaryEnd', 'Detail'].forEach(what => { + const meth = 'on' + what; + LcovReport.prototype[meth] = function(...args) { + const lcov = this.lcov; + const html = this.html; + + if (lcov[meth]) { + lcov[meth](...args); + } + if (html[meth]) { + html[meth](...args); + } + }; +}); + +module.exports = LcovReport; diff --git a/node_modules/istanbul-reports/lib/lcovonly/index.js b/node_modules/istanbul-reports/lib/lcovonly/index.js new file mode 100644 index 00000000..0720e469 --- /dev/null +++ b/node_modules/istanbul-reports/lib/lcovonly/index.js @@ -0,0 +1,77 @@ +/* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +'use strict'; +const { ReportBase } = require('istanbul-lib-report'); + +class LcovOnlyReport extends ReportBase { + constructor(opts) { + super(); + opts = opts || {}; + this.file = opts.file || 'lcov.info'; + this.projectRoot = opts.projectRoot || process.cwd(); + this.contentWriter = null; + } + + onStart(root, context) { + this.contentWriter = context.writer.writeFile(this.file); + } + + onDetail(node) { + const fc = node.getFileCoverage(); + const writer = this.contentWriter; + const functions = fc.f; + const functionMap = fc.fnMap; + const lines = fc.getLineCoverage(); + const branches = fc.b; + const branchMap = fc.branchMap; + const summary = node.getCoverageSummary(); + const path = require('path'); + + writer.println('TN:'); + const fileName = path.relative(this.projectRoot, fc.path); + writer.println('SF:' + fileName); + + Object.values(functionMap).forEach(meta => { + // Some versions of the instrumenter in the wild populate 'loc' + // but not 'decl': + const decl = meta.decl || meta.loc; + writer.println('FN:' + [decl.start.line, meta.name].join(',')); + }); + writer.println('FNF:' + summary.functions.total); + writer.println('FNH:' + summary.functions.covered); + + Object.entries(functionMap).forEach(([key, meta]) => { + const stats = functions[key]; + writer.println('FNDA:' + [stats, meta.name].join(',')); + }); + + Object.entries(lines).forEach(entry => { + writer.println('DA:' + entry.join(',')); + }); + writer.println('LF:' + summary.lines.total); + writer.println('LH:' + summary.lines.covered); + + Object.entries(branches).forEach(([key, branchArray]) => { + const meta = branchMap[key]; + if (meta) { + const { line } = meta.loc.start; + branchArray.forEach((b, i) => { + writer.println('BRDA:' + [line, key, i, b].join(',')); + }); + } else { + console.warn('Missing coverage entries in', fileName, key); + } + }); + writer.println('BRF:' + summary.branches.total); + writer.println('BRH:' + summary.branches.covered); + writer.println('end_of_record'); + } + + onEnd() { + this.contentWriter.close(); + } +} + +module.exports = LcovOnlyReport; diff --git a/node_modules/istanbul-reports/lib/none/index.js b/node_modules/istanbul-reports/lib/none/index.js new file mode 100644 index 00000000..81c14088 --- /dev/null +++ b/node_modules/istanbul-reports/lib/none/index.js @@ -0,0 +1,10 @@ +'use strict'; +/* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +const { ReportBase } = require('istanbul-lib-report'); + +class NoneReport extends ReportBase {} + +module.exports = NoneReport; diff --git a/node_modules/istanbul-reports/lib/teamcity/index.js b/node_modules/istanbul-reports/lib/teamcity/index.js new file mode 100644 index 00000000..2bca26a8 --- /dev/null +++ b/node_modules/istanbul-reports/lib/teamcity/index.js @@ -0,0 +1,67 @@ +/* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +'use strict'; +const { ReportBase } = require('istanbul-lib-report'); + +class TeamcityReport extends ReportBase { + constructor(opts) { + super(); + + opts = opts || {}; + this.file = opts.file || null; + this.blockName = opts.blockName || 'Code Coverage Summary'; + } + + onStart(node, context) { + const metrics = node.getCoverageSummary(); + const cw = context.writer.writeFile(this.file); + + cw.println(''); + cw.println("##teamcity[blockOpened name='" + this.blockName + "']"); + + //Statements Covered + cw.println( + lineForKey(metrics.statements.covered, 'CodeCoverageAbsBCovered') + ); + cw.println( + lineForKey(metrics.statements.total, 'CodeCoverageAbsBTotal') + ); + + //Branches Covered + cw.println( + lineForKey(metrics.branches.covered, 'CodeCoverageAbsRCovered') + ); + cw.println(lineForKey(metrics.branches.total, 'CodeCoverageAbsRTotal')); + + //Functions Covered + cw.println( + lineForKey(metrics.functions.covered, 'CodeCoverageAbsMCovered') + ); + cw.println( + lineForKey(metrics.functions.total, 'CodeCoverageAbsMTotal') + ); + + //Lines Covered + cw.println( + lineForKey(metrics.lines.covered, 'CodeCoverageAbsLCovered') + ); + cw.println(lineForKey(metrics.lines.total, 'CodeCoverageAbsLTotal')); + + cw.println("##teamcity[blockClosed name='" + this.blockName + "']"); + cw.close(); + } +} + +function lineForKey(value, teamcityVar) { + return ( + "##teamcity[buildStatisticValue key='" + + teamcityVar + + "' value='" + + value + + "']" + ); +} + +module.exports = TeamcityReport; diff --git a/node_modules/istanbul-reports/lib/text-lcov/index.js b/node_modules/istanbul-reports/lib/text-lcov/index.js new file mode 100644 index 00000000..847aedfd --- /dev/null +++ b/node_modules/istanbul-reports/lib/text-lcov/index.js @@ -0,0 +1,17 @@ +'use strict'; +/* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +const LcovOnly = require('../lcovonly'); + +class TextLcov extends LcovOnly { + constructor(opts) { + super({ + ...opts, + file: '-' + }); + } +} + +module.exports = TextLcov; diff --git a/node_modules/istanbul-reports/lib/text-summary/index.js b/node_modules/istanbul-reports/lib/text-summary/index.js new file mode 100644 index 00000000..a9e6eab3 --- /dev/null +++ b/node_modules/istanbul-reports/lib/text-summary/index.js @@ -0,0 +1,62 @@ +/* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */ +'use strict'; +const { ReportBase } = require('istanbul-lib-report'); + +class TextSummaryReport extends ReportBase { + constructor(opts) { + super(); + + opts = opts || {}; + this.file = opts.file || null; + } + + onStart(node, context) { + const summary = node.getCoverageSummary(); + const cw = context.writer.writeFile(this.file); + const printLine = function(key) { + const str = lineForKey(summary, key); + const clazz = context.classForPercent(key, summary[key].pct); + cw.println(cw.colorize(str, clazz)); + }; + + cw.println(''); + cw.println( + '=============================== Coverage summary ===============================' + ); + printLine('statements'); + printLine('branches'); + printLine('functions'); + printLine('lines'); + cw.println( + '================================================================================' + ); + cw.close(); + } +} + +function lineForKey(summary, key) { + const metrics = summary[key]; + + key = key.substring(0, 1).toUpperCase() + key.substring(1); + if (key.length < 12) { + key += ' '.substring(0, 12 - key.length); + } + const result = [ + key, + ':', + metrics.pct + '%', + '(', + metrics.covered + '/' + metrics.total, + ')' + ].join(' '); + const skipped = metrics.skipped; + if (skipped > 0) { + return result + ', ' + skipped + ' ignored'; + } + return result; +} + +module.exports = TextSummaryReport; diff --git a/node_modules/istanbul-reports/lib/text/index.js b/node_modules/istanbul-reports/lib/text/index.js new file mode 100644 index 00000000..c28cedb0 --- /dev/null +++ b/node_modules/istanbul-reports/lib/text/index.js @@ -0,0 +1,298 @@ +/* + Copyright 2012-2015, Yahoo Inc. + Copyrights licensed under the New BSD License. See the accompanying LICENSE + file for terms. + */ +'use strict'; +const { ReportBase } = require('istanbul-lib-report'); + +const NAME_COL = 4; +const PCT_COLS = 7; +const MISSING_COL = 17; +const TAB_SIZE = 1; +const DELIM = ' | '; + +function padding(num, ch) { + let str = ''; + let i; + ch = ch || ' '; + for (i = 0; i < num; i += 1) { + str += ch; + } + return str; +} + +function fill(str, width, right, tabs) { + tabs = tabs || 0; + str = String(str); + + const leadingSpaces = tabs * TAB_SIZE; + const remaining = width - leadingSpaces; + const leader = padding(leadingSpaces); + let fmtStr = ''; + + if (remaining > 0) { + const strlen = str.length; + let fillStr; + + if (remaining >= strlen) { + fillStr = padding(remaining - strlen); + } else { + fillStr = '...'; + const length = remaining - fillStr.length; + + str = str.substring(strlen - length); + right = true; + } + fmtStr = right ? fillStr + str : str + fillStr; + } + + return leader + fmtStr; +} + +function formatName(name, maxCols, level) { + return fill(name, maxCols, false, level); +} + +function formatPct(pct, width) { + return fill(pct, width || PCT_COLS, true, 0); +} + +function nodeMissing(node) { + if (node.isSummary()) { + return ''; + } + + const metrics = node.getCoverageSummary(); + const isEmpty = metrics.isEmpty(); + const lines = isEmpty ? 0 : metrics.lines.pct; + + let coveredLines; + + const fileCoverage = node.getFileCoverage(); + if (lines === 100) { + const branches = fileCoverage.getBranchCoverageByLine(); + coveredLines = Object.entries(branches).map(([key, { coverage }]) => [ + key, + coverage === 100 + ]); + } else { + coveredLines = Object.entries(fileCoverage.getLineCoverage()); + } + + let newRange = true; + const ranges = coveredLines + .reduce((acum, [line, hit]) => { + if (hit) newRange = true; + else { + line = parseInt(line); + if (newRange) { + acum.push([line]); + newRange = false; + } else acum[acum.length - 1][1] = line; + } + + return acum; + }, []) + .map(range => { + const { length } = range; + + if (length === 1) return range[0]; + + return `${range[0]}-${range[1]}`; + }); + + return [].concat(...ranges).join(','); +} + +function nodeName(node) { + return node.getRelativeName() || 'All files'; +} + +function depthFor(node) { + let ret = 0; + node = node.getParent(); + while (node) { + ret += 1; + node = node.getParent(); + } + return ret; +} + +function nullDepthFor() { + return 0; +} + +function findWidth(node, context, nodeExtractor, depthFor = nullDepthFor) { + let last = 0; + function compareWidth(node) { + last = Math.max( + last, + TAB_SIZE * depthFor(node) + nodeExtractor(node).length + ); + } + const visitor = { + onSummary: compareWidth, + onDetail: compareWidth + }; + node.visit(context.getVisitor(visitor)); + return last; +} + +function makeLine(nameWidth, missingWidth) { + const name = padding(nameWidth, '-'); + const pct = padding(PCT_COLS, '-'); + const elements = []; + + elements.push(name); + elements.push(pct); + elements.push(padding(PCT_COLS + 1, '-')); + elements.push(pct); + elements.push(pct); + elements.push(padding(missingWidth, '-')); + return elements.join(DELIM.replace(/ /g, '-')) + '-'; +} + +function tableHeader(maxNameCols, missingWidth) { + const elements = []; + elements.push(formatName('File', maxNameCols, 0)); + elements.push(formatPct('% Stmts')); + elements.push(formatPct('% Branch', PCT_COLS + 1)); + elements.push(formatPct('% Funcs')); + elements.push(formatPct('% Lines')); + elements.push(formatName('Uncovered Line #s', missingWidth)); + return elements.join(DELIM) + ' '; +} + +function isFull(metrics) { + return ( + metrics.statements.pct === 100 && + metrics.branches.pct === 100 && + metrics.functions.pct === 100 && + metrics.lines.pct === 100 + ); +} + +function tableRow( + node, + context, + colorizer, + maxNameCols, + level, + skipEmpty, + skipFull, + missingWidth +) { + const name = nodeName(node); + const metrics = node.getCoverageSummary(); + const isEmpty = metrics.isEmpty(); + if (skipEmpty && isEmpty) { + return ''; + } + if (skipFull && isFull(metrics)) { + return ''; + } + + const mm = { + statements: isEmpty ? 0 : metrics.statements.pct, + branches: isEmpty ? 0 : metrics.branches.pct, + functions: isEmpty ? 0 : metrics.functions.pct, + lines: isEmpty ? 0 : metrics.lines.pct + }; + const colorize = isEmpty + ? function(str) { + return str; + } + : function(str, key) { + return colorizer(str, context.classForPercent(key, mm[key])); + }; + const elements = []; + + elements.push(colorize(formatName(name, maxNameCols, level), 'statements')); + elements.push(colorize(formatPct(mm.statements), 'statements')); + elements.push(colorize(formatPct(mm.branches, PCT_COLS + 1), 'branches')); + elements.push(colorize(formatPct(mm.functions), 'functions')); + elements.push(colorize(formatPct(mm.lines), 'lines')); + elements.push( + colorizer( + formatName(nodeMissing(node), missingWidth), + mm.lines === 100 ? 'medium' : 'low' + ) + ); + + return elements.join(DELIM) + ' '; +} + +class TextReport extends ReportBase { + constructor(opts) { + super(opts); + + opts = opts || {}; + const { maxCols } = opts; + + this.file = opts.file || null; + this.maxCols = maxCols != null ? maxCols : process.stdout.columns || 80; + this.cw = null; + this.skipEmpty = opts.skipEmpty; + this.skipFull = opts.skipFull; + } + + onStart(root, context) { + this.cw = context.writer.writeFile(this.file); + this.nameWidth = Math.max( + NAME_COL, + findWidth(root, context, nodeName, depthFor) + ); + this.missingWidth = Math.max( + MISSING_COL, + findWidth(root, context, nodeMissing) + ); + + if (this.maxCols > 0) { + const pct_cols = DELIM.length + 4 * (PCT_COLS + DELIM.length) + 2; + + const maxRemaining = this.maxCols - (pct_cols + MISSING_COL); + if (this.nameWidth > maxRemaining) { + this.nameWidth = maxRemaining; + this.missingWidth = MISSING_COL; + } else if (this.nameWidth < maxRemaining) { + const maxRemaining = this.maxCols - (this.nameWidth + pct_cols); + if (this.missingWidth > maxRemaining) { + this.missingWidth = maxRemaining; + } + } + } + const line = makeLine(this.nameWidth, this.missingWidth); + this.cw.println(line); + this.cw.println(tableHeader(this.nameWidth, this.missingWidth)); + this.cw.println(line); + } + + onSummary(node, context) { + const nodeDepth = depthFor(node); + const row = tableRow( + node, + context, + this.cw.colorize.bind(this.cw), + this.nameWidth, + nodeDepth, + this.skipEmpty, + this.skipFull, + this.missingWidth + ); + if (row) { + this.cw.println(row); + } + } + + onDetail(node, context) { + return this.onSummary(node, context); + } + + onEnd() { + this.cw.println(makeLine(this.nameWidth, this.missingWidth)); + this.cw.close(); + } +} + +module.exports = TextReport; diff --git a/node_modules/istanbul-reports/package.json b/node_modules/istanbul-reports/package.json new file mode 100644 index 00000000..abfcb0d7 --- /dev/null +++ b/node_modules/istanbul-reports/package.json @@ -0,0 +1,60 @@ +{ + "name": "istanbul-reports", + "version": "3.1.6", + "description": "istanbul reports", + "author": "Krishnan Anantheswaran ", + "main": "index.js", + "files": [ + "index.js", + "lib" + ], + "scripts": { + "test": "nyc mocha --recursive", + "prepare": "webpack --config lib/html-spa/webpack.config.js --mode production", + "prepare:watch": "webpack --config lib/html-spa/webpack.config.js --watch --mode development" + }, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "devDependencies": { + "@babel/core": "^7.7.5", + "@babel/preset-env": "^7.7.5", + "@babel/preset-react": "^7.7.4", + "babel-loader": "^8.0.6", + "chai": "^4.2.0", + "is-windows": "^1.0.2", + "istanbul-lib-coverage": "^3.0.0", + "mocha": "^6.2.2", + "nyc": "^15.0.0-beta.2", + "react": "^16.12.0", + "react-dom": "^16.12.0", + "webpack": "^4.41.2", + "webpack-cli": "^3.3.10" + }, + "license": "BSD-3-Clause", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/istanbuljs/istanbuljs.git", + "directory": "packages/istanbul-reports" + }, + "keywords": [ + "istanbul", + "reports" + ], + "bugs": { + "url": "https://github.com/istanbuljs/istanbuljs/issues" + }, + "homepage": "https://istanbul.js.org/", + "nyc": { + "exclude": [ + "lib/html/assets/**", + "lib/html-spa/assets/**", + "lib/html-spa/rollup.config.js", + "test/**" + ] + }, + "engines": { + "node": ">=8" + } +} diff --git a/node_modules/jest-changed-files/LICENSE b/node_modules/jest-changed-files/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-changed-files/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-changed-files/README.md b/node_modules/jest-changed-files/README.md new file mode 100644 index 00000000..54b96079 --- /dev/null +++ b/node_modules/jest-changed-files/README.md @@ -0,0 +1,95 @@ +# jest-changed-files + +A module used internally by Jest to check which files have changed since you last committed in git or hg. + +## Install + +```sh +$ npm install --save jest-changed-files +``` + +## API + +### `getChangedFilesForRoots(roots: Array, options: Options): Promise` + +Get the list of files and repos that have changed since the last commit. + +#### Parameters + +roots: Array of string paths gathered from [jest roots](https://jestjs.io/docs/configuration#roots-arraystring). + +options: Object literal with keys + +- lastCommit: boolean +- withAncestor: boolean +- changedSince: string + +### Returns + +A Promise of Object literal with keys + +- changedFiles: Set\ +- repos: + - git: Set\ + - hg: Set\ + +### findRepos(roots: Array): Promise + +Get a set of git and hg repositories. + +#### Parameters + +roots: Array of string paths gathered from [jest roots](https://jestjs.io/docs/configuration#roots-arraystring). + +### Returns + +A Promise of Object literal with keys + +- git: Set\ +- hg: Set\ + +## Usage + +```javascript +import {getChangedFilesForRoots} from 'jest-changed-files'; + +getChangedFilesForRoots(['/path/to/test'], { + lastCommit: true, + withAncestor: true, +}).then(files => { + /* + { + repos: [], + changedFiles: [] + } + */ +}); +``` + +```javascript +import {getChangedFilesForRoots} from 'jest-changed-files'; + +getChangedFilesForRoots(['/path/to/test'], { + changedSince: 'main', +}).then(files => { + /* + { + repos: [], + changedFiles: [] + } + */ +}); +``` + +```javascript +import {findRepos} from 'jest-changed-files'; + +findRepos(['/path/to/test']).then(repos => { + /* + { + git: Set, + hg: Set + } + */ +}); +``` diff --git a/node_modules/jest-changed-files/build/git.js b/node_modules/jest-changed-files/build/git.js new file mode 100644 index 00000000..4a443e42 --- /dev/null +++ b/node_modules/jest-changed-files/build/git.js @@ -0,0 +1,169 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _util() { + const data = require('util'); + _util = function () { + return data; + }; + return data; +} +function _execa() { + const data = _interopRequireDefault(require('execa')); + _execa = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +const findChangedFilesUsingCommand = async (args, cwd) => { + let result; + try { + result = await (0, _execa().default)('git', args, { + cwd + }); + } catch (e) { + if (_util().types.isNativeError(e)) { + const err = e; + // TODO: Should we keep the original `message`? + err.message = err.stderr; + } + throw e; + } + return result.stdout + .split('\n') + .filter(s => s !== '') + .map(changedPath => path().resolve(cwd, changedPath)); +}; +const adapter = { + findChangedFiles: async (cwd, options) => { + const changedSince = + options.withAncestor === true ? 'HEAD^' : options.changedSince; + const includePaths = (options.includePaths ?? []).map(absoluteRoot => + path().normalize(path().relative(cwd, absoluteRoot)) + ); + if (options.lastCommit === true) { + return findChangedFilesUsingCommand( + ['show', '--name-only', '--pretty=format:', 'HEAD', '--'].concat( + includePaths + ), + cwd + ); + } + if (changedSince != null && changedSince.length > 0) { + const [committed, staged, unstaged] = await Promise.all([ + findChangedFilesUsingCommand( + ['diff', '--name-only', `${changedSince}...HEAD`, '--'].concat( + includePaths + ), + cwd + ), + findChangedFilesUsingCommand( + ['diff', '--cached', '--name-only', '--'].concat(includePaths), + cwd + ), + findChangedFilesUsingCommand( + [ + 'ls-files', + '--other', + '--modified', + '--exclude-standard', + '--' + ].concat(includePaths), + cwd + ) + ]); + return [...committed, ...staged, ...unstaged]; + } + const [staged, unstaged] = await Promise.all([ + findChangedFilesUsingCommand( + ['diff', '--cached', '--name-only', '--'].concat(includePaths), + cwd + ), + findChangedFilesUsingCommand( + [ + 'ls-files', + '--other', + '--modified', + '--exclude-standard', + '--' + ].concat(includePaths), + cwd + ) + ]); + return [...staged, ...unstaged]; + }, + getRoot: async cwd => { + const options = ['rev-parse', '--show-cdup']; + try { + const result = await (0, _execa().default)('git', options, { + cwd + }); + return path().resolve(cwd, result.stdout); + } catch { + return null; + } + } +}; +var _default = adapter; +exports.default = _default; diff --git a/node_modules/jest-changed-files/build/hg.js b/node_modules/jest-changed-files/build/hg.js new file mode 100644 index 00000000..b6836c0c --- /dev/null +++ b/node_modules/jest-changed-files/build/hg.js @@ -0,0 +1,130 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _util() { + const data = require('util'); + _util = function () { + return data; + }; + return data; +} +function _execa() { + const data = _interopRequireDefault(require('execa')); + _execa = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +const env = { + ...process.env, + HGPLAIN: '1' +}; +const adapter = { + findChangedFiles: async (cwd, options) => { + const includePaths = options.includePaths ?? []; + const args = ['status', '-amnu']; + if (options.withAncestor === true) { + args.push('--rev', 'first(min(!public() & ::.)^+.^)'); + } else if ( + options.changedSince != null && + options.changedSince.length > 0 + ) { + args.push('--rev', `ancestor(., ${options.changedSince})`); + } else if (options.lastCommit === true) { + args.push('--change', '.'); + } + args.push(...includePaths); + let result; + try { + result = await (0, _execa().default)('hg', args, { + cwd, + env + }); + } catch (e) { + if (_util().types.isNativeError(e)) { + const err = e; + // TODO: Should we keep the original `message`? + err.message = err.stderr; + } + throw e; + } + return result.stdout + .split('\n') + .filter(s => s !== '') + .map(changedPath => path().resolve(cwd, changedPath)); + }, + getRoot: async cwd => { + try { + const result = await (0, _execa().default)('hg', ['root'], { + cwd, + env + }); + return result.stdout; + } catch { + return null; + } + } +}; +var _default = adapter; +exports.default = _default; diff --git a/node_modules/jest-changed-files/build/index.d.ts b/node_modules/jest-changed-files/build/index.d.ts new file mode 100644 index 00000000..fd8e08bf --- /dev/null +++ b/node_modules/jest-changed-files/build/index.d.ts @@ -0,0 +1,36 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare type ChangedFiles = { + repos: Repos; + changedFiles: Paths; +}; + +export declare type ChangedFilesPromise = Promise; + +export declare const findRepos: (roots: Array) => Promise; + +export declare const getChangedFilesForRoots: ( + roots: Array, + options: Options, +) => ChangedFilesPromise; + +declare type Options = { + lastCommit?: boolean; + withAncestor?: boolean; + changedSince?: string; + includePaths?: Array; +}; + +declare type Paths = Set; + +declare type Repos = { + git: Paths; + hg: Paths; + sl: Paths; +}; + +export {}; diff --git a/node_modules/jest-changed-files/build/index.js b/node_modules/jest-changed-files/build/index.js new file mode 100644 index 00000000..c8107dc8 --- /dev/null +++ b/node_modules/jest-changed-files/build/index.js @@ -0,0 +1,82 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.getChangedFilesForRoots = exports.findRepos = void 0; +function _pLimit() { + const data = _interopRequireDefault(require('p-limit')); + _pLimit = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +var _git = _interopRequireDefault(require('./git')); +var _hg = _interopRequireDefault(require('./hg')); +var _sl = _interopRequireDefault(require('./sl')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +// This is an arbitrary number. The main goal is to prevent projects with +// many roots (50+) from spawning too many processes at once. +const mutex = (0, _pLimit().default)(5); +const findGitRoot = dir => mutex(() => _git.default.getRoot(dir)); +const findHgRoot = dir => mutex(() => _hg.default.getRoot(dir)); +const findSlRoot = dir => mutex(() => _sl.default.getRoot(dir)); +const getChangedFilesForRoots = async (roots, options) => { + const repos = await findRepos(roots); + const changedFilesOptions = { + includePaths: roots, + ...options + }; + const gitPromises = Array.from(repos.git, repo => + _git.default.findChangedFiles(repo, changedFilesOptions) + ); + const hgPromises = Array.from(repos.hg, repo => + _hg.default.findChangedFiles(repo, changedFilesOptions) + ); + const slPromises = Array.from(repos.sl, repo => + _sl.default.findChangedFiles(repo, changedFilesOptions) + ); + const changedFiles = ( + await Promise.all([...gitPromises, ...hgPromises, ...slPromises]) + ).reduce((allFiles, changedFilesInTheRepo) => { + for (const file of changedFilesInTheRepo) { + allFiles.add(file); + } + return allFiles; + }, new Set()); + return { + changedFiles, + repos + }; +}; +exports.getChangedFilesForRoots = getChangedFilesForRoots; +const findRepos = async roots => { + const [gitRepos, hgRepos, slRepos] = await Promise.all([ + Promise.all(roots.map(findGitRoot)), + Promise.all(roots.map(findHgRoot)), + Promise.all(roots.map(findSlRoot)) + ]); + return { + git: new Set(gitRepos.filter(_jestUtil().isNonNullable)), + hg: new Set(hgRepos.filter(_jestUtil().isNonNullable)), + sl: new Set(slRepos.filter(_jestUtil().isNonNullable)) + }; +}; +exports.findRepos = findRepos; diff --git a/node_modules/jest-changed-files/build/sl.js b/node_modules/jest-changed-files/build/sl.js new file mode 100644 index 00000000..6c42e589 --- /dev/null +++ b/node_modules/jest-changed-files/build/sl.js @@ -0,0 +1,134 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _util() { + const data = require('util'); + _util = function () { + return data; + }; + return data; +} +function _execa() { + const data = _interopRequireDefault(require('execa')); + _execa = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +/** + * Disable any configuration settings that might change Sapling's default output. + * More info in `sl help environment`. _HG_PLAIN is intentional + */ +const env = { + ...process.env, + HGPLAIN: '1' +}; +const adapter = { + findChangedFiles: async (cwd, options) => { + const includePaths = options.includePaths ?? []; + const args = ['status', '-amnu']; + if (options.withAncestor === true) { + args.push('--rev', 'first(min(!public() & ::.)^+.^)'); + } else if ( + options.changedSince != null && + options.changedSince.length > 0 + ) { + args.push('--rev', `ancestor(., ${options.changedSince})`); + } else if (options.lastCommit === true) { + args.push('--change', '.'); + } + args.push(...includePaths); + let result; + try { + result = await (0, _execa().default)('sl', args, { + cwd, + env + }); + } catch (e) { + if (_util().types.isNativeError(e)) { + const err = e; + // TODO: Should we keep the original `message`? + err.message = err.stderr; + } + throw e; + } + return result.stdout + .split('\n') + .filter(s => s !== '') + .map(changedPath => path().resolve(cwd, changedPath)); + }, + getRoot: async cwd => { + try { + const result = await (0, _execa().default)('sl', ['root'], { + cwd, + env + }); + return result.stdout; + } catch { + return null; + } + } +}; +var _default = adapter; +exports.default = _default; diff --git a/node_modules/jest-changed-files/build/types.js b/node_modules/jest-changed-files/build/types.js new file mode 100644 index 00000000..ad9a93a7 --- /dev/null +++ b/node_modules/jest-changed-files/build/types.js @@ -0,0 +1 @@ +'use strict'; diff --git a/node_modules/jest-changed-files/package.json b/node_modules/jest-changed-files/package.json new file mode 100644 index 00000000..143782dc --- /dev/null +++ b/node_modules/jest-changed-files/package.json @@ -0,0 +1,31 @@ +{ + "name": "jest-changed-files", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-changed-files" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-circus/LICENSE b/node_modules/jest-circus/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-circus/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-circus/README.md b/node_modules/jest-circus/README.md new file mode 100644 index 00000000..6c5c6836 --- /dev/null +++ b/node_modules/jest-circus/README.md @@ -0,0 +1,65 @@ +[type-definitions]: https://github.com/jestjs/jest/blob/main/packages/jest-types/src/Circus.ts + +

+ + +

jest-circus

+

The next-gen test runner for Jest

+

+ +## Overview + +Circus is a flux-based test runner for Jest that is fast, maintainable, and simple to extend. + +Circus allows you to bind to events via an optional event handler on any [custom environment](https://jestjs.io/docs/configuration#testenvironment-string). See the [type definitions][type-definitions] for more information on the events and state data currently available. + +```js +import {Event, State} from 'jest-circus'; +import {TestEnvironment as NodeEnvironment} from 'jest-environment-node'; + +class MyCustomEnvironment extends NodeEnvironment { + //... + + async handleTestEvent(event: Event, state: State) { + if (event.name === 'test_start') { + // ... + } + } +} +``` + +Mutating event or state data is currently unsupported and may cause unexpected behavior or break in a future release without warning. New events, event data, and/or state data will not be considered a breaking change and may be added in any minor release. + +Note, that `jest-circus` test runner would pause until a promise returned from `handleTestEvent` gets fulfilled. **However, there are a few events that do not conform to this rule, namely**: `start_describe_definition`, `finish_describe_definition`, `add_hook`, `add_test` or `error` (for the up-to-date list you can look at [SyncEvent type in the types definitions][type-definitions]). That is caused by backward compatibility reasons and `process.on('unhandledRejection', callback)` signature, but that usually should not be a problem for most of the use cases. + +## Installation + +> Note: As of Jest 27, `jest-circus` is the default test runner, so you do not have to install it to use it. + +Install `jest-circus` using yarn: + +```bash +yarn add --dev jest-circus +``` + +Or via npm: + +```bash +npm install --save-dev jest-circus +``` + +## Configure + +Configure Jest to use `jest-circus` via the [`testRunner`](https://jestjs.io/docs/configuration#testrunner-string) option: + +```json +{ + "testRunner": "jest-circus/runner" +} +``` + +Or via CLI: + +```bash +jest --testRunner='jest-circus/runner' +``` diff --git a/node_modules/jest-circus/build/eventHandler.js b/node_modules/jest-circus/build/eventHandler.js new file mode 100644 index 00000000..ececd7b2 --- /dev/null +++ b/node_modules/jest-circus/build/eventHandler.js @@ -0,0 +1,281 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _jestUtil = require('jest-util'); +var _globalErrorHandlers = require('./globalErrorHandlers'); +var _types = require('./types'); +var _utils = require('./utils'); +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var jestNow = globalThis[Symbol.for('jest-native-now')] || globalThis.Date.now; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +const eventHandler = (event, state) => { + switch (event.name) { + case 'include_test_location_in_result': { + state.includeTestLocationInResult = true; + break; + } + case 'hook_start': { + event.hook.seenDone = false; + break; + } + case 'start_describe_definition': { + const {blockName, mode} = event; + const {currentDescribeBlock, currentlyRunningTest} = state; + if (currentlyRunningTest) { + currentlyRunningTest.errors.push( + new Error( + `Cannot nest a describe inside a test. Describe block "${blockName}" cannot run because it is nested within "${currentlyRunningTest.name}".` + ) + ); + break; + } + const describeBlock = (0, _utils.makeDescribe)( + blockName, + currentDescribeBlock, + mode + ); + currentDescribeBlock.children.push(describeBlock); + state.currentDescribeBlock = describeBlock; + break; + } + case 'finish_describe_definition': { + const {currentDescribeBlock} = state; + (0, _jestUtil.invariant)( + currentDescribeBlock, + 'currentDescribeBlock must be there' + ); + if (!(0, _utils.describeBlockHasTests)(currentDescribeBlock)) { + currentDescribeBlock.hooks.forEach(hook => { + hook.asyncError.message = `Invalid: ${hook.type}() may not be used in a describe block containing no tests.`; + state.unhandledErrors.push(hook.asyncError); + }); + } + + // pass mode of currentDescribeBlock to tests + // but do not when there is already a single test with "only" mode + const shouldPassMode = !( + currentDescribeBlock.mode === 'only' && + currentDescribeBlock.children.some( + child => child.type === 'test' && child.mode === 'only' + ) + ); + if (shouldPassMode) { + currentDescribeBlock.children.forEach(child => { + if (child.type === 'test' && !child.mode) { + child.mode = currentDescribeBlock.mode; + } + }); + } + if ( + !state.hasFocusedTests && + currentDescribeBlock.mode !== 'skip' && + currentDescribeBlock.children.some( + child => child.type === 'test' && child.mode === 'only' + ) + ) { + state.hasFocusedTests = true; + } + if (currentDescribeBlock.parent) { + state.currentDescribeBlock = currentDescribeBlock.parent; + } + break; + } + case 'add_hook': { + const {currentDescribeBlock, currentlyRunningTest, hasStarted} = state; + const {asyncError, fn, hookType: type, timeout} = event; + if (currentlyRunningTest) { + currentlyRunningTest.errors.push( + new Error( + `Hooks cannot be defined inside tests. Hook of type "${type}" is nested within "${currentlyRunningTest.name}".` + ) + ); + break; + } else if (hasStarted) { + state.unhandledErrors.push( + new Error( + 'Cannot add a hook after tests have started running. Hooks must be defined synchronously.' + ) + ); + break; + } + const parent = currentDescribeBlock; + currentDescribeBlock.hooks.push({ + asyncError, + fn, + parent, + seenDone: false, + timeout, + type + }); + break; + } + case 'add_test': { + const {currentDescribeBlock, currentlyRunningTest, hasStarted} = state; + const { + asyncError, + fn, + mode, + testName: name, + timeout, + concurrent, + failing + } = event; + if (currentlyRunningTest) { + currentlyRunningTest.errors.push( + new Error( + `Tests cannot be nested. Test "${name}" cannot run because it is nested within "${currentlyRunningTest.name}".` + ) + ); + break; + } else if (hasStarted) { + state.unhandledErrors.push( + new Error( + 'Cannot add a test after tests have started running. Tests must be defined synchronously.' + ) + ); + break; + } + const test = (0, _utils.makeTest)( + fn, + mode, + concurrent, + name, + currentDescribeBlock, + timeout, + asyncError, + failing + ); + if (currentDescribeBlock.mode !== 'skip' && test.mode === 'only') { + state.hasFocusedTests = true; + } + currentDescribeBlock.children.push(test); + currentDescribeBlock.tests.push(test); + break; + } + case 'hook_failure': { + const {test, describeBlock, error, hook} = event; + const {asyncError, type} = hook; + if (type === 'beforeAll') { + (0, _jestUtil.invariant)( + describeBlock, + 'always present for `*All` hooks' + ); + (0, _utils.addErrorToEachTestUnderDescribe)( + describeBlock, + error, + asyncError + ); + } else if (type === 'afterAll') { + // Attaching `afterAll` errors to each test makes execution flow + // too complicated, so we'll consider them to be global. + state.unhandledErrors.push([error, asyncError]); + } else { + (0, _jestUtil.invariant)(test, 'always present for `*Each` hooks'); + test.errors.push([error, asyncError]); + } + break; + } + case 'test_skip': { + event.test.status = 'skip'; + break; + } + case 'test_todo': { + event.test.status = 'todo'; + break; + } + case 'test_done': { + event.test.duration = (0, _utils.getTestDuration)(event.test); + event.test.status = 'done'; + state.currentlyRunningTest = null; + break; + } + case 'test_start': { + state.currentlyRunningTest = event.test; + event.test.startedAt = jestNow(); + event.test.invocations += 1; + break; + } + case 'test_fn_start': { + event.test.seenDone = false; + break; + } + case 'test_fn_failure': { + const { + error, + test: {asyncError} + } = event; + event.test.errors.push([error, asyncError]); + break; + } + case 'test_retry': { + const logErrorsBeforeRetry = + // eslint-disable-next-line no-restricted-globals + global[_types.LOG_ERRORS_BEFORE_RETRY] || false; + if (logErrorsBeforeRetry) { + event.test.retryReasons.push(...event.test.errors); + } + event.test.errors = []; + break; + } + case 'run_start': { + state.hasStarted = true; + /* eslint-disable no-restricted-globals */ + global[_types.TEST_TIMEOUT_SYMBOL] && + (state.testTimeout = global[_types.TEST_TIMEOUT_SYMBOL]); + /* eslint-enable */ + break; + } + case 'run_finish': { + break; + } + case 'setup': { + // Uncaught exception handlers should be defined on the parent process + // object. If defined on the VM's process object they just no op and let + // the parent process crash. It might make sense to return a `dispatch` + // function to the parent process and register handlers there instead, but + // i'm not sure if this is works. For now i just replicated whatever + // jasmine was doing -- dabramov + state.parentProcess = event.parentProcess; + (0, _jestUtil.invariant)(state.parentProcess); + state.originalGlobalErrorHandlers = (0, + _globalErrorHandlers.injectGlobalErrorHandlers)(state.parentProcess); + if (event.testNamePattern) { + state.testNamePattern = new RegExp(event.testNamePattern, 'i'); + } + break; + } + case 'teardown': { + (0, _jestUtil.invariant)(state.originalGlobalErrorHandlers); + (0, _jestUtil.invariant)(state.parentProcess); + (0, _globalErrorHandlers.restoreGlobalErrorHandlers)( + state.parentProcess, + state.originalGlobalErrorHandlers + ); + break; + } + case 'error': { + // It's very likely for long-running async tests to throw errors. In this + // case we want to catch them and fail the current test. At the same time + // there's a possibility that one test sets a long timeout, that will + // eventually throw after this test finishes but during some other test + // execution, which will result in one test's error failing another test. + // In any way, it should be possible to track where the error was thrown + // from. + state.currentlyRunningTest + ? state.currentlyRunningTest.errors.push(event.error) + : state.unhandledErrors.push(event.error); + break; + } + } +}; +var _default = eventHandler; +exports.default = _default; diff --git a/node_modules/jest-circus/build/formatNodeAssertErrors.js b/node_modules/jest-circus/build/formatNodeAssertErrors.js new file mode 100644 index 00000000..a608c593 --- /dev/null +++ b/node_modules/jest-circus/build/formatNodeAssertErrors.js @@ -0,0 +1,186 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _assert = require('assert'); +var _chalk = _interopRequireDefault(require('chalk')); +var _jestMatcherUtils = require('jest-matcher-utils'); +var _prettyFormat = require('pretty-format'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const assertOperatorsMap = { + '!=': 'notEqual', + '!==': 'notStrictEqual', + '==': 'equal', + '===': 'strictEqual' +}; +const humanReadableOperators = { + deepEqual: 'to deeply equal', + deepStrictEqual: 'to deeply and strictly equal', + equal: 'to be equal', + notDeepEqual: 'not to deeply equal', + notDeepStrictEqual: 'not to deeply and strictly equal', + notEqual: 'to not be equal', + notStrictEqual: 'not be strictly equal', + strictEqual: 'to strictly be equal' +}; +const formatNodeAssertErrors = (event, state) => { + if (event.name === 'test_done') { + event.test.errors = event.test.errors.map(errors => { + let error; + if (Array.isArray(errors)) { + const [originalError, asyncError] = errors; + if (originalError == null) { + error = asyncError; + } else if (!originalError.stack) { + error = asyncError; + error.message = originalError.message + ? originalError.message + : `thrown: ${(0, _prettyFormat.format)(originalError, { + maxDepth: 3 + })}`; + } else { + error = originalError; + } + } else { + error = errors; + } + return isAssertionError(error) + ? { + message: assertionErrorMessage(error, { + expand: state.expand + }) + } + : errors; + }); + } +}; +const getOperatorName = (operator, stack) => { + if (typeof operator === 'string') { + return assertOperatorsMap[operator] || operator; + } + if (stack.match('.doesNotThrow')) { + return 'doesNotThrow'; + } + if (stack.match('.throws')) { + return 'throws'; + } + return ''; +}; +const operatorMessage = operator => { + const niceOperatorName = getOperatorName(operator, ''); + const humanReadableOperator = humanReadableOperators[niceOperatorName]; + return typeof operator === 'string' + ? `${humanReadableOperator || niceOperatorName} to:\n` + : ''; +}; +const assertThrowingMatcherHint = operatorName => + operatorName + ? _chalk.default.dim('assert') + + _chalk.default.dim(`.${operatorName}(`) + + _chalk.default.red('function') + + _chalk.default.dim(')') + : ''; +const assertMatcherHint = (operator, operatorName, expected) => { + let message = ''; + if (operator === '==' && expected === true) { + message = + _chalk.default.dim('assert') + + _chalk.default.dim('(') + + _chalk.default.red('received') + + _chalk.default.dim(')'); + } else if (operatorName) { + message = + _chalk.default.dim('assert') + + _chalk.default.dim(`.${operatorName}(`) + + _chalk.default.red('received') + + _chalk.default.dim(', ') + + _chalk.default.green('expected') + + _chalk.default.dim(')'); + } + return message; +}; +function assertionErrorMessage(error, options) { + const {expected, actual, generatedMessage, message, operator, stack} = error; + const diffString = (0, _jestMatcherUtils.diff)(expected, actual, options); + const hasCustomMessage = !generatedMessage; + const operatorName = getOperatorName(operator, stack); + const trimmedStack = stack + .replace(message, '') + .replace(/AssertionError(.*)/g, ''); + if (operatorName === 'doesNotThrow') { + return ( + // eslint-disable-next-line prefer-template + buildHintString(assertThrowingMatcherHint(operatorName)) + + _chalk.default.reset('Expected the function not to throw an error.\n') + + _chalk.default.reset('Instead, it threw:\n') + + ` ${(0, _jestMatcherUtils.printReceived)(actual)}` + + _chalk.default.reset( + hasCustomMessage ? `\n\nMessage:\n ${message}` : '' + ) + + trimmedStack + ); + } + if (operatorName === 'throws') { + if (error.generatedMessage) { + return ( + buildHintString(assertThrowingMatcherHint(operatorName)) + + _chalk.default.reset(error.message) + + _chalk.default.reset( + hasCustomMessage ? `\n\nMessage:\n ${message}` : '' + ) + + trimmedStack + ); + } + return ( + buildHintString(assertThrowingMatcherHint(operatorName)) + + _chalk.default.reset('Expected the function to throw an error.\n') + + _chalk.default.reset("But it didn't throw anything.") + + _chalk.default.reset( + hasCustomMessage ? `\n\nMessage:\n ${message}` : '' + ) + + trimmedStack + ); + } + if (operatorName === 'fail') { + return ( + buildHintString(assertMatcherHint(operator, operatorName, expected)) + + _chalk.default.reset(hasCustomMessage ? `Message:\n ${message}` : '') + + trimmedStack + ); + } + return ( + // eslint-disable-next-line prefer-template + buildHintString(assertMatcherHint(operator, operatorName, expected)) + + _chalk.default.reset(`Expected value ${operatorMessage(operator)}`) + + ` ${(0, _jestMatcherUtils.printExpected)(expected)}\n` + + _chalk.default.reset('Received:\n') + + ` ${(0, _jestMatcherUtils.printReceived)(actual)}` + + _chalk.default.reset(hasCustomMessage ? `\n\nMessage:\n ${message}` : '') + + (diffString ? `\n\nDifference:\n\n${diffString}` : '') + + trimmedStack + ); +} +function isAssertionError(error) { + return ( + error && + (error instanceof _assert.AssertionError || + error.name === _assert.AssertionError.name || + error.code === 'ERR_ASSERTION') + ); +} +function buildHintString(hint) { + return hint ? `${hint}\n\n` : ''; +} +var _default = formatNodeAssertErrors; +exports.default = _default; diff --git a/node_modules/jest-circus/build/globalErrorHandlers.js b/node_modules/jest-circus/build/globalErrorHandlers.js new file mode 100644 index 00000000..888232a0 --- /dev/null +++ b/node_modules/jest-circus/build/globalErrorHandlers.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.restoreGlobalErrorHandlers = exports.injectGlobalErrorHandlers = void 0; +var _state = require('./state'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const uncaught = error => { + (0, _state.dispatchSync)({ + error, + name: 'error' + }); +}; +const injectGlobalErrorHandlers = parentProcess => { + const uncaughtException = process.listeners('uncaughtException').slice(); + const unhandledRejection = process.listeners('unhandledRejection').slice(); + parentProcess.removeAllListeners('uncaughtException'); + parentProcess.removeAllListeners('unhandledRejection'); + parentProcess.on('uncaughtException', uncaught); + parentProcess.on('unhandledRejection', uncaught); + return { + uncaughtException, + unhandledRejection + }; +}; +exports.injectGlobalErrorHandlers = injectGlobalErrorHandlers; +const restoreGlobalErrorHandlers = (parentProcess, originalErrorHandlers) => { + parentProcess.removeListener('uncaughtException', uncaught); + parentProcess.removeListener('unhandledRejection', uncaught); + for (const listener of originalErrorHandlers.uncaughtException) { + parentProcess.on('uncaughtException', listener); + } + for (const listener of originalErrorHandlers.unhandledRejection) { + parentProcess.on('unhandledRejection', listener); + } +}; +exports.restoreGlobalErrorHandlers = restoreGlobalErrorHandlers; diff --git a/node_modules/jest-circus/build/index.d.ts b/node_modules/jest-circus/build/index.d.ts new file mode 100644 index 00000000..654496e7 --- /dev/null +++ b/node_modules/jest-circus/build/index.d.ts @@ -0,0 +1,72 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {Circus} from '@jest/types'; +import type {Global} from '@jest/types'; + +export declare const afterAll: THook; + +export declare const afterEach: THook; + +export declare const beforeAll: THook; + +export declare const beforeEach: THook; + +declare const _default: { + afterAll: THook; + afterEach: THook; + beforeAll: THook; + beforeEach: THook; + describe: { + (blockName: Global.BlockNameLike, blockFn: Global.BlockFn): void; + each: Global.EachTestFn; + only: { + (blockName: Global.BlockNameLike, blockFn: Global.BlockFn): void; + each: Global.EachTestFn; + }; + skip: { + (blockName: Global.BlockNameLike, blockFn: Global.BlockFn): void; + each: Global.EachTestFn; + }; + }; + it: Global.It; + test: Global.It; +}; +export default _default; + +export declare const describe: { + (blockName: Circus.BlockNameLike, blockFn: Circus.BlockFn): void; + each: Global.EachTestFn; + only: { + (blockName: Circus.BlockNameLike, blockFn: Circus.BlockFn): void; + each: Global.EachTestFn; + }; + skip: { + (blockName: Circus.BlockNameLike, blockFn: Circus.BlockFn): void; + each: Global.EachTestFn; + }; +}; + +declare type Event_2 = Circus.Event; +export {Event_2 as Event}; + +export declare const getState: () => Circus.State; + +export declare const it: Global.It; + +export declare const resetState: () => void; + +export declare const run: () => Promise; + +export declare const setState: (state: Circus.State) => Circus.State; + +export declare type State = Circus.State; + +export declare const test: Global.It; + +declare type THook = (fn: Circus.HookFn, timeout?: number) => void; + +export {}; diff --git a/node_modules/jest-circus/build/index.js b/node_modules/jest-circus/build/index.js new file mode 100644 index 00000000..97a2521c --- /dev/null +++ b/node_modules/jest-circus/build/index.js @@ -0,0 +1,238 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.describe = + exports.default = + exports.beforeEach = + exports.beforeAll = + exports.afterEach = + exports.afterAll = + void 0; +Object.defineProperty(exports, 'getState', { + enumerable: true, + get: function () { + return _state.getState; + } +}); +exports.it = void 0; +Object.defineProperty(exports, 'resetState', { + enumerable: true, + get: function () { + return _state.resetState; + } +}); +Object.defineProperty(exports, 'run', { + enumerable: true, + get: function () { + return _run.default; + } +}); +Object.defineProperty(exports, 'setState', { + enumerable: true, + get: function () { + return _state.setState; + } +}); +exports.test = void 0; +var _jestEach = require('jest-each'); +var _jestUtil = require('jest-util'); +var _state = require('./state'); +var _run = _interopRequireDefault(require('./run')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const describe = (() => { + const describe = (blockName, blockFn) => + _dispatchDescribe(blockFn, blockName, describe); + const only = (blockName, blockFn) => + _dispatchDescribe(blockFn, blockName, only, 'only'); + const skip = (blockName, blockFn) => + _dispatchDescribe(blockFn, blockName, skip, 'skip'); + describe.each = (0, _jestEach.bind)(describe, false); + only.each = (0, _jestEach.bind)(only, false); + skip.each = (0, _jestEach.bind)(skip, false); + describe.only = only; + describe.skip = skip; + return describe; +})(); +exports.describe = describe; +const _dispatchDescribe = (blockFn, blockName, describeFn, mode) => { + const asyncError = new _jestUtil.ErrorWithStack(undefined, describeFn); + if (blockFn === undefined) { + asyncError.message = + 'Missing second argument. It must be a callback function.'; + throw asyncError; + } + if (typeof blockFn !== 'function') { + asyncError.message = `Invalid second argument, ${blockFn}. It must be a callback function.`; + throw asyncError; + } + try { + blockName = (0, _jestUtil.convertDescriptorToString)(blockName); + } catch (error) { + asyncError.message = error.message; + throw asyncError; + } + (0, _state.dispatchSync)({ + asyncError, + blockName, + mode, + name: 'start_describe_definition' + }); + const describeReturn = blockFn(); + if ((0, _jestUtil.isPromise)(describeReturn)) { + throw new _jestUtil.ErrorWithStack( + 'Returning a Promise from "describe" is not supported. Tests must be defined synchronously.', + describeFn + ); + } else if (describeReturn !== undefined) { + throw new _jestUtil.ErrorWithStack( + 'A "describe" callback must not return a value.', + describeFn + ); + } + (0, _state.dispatchSync)({ + blockName, + mode, + name: 'finish_describe_definition' + }); +}; +const _addHook = (fn, hookType, hookFn, timeout) => { + const asyncError = new _jestUtil.ErrorWithStack(undefined, hookFn); + if (typeof fn !== 'function') { + asyncError.message = + 'Invalid first argument. It must be a callback function.'; + throw asyncError; + } + (0, _state.dispatchSync)({ + asyncError, + fn, + hookType, + name: 'add_hook', + timeout + }); +}; + +// Hooks have to pass themselves to the HOF in order for us to trim stack traces. +const beforeEach = (fn, timeout) => + _addHook(fn, 'beforeEach', beforeEach, timeout); +exports.beforeEach = beforeEach; +const beforeAll = (fn, timeout) => + _addHook(fn, 'beforeAll', beforeAll, timeout); +exports.beforeAll = beforeAll; +const afterEach = (fn, timeout) => + _addHook(fn, 'afterEach', afterEach, timeout); +exports.afterEach = afterEach; +const afterAll = (fn, timeout) => _addHook(fn, 'afterAll', afterAll, timeout); +exports.afterAll = afterAll; +const test = (() => { + const test = (testName, fn, timeout) => + _addTest(testName, undefined, false, fn, test, timeout); + const skip = (testName, fn, timeout) => + _addTest(testName, 'skip', false, fn, skip, timeout); + const only = (testName, fn, timeout) => + _addTest(testName, 'only', false, fn, test.only, timeout); + const concurrentTest = (testName, fn, timeout) => + _addTest(testName, undefined, true, fn, concurrentTest, timeout); + const concurrentOnly = (testName, fn, timeout) => + _addTest(testName, 'only', true, fn, concurrentOnly, timeout); + const bindFailing = (concurrent, mode) => { + const failing = (testName, fn, timeout, eachError) => + _addTest( + testName, + mode, + concurrent, + fn, + failing, + timeout, + true, + eachError + ); + failing.each = (0, _jestEach.bind)(failing, false, true); + return failing; + }; + test.todo = (testName, ...rest) => { + if (rest.length > 0 || typeof testName !== 'string') { + throw new _jestUtil.ErrorWithStack( + 'Todo must be called with only a description.', + test.todo + ); + } + // eslint-disable-next-line @typescript-eslint/no-empty-function + return _addTest(testName, 'todo', false, () => {}, test.todo); + }; + const _addTest = ( + testName, + mode, + concurrent, + fn, + testFn, + timeout, + failing, + asyncError = new _jestUtil.ErrorWithStack(undefined, testFn) + ) => { + try { + testName = (0, _jestUtil.convertDescriptorToString)(testName); + } catch (error) { + asyncError.message = error.message; + throw asyncError; + } + if (fn === undefined) { + asyncError.message = + 'Missing second argument. It must be a callback function. Perhaps you want to use `test.todo` for a test placeholder.'; + throw asyncError; + } + if (typeof fn !== 'function') { + asyncError.message = `Invalid second argument, ${fn}. It must be a callback function.`; + throw asyncError; + } + return (0, _state.dispatchSync)({ + asyncError, + concurrent, + failing: failing === undefined ? false : failing, + fn, + mode, + name: 'add_test', + testName, + timeout + }); + }; + test.each = (0, _jestEach.bind)(test); + only.each = (0, _jestEach.bind)(only); + skip.each = (0, _jestEach.bind)(skip); + concurrentTest.each = (0, _jestEach.bind)(concurrentTest, false); + concurrentOnly.each = (0, _jestEach.bind)(concurrentOnly, false); + only.failing = bindFailing(false, 'only'); + skip.failing = bindFailing(false, 'skip'); + test.failing = bindFailing(false); + test.only = only; + test.skip = skip; + test.concurrent = concurrentTest; + concurrentTest.only = concurrentOnly; + concurrentTest.skip = skip; + concurrentTest.failing = bindFailing(true); + concurrentOnly.failing = bindFailing(true, 'only'); + return test; +})(); +exports.test = test; +const it = test; +exports.it = it; +var _default = { + afterAll, + afterEach, + beforeAll, + beforeEach, + describe, + it, + test +}; +exports.default = _default; diff --git a/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js b/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js new file mode 100644 index 00000000..423eeb4b --- /dev/null +++ b/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js @@ -0,0 +1,117 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _jestUtil = require('jest-util'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const FRAMEWORK_INITIALIZER = require.resolve('./jestAdapterInit'); +const jestAdapter = async ( + globalConfig, + config, + environment, + runtime, + testPath, + sendMessageToJest +) => { + const {initialize, runAndTransformResultsToJestFormat} = + runtime.requireInternalModule(FRAMEWORK_INITIALIZER); + const {globals, snapshotState} = await initialize({ + config, + environment, + globalConfig, + localRequire: runtime.requireModule.bind(runtime), + parentProcess: process, + sendMessageToJest, + setGlobalsForRuntime: runtime.setGlobalsForRuntime.bind(runtime), + testPath + }); + if (config.fakeTimers.enableGlobally) { + if (config.fakeTimers.legacyFakeTimers) { + // during setup, this cannot be null (and it's fine to explode if it is) + environment.fakeTimers.useFakeTimers(); + } else { + environment.fakeTimersModern.useFakeTimers(); + } + } + globals.beforeEach(() => { + if (config.resetModules) { + runtime.resetModules(); + } + if (config.clearMocks) { + runtime.clearAllMocks(); + } + if (config.resetMocks) { + runtime.resetAllMocks(); + if ( + config.fakeTimers.enableGlobally && + config.fakeTimers.legacyFakeTimers + ) { + // during setup, this cannot be null (and it's fine to explode if it is) + environment.fakeTimers.useFakeTimers(); + } + } + if (config.restoreMocks) { + runtime.restoreAllMocks(); + } + }); + for (const path of config.setupFilesAfterEnv) { + const esm = runtime.unstable_shouldLoadAsEsm(path); + if (esm) { + await runtime.unstable_importModule(path); + } else { + runtime.requireModule(path); + } + } + const esm = runtime.unstable_shouldLoadAsEsm(testPath); + if (esm) { + await runtime.unstable_importModule(testPath); + } else { + runtime.requireModule(testPath); + } + const results = await runAndTransformResultsToJestFormat({ + config, + globalConfig, + testPath + }); + _addSnapshotData(results, snapshotState); + + // We need to copy the results object to ensure we don't leaks the prototypes + // from the VM. Jasmine creates the result objects in the parent process, we + // should consider doing that for circus as well. + return (0, _jestUtil.deepCyclicCopy)(results, { + keepPrototype: false + }); +}; +const _addSnapshotData = (results, snapshotState) => { + results.testResults.forEach(({fullName, status}) => { + if (status === 'pending' || status === 'failed') { + // if test is skipped or failed, we don't want to mark + // its snapshots as obsolete. + snapshotState.markSnapshotsAsCheckedForTest(fullName); + } + }); + const uncheckedCount = snapshotState.getUncheckedCount(); + const uncheckedKeys = snapshotState.getUncheckedKeys(); + if (uncheckedCount) { + snapshotState.removeUncheckedKeys(); + } + const status = snapshotState.save(); + results.snapshot.fileDeleted = status.deleted; + results.snapshot.added = snapshotState.added; + results.snapshot.matched = snapshotState.matched; + results.snapshot.unmatched = snapshotState.unmatched; + results.snapshot.updated = snapshotState.updated; + results.snapshot.unchecked = !status.deleted ? uncheckedCount : 0; + // Copy the array to prevent memory leaks + results.snapshot.uncheckedKeys = Array.from(uncheckedKeys); +}; +var _default = jestAdapter; +exports.default = _default; diff --git a/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js b/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js new file mode 100644 index 00000000..1528b99d --- /dev/null +++ b/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js @@ -0,0 +1,240 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.runAndTransformResultsToJestFormat = exports.initialize = void 0; +var _expect = require('@jest/expect'); +var _testResult = require('@jest/test-result'); +var _jestMessageUtil = require('jest-message-util'); +var _jestSnapshot = require('jest-snapshot'); +var _ = _interopRequireDefault(require('..')); +var _run = _interopRequireDefault(require('../run')); +var _state = require('../state'); +var _testCaseReportHandler = _interopRequireDefault( + require('../testCaseReportHandler') +); +var _utils = require('../utils'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const initialize = async ({ + config, + environment, + globalConfig, + localRequire, + parentProcess, + sendMessageToJest, + setGlobalsForRuntime, + testPath +}) => { + if (globalConfig.testTimeout) { + (0, _state.getState)().testTimeout = globalConfig.testTimeout; + } + (0, _state.getState)().maxConcurrency = globalConfig.maxConcurrency; + (0, _state.getState)().randomize = globalConfig.randomize; + (0, _state.getState)().seed = globalConfig.seed; + + // @ts-expect-error: missing `concurrent` which is added later + const globalsObject = { + ..._.default, + fdescribe: _.default.describe.only, + fit: _.default.it.only, + xdescribe: _.default.describe.skip, + xit: _.default.it.skip, + xtest: _.default.it.skip + }; + (0, _state.addEventHandler)(eventHandler); + if (environment.handleTestEvent) { + (0, _state.addEventHandler)(environment.handleTestEvent.bind(environment)); + } + _expect.jestExpect.setState({ + expand: globalConfig.expand + }); + const runtimeGlobals = { + ...globalsObject, + expect: _expect.jestExpect + }; + setGlobalsForRuntime(runtimeGlobals); + if (config.injectGlobals) { + Object.assign(environment.global, runtimeGlobals); + } + await (0, _state.dispatch)({ + name: 'setup', + parentProcess, + runtimeGlobals, + testNamePattern: globalConfig.testNamePattern + }); + if (config.testLocationInResults) { + await (0, _state.dispatch)({ + name: 'include_test_location_in_result' + }); + } + + // Jest tests snapshotSerializers in order preceding built-in serializers. + // Therefore, add in reverse because the last added is the first tested. + config.snapshotSerializers + .concat() + .reverse() + .forEach(path => (0, _jestSnapshot.addSerializer)(localRequire(path))); + const snapshotResolver = await (0, _jestSnapshot.buildSnapshotResolver)( + config, + localRequire + ); + const snapshotPath = snapshotResolver.resolveSnapshotPath(testPath); + const snapshotState = new _jestSnapshot.SnapshotState(snapshotPath, { + expand: globalConfig.expand, + prettierPath: config.prettierPath, + rootDir: config.rootDir, + snapshotFormat: config.snapshotFormat, + updateSnapshot: globalConfig.updateSnapshot + }); + _expect.jestExpect.setState({ + snapshotState, + testPath + }); + (0, _state.addEventHandler)(handleSnapshotStateAfterRetry(snapshotState)); + if (sendMessageToJest) { + (0, _state.addEventHandler)( + (0, _testCaseReportHandler.default)(testPath, sendMessageToJest) + ); + } + + // Return it back to the outer scope (test runner outside the VM). + return { + globals: globalsObject, + snapshotState + }; +}; +exports.initialize = initialize; +const runAndTransformResultsToJestFormat = async ({ + config, + globalConfig, + testPath +}) => { + const runResult = await (0, _run.default)(); + let numFailingTests = 0; + let numPassingTests = 0; + let numPendingTests = 0; + let numTodoTests = 0; + const assertionResults = runResult.testResults.map(testResult => { + let status; + if (testResult.status === 'skip') { + status = 'pending'; + numPendingTests += 1; + } else if (testResult.status === 'todo') { + status = 'todo'; + numTodoTests += 1; + } else if (testResult.errors.length) { + status = 'failed'; + numFailingTests += 1; + } else { + status = 'passed'; + numPassingTests += 1; + } + const ancestorTitles = testResult.testPath.filter( + name => name !== _state.ROOT_DESCRIBE_BLOCK_NAME + ); + const title = ancestorTitles.pop(); + return { + ancestorTitles, + duration: testResult.duration, + failureDetails: testResult.errorsDetailed, + failureMessages: testResult.errors, + fullName: title + ? ancestorTitles.concat(title).join(' ') + : ancestorTitles.join(' '), + invocations: testResult.invocations, + location: testResult.location, + numPassingAsserts: testResult.numPassingAsserts, + retryReasons: testResult.retryReasons, + status, + title: testResult.testPath[testResult.testPath.length - 1] + }; + }); + let failureMessage = (0, _jestMessageUtil.formatResultsErrors)( + assertionResults, + config, + globalConfig, + testPath + ); + let testExecError; + if (runResult.unhandledErrors.length) { + testExecError = { + message: '', + stack: runResult.unhandledErrors.join('\n') + }; + failureMessage = `${failureMessage || ''}\n\n${runResult.unhandledErrors + .map(err => + (0, _jestMessageUtil.formatExecError)(err, config, globalConfig) + ) + .join('\n')}`; + } + await (0, _state.dispatch)({ + name: 'teardown' + }); + return { + ...(0, _testResult.createEmptyTestResult)(), + console: undefined, + displayName: config.displayName, + failureMessage, + numFailingTests, + numPassingTests, + numPendingTests, + numTodoTests, + testExecError, + testFilePath: testPath, + testResults: assertionResults + }; +}; +exports.runAndTransformResultsToJestFormat = runAndTransformResultsToJestFormat; +const handleSnapshotStateAfterRetry = snapshotState => event => { + switch (event.name) { + case 'test_retry': { + // Clear any snapshot data that occurred in previous test run + snapshotState.clear(); + } + } +}; +const eventHandler = async event => { + switch (event.name) { + case 'test_start': { + _expect.jestExpect.setState({ + currentTestName: (0, _utils.getTestID)(event.test) + }); + break; + } + case 'test_done': { + event.test.numPassingAsserts = + _expect.jestExpect.getState().numPassingAsserts; + _addSuppressedErrors(event.test); + _addExpectedAssertionErrors(event.test); + break; + } + } +}; +const _addExpectedAssertionErrors = test => { + const failures = _expect.jestExpect.extractExpectedAssertionsErrors(); + const errors = failures.map(failure => failure.error); + test.errors = test.errors.concat(errors); +}; + +// Get suppressed errors from ``jest-matchers`` that weren't throw during +// test execution and add them to the test result, potentially failing +// a passing test. +const _addSuppressedErrors = test => { + const {suppressedErrors} = _expect.jestExpect.getState(); + _expect.jestExpect.setState({ + suppressedErrors: [] + }); + if (suppressedErrors.length) { + test.errors = test.errors.concat(suppressedErrors); + } +}; diff --git a/node_modules/jest-circus/build/run.js b/node_modules/jest-circus/build/run.js new file mode 100644 index 00000000..294b9e59 --- /dev/null +++ b/node_modules/jest-circus/build/run.js @@ -0,0 +1,350 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _async_hooks = require('async_hooks'); +var _pLimit = _interopRequireDefault(require('p-limit')); +var _expect = require('@jest/expect'); +var _jestUtil = require('jest-util'); +var _shuffleArray = _interopRequireWildcard(require('./shuffleArray')); +var _state = require('./state'); +var _types = require('./types'); +var _utils = require('./utils'); +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const run = async () => { + const {rootDescribeBlock, seed, randomize} = (0, _state.getState)(); + const rng = randomize ? (0, _shuffleArray.rngBuilder)(seed) : undefined; + await (0, _state.dispatch)({ + name: 'run_start' + }); + await _runTestsForDescribeBlock(rootDescribeBlock, rng, true); + await (0, _state.dispatch)({ + name: 'run_finish' + }); + return (0, _utils.makeRunResult)( + (0, _state.getState)().rootDescribeBlock, + (0, _state.getState)().unhandledErrors + ); +}; +const _runTestsForDescribeBlock = async ( + describeBlock, + rng, + isRootBlock = false +) => { + await (0, _state.dispatch)({ + describeBlock, + name: 'run_describe_start' + }); + const {beforeAll, afterAll} = (0, _utils.getAllHooksForDescribe)( + describeBlock + ); + const isSkipped = describeBlock.mode === 'skip'; + if (!isSkipped) { + for (const hook of beforeAll) { + await _callCircusHook({ + describeBlock, + hook + }); + } + } + if (isRootBlock) { + const concurrentTests = collectConcurrentTests(describeBlock); + if (concurrentTests.length > 0) { + startTestsConcurrently(concurrentTests); + } + } + + // Tests that fail and are retried we run after other tests + // eslint-disable-next-line no-restricted-globals + const retryTimes = parseInt(global[_types.RETRY_TIMES], 10) || 0; + const deferredRetryTests = []; + if (rng) { + describeBlock.children = (0, _shuffleArray.default)( + describeBlock.children, + rng + ); + } + for (const child of describeBlock.children) { + switch (child.type) { + case 'describeBlock': { + await _runTestsForDescribeBlock(child, rng); + break; + } + case 'test': { + const hasErrorsBeforeTestRun = child.errors.length > 0; + await _runTest(child, isSkipped); + if ( + hasErrorsBeforeTestRun === false && + retryTimes > 0 && + child.errors.length > 0 + ) { + deferredRetryTests.push(child); + } + break; + } + } + } + + // Re-run failed tests n-times if configured + for (const test of deferredRetryTests) { + let numRetriesAvailable = retryTimes; + while (numRetriesAvailable > 0 && test.errors.length > 0) { + // Clear errors so retries occur + await (0, _state.dispatch)({ + name: 'test_retry', + test + }); + await _runTest(test, isSkipped); + numRetriesAvailable--; + } + } + if (!isSkipped) { + for (const hook of afterAll) { + await _callCircusHook({ + describeBlock, + hook + }); + } + } + await (0, _state.dispatch)({ + describeBlock, + name: 'run_describe_finish' + }); +}; +function collectConcurrentTests(describeBlock) { + if (describeBlock.mode === 'skip') { + return []; + } + const {hasFocusedTests, testNamePattern} = (0, _state.getState)(); + return describeBlock.children.flatMap(child => { + switch (child.type) { + case 'describeBlock': + return collectConcurrentTests(child); + case 'test': + const skip = + !child.concurrent || + child.mode === 'skip' || + (hasFocusedTests && child.mode !== 'only') || + (testNamePattern && + !testNamePattern.test((0, _utils.getTestID)(child))); + return skip ? [] : [child]; + } + }); +} +function startTestsConcurrently(concurrentTests) { + const mutex = (0, _pLimit.default)((0, _state.getState)().maxConcurrency); + const testNameStorage = new _async_hooks.AsyncLocalStorage(); + _expect.jestExpect.setState({ + currentConcurrentTestName: () => testNameStorage.getStore() + }); + for (const test of concurrentTests) { + try { + const testFn = test.fn; + const promise = mutex(() => + testNameStorage.run((0, _utils.getTestID)(test), testFn) + ); + // Avoid triggering the uncaught promise rejection handler in case the + // test fails before being awaited on. + // eslint-disable-next-line @typescript-eslint/no-empty-function + promise.catch(() => {}); + test.fn = () => promise; + } catch (err) { + test.fn = () => { + throw err; + }; + } + } +} +const _runTest = async (test, parentSkipped) => { + await (0, _state.dispatch)({ + name: 'test_start', + test + }); + const testContext = Object.create(null); + const {hasFocusedTests, testNamePattern} = (0, _state.getState)(); + const isSkipped = + parentSkipped || + test.mode === 'skip' || + (hasFocusedTests && test.mode === undefined) || + (testNamePattern && !testNamePattern.test((0, _utils.getTestID)(test))); + if (isSkipped) { + await (0, _state.dispatch)({ + name: 'test_skip', + test + }); + return; + } + if (test.mode === 'todo') { + await (0, _state.dispatch)({ + name: 'test_todo', + test + }); + return; + } + await (0, _state.dispatch)({ + name: 'test_started', + test + }); + const {afterEach, beforeEach} = (0, _utils.getEachHooksForTest)(test); + for (const hook of beforeEach) { + if (test.errors.length) { + // If any of the before hooks failed already, we don't run any + // hooks after that. + break; + } + await _callCircusHook({ + hook, + test, + testContext + }); + } + await _callCircusTest(test, testContext); + for (const hook of afterEach) { + await _callCircusHook({ + hook, + test, + testContext + }); + } + + // `afterAll` hooks should not affect test status (pass or fail), because if + // we had a global `afterAll` hook it would block all existing tests until + // this hook is executed. So we dispatch `test_done` right away. + await (0, _state.dispatch)({ + name: 'test_done', + test + }); +}; +const _callCircusHook = async ({ + hook, + test, + describeBlock, + testContext = {} +}) => { + await (0, _state.dispatch)({ + hook, + name: 'hook_start' + }); + const timeout = hook.timeout || (0, _state.getState)().testTimeout; + try { + await (0, _utils.callAsyncCircusFn)(hook, testContext, { + isHook: true, + timeout + }); + await (0, _state.dispatch)({ + describeBlock, + hook, + name: 'hook_success', + test + }); + } catch (error) { + await (0, _state.dispatch)({ + describeBlock, + error, + hook, + name: 'hook_failure', + test + }); + } +}; +const _callCircusTest = async (test, testContext) => { + await (0, _state.dispatch)({ + name: 'test_fn_start', + test + }); + const timeout = test.timeout || (0, _state.getState)().testTimeout; + (0, _jestUtil.invariant)( + test.fn, + "Tests with no 'fn' should have 'mode' set to 'skipped'" + ); + if (test.errors.length) { + return; // We don't run the test if there's already an error in before hooks. + } + + try { + await (0, _utils.callAsyncCircusFn)(test, testContext, { + isHook: false, + timeout + }); + if (test.failing) { + test.asyncError.message = + 'Failing test passed even though it was supposed to fail. Remove `.failing` to remove error.'; + await (0, _state.dispatch)({ + error: test.asyncError, + name: 'test_fn_failure', + test + }); + } else { + await (0, _state.dispatch)({ + name: 'test_fn_success', + test + }); + } + } catch (error) { + if (test.failing) { + await (0, _state.dispatch)({ + name: 'test_fn_success', + test + }); + } else { + await (0, _state.dispatch)({ + error, + name: 'test_fn_failure', + test + }); + } + } +}; +var _default = run; +exports.default = _default; diff --git a/node_modules/jest-circus/build/shuffleArray.js b/node_modules/jest-circus/build/shuffleArray.js new file mode 100644 index 00000000..cc9d442a --- /dev/null +++ b/node_modules/jest-circus/build/shuffleArray.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = shuffleArray; +exports.rngBuilder = void 0; +var _pureRand = require('pure-rand'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Generates [from, to] inclusive + +const rngBuilder = seed => { + const gen = (0, _pureRand.xoroshiro128plus)(seed); + return { + next: (from, to) => + (0, _pureRand.unsafeUniformIntDistribution)(from, to, gen) + }; +}; + +// Fisher-Yates shuffle +// This is performed in-place +exports.rngBuilder = rngBuilder; +function shuffleArray(array, random) { + const length = array.length; + if (length === 0) { + return []; + } + for (let i = 0; i < length; i++) { + const n = random.next(i, length - 1); + const value = array[i]; + array[i] = array[n]; + array[n] = value; + } + return array; +} diff --git a/node_modules/jest-circus/build/state.js b/node_modules/jest-circus/build/state.js new file mode 100644 index 00000000..0fe5e8d4 --- /dev/null +++ b/node_modules/jest-circus/build/state.js @@ -0,0 +1,80 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.setState = + exports.resetState = + exports.getState = + exports.dispatchSync = + exports.dispatch = + exports.addEventHandler = + exports.ROOT_DESCRIBE_BLOCK_NAME = + void 0; +var _eventHandler = _interopRequireDefault(require('./eventHandler')); +var _formatNodeAssertErrors = _interopRequireDefault( + require('./formatNodeAssertErrors') +); +var _types = require('./types'); +var _utils = require('./utils'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const eventHandlers = [_eventHandler.default, _formatNodeAssertErrors.default]; +const ROOT_DESCRIBE_BLOCK_NAME = 'ROOT_DESCRIBE_BLOCK'; +exports.ROOT_DESCRIBE_BLOCK_NAME = ROOT_DESCRIBE_BLOCK_NAME; +const createState = () => { + const ROOT_DESCRIBE_BLOCK = (0, _utils.makeDescribe)( + ROOT_DESCRIBE_BLOCK_NAME + ); + return { + currentDescribeBlock: ROOT_DESCRIBE_BLOCK, + currentlyRunningTest: null, + expand: undefined, + hasFocusedTests: false, + hasStarted: false, + includeTestLocationInResult: false, + maxConcurrency: 5, + parentProcess: null, + rootDescribeBlock: ROOT_DESCRIBE_BLOCK, + seed: 0, + testNamePattern: null, + testTimeout: 5000, + unhandledErrors: [] + }; +}; + +/* eslint-disable no-restricted-globals */ +const resetState = () => { + global[_types.STATE_SYM] = createState(); +}; +exports.resetState = resetState; +resetState(); +const getState = () => global[_types.STATE_SYM]; +exports.getState = getState; +const setState = state => (global[_types.STATE_SYM] = state); +/* eslint-enable */ +exports.setState = setState; +const dispatch = async event => { + for (const handler of eventHandlers) { + await handler(event, getState()); + } +}; +exports.dispatch = dispatch; +const dispatchSync = event => { + for (const handler of eventHandlers) { + handler(event, getState()); + } +}; +exports.dispatchSync = dispatchSync; +const addEventHandler = handler => { + eventHandlers.push(handler); +}; +exports.addEventHandler = addEventHandler; diff --git a/node_modules/jest-circus/build/testCaseReportHandler.js b/node_modules/jest-circus/build/testCaseReportHandler.js new file mode 100644 index 00000000..883b7756 --- /dev/null +++ b/node_modules/jest-circus/build/testCaseReportHandler.js @@ -0,0 +1,32 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _utils = require('./utils'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const testCaseReportHandler = (testPath, sendMessageToJest) => event => { + switch (event.name) { + case 'test_started': { + const testCaseStartInfo = (0, _utils.createTestCaseStartInfo)(event.test); + sendMessageToJest('test-case-start', [testPath, testCaseStartInfo]); + break; + } + case 'test_todo': + case 'test_done': { + const testResult = (0, _utils.makeSingleTestResult)(event.test); + const testCaseResult = (0, _utils.parseSingleTestResult)(testResult); + sendMessageToJest('test-case-result', [testPath, testCaseResult]); + break; + } + } +}; +var _default = testCaseReportHandler; +exports.default = _default; diff --git a/node_modules/jest-circus/build/types.js b/node_modules/jest-circus/build/types.js new file mode 100644 index 00000000..7bdfae84 --- /dev/null +++ b/node_modules/jest-circus/build/types.js @@ -0,0 +1,27 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.TEST_TIMEOUT_SYMBOL = + exports.STATE_SYM = + exports.RETRY_TIMES = + exports.LOG_ERRORS_BEFORE_RETRY = + void 0; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const STATE_SYM = Symbol('JEST_STATE_SYMBOL'); +exports.STATE_SYM = STATE_SYM; +const RETRY_TIMES = Symbol.for('RETRY_TIMES'); +// To pass this value from Runtime object to state we need to use global[sym] +exports.RETRY_TIMES = RETRY_TIMES; +const TEST_TIMEOUT_SYMBOL = Symbol.for('TEST_TIMEOUT_SYMBOL'); +exports.TEST_TIMEOUT_SYMBOL = TEST_TIMEOUT_SYMBOL; +const LOG_ERRORS_BEFORE_RETRY = Symbol.for('LOG_ERRORS_BEFORE_RETRY'); +exports.LOG_ERRORS_BEFORE_RETRY = LOG_ERRORS_BEFORE_RETRY; diff --git a/node_modules/jest-circus/build/utils.js b/node_modules/jest-circus/build/utils.js new file mode 100644 index 00000000..defd9b36 --- /dev/null +++ b/node_modules/jest-circus/build/utils.js @@ -0,0 +1,511 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.parseSingleTestResult = + exports.makeTest = + exports.makeSingleTestResult = + exports.makeRunResult = + exports.makeDescribe = + exports.getTestID = + exports.getTestDuration = + exports.getEachHooksForTest = + exports.getAllHooksForDescribe = + exports.describeBlockHasTests = + exports.createTestCaseStartInfo = + exports.callAsyncCircusFn = + exports.addErrorToEachTestUnderDescribe = + void 0; +var path = _interopRequireWildcard(require('path')); +var _co = _interopRequireDefault(require('co')); +var _dedent = _interopRequireDefault(require('dedent')); +var _isGeneratorFn = _interopRequireDefault(require('is-generator-fn')); +var _slash = _interopRequireDefault(require('slash')); +var _stackUtils = _interopRequireDefault(require('stack-utils')); +var _jestUtil = require('jest-util'); +var _prettyFormat = require('pretty-format'); +var _state = require('./state'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var jestNow = globalThis[Symbol.for('jest-native-now')] || globalThis.Date.now; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var Promise = + globalThis[Symbol.for('jest-native-promise')] || globalThis.Promise; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +const stackUtils = new _stackUtils.default({ + cwd: 'A path that does not exist' +}); +const jestEachBuildDir = (0, _slash.default)( + path.dirname(require.resolve('jest-each')) +); +function takesDoneCallback(fn) { + return fn.length > 0; +} +function isGeneratorFunction(fn) { + return (0, _isGeneratorFn.default)(fn); +} +const makeDescribe = (name, parent, mode) => { + let _mode = mode; + if (parent && !mode) { + // If not set explicitly, inherit from the parent describe. + _mode = parent.mode; + } + return { + type: 'describeBlock', + // eslint-disable-next-line sort-keys + children: [], + hooks: [], + mode: _mode, + name: (0, _jestUtil.convertDescriptorToString)(name), + parent, + tests: [] + }; +}; +exports.makeDescribe = makeDescribe; +const makeTest = ( + fn, + mode, + concurrent, + name, + parent, + timeout, + asyncError, + failing +) => ({ + type: 'test', + // eslint-disable-next-line sort-keys + asyncError, + concurrent, + duration: null, + errors: [], + failing, + fn, + invocations: 0, + mode, + name: (0, _jestUtil.convertDescriptorToString)(name), + numPassingAsserts: 0, + parent, + retryReasons: [], + seenDone: false, + startedAt: null, + status: null, + timeout +}); + +// Traverse the tree of describe blocks and return true if at least one describe +// block has an enabled test. +exports.makeTest = makeTest; +const hasEnabledTest = describeBlock => { + const {hasFocusedTests, testNamePattern} = (0, _state.getState)(); + return describeBlock.children.some(child => + child.type === 'describeBlock' + ? hasEnabledTest(child) + : !( + child.mode === 'skip' || + (hasFocusedTests && child.mode !== 'only') || + (testNamePattern && !testNamePattern.test(getTestID(child))) + ) + ); +}; +const getAllHooksForDescribe = describe => { + const result = { + afterAll: [], + beforeAll: [] + }; + if (hasEnabledTest(describe)) { + for (const hook of describe.hooks) { + switch (hook.type) { + case 'beforeAll': + result.beforeAll.push(hook); + break; + case 'afterAll': + result.afterAll.push(hook); + break; + } + } + } + return result; +}; +exports.getAllHooksForDescribe = getAllHooksForDescribe; +const getEachHooksForTest = test => { + const result = { + afterEach: [], + beforeEach: [] + }; + if (test.concurrent) { + // *Each hooks are not run for concurrent tests + return result; + } + let block = test.parent; + do { + const beforeEachForCurrentBlock = []; + for (const hook of block.hooks) { + switch (hook.type) { + case 'beforeEach': + beforeEachForCurrentBlock.push(hook); + break; + case 'afterEach': + result.afterEach.push(hook); + break; + } + } + // 'beforeEach' hooks are executed from top to bottom, the opposite of the + // way we traversed it. + result.beforeEach = [...beforeEachForCurrentBlock, ...result.beforeEach]; + } while ((block = block.parent)); + return result; +}; +exports.getEachHooksForTest = getEachHooksForTest; +const describeBlockHasTests = describe => + describe.children.some( + child => child.type === 'test' || describeBlockHasTests(child) + ); +exports.describeBlockHasTests = describeBlockHasTests; +const _makeTimeoutMessage = (timeout, isHook, takesDoneCallback) => + `Exceeded timeout of ${(0, _jestUtil.formatTime)(timeout)} for a ${ + isHook ? 'hook' : 'test' + }${ + takesDoneCallback ? ' while waiting for `done()` to be called' : '' + }.\nAdd a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.`; + +// Global values can be overwritten by mocks or tests. We'll capture +// the original values in the variables before we require any files. +const {setTimeout, clearTimeout} = globalThis; +function checkIsError(error) { + return !!(error && error.message && error.stack); +} +const callAsyncCircusFn = (testOrHook, testContext, {isHook, timeout}) => { + let timeoutID; + let completed = false; + const {fn, asyncError} = testOrHook; + const doneCallback = takesDoneCallback(fn); + return new Promise((resolve, reject) => { + timeoutID = setTimeout( + () => reject(_makeTimeoutMessage(timeout, isHook, doneCallback)), + timeout + ); + + // If this fn accepts `done` callback we return a promise that fulfills as + // soon as `done` called. + if (doneCallback) { + let returnedValue = undefined; + const done = reason => { + // We need to keep a stack here before the promise tick + const errorAtDone = new _jestUtil.ErrorWithStack(undefined, done); + if (!completed && testOrHook.seenDone) { + errorAtDone.message = + 'Expected done to be called once, but it was called multiple times.'; + if (reason) { + errorAtDone.message += ` Reason: ${(0, _prettyFormat.format)( + reason, + { + maxDepth: 3 + } + )}`; + } + reject(errorAtDone); + throw errorAtDone; + } else { + testOrHook.seenDone = true; + } + + // Use `Promise.resolve` to allow the event loop to go a single tick in case `done` is called synchronously + Promise.resolve().then(() => { + if (returnedValue !== undefined) { + asyncError.message = (0, _dedent.default)` + Test functions cannot both take a 'done' callback and return something. Either use a 'done' callback, or return a promise. + Returned value: ${(0, _prettyFormat.format)(returnedValue, { + maxDepth: 3 + })} + `; + return reject(asyncError); + } + let errorAsErrorObject; + if (checkIsError(reason)) { + errorAsErrorObject = reason; + } else { + errorAsErrorObject = errorAtDone; + errorAtDone.message = `Failed: ${(0, _prettyFormat.format)(reason, { + maxDepth: 3 + })}`; + } + + // Consider always throwing, regardless if `reason` is set or not + if (completed && reason) { + errorAsErrorObject.message = `Caught error after test environment was torn down\n\n${errorAsErrorObject.message}`; + throw errorAsErrorObject; + } + return reason ? reject(errorAsErrorObject) : resolve(); + }); + }; + returnedValue = fn.call(testContext, done); + return; + } + let returnedValue; + if (isGeneratorFunction(fn)) { + returnedValue = _co.default.wrap(fn).call({}); + } else { + try { + returnedValue = fn.call(testContext); + } catch (error) { + reject(error); + return; + } + } + if ((0, _jestUtil.isPromise)(returnedValue)) { + returnedValue.then(() => resolve(), reject); + return; + } + if (!isHook && returnedValue !== undefined) { + reject( + new Error((0, _dedent.default)` + test functions can only return Promise or undefined. + Returned value: ${(0, _prettyFormat.format)(returnedValue, { + maxDepth: 3 + })} + `) + ); + return; + } + + // Otherwise this test is synchronous, and if it didn't throw it means + // it passed. + resolve(); + }) + .then(() => { + completed = true; + // If timeout is not cleared/unrefed the node process won't exit until + // it's resolved. + timeoutID.unref?.(); + clearTimeout(timeoutID); + }) + .catch(error => { + completed = true; + timeoutID.unref?.(); + clearTimeout(timeoutID); + throw error; + }); +}; +exports.callAsyncCircusFn = callAsyncCircusFn; +const getTestDuration = test => { + const {startedAt} = test; + return typeof startedAt === 'number' ? jestNow() - startedAt : null; +}; +exports.getTestDuration = getTestDuration; +const makeRunResult = (describeBlock, unhandledErrors) => ({ + testResults: makeTestResults(describeBlock), + unhandledErrors: unhandledErrors.map(_getError).map(getErrorStack) +}); +exports.makeRunResult = makeRunResult; +const getTestNamesPath = test => { + const titles = []; + let parent = test; + do { + titles.unshift(parent.name); + } while ((parent = parent.parent)); + return titles; +}; +const makeSingleTestResult = test => { + const {includeTestLocationInResult} = (0, _state.getState)(); + const {status} = test; + (0, _jestUtil.invariant)( + status, + 'Status should be present after tests are run.' + ); + const testPath = getTestNamesPath(test); + let location = null; + if (includeTestLocationInResult) { + const stackLines = test.asyncError.stack.split('\n'); + const stackLine = stackLines[1]; + let parsedLine = stackUtils.parseLine(stackLine); + if (parsedLine?.file?.startsWith(jestEachBuildDir)) { + const stackLine = stackLines[4]; + parsedLine = stackUtils.parseLine(stackLine); + } + if ( + parsedLine && + typeof parsedLine.column === 'number' && + typeof parsedLine.line === 'number' + ) { + location = { + column: parsedLine.column, + line: parsedLine.line + }; + } + } + const errorsDetailed = test.errors.map(_getError); + return { + duration: test.duration, + errors: errorsDetailed.map(getErrorStack), + errorsDetailed, + invocations: test.invocations, + location, + numPassingAsserts: test.numPassingAsserts, + retryReasons: test.retryReasons.map(_getError).map(getErrorStack), + status, + testPath: Array.from(testPath) + }; +}; +exports.makeSingleTestResult = makeSingleTestResult; +const makeTestResults = describeBlock => { + const testResults = []; + for (const child of describeBlock.children) { + switch (child.type) { + case 'describeBlock': { + testResults.push(...makeTestResults(child)); + break; + } + case 'test': { + testResults.push(makeSingleTestResult(child)); + break; + } + } + } + return testResults; +}; + +// Return a string that identifies the test (concat of parent describe block +// names + test title) +const getTestID = test => { + const testNamesPath = getTestNamesPath(test); + testNamesPath.shift(); // remove TOP_DESCRIBE_BLOCK_NAME + return testNamesPath.join(' '); +}; +exports.getTestID = getTestID; +const _getError = errors => { + let error; + let asyncError; + if (Array.isArray(errors)) { + error = errors[0]; + asyncError = errors[1]; + } else { + error = errors; + asyncError = new Error(); + } + if (error && (typeof error.stack === 'string' || error.message)) { + return error; + } + asyncError.message = `thrown: ${(0, _prettyFormat.format)(error, { + maxDepth: 3 + })}`; + return asyncError; +}; +const getErrorStack = error => + typeof error.stack === 'string' ? error.stack : error.message; +const addErrorToEachTestUnderDescribe = (describeBlock, error, asyncError) => { + for (const child of describeBlock.children) { + switch (child.type) { + case 'describeBlock': + addErrorToEachTestUnderDescribe(child, error, asyncError); + break; + case 'test': + child.errors.push([error, asyncError]); + break; + } + } +}; +exports.addErrorToEachTestUnderDescribe = addErrorToEachTestUnderDescribe; +const resolveTestCaseStartInfo = testNamesPath => { + const ancestorTitles = testNamesPath.filter( + name => name !== _state.ROOT_DESCRIBE_BLOCK_NAME + ); + const fullName = ancestorTitles.join(' '); + const title = testNamesPath[testNamesPath.length - 1]; + // remove title + ancestorTitles.pop(); + return { + ancestorTitles, + fullName, + title + }; +}; +const parseSingleTestResult = testResult => { + let status; + if (testResult.status === 'skip') { + status = 'pending'; + } else if (testResult.status === 'todo') { + status = 'todo'; + } else if (testResult.errors.length > 0) { + status = 'failed'; + } else { + status = 'passed'; + } + const {ancestorTitles, fullName, title} = resolveTestCaseStartInfo( + testResult.testPath + ); + return { + ancestorTitles, + duration: testResult.duration, + failureDetails: testResult.errorsDetailed, + failureMessages: Array.from(testResult.errors), + fullName, + invocations: testResult.invocations, + location: testResult.location, + numPassingAsserts: testResult.numPassingAsserts, + retryReasons: Array.from(testResult.retryReasons), + status, + title + }; +}; +exports.parseSingleTestResult = parseSingleTestResult; +const createTestCaseStartInfo = test => { + const testPath = getTestNamesPath(test); + const {ancestorTitles, fullName, title} = resolveTestCaseStartInfo(testPath); + return { + ancestorTitles, + fullName, + mode: test.mode, + startedAt: test.startedAt, + title + }; +}; +exports.createTestCaseStartInfo = createTestCaseStartInfo; diff --git a/node_modules/jest-circus/package.json b/node_modules/jest-circus/package.json new file mode 100644 index 00000000..8f2dfd98 --- /dev/null +++ b/node_modules/jest-circus/package.json @@ -0,0 +1,59 @@ +{ + "name": "jest-circus", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-circus" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json", + "./runner": "./runner.js" + }, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "devDependencies": { + "@babel/core": "^7.11.6", + "@babel/register": "^7.0.0", + "@types/co": "^4.6.2", + "@types/graceful-fs": "^4.1.3", + "@types/stack-utils": "^2.0.0", + "execa": "^5.0.0", + "graceful-fs": "^4.2.9", + "tempy": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-circus/runner.js b/node_modules/jest-circus/runner.js new file mode 100644 index 00000000..de11d642 --- /dev/null +++ b/node_modules/jest-circus/runner.js @@ -0,0 +1,10 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Allow people to use `jest-circus/runner` as a runner. +const runner = require('./build/legacy-code-todo-rewrite/jestAdapter').default; +module.exports = runner; diff --git a/node_modules/jest-cli/LICENSE b/node_modules/jest-cli/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-cli/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-cli/README.md b/node_modules/jest-cli/README.md new file mode 100644 index 00000000..9c3d31ef --- /dev/null +++ b/node_modules/jest-cli/README.md @@ -0,0 +1,11 @@ +# Jest + +🃏 Delightful JavaScript Testing + +- **👩🏻‍💻 Developer Ready**: Complete and ready to set-up JavaScript testing solution. Works out of the box for any React project. + +- **🏃🏽 Instant Feedback**: Failed tests run first. Fast interactive mode can switch between running all tests or only test files related to changed files. + +- **📸 Snapshot Testing**: Jest can [capture snapshots](https://jestjs.io/docs/snapshot-testing) of React trees or other serializable values to simplify UI testing. + +Read More: https://jestjs.io/ diff --git a/node_modules/jest-cli/bin/jest.js b/node_modules/jest-cli/bin/jest.js new file mode 100644 index 00000000..3ddf9403 --- /dev/null +++ b/node_modules/jest-cli/bin/jest.js @@ -0,0 +1,17 @@ +#!/usr/bin/env node +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const importLocal = require('import-local'); + +if (!importLocal(__filename)) { + if (process.env.NODE_ENV == null) { + process.env.NODE_ENV = 'test'; + } + + require('..').run(); +} diff --git a/node_modules/jest-cli/build/args.js b/node_modules/jest-cli/build/args.js new file mode 100644 index 00000000..170606fc --- /dev/null +++ b/node_modules/jest-cli/build/args.js @@ -0,0 +1,731 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.check = check; +exports.usage = exports.options = exports.docs = void 0; +function _jestConfig() { + const data = require('jest-config'); + _jestConfig = function () { + return data; + }; + return data; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function check(argv) { + if ( + argv.runInBand && + Object.prototype.hasOwnProperty.call(argv, 'maxWorkers') + ) { + throw new Error( + 'Both --runInBand and --maxWorkers were specified, only one is allowed.' + ); + } + for (const key of [ + 'onlyChanged', + 'lastCommit', + 'changedFilesWithAncestor', + 'changedSince' + ]) { + if (argv[key] && argv.watchAll) { + throw new Error( + `Both --${key} and --watchAll were specified, but cannot be used ` + + 'together. Try the --watch option which reruns only tests ' + + 'related to changed files.' + ); + } + } + if (argv.onlyFailures && argv.watchAll) { + throw new Error( + 'Both --onlyFailures and --watchAll were specified, only one is allowed.' + ); + } + if (argv.findRelatedTests && argv._.length === 0) { + throw new Error( + 'The --findRelatedTests option requires file paths to be specified.\n' + + 'Example usage: jest --findRelatedTests ./src/source.js ' + + './src/index.js.' + ); + } + if ( + Object.prototype.hasOwnProperty.call(argv, 'maxWorkers') && + argv.maxWorkers === undefined + ) { + throw new Error( + 'The --maxWorkers (-w) option requires a number or string to be specified.\n' + + 'Example usage: jest --maxWorkers 2\n' + + 'Example usage: jest --maxWorkers 50%\n' + + 'Or did you mean --watch?' + ); + } + if (argv.selectProjects && argv.selectProjects.length === 0) { + throw new Error( + 'The --selectProjects option requires the name of at least one project to be specified.\n' + + 'Example usage: jest --selectProjects my-first-project my-second-project' + ); + } + if (argv.ignoreProjects && argv.ignoreProjects.length === 0) { + throw new Error( + 'The --ignoreProjects option requires the name of at least one project to be specified.\n' + + 'Example usage: jest --ignoreProjects my-first-project my-second-project' + ); + } + if ( + argv.config && + !(0, _jestConfig().isJSONString)(argv.config) && + !argv.config.match( + new RegExp( + `\\.(${_jestConfig() + .constants.JEST_CONFIG_EXT_ORDER.map(e => e.substring(1)) + .join('|')})$`, + 'i' + ) + ) + ) { + throw new Error( + `The --config option requires a JSON string literal, or a file path with one of these extensions: ${_jestConfig().constants.JEST_CONFIG_EXT_ORDER.join( + ', ' + )}.\nExample usage: jest --config ./jest.config.js` + ); + } + return true; +} +const usage = 'Usage: $0 [--config=] [TestPathPattern]'; +exports.usage = usage; +const docs = 'Documentation: https://jestjs.io/'; + +// The default values are all set in jest-config +exports.docs = docs; +const options = { + all: { + description: + 'The opposite of `onlyChanged`. If `onlyChanged` is set by ' + + 'default, running jest with `--all` will force Jest to run all tests ' + + 'instead of running only tests related to changed files.', + type: 'boolean' + }, + automock: { + description: 'Automock all files by default.', + type: 'boolean' + }, + bail: { + alias: 'b', + description: + 'Exit the test suite immediately after `n` number of failing tests.', + type: 'boolean' + }, + cache: { + description: + 'Whether to use the transform cache. Disable the cache ' + + 'using --no-cache.', + type: 'boolean' + }, + cacheDirectory: { + description: + 'The directory where Jest should store its cached ' + + ' dependency information.', + type: 'string' + }, + changedFilesWithAncestor: { + description: + 'Runs tests related to the current changes and the changes made in the ' + + 'last commit. Behaves similarly to `--onlyChanged`.', + type: 'boolean' + }, + changedSince: { + description: + 'Runs tests related to the changes since the provided branch. If the ' + + 'current branch has diverged from the given branch, then only changes ' + + 'made locally will be tested. Behaves similarly to `--onlyChanged`.', + nargs: 1, + type: 'string' + }, + ci: { + description: + 'Whether to run Jest in continuous integration (CI) mode. ' + + 'This option is on by default in most popular CI environments. It will ' + + 'prevent snapshots from being written unless explicitly requested.', + type: 'boolean' + }, + clearCache: { + description: + 'Clears the configured Jest cache directory and then exits. ' + + 'Default directory can be found by calling jest --showConfig', + type: 'boolean' + }, + clearMocks: { + description: + 'Automatically clear mock calls, instances, contexts and results before every test. ' + + 'Equivalent to calling jest.clearAllMocks() before each test.', + type: 'boolean' + }, + collectCoverage: { + description: 'Alias for --coverage.', + type: 'boolean' + }, + collectCoverageFrom: { + description: + 'A glob pattern relative to matching the files that coverage ' + + 'info needs to be collected from.', + type: 'string' + }, + color: { + description: + 'Forces test results output color highlighting (even if ' + + 'stdout is not a TTY). Set to false if you would like to have no colors.', + type: 'boolean' + }, + colors: { + description: 'Alias for `--color`.', + type: 'boolean' + }, + config: { + alias: 'c', + description: + 'The path to a jest config file specifying how to find ' + + 'and execute tests. If no rootDir is set in the config, the directory ' + + 'containing the config file is assumed to be the rootDir for the project. ' + + 'This can also be a JSON encoded value which Jest will use as configuration.', + type: 'string' + }, + coverage: { + description: + 'Indicates that test coverage information should be ' + + 'collected and reported in the output.', + type: 'boolean' + }, + coverageDirectory: { + description: 'The directory where Jest should output its coverage files.', + type: 'string' + }, + coveragePathIgnorePatterns: { + description: + 'An array of regexp pattern strings that are matched ' + + 'against all file paths before executing the test. If the file path ' + + 'matches any of the patterns, coverage information will be skipped.', + string: true, + type: 'array' + }, + coverageProvider: { + choices: ['babel', 'v8'], + description: 'Select between Babel and V8 to collect coverage' + }, + coverageReporters: { + description: + 'A list of reporter names that Jest uses when writing ' + + 'coverage reports. Any istanbul reporter can be used.', + string: true, + type: 'array' + }, + coverageThreshold: { + description: + 'A JSON string with which will be used to configure ' + + 'minimum threshold enforcement for coverage results', + type: 'string' + }, + debug: { + description: 'Print debugging info about your jest config.', + type: 'boolean' + }, + detectLeaks: { + description: + '**EXPERIMENTAL**: Detect memory leaks in tests. After executing a ' + + 'test, it will try to garbage collect the global object used, and fail ' + + 'if it was leaked', + type: 'boolean' + }, + detectOpenHandles: { + description: + 'Print out remaining open handles preventing Jest from exiting at the ' + + 'end of a test run. Implies `runInBand`.', + type: 'boolean' + }, + env: { + description: + 'The test environment used for all tests. This can point to ' + + 'any file or node module. Examples: `jsdom`, `node` or ' + + '`path/to/my-environment.js`', + type: 'string' + }, + errorOnDeprecated: { + description: 'Make calling deprecated APIs throw helpful error messages.', + type: 'boolean' + }, + expand: { + alias: 'e', + description: 'Use this flag to show full diffs instead of a patch.', + type: 'boolean' + }, + filter: { + description: + 'Path to a module exporting a filtering function. This method receives ' + + 'a list of tests which can be manipulated to exclude tests from ' + + 'running. Especially useful when used in conjunction with a testing ' + + 'infrastructure to filter known broken tests.', + type: 'string' + }, + findRelatedTests: { + description: + 'Find related tests for a list of source files that were ' + + 'passed in as arguments. Useful for pre-commit hook integration to run ' + + 'the minimal amount of tests necessary.', + type: 'boolean' + }, + forceExit: { + description: + 'Force Jest to exit after all tests have completed running. ' + + 'This is useful when resources set up by test code cannot be ' + + 'adequately cleaned up.', + type: 'boolean' + }, + globalSetup: { + description: 'The path to a module that runs before All Tests.', + type: 'string' + }, + globalTeardown: { + description: 'The path to a module that runs after All Tests.', + type: 'string' + }, + globals: { + description: + 'A JSON string with map of global variables that need ' + + 'to be available in all test environments.', + type: 'string' + }, + haste: { + description: + 'A JSON string with map of variables for the haste module system', + type: 'string' + }, + ignoreProjects: { + description: + 'Ignore the tests of the specified projects. ' + + 'Jest uses the attribute `displayName` in the configuration to identify each project.', + string: true, + type: 'array' + }, + init: { + description: 'Generate a basic configuration file', + type: 'boolean' + }, + injectGlobals: { + description: 'Should Jest inject global variables or not', + type: 'boolean' + }, + json: { + description: + 'Prints the test results in JSON. This mode will send all ' + + 'other test output and user messages to stderr.', + type: 'boolean' + }, + lastCommit: { + description: + 'Run all tests affected by file changes in the last commit made. ' + + 'Behaves similarly to `--onlyChanged`.', + type: 'boolean' + }, + listTests: { + description: + 'Lists all tests Jest will run given the arguments and ' + + 'exits. Most useful in a CI system together with `--findRelatedTests` ' + + 'to determine the tests Jest will run based on specific files', + type: 'boolean' + }, + logHeapUsage: { + description: + 'Logs the heap usage after every test. Useful to debug ' + + 'memory leaks. Use together with `--runInBand` and `--expose-gc` in ' + + 'node.', + type: 'boolean' + }, + maxConcurrency: { + description: + 'Specifies the maximum number of tests that are allowed to run ' + + 'concurrently. This only affects tests using `test.concurrent`.', + type: 'number' + }, + maxWorkers: { + alias: 'w', + description: + 'Specifies the maximum number of workers the worker-pool ' + + 'will spawn for running tests. This defaults to the number of the ' + + 'cores available on your machine. (its usually best not to override ' + + 'this default)', + type: 'string' + }, + moduleDirectories: { + description: + 'An array of directory names to be searched recursively ' + + "up from the requiring module's location.", + string: true, + type: 'array' + }, + moduleFileExtensions: { + description: + 'An array of file extensions your modules use. If you ' + + 'require modules without specifying a file extension, these are the ' + + 'extensions Jest will look for.', + string: true, + type: 'array' + }, + moduleNameMapper: { + description: + 'A JSON string with a map from regular expressions to ' + + 'module names or to arrays of module names that allow to stub ' + + 'out resources, like images or styles with a single module', + type: 'string' + }, + modulePathIgnorePatterns: { + description: + 'An array of regexp pattern strings that are matched ' + + 'against all module paths before those paths are to be considered ' + + '"visible" to the module loader.', + string: true, + type: 'array' + }, + modulePaths: { + description: + 'An alternative API to setting the NODE_PATH env variable, ' + + 'modulePaths is an array of absolute paths to additional locations to ' + + 'search when resolving modules.', + string: true, + type: 'array' + }, + noStackTrace: { + description: 'Disables stack trace in test results output', + type: 'boolean' + }, + notify: { + description: 'Activates notifications for test results.', + type: 'boolean' + }, + notifyMode: { + description: 'Specifies when notifications will appear for test results.', + type: 'string' + }, + onlyChanged: { + alias: 'o', + description: + 'Attempts to identify which tests to run based on which ' + + "files have changed in the current repository. Only works if you're " + + 'running tests in a git or hg repository at the moment.', + type: 'boolean' + }, + onlyFailures: { + alias: 'f', + description: 'Run tests that failed in the previous execution.', + type: 'boolean' + }, + openHandlesTimeout: { + description: + 'Print a warning about probable open handles if Jest does not exit ' + + 'cleanly after this number of milliseconds. `0` to disable.', + type: 'number' + }, + outputFile: { + description: + 'Write test results to a file when the --json option is ' + + 'also specified.', + type: 'string' + }, + passWithNoTests: { + description: + 'Will not fail if no tests are found (for example while using `--testPathPattern`.)', + type: 'boolean' + }, + preset: { + description: "A preset that is used as a base for Jest's configuration.", + type: 'string' + }, + prettierPath: { + description: 'The path to the "prettier" module used for inline snapshots.', + type: 'string' + }, + projects: { + description: + 'A list of projects that use Jest to run all tests of all ' + + 'projects in a single instance of Jest.', + string: true, + type: 'array' + }, + randomize: { + description: + 'Shuffle the order of the tests within a file. In order to choose the seed refer to the `--seed` CLI option.', + type: 'boolean' + }, + reporters: { + description: 'A list of custom reporters for the test suite.', + string: true, + type: 'array' + }, + resetMocks: { + description: + 'Automatically reset mock state before every test. ' + + 'Equivalent to calling jest.resetAllMocks() before each test.', + type: 'boolean' + }, + resetModules: { + description: + 'If enabled, the module registry for every test file will ' + + 'be reset before running each individual test.', + type: 'boolean' + }, + resolver: { + description: 'A JSON string which allows the use of a custom resolver.', + type: 'string' + }, + restoreMocks: { + description: + 'Automatically restore mock state and implementation before every test. ' + + 'Equivalent to calling jest.restoreAllMocks() before each test.', + type: 'boolean' + }, + rootDir: { + description: + 'The root directory that Jest should scan for tests and ' + + 'modules within.', + type: 'string' + }, + roots: { + description: + 'A list of paths to directories that Jest should use to ' + + 'search for files in.', + string: true, + type: 'array' + }, + runInBand: { + alias: 'i', + description: + 'Run all tests serially in the current process (rather than ' + + 'creating a worker pool of child processes that run tests). This ' + + 'is sometimes useful for debugging, but such use cases are pretty ' + + 'rare.', + type: 'boolean' + }, + runTestsByPath: { + description: + 'Used when provided patterns are exact file paths. This avoids ' + + 'converting them into a regular expression and matching it against ' + + 'every single file.', + type: 'boolean' + }, + runner: { + description: + "Allows to use a custom runner instead of Jest's default test runner.", + type: 'string' + }, + seed: { + description: + 'Sets a seed value that can be retrieved in a tests file via `jest.getSeed()`. If this option is not specified Jest will randomly generate the value. The seed value must be between `-0x80000000` and `0x7fffffff` inclusive.', + type: 'number' + }, + selectProjects: { + description: + 'Run the tests of the specified projects. ' + + 'Jest uses the attribute `displayName` in the configuration to identify each project.', + string: true, + type: 'array' + }, + setupFiles: { + description: + 'A list of paths to modules that run some code to configure or ' + + 'set up the testing environment before each test.', + string: true, + type: 'array' + }, + setupFilesAfterEnv: { + description: + 'A list of paths to modules that run some code to configure or ' + + 'set up the testing framework before each test', + string: true, + type: 'array' + }, + shard: { + description: + 'Shard tests and execute only the selected shard, specify in ' + + 'the form "current/all". 1-based, for example "3/5".', + type: 'string' + }, + showConfig: { + description: 'Print your jest config and then exits.', + type: 'boolean' + }, + showSeed: { + description: + 'Prints the seed value in the test report summary. See `--seed` for how to set this value', + type: 'boolean' + }, + silent: { + description: 'Prevent tests from printing messages through the console.', + type: 'boolean' + }, + skipFilter: { + description: + 'Disables the filter provided by --filter. Useful for CI jobs, or ' + + 'local enforcement when fixing tests.', + type: 'boolean' + }, + snapshotSerializers: { + description: + 'A list of paths to snapshot serializer modules Jest should ' + + 'use for snapshot testing.', + string: true, + type: 'array' + }, + testEnvironment: { + description: 'Alias for --env', + type: 'string' + }, + testEnvironmentOptions: { + description: + 'A JSON string with options that will be passed to the `testEnvironment`. ' + + 'The relevant options depend on the environment.', + type: 'string' + }, + testFailureExitCode: { + description: 'Exit code of `jest` command if the test run failed', + type: 'string' // number + }, + + testLocationInResults: { + description: 'Add `location` information to the test results', + type: 'boolean' + }, + testMatch: { + description: 'The glob patterns Jest uses to detect test files.', + string: true, + type: 'array' + }, + testNamePattern: { + alias: 't', + description: 'Run only tests with a name that matches the regex pattern.', + type: 'string' + }, + testPathIgnorePatterns: { + description: + 'An array of regexp pattern strings that are matched ' + + 'against all test paths before executing the test. If the test path ' + + 'matches any of the patterns, it will be skipped.', + string: true, + type: 'array' + }, + testPathPattern: { + description: + 'A regexp pattern string that is matched against all tests ' + + 'paths before executing the test.', + string: true, + type: 'array' + }, + testRegex: { + description: + 'A string or array of string regexp patterns that Jest uses to detect test files.', + string: true, + type: 'array' + }, + testResultsProcessor: { + description: + 'Allows the use of a custom results processor. ' + + 'This processor must be a node module that exports ' + + 'a function expecting as the first argument the result object.', + type: 'string' + }, + testRunner: { + description: + 'Allows to specify a custom test runner. The default is' + + ' `jest-circus/runner`. A path to a custom test runner can be provided:' + + ' `/path/to/testRunner.js`.', + type: 'string' + }, + testSequencer: { + description: + 'Allows to specify a custom test sequencer. The default is ' + + '`@jest/test-sequencer`. A path to a custom test sequencer can be ' + + 'provided: `/path/to/testSequencer.js`', + type: 'string' + }, + testTimeout: { + description: 'This option sets the default timeouts of test cases.', + type: 'number' + }, + transform: { + description: + 'A JSON string which maps from regular expressions to paths ' + + 'to transformers.', + type: 'string' + }, + transformIgnorePatterns: { + description: + 'An array of regexp pattern strings that are matched ' + + 'against all source file paths before transformation.', + string: true, + type: 'array' + }, + unmockedModulePathPatterns: { + description: + 'An array of regexp pattern strings that are matched ' + + 'against all modules before the module loader will automatically ' + + 'return a mock for them.', + string: true, + type: 'array' + }, + updateSnapshot: { + alias: 'u', + description: + 'Use this flag to re-record snapshots. ' + + 'Can be used together with a test suite pattern or with ' + + '`--testNamePattern` to re-record snapshot for test matching ' + + 'the pattern', + type: 'boolean' + }, + useStderr: { + description: 'Divert all output to stderr.', + type: 'boolean' + }, + verbose: { + description: + 'Display individual test results with the test suite hierarchy.', + type: 'boolean' + }, + watch: { + description: + 'Watch files for changes and rerun tests related to ' + + 'changed files. If you want to re-run all tests when a file has ' + + 'changed, use the `--watchAll` option.', + type: 'boolean' + }, + watchAll: { + description: + 'Watch files for changes and rerun all tests. If you want ' + + 'to re-run only the tests related to the changed files, use the ' + + '`--watch` option.', + type: 'boolean' + }, + watchPathIgnorePatterns: { + description: + 'An array of regexp pattern strings that are matched ' + + 'against all paths before trigger test re-run in watch mode. ' + + 'If the test path matches any of the patterns, it will be skipped.', + string: true, + type: 'array' + }, + watchman: { + description: + 'Whether to use watchman for file crawling. Disable using ' + + '--no-watchman.', + type: 'boolean' + }, + workerThreads: { + description: + 'Whether to use worker threads for parallelization. Child processes ' + + 'are used by default.', + type: 'boolean' + } +}; +exports.options = options; diff --git a/node_modules/jest-cli/build/index.d.ts b/node_modules/jest-cli/build/index.d.ts new file mode 100644 index 00000000..88680093 --- /dev/null +++ b/node_modules/jest-cli/build/index.d.ts @@ -0,0 +1,18 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {Options} from 'yargs'; + +export declare function run( + maybeArgv?: Array, + project?: string, +): Promise; + +export declare const yargsOptions: { + [key: string]: Options; +}; + +export {}; diff --git a/node_modules/jest-cli/build/index.js b/node_modules/jest-cli/build/index.js new file mode 100644 index 00000000..fc00c8bf --- /dev/null +++ b/node_modules/jest-cli/build/index.js @@ -0,0 +1,19 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +Object.defineProperty(exports, 'run', { + enumerable: true, + get: function () { + return _run.run; + } +}); +Object.defineProperty(exports, 'yargsOptions', { + enumerable: true, + get: function () { + return _args.options; + } +}); +var _run = require('./run'); +var _args = require('./args'); diff --git a/node_modules/jest-cli/build/run.js b/node_modules/jest-cli/build/run.js new file mode 100644 index 00000000..6e0a5cc5 --- /dev/null +++ b/node_modules/jest-cli/build/run.js @@ -0,0 +1,239 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.buildArgv = buildArgv; +exports.run = run; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _exit() { + const data = _interopRequireDefault(require('exit')); + _exit = function () { + return data; + }; + return data; +} +function _yargs() { + const data = _interopRequireDefault(require('yargs')); + _yargs = function () { + return data; + }; + return data; +} +function _core() { + const data = require('@jest/core'); + _core = function () { + return data; + }; + return data; +} +function _createJest() { + const data = require('create-jest'); + _createJest = function () { + return data; + }; + return data; +} +function _jestConfig() { + const data = require('jest-config'); + _jestConfig = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +function _jestValidate() { + const data = require('jest-validate'); + _jestValidate = function () { + return data; + }; + return data; +} +var args = _interopRequireWildcard(require('./args')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +async function run(maybeArgv, project) { + try { + const argv = await buildArgv(maybeArgv); + if (argv.init) { + await (0, _createJest().runCreate)(); + return; + } + const projects = getProjectListFromCLIArgs(argv, project); + const {results, globalConfig} = await (0, _core().runCLI)(argv, projects); + readResultsAndExit(results, globalConfig); + } catch (error) { + (0, _jestUtil().clearLine)(process.stderr); + (0, _jestUtil().clearLine)(process.stdout); + if (error?.stack) { + console.error(_chalk().default.red(error.stack)); + } else { + console.error(_chalk().default.red(error)); + } + (0, _exit().default)(1); + throw error; + } +} +async function buildArgv(maybeArgv) { + const version = + (0, _core().getVersion)() + + (__dirname.includes(`packages${path().sep}jest-cli`) ? '-dev' : ''); + const rawArgv = maybeArgv || process.argv.slice(2); + const argv = await (0, _yargs().default)(rawArgv) + .usage(args.usage) + .version(version) + .alias('help', 'h') + .options(args.options) + .epilogue(args.docs) + .check(args.check).argv; + (0, _jestValidate().validateCLIOptions)( + argv, + { + ...args.options, + deprecationEntries: _jestConfig().deprecationEntries + }, + // strip leading dashes + Array.isArray(rawArgv) + ? rawArgv.map(rawArgv => rawArgv.replace(/^--?/, '')) + : Object.keys(rawArgv) + ); + + // strip dashed args + return Object.keys(argv).reduce( + (result, key) => { + if (!key.includes('-')) { + result[key] = argv[key]; + } + return result; + }, + { + $0: argv.$0, + _: argv._ + } + ); +} +const getProjectListFromCLIArgs = (argv, project) => { + const projects = argv.projects ? argv.projects : []; + if (project) { + projects.push(project); + } + if (!projects.length && process.platform === 'win32') { + try { + projects.push((0, _jestUtil().tryRealpath)(process.cwd())); + } catch { + // do nothing, just catch error + // process.binding('fs').realpath can throw, e.g. on mapped drives + } + } + if (!projects.length) { + projects.push(process.cwd()); + } + return projects; +}; +const readResultsAndExit = (result, globalConfig) => { + const code = !result || result.success ? 0 : globalConfig.testFailureExitCode; + + // Only exit if needed + process.on('exit', () => { + if (typeof code === 'number' && code !== 0) { + process.exitCode = code; + } + }); + if (globalConfig.forceExit) { + if (!globalConfig.detectOpenHandles) { + console.warn( + `${_chalk().default.bold( + 'Force exiting Jest: ' + )}Have you considered using \`--detectOpenHandles\` to detect ` + + 'async operations that kept running after all tests finished?' + ); + } + (0, _exit().default)(code); + } else if ( + !globalConfig.detectOpenHandles && + globalConfig.openHandlesTimeout !== 0 + ) { + const timeout = globalConfig.openHandlesTimeout; + setTimeout(() => { + console.warn( + _chalk().default.yellow.bold( + `Jest did not exit ${ + timeout === 1000 ? 'one second' : `${timeout / 1000} seconds` + } after the test run has completed.\n\n'` + ) + + _chalk().default.yellow( + 'This usually means that there are asynchronous operations that ' + + "weren't stopped in your tests. Consider running Jest with " + + '`--detectOpenHandles` to troubleshoot this issue.' + ) + ); + }, timeout).unref(); + } +}; diff --git a/node_modules/jest-cli/package.json b/node_modules/jest-cli/package.json new file mode 100644 index 00000000..a923ae25 --- /dev/null +++ b/node_modules/jest-cli/package.json @@ -0,0 +1,88 @@ +{ + "name": "jest-cli", + "description": "Delightful JavaScript Testing.", + "version": "29.7.0", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json", + "./bin/jest": "./bin/jest.js" + }, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "devDependencies": { + "@tsd/typescript": "^5.0.4", + "@types/exit": "^0.1.30", + "@types/yargs": "^17.0.8", + "tsd-lite": "^0.7.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + }, + "bin": { + "jest": "./bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-cli" + }, + "bugs": { + "url": "https://github.com/jestjs/jest/issues" + }, + "homepage": "https://jestjs.io/", + "license": "MIT", + "keywords": [ + "ava", + "babel", + "coverage", + "easy", + "expect", + "facebook", + "immersive", + "instant", + "jasmine", + "jest", + "jsdom", + "mocha", + "mocking", + "painless", + "qunit", + "runner", + "sandboxed", + "snapshot", + "tap", + "tape", + "test", + "testing", + "typescript", + "watch" + ], + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-config/LICENSE b/node_modules/jest-config/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-config/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-config/build/Defaults.js b/node_modules/jest-config/build/Defaults.js new file mode 100644 index 00000000..ee5c7b1a --- /dev/null +++ b/node_modules/jest-config/build/Defaults.js @@ -0,0 +1,129 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _path() { + const data = require('path'); + _path = function () { + return data; + }; + return data; +} +function _ciInfo() { + const data = require('ci-info'); + _ciInfo = function () { + return data; + }; + return data; +} +function _jestRegexUtil() { + const data = require('jest-regex-util'); + _jestRegexUtil = function () { + return data; + }; + return data; +} +var _constants = require('./constants'); +var _getCacheDirectory = _interopRequireDefault(require('./getCacheDirectory')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const NODE_MODULES_REGEXP = (0, _jestRegexUtil().replacePathSepForRegex)( + _constants.NODE_MODULES +); +const defaultOptions = { + automock: false, + bail: 0, + cache: true, + cacheDirectory: (0, _getCacheDirectory.default)(), + changedFilesWithAncestor: false, + ci: _ciInfo().isCI, + clearMocks: false, + collectCoverage: false, + coveragePathIgnorePatterns: [NODE_MODULES_REGEXP], + coverageProvider: 'babel', + coverageReporters: ['json', 'text', 'lcov', 'clover'], + detectLeaks: false, + detectOpenHandles: false, + errorOnDeprecated: false, + expand: false, + extensionsToTreatAsEsm: [], + fakeTimers: { + enableGlobally: false + }, + forceCoverageMatch: [], + globals: {}, + haste: { + computeSha1: false, + enableSymlinks: false, + forceNodeFilesystemAPI: true, + throwOnModuleCollision: false + }, + injectGlobals: true, + listTests: false, + maxConcurrency: 5, + maxWorkers: '50%', + moduleDirectories: ['node_modules'], + moduleFileExtensions: [ + 'js', + 'mjs', + 'cjs', + 'jsx', + 'ts', + 'tsx', + 'json', + 'node' + ], + moduleNameMapper: {}, + modulePathIgnorePatterns: [], + noStackTrace: false, + notify: false, + notifyMode: 'failure-change', + openHandlesTimeout: 1000, + passWithNoTests: false, + prettierPath: 'prettier', + resetMocks: false, + resetModules: false, + restoreMocks: false, + roots: [''], + runTestsByPath: false, + runner: 'jest-runner', + setupFiles: [], + setupFilesAfterEnv: [], + skipFilter: false, + slowTestThreshold: 5, + snapshotFormat: { + escapeString: false, + printBasicPrototype: false + }, + snapshotSerializers: [], + testEnvironment: 'jest-environment-node', + testEnvironmentOptions: {}, + testFailureExitCode: 1, + testLocationInResults: false, + testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[tj]s?(x)'], + testPathIgnorePatterns: [NODE_MODULES_REGEXP], + testRegex: [], + testRunner: 'jest-circus/runner', + testSequencer: '@jest/test-sequencer', + transformIgnorePatterns: [ + NODE_MODULES_REGEXP, + `\\.pnp\\.[^\\${_path().sep}]+$` + ], + useStderr: false, + watch: false, + watchPathIgnorePatterns: [], + watchman: true, + workerThreads: false +}; +var _default = defaultOptions; +exports.default = _default; diff --git a/node_modules/jest-config/build/Deprecated.js b/node_modules/jest-config/build/Deprecated.js new file mode 100644 index 00000000..e13c1659 --- /dev/null +++ b/node_modules/jest-config/build/Deprecated.js @@ -0,0 +1,85 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const deprecatedOptions = { + browser: () => + ` Option ${_chalk().default.bold( + '"browser"' + )} has been deprecated. Please install "browser-resolve" and use the "resolver" option in Jest configuration as shown in the documentation: https://jestjs.io/docs/configuration#resolver-string`, + collectCoverageOnlyFrom: _options => ` Option ${_chalk().default.bold( + '"collectCoverageOnlyFrom"' + )} was replaced by ${_chalk().default.bold('"collectCoverageFrom"')}. + + Please update your configuration.`, + extraGlobals: _options => ` Option ${_chalk().default.bold( + '"extraGlobals"' + )} was replaced by ${_chalk().default.bold('"sandboxInjectedGlobals"')}. + + Please update your configuration.`, + moduleLoader: _options => ` Option ${_chalk().default.bold( + '"moduleLoader"' + )} was replaced by ${_chalk().default.bold('"runtime"')}. + + Please update your configuration.`, + preprocessorIgnorePatterns: _options => ` Option ${_chalk().default.bold( + '"preprocessorIgnorePatterns"' + )} was replaced by ${_chalk().default.bold( + '"transformIgnorePatterns"' + )}, which support multiple preprocessors. + + Please update your configuration.`, + scriptPreprocessor: _options => ` Option ${_chalk().default.bold( + '"scriptPreprocessor"' + )} was replaced by ${_chalk().default.bold( + '"transform"' + )}, which support multiple preprocessors. + + Please update your configuration.`, + setupTestFrameworkScriptFile: _options => ` Option ${_chalk().default.bold( + '"setupTestFrameworkScriptFile"' + )} was replaced by configuration ${_chalk().default.bold( + '"setupFilesAfterEnv"' + )}, which supports multiple paths. + + Please update your configuration.`, + testPathDirs: _options => ` Option ${_chalk().default.bold( + '"testPathDirs"' + )} was replaced by ${_chalk().default.bold('"roots"')}. + + Please update your configuration. + `, + testURL: _options => ` Option ${_chalk().default.bold( + '"testURL"' + )} was replaced by passing the URL via ${_chalk().default.bold( + '"testEnvironmentOptions.url"' + )}. + + Please update your configuration.`, + timers: _options => ` Option ${_chalk().default.bold( + '"timers"' + )} was replaced by ${_chalk().default.bold('"fakeTimers"')}. + + Please update your configuration.` +}; +var _default = deprecatedOptions; +exports.default = _default; diff --git a/node_modules/jest-config/build/Descriptions.js b/node_modules/jest-config/build/Descriptions.js new file mode 100644 index 00000000..d46491cd --- /dev/null +++ b/node_modules/jest-config/build/Descriptions.js @@ -0,0 +1,104 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const descriptions = { + automock: 'All imported modules in your tests should be mocked automatically', + bail: 'Stop running tests after `n` failures', + cacheDirectory: + 'The directory where Jest should store its cached dependency information', + clearMocks: + 'Automatically clear mock calls, instances, contexts and results before every test', + collectCoverage: + 'Indicates whether the coverage information should be collected while executing the test', + collectCoverageFrom: + 'An array of glob patterns indicating a set of files for which coverage information should be collected', + coverageDirectory: + 'The directory where Jest should output its coverage files', + coveragePathIgnorePatterns: + 'An array of regexp pattern strings used to skip coverage collection', + coverageProvider: + 'Indicates which provider should be used to instrument code for coverage', + coverageReporters: + 'A list of reporter names that Jest uses when writing coverage reports', + coverageThreshold: + 'An object that configures minimum threshold enforcement for coverage results', + dependencyExtractor: 'A path to a custom dependency extractor', + errorOnDeprecated: + 'Make calling deprecated APIs throw helpful error messages', + fakeTimers: 'The default configuration for fake timers', + forceCoverageMatch: + 'Force coverage collection from ignored files using an array of glob patterns', + globalSetup: + 'A path to a module which exports an async function that is triggered once before all test suites', + globalTeardown: + 'A path to a module which exports an async function that is triggered once after all test suites', + globals: + 'A set of global variables that need to be available in all test environments', + maxWorkers: + 'The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.', + moduleDirectories: + "An array of directory names to be searched recursively up from the requiring module's location", + moduleFileExtensions: 'An array of file extensions your modules use', + moduleNameMapper: + 'A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module', + modulePathIgnorePatterns: + "An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader", + notify: 'Activates notifications for test results', + notifyMode: + 'An enum that specifies notification mode. Requires { notify: true }', + preset: "A preset that is used as a base for Jest's configuration", + projects: 'Run tests from one or more projects', + reporters: 'Use this configuration option to add custom reporters to Jest', + resetMocks: 'Automatically reset mock state before every test', + resetModules: 'Reset the module registry before running each individual test', + resolver: 'A path to a custom resolver', + restoreMocks: + 'Automatically restore mock state and implementation before every test', + rootDir: + 'The root directory that Jest should scan for tests and modules within', + roots: + 'A list of paths to directories that Jest should use to search for files in', + runner: + "Allows you to use a custom runner instead of Jest's default test runner", + setupFiles: + 'The paths to modules that run some code to configure or set up the testing environment before each test', + setupFilesAfterEnv: + 'A list of paths to modules that run some code to configure or set up the testing framework before each test', + slowTestThreshold: + 'The number of seconds after which a test is considered as slow and reported as such in the results.', + snapshotSerializers: + 'A list of paths to snapshot serializer modules Jest should use for snapshot testing', + testEnvironment: 'The test environment that will be used for testing', + testEnvironmentOptions: 'Options that will be passed to the testEnvironment', + testLocationInResults: 'Adds a location field to test results', + testMatch: 'The glob patterns Jest uses to detect test files', + testPathIgnorePatterns: + 'An array of regexp pattern strings that are matched against all test paths, matched tests are skipped', + testRegex: + 'The regexp pattern or array of patterns that Jest uses to detect test files', + testResultsProcessor: + 'This option allows the use of a custom results processor', + testRunner: 'This option allows use of a custom test runner', + transform: 'A map from regular expressions to paths to transformers', + transformIgnorePatterns: + 'An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation', + unmockedModulePathPatterns: + 'An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them', + verbose: + 'Indicates whether each individual test should be reported during the run', + watchPathIgnorePatterns: + 'An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode', + watchman: 'Whether to use watchman for file crawling' +}; +var _default = descriptions; +exports.default = _default; diff --git a/node_modules/jest-config/build/ReporterValidationErrors.js b/node_modules/jest-config/build/ReporterValidationErrors.js new file mode 100644 index 00000000..2be0df37 --- /dev/null +++ b/node_modules/jest-config/build/ReporterValidationErrors.js @@ -0,0 +1,122 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.createArrayReporterError = createArrayReporterError; +exports.createReporterError = createReporterError; +exports.validateReporters = validateReporters; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _jestGetType() { + const data = require('jest-get-type'); + _jestGetType = function () { + return data; + }; + return data; +} +function _jestValidate() { + const data = require('jest-validate'); + _jestValidate = function () { + return data; + }; + return data; +} +var _utils = require('./utils'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const validReporterTypes = ['array', 'string']; +const ERROR = `${_utils.BULLET}Reporter Validation Error`; + +/** + * Reporter Validation Error is thrown if the given arguments + * within the reporter are not valid. + * + * This is a highly specific reporter error and in the future will be + * merged with jest-validate. Till then, we can make use of it. It works + * and that's what counts most at this time. + */ +function createReporterError(reporterIndex, reporterValue) { + const errorMessage = + ` Reporter at index ${reporterIndex} must be of type:\n` + + ` ${_chalk().default.bold.green(validReporterTypes.join(' or '))}\n` + + ' but instead received:\n' + + ` ${_chalk().default.bold.red( + (0, _jestGetType().getType)(reporterValue) + )}`; + return new (_jestValidate().ValidationError)( + ERROR, + errorMessage, + _utils.DOCUMENTATION_NOTE + ); +} +function createArrayReporterError( + arrayReporter, + reporterIndex, + valueIndex, + value, + expectedType, + valueName +) { + const errorMessage = + ` Unexpected value for ${valueName} ` + + `at index ${valueIndex} of reporter at index ${reporterIndex}\n` + + ' Expected:\n' + + ` ${_chalk().default.bold.red(expectedType)}\n` + + ' Got:\n' + + ` ${_chalk().default.bold.green((0, _jestGetType().getType)(value))}\n` + + ' Reporter configuration:\n' + + ` ${_chalk().default.bold.green( + JSON.stringify(arrayReporter, null, 2).split('\n').join('\n ') + )}`; + return new (_jestValidate().ValidationError)( + ERROR, + errorMessage, + _utils.DOCUMENTATION_NOTE + ); +} +function validateReporters(reporterConfig) { + return reporterConfig.every((reporter, index) => { + if (Array.isArray(reporter)) { + validateArrayReporter(reporter, index); + } else if (typeof reporter !== 'string') { + throw createReporterError(index, reporter); + } + return true; + }); +} +function validateArrayReporter(arrayReporter, reporterIndex) { + const [path, options] = arrayReporter; + if (typeof path !== 'string') { + throw createArrayReporterError( + arrayReporter, + reporterIndex, + 0, + path, + 'string', + 'Path' + ); + } else if (typeof options !== 'object') { + throw createArrayReporterError( + arrayReporter, + reporterIndex, + 1, + options, + 'object', + 'Reporter Configuration' + ); + } +} diff --git a/node_modules/jest-config/build/ValidConfig.js b/node_modules/jest-config/build/ValidConfig.js new file mode 100644 index 00000000..0c1250c4 --- /dev/null +++ b/node_modules/jest-config/build/ValidConfig.js @@ -0,0 +1,342 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.initialProjectOptions = exports.initialOptions = void 0; +function _jestRegexUtil() { + const data = require('jest-regex-util'); + _jestRegexUtil = function () { + return data; + }; + return data; +} +function _jestValidate() { + const data = require('jest-validate'); + _jestValidate = function () { + return data; + }; + return data; +} +function _prettyFormat() { + const data = require('pretty-format'); + _prettyFormat = function () { + return data; + }; + return data; +} +var _constants = require('./constants'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const NODE_MODULES_REGEXP = (0, _jestRegexUtil().replacePathSepForRegex)( + _constants.NODE_MODULES +); +const initialOptions = { + automock: false, + bail: (0, _jestValidate().multipleValidOptions)(false, 0), + cache: true, + cacheDirectory: '/tmp/user/jest', + changedFilesWithAncestor: false, + changedSince: 'master', + ci: false, + clearMocks: false, + collectCoverage: true, + collectCoverageFrom: ['src', '!public'], + coverageDirectory: 'coverage', + coveragePathIgnorePatterns: [NODE_MODULES_REGEXP], + coverageProvider: 'v8', + coverageReporters: ['json', 'text', 'lcov', 'clover'], + coverageThreshold: { + global: { + branches: 50, + functions: 100, + lines: 100, + statements: 100 + } + }, + dependencyExtractor: '/dependencyExtractor.js', + detectLeaks: false, + detectOpenHandles: false, + displayName: (0, _jestValidate().multipleValidOptions)('test-config', { + color: 'blue', + name: 'test-config' + }), + errorOnDeprecated: false, + expand: false, + extensionsToTreatAsEsm: [], + fakeTimers: { + advanceTimers: (0, _jestValidate().multipleValidOptions)(40, true), + doNotFake: [ + 'Date', + 'hrtime', + 'nextTick', + 'performance', + 'queueMicrotask', + 'requestAnimationFrame', + 'cancelAnimationFrame', + 'requestIdleCallback', + 'cancelIdleCallback', + 'setImmediate', + 'clearImmediate', + 'setInterval', + 'clearInterval', + 'setTimeout', + 'clearTimeout' + ], + enableGlobally: true, + legacyFakeTimers: false, + now: 1483228800000, + timerLimit: 1000 + }, + filter: '/filter.js', + forceCoverageMatch: ['**/*.t.js'], + forceExit: false, + globalSetup: 'setup.js', + globalTeardown: 'teardown.js', + globals: { + __DEV__: true + }, + haste: { + computeSha1: true, + defaultPlatform: 'ios', + enableSymlinks: false, + forceNodeFilesystemAPI: true, + hasteImplModulePath: '/haste_impl.js', + hasteMapModulePath: '', + platforms: ['ios', 'android'], + retainAllFiles: false, + throwOnModuleCollision: false + }, + id: 'string', + injectGlobals: true, + json: false, + lastCommit: false, + listTests: false, + logHeapUsage: true, + maxConcurrency: 5, + maxWorkers: '50%', + moduleDirectories: ['node_modules'], + moduleFileExtensions: [ + 'js', + 'mjs', + 'cjs', + 'json', + 'jsx', + 'ts', + 'tsx', + 'node' + ], + moduleNameMapper: { + '^React$': '/node_modules/react' + }, + modulePathIgnorePatterns: ['/build/'], + modulePaths: ['/shared/vendor/modules'], + noStackTrace: false, + notify: false, + notifyMode: 'failure-change', + onlyChanged: false, + onlyFailures: false, + openHandlesTimeout: 1000, + passWithNoTests: false, + preset: 'react-native', + prettierPath: '/node_modules/prettier', + projects: ['project-a', 'project-b/'], + randomize: false, + reporters: [ + 'default', + 'custom-reporter-1', + [ + 'custom-reporter-2', + { + configValue: true + } + ] + ], + resetMocks: false, + resetModules: false, + resolver: '/resolver.js', + restoreMocks: false, + rootDir: '/', + roots: [''], + runTestsByPath: false, + runner: 'jest-runner', + runtime: '', + sandboxInjectedGlobals: [], + setupFiles: ['/setup.js'], + setupFilesAfterEnv: ['/testSetupFile.js'], + showSeed: false, + silent: true, + skipFilter: false, + skipNodeResolution: false, + slowTestThreshold: 5, + snapshotFormat: _prettyFormat().DEFAULT_OPTIONS, + snapshotResolver: '/snapshotResolver.js', + snapshotSerializers: ['my-serializer-module'], + testEnvironment: 'jest-environment-node', + testEnvironmentOptions: { + url: 'http://localhost', + userAgent: 'Agent/007' + }, + testFailureExitCode: 1, + testLocationInResults: false, + testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], + testNamePattern: 'test signature', + testPathIgnorePatterns: [NODE_MODULES_REGEXP], + testRegex: (0, _jestValidate().multipleValidOptions)( + '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$', + ['/__tests__/\\.test\\.[jt]sx?$', '/__tests__/\\.spec\\.[jt]sx?$'] + ), + testResultsProcessor: 'processor-node-module', + testRunner: 'circus', + testSequencer: '@jest/test-sequencer', + testTimeout: 5000, + transform: { + '\\.js$': '/preprocessor.js' + }, + transformIgnorePatterns: [NODE_MODULES_REGEXP], + unmockedModulePathPatterns: ['mock'], + updateSnapshot: true, + useStderr: false, + verbose: false, + watch: false, + watchAll: false, + watchPathIgnorePatterns: ['/e2e/'], + watchPlugins: [ + 'path/to/yourWatchPlugin', + [ + 'jest-watch-typeahead/filename', + { + key: 'k', + prompt: 'do something with my custom prompt' + } + ] + ], + watchman: true, + workerIdleMemoryLimit: (0, _jestValidate().multipleValidOptions)(0.2, '50%'), + workerThreads: true +}; +exports.initialOptions = initialOptions; +const initialProjectOptions = { + automock: false, + cache: true, + cacheDirectory: '/tmp/user/jest', + clearMocks: false, + collectCoverageFrom: ['src', '!public'], + coverageDirectory: 'coverage', + coveragePathIgnorePatterns: [NODE_MODULES_REGEXP], + dependencyExtractor: '/dependencyExtractor.js', + detectLeaks: false, + detectOpenHandles: false, + displayName: (0, _jestValidate().multipleValidOptions)('test-config', { + color: 'blue', + name: 'test-config' + }), + errorOnDeprecated: false, + extensionsToTreatAsEsm: [], + fakeTimers: { + advanceTimers: (0, _jestValidate().multipleValidOptions)(40, true), + doNotFake: [ + 'Date', + 'hrtime', + 'nextTick', + 'performance', + 'queueMicrotask', + 'requestAnimationFrame', + 'cancelAnimationFrame', + 'requestIdleCallback', + 'cancelIdleCallback', + 'setImmediate', + 'clearImmediate', + 'setInterval', + 'clearInterval', + 'setTimeout', + 'clearTimeout' + ], + enableGlobally: true, + legacyFakeTimers: false, + now: 1483228800000, + timerLimit: 1000 + }, + filter: '/filter.js', + forceCoverageMatch: ['**/*.t.js'], + globalSetup: 'setup.js', + globalTeardown: 'teardown.js', + globals: { + __DEV__: true + }, + haste: { + computeSha1: true, + defaultPlatform: 'ios', + enableSymlinks: false, + forceNodeFilesystemAPI: true, + hasteImplModulePath: '/haste_impl.js', + hasteMapModulePath: '', + platforms: ['ios', 'android'], + retainAllFiles: false, + throwOnModuleCollision: false + }, + id: 'string', + injectGlobals: true, + moduleDirectories: ['node_modules'], + moduleFileExtensions: [ + 'js', + 'mjs', + 'cjs', + 'json', + 'jsx', + 'ts', + 'tsx', + 'node' + ], + moduleNameMapper: { + '^React$': '/node_modules/react' + }, + modulePathIgnorePatterns: ['/build/'], + modulePaths: ['/shared/vendor/modules'], + openHandlesTimeout: 1000, + preset: 'react-native', + prettierPath: '/node_modules/prettier', + resetMocks: false, + resetModules: false, + resolver: '/resolver.js', + restoreMocks: false, + rootDir: '/', + roots: [''], + runner: 'jest-runner', + runtime: '', + sandboxInjectedGlobals: [], + setupFiles: ['/setup.js'], + setupFilesAfterEnv: ['/testSetupFile.js'], + skipFilter: false, + skipNodeResolution: false, + slowTestThreshold: 5, + snapshotFormat: _prettyFormat().DEFAULT_OPTIONS, + snapshotResolver: '/snapshotResolver.js', + snapshotSerializers: ['my-serializer-module'], + testEnvironment: 'jest-environment-node', + testEnvironmentOptions: { + url: 'http://localhost', + userAgent: 'Agent/007' + }, + testLocationInResults: false, + testMatch: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], + testPathIgnorePatterns: [NODE_MODULES_REGEXP], + testRegex: (0, _jestValidate().multipleValidOptions)( + '(/__tests__/.*|(\\.|/)(test|spec))\\.[jt]sx?$', + ['/__tests__/\\.test\\.[jt]sx?$', '/__tests__/\\.spec\\.[jt]sx?$'] + ), + testRunner: 'circus', + transform: { + '\\.js$': '/preprocessor.js' + }, + transformIgnorePatterns: [NODE_MODULES_REGEXP], + unmockedModulePathPatterns: ['mock'], + watchPathIgnorePatterns: ['/e2e/'], + workerIdleMemoryLimit: (0, _jestValidate().multipleValidOptions)(0.2, '50%') +}; +exports.initialProjectOptions = initialProjectOptions; diff --git a/node_modules/jest-config/build/color.js b/node_modules/jest-config/build/color.js new file mode 100644 index 00000000..ac0bf905 --- /dev/null +++ b/node_modules/jest-config/build/color.js @@ -0,0 +1,31 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.getDisplayNameColor = void 0; +function _crypto() { + const data = require('crypto'); + _crypto = function () { + return data; + }; + return data; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const colors = ['red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']; +const getDisplayNameColor = seed => { + if (seed === undefined) { + return 'white'; + } + const hash = (0, _crypto().createHash)('sha256'); + hash.update(seed); + const num = hash.digest().readUInt32LE(0); + return colors[num % colors.length]; +}; +exports.getDisplayNameColor = getDisplayNameColor; diff --git a/node_modules/jest-config/build/constants.js b/node_modules/jest-config/build/constants.js new file mode 100644 index 00000000..273cd39e --- /dev/null +++ b/node_modules/jest-config/build/constants.js @@ -0,0 +1,96 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.PACKAGE_JSON = + exports.NODE_MODULES = + exports.JEST_CONFIG_EXT_TS = + exports.JEST_CONFIG_EXT_ORDER = + exports.JEST_CONFIG_EXT_MJS = + exports.JEST_CONFIG_EXT_JSON = + exports.JEST_CONFIG_EXT_JS = + exports.JEST_CONFIG_EXT_CJS = + exports.JEST_CONFIG_BASE_NAME = + exports.DEFAULT_JS_PATTERN = + void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const NODE_MODULES = `${path().sep}node_modules${path().sep}`; +exports.NODE_MODULES = NODE_MODULES; +const DEFAULT_JS_PATTERN = '\\.[jt]sx?$'; +exports.DEFAULT_JS_PATTERN = DEFAULT_JS_PATTERN; +const PACKAGE_JSON = 'package.json'; +exports.PACKAGE_JSON = PACKAGE_JSON; +const JEST_CONFIG_BASE_NAME = 'jest.config'; +exports.JEST_CONFIG_BASE_NAME = JEST_CONFIG_BASE_NAME; +const JEST_CONFIG_EXT_CJS = '.cjs'; +exports.JEST_CONFIG_EXT_CJS = JEST_CONFIG_EXT_CJS; +const JEST_CONFIG_EXT_MJS = '.mjs'; +exports.JEST_CONFIG_EXT_MJS = JEST_CONFIG_EXT_MJS; +const JEST_CONFIG_EXT_JS = '.js'; +exports.JEST_CONFIG_EXT_JS = JEST_CONFIG_EXT_JS; +const JEST_CONFIG_EXT_TS = '.ts'; +exports.JEST_CONFIG_EXT_TS = JEST_CONFIG_EXT_TS; +const JEST_CONFIG_EXT_JSON = '.json'; +exports.JEST_CONFIG_EXT_JSON = JEST_CONFIG_EXT_JSON; +const JEST_CONFIG_EXT_ORDER = Object.freeze([ + JEST_CONFIG_EXT_JS, + JEST_CONFIG_EXT_TS, + JEST_CONFIG_EXT_MJS, + JEST_CONFIG_EXT_CJS, + JEST_CONFIG_EXT_JSON +]); +exports.JEST_CONFIG_EXT_ORDER = JEST_CONFIG_EXT_ORDER; diff --git a/node_modules/jest-config/build/getCacheDirectory.js b/node_modules/jest-config/build/getCacheDirectory.js new file mode 100644 index 00000000..896ef992 --- /dev/null +++ b/node_modules/jest-config/build/getCacheDirectory.js @@ -0,0 +1,91 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _os() { + const data = require('os'); + _os = function () { + return data; + }; + return data; +} +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const getCacheDirectory = () => { + const {getuid} = process; + const tmpdirPath = path().join( + (0, _jestUtil().tryRealpath)((0, _os().tmpdir)()), + 'jest' + ); + if (getuid == null) { + return tmpdirPath; + } else { + // On some platforms tmpdir() is `/tmp`, causing conflicts between different + // users and permission issues. Adding an additional subdivision by UID can + // help. + return `${tmpdirPath}_${getuid.call(process).toString(36)}`; + } +}; +var _default = getCacheDirectory; +exports.default = _default; diff --git a/node_modules/jest-config/build/getMaxWorkers.js b/node_modules/jest-config/build/getMaxWorkers.js new file mode 100644 index 00000000..7a437419 --- /dev/null +++ b/node_modules/jest-config/build/getMaxWorkers.js @@ -0,0 +1,56 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = getMaxWorkers; +function _os() { + const data = require('os'); + _os = function () { + return data; + }; + return data; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function getNumCpus() { + return typeof _os().availableParallelism === 'function' + ? (0, _os().availableParallelism)() + : (0, _os().cpus)()?.length ?? 1; +} +function getMaxWorkers(argv, defaultOptions) { + if (argv.runInBand) { + return 1; + } else if (argv.maxWorkers) { + return parseWorkers(argv.maxWorkers); + } else if (defaultOptions && defaultOptions.maxWorkers) { + return parseWorkers(defaultOptions.maxWorkers); + } else { + // In watch mode, Jest should be unobtrusive and not use all available CPUs. + const numCpus = getNumCpus(); + const isWatchModeEnabled = argv.watch || argv.watchAll; + return Math.max( + isWatchModeEnabled ? Math.floor(numCpus / 2) : numCpus - 1, + 1 + ); + } +} +const parseWorkers = maxWorkers => { + const parsed = parseInt(maxWorkers.toString(), 10); + if ( + typeof maxWorkers === 'string' && + maxWorkers.trim().endsWith('%') && + parsed > 0 && + parsed <= 100 + ) { + const numCpus = getNumCpus(); + const workers = Math.floor((parsed / 100) * numCpus); + return Math.max(workers, 1); + } + return parsed > 0 ? parsed : 1; +}; diff --git a/node_modules/jest-config/build/index.d.ts b/node_modules/jest-config/build/index.d.ts new file mode 100644 index 00000000..e3165e0f --- /dev/null +++ b/node_modules/jest-config/build/index.d.ts @@ -0,0 +1,147 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {Config} from '@jest/types'; +import type {DeprecatedOptions} from 'jest-validate'; + +declare type AllOptions = Config.ProjectConfig & Config.GlobalConfig; + +declare namespace constants { + export { + NODE_MODULES, + DEFAULT_JS_PATTERN, + PACKAGE_JSON, + JEST_CONFIG_BASE_NAME, + JEST_CONFIG_EXT_CJS, + JEST_CONFIG_EXT_MJS, + JEST_CONFIG_EXT_JS, + JEST_CONFIG_EXT_TS, + JEST_CONFIG_EXT_JSON, + JEST_CONFIG_EXT_ORDER, + }; +} +export {constants}; + +declare const DEFAULT_JS_PATTERN = '\\.[jt]sx?$'; + +export declare const defaults: Config.DefaultOptions; + +export declare const deprecationEntries: DeprecatedOptions; + +export declare const descriptions: { + [key in keyof Config.InitialOptions]: string; +}; + +export declare const isJSONString: ( + text?: JSONString | string, +) => text is JSONString; + +declare const JEST_CONFIG_BASE_NAME = 'jest.config'; + +declare const JEST_CONFIG_EXT_CJS = '.cjs'; + +declare const JEST_CONFIG_EXT_JS = '.js'; + +declare const JEST_CONFIG_EXT_JSON = '.json'; + +declare const JEST_CONFIG_EXT_MJS = '.mjs'; + +declare const JEST_CONFIG_EXT_ORDER: readonly string[]; + +declare const JEST_CONFIG_EXT_TS = '.ts'; + +declare type JSONString = string & { + readonly $$type: never; +}; + +declare const NODE_MODULES: string; + +export declare function normalize( + initialOptions: Config.InitialOptions, + argv: Config.Argv, + configPath?: string | null, + projectIndex?: number, + isProjectOptions?: boolean, +): Promise<{ + hasDeprecationWarnings: boolean; + options: AllOptions; +}>; + +declare const PACKAGE_JSON = 'package.json'; + +declare type ReadConfig = { + configPath: string | null | undefined; + globalConfig: Config.GlobalConfig; + hasDeprecationWarnings: boolean; + projectConfig: Config.ProjectConfig; +}; + +export declare function readConfig( + argv: Config.Argv, + packageRootOrConfig: string | Config.InitialOptions, + skipArgvConfigOption?: boolean, + parentConfigDirname?: string | null, + projectIndex?: number, + skipMultipleConfigError?: boolean, +): Promise; + +export declare function readConfigs( + argv: Config.Argv, + projectPaths: Array, +): Promise<{ + globalConfig: Config.GlobalConfig; + configs: Array; + hasDeprecationWarnings: boolean; +}>; + +/** + * Reads the jest config, without validating them or filling it out with defaults. + * @param config The path to the file or serialized config. + * @param param1 Additional options + * @returns The raw initial config (not validated) + */ +export declare function readInitialOptions( + config?: string, + { + packageRootOrConfig, + parentConfigDirname, + readFromCwd, + skipMultipleConfigError, + }?: ReadJestConfigOptions, +): Promise<{ + config: Config.InitialOptions; + configPath: string | null; +}>; + +export declare interface ReadJestConfigOptions { + /** + * The package root or deserialized config (default is cwd) + */ + packageRootOrConfig?: string | Config.InitialOptions; + /** + * When the `packageRootOrConfig` contains config, this parameter should + * contain the dirname of the parent config + */ + parentConfigDirname?: null | string; + /** + * Indicates whether or not to read the specified config file from disk. + * When true, jest will read try to read config from the current working directory. + * (default is false) + */ + readFromCwd?: boolean; + /** + * Indicates whether or not to ignore the error of jest finding multiple config files. + * (default is false) + */ + skipMultipleConfigError?: boolean; +} + +export declare const replaceRootDirInPath: ( + rootDir: string, + filePath: string, +) => string; + +export {}; diff --git a/node_modules/jest-config/build/index.js b/node_modules/jest-config/build/index.js new file mode 100644 index 00000000..a78c4681 --- /dev/null +++ b/node_modules/jest-config/build/index.js @@ -0,0 +1,494 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.constants = void 0; +Object.defineProperty(exports, 'defaults', { + enumerable: true, + get: function () { + return _Defaults.default; + } +}); +Object.defineProperty(exports, 'deprecationEntries', { + enumerable: true, + get: function () { + return _Deprecated.default; + } +}); +Object.defineProperty(exports, 'descriptions', { + enumerable: true, + get: function () { + return _Descriptions.default; + } +}); +Object.defineProperty(exports, 'isJSONString', { + enumerable: true, + get: function () { + return _utils.isJSONString; + } +}); +Object.defineProperty(exports, 'normalize', { + enumerable: true, + get: function () { + return _normalize.default; + } +}); +exports.readConfig = readConfig; +exports.readConfigs = readConfigs; +exports.readInitialOptions = readInitialOptions; +Object.defineProperty(exports, 'replaceRootDirInPath', { + enumerable: true, + get: function () { + return _utils.replaceRootDirInPath; + } +}); +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +var constants = _interopRequireWildcard(require('./constants')); +exports.constants = constants; +var _normalize = _interopRequireDefault(require('./normalize')); +var _readConfigFileAndSetRootDir = _interopRequireDefault( + require('./readConfigFileAndSetRootDir') +); +var _resolveConfigPath = _interopRequireDefault(require('./resolveConfigPath')); +var _utils = require('./utils'); +var _Deprecated = _interopRequireDefault(require('./Deprecated')); +var _Defaults = _interopRequireDefault(require('./Defaults')); +var _Descriptions = _interopRequireDefault(require('./Descriptions')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +async function readConfig( + argv, + packageRootOrConfig, + // Whether it needs to look into `--config` arg passed to CLI. + // It only used to read initial config. If the initial config contains + // `project` property, we don't want to read `--config` value and rather + // read individual configs for every project. + skipArgvConfigOption, + parentConfigDirname, + projectIndex = Infinity, + skipMultipleConfigError = false +) { + const {config: initialOptions, configPath} = await readInitialOptions( + argv.config, + { + packageRootOrConfig, + parentConfigDirname, + readFromCwd: skipArgvConfigOption, + skipMultipleConfigError + } + ); + const packageRoot = + typeof packageRootOrConfig === 'string' + ? path().resolve(packageRootOrConfig) + : undefined; + const {options, hasDeprecationWarnings} = await (0, _normalize.default)( + initialOptions, + argv, + configPath, + projectIndex, + skipArgvConfigOption && !(packageRoot === parentConfigDirname) + ); + const {globalConfig, projectConfig} = groupOptions(options); + return { + configPath, + globalConfig, + hasDeprecationWarnings, + projectConfig + }; +} +const groupOptions = options => ({ + globalConfig: Object.freeze({ + bail: options.bail, + changedFilesWithAncestor: options.changedFilesWithAncestor, + changedSince: options.changedSince, + ci: options.ci, + collectCoverage: options.collectCoverage, + collectCoverageFrom: options.collectCoverageFrom, + coverageDirectory: options.coverageDirectory, + coverageProvider: options.coverageProvider, + coverageReporters: options.coverageReporters, + coverageThreshold: options.coverageThreshold, + detectLeaks: options.detectLeaks, + detectOpenHandles: options.detectOpenHandles, + errorOnDeprecated: options.errorOnDeprecated, + expand: options.expand, + filter: options.filter, + findRelatedTests: options.findRelatedTests, + forceExit: options.forceExit, + globalSetup: options.globalSetup, + globalTeardown: options.globalTeardown, + json: options.json, + lastCommit: options.lastCommit, + listTests: options.listTests, + logHeapUsage: options.logHeapUsage, + maxConcurrency: options.maxConcurrency, + maxWorkers: options.maxWorkers, + noSCM: undefined, + noStackTrace: options.noStackTrace, + nonFlagArgs: options.nonFlagArgs, + notify: options.notify, + notifyMode: options.notifyMode, + onlyChanged: options.onlyChanged, + onlyFailures: options.onlyFailures, + openHandlesTimeout: options.openHandlesTimeout, + outputFile: options.outputFile, + passWithNoTests: options.passWithNoTests, + projects: options.projects, + randomize: options.randomize, + replname: options.replname, + reporters: options.reporters, + rootDir: options.rootDir, + runInBand: options.runInBand, + runTestsByPath: options.runTestsByPath, + seed: options.seed, + shard: options.shard, + showSeed: options.showSeed, + silent: options.silent, + skipFilter: options.skipFilter, + snapshotFormat: options.snapshotFormat, + testFailureExitCode: options.testFailureExitCode, + testNamePattern: options.testNamePattern, + testPathPattern: options.testPathPattern, + testResultsProcessor: options.testResultsProcessor, + testSequencer: options.testSequencer, + testTimeout: options.testTimeout, + updateSnapshot: options.updateSnapshot, + useStderr: options.useStderr, + verbose: options.verbose, + watch: options.watch, + watchAll: options.watchAll, + watchPlugins: options.watchPlugins, + watchman: options.watchman, + workerIdleMemoryLimit: options.workerIdleMemoryLimit, + workerThreads: options.workerThreads + }), + projectConfig: Object.freeze({ + automock: options.automock, + cache: options.cache, + cacheDirectory: options.cacheDirectory, + clearMocks: options.clearMocks, + collectCoverageFrom: options.collectCoverageFrom, + coverageDirectory: options.coverageDirectory, + coveragePathIgnorePatterns: options.coveragePathIgnorePatterns, + cwd: options.cwd, + dependencyExtractor: options.dependencyExtractor, + detectLeaks: options.detectLeaks, + detectOpenHandles: options.detectOpenHandles, + displayName: options.displayName, + errorOnDeprecated: options.errorOnDeprecated, + extensionsToTreatAsEsm: options.extensionsToTreatAsEsm, + fakeTimers: options.fakeTimers, + filter: options.filter, + forceCoverageMatch: options.forceCoverageMatch, + globalSetup: options.globalSetup, + globalTeardown: options.globalTeardown, + globals: options.globals, + haste: options.haste, + id: options.id, + injectGlobals: options.injectGlobals, + moduleDirectories: options.moduleDirectories, + moduleFileExtensions: options.moduleFileExtensions, + moduleNameMapper: options.moduleNameMapper, + modulePathIgnorePatterns: options.modulePathIgnorePatterns, + modulePaths: options.modulePaths, + openHandlesTimeout: options.openHandlesTimeout, + prettierPath: options.prettierPath, + resetMocks: options.resetMocks, + resetModules: options.resetModules, + resolver: options.resolver, + restoreMocks: options.restoreMocks, + rootDir: options.rootDir, + roots: options.roots, + runner: options.runner, + runtime: options.runtime, + sandboxInjectedGlobals: options.sandboxInjectedGlobals, + setupFiles: options.setupFiles, + setupFilesAfterEnv: options.setupFilesAfterEnv, + skipFilter: options.skipFilter, + skipNodeResolution: options.skipNodeResolution, + slowTestThreshold: options.slowTestThreshold, + snapshotFormat: options.snapshotFormat, + snapshotResolver: options.snapshotResolver, + snapshotSerializers: options.snapshotSerializers, + testEnvironment: options.testEnvironment, + testEnvironmentOptions: options.testEnvironmentOptions, + testLocationInResults: options.testLocationInResults, + testMatch: options.testMatch, + testPathIgnorePatterns: options.testPathIgnorePatterns, + testRegex: options.testRegex, + testRunner: options.testRunner, + transform: options.transform, + transformIgnorePatterns: options.transformIgnorePatterns, + unmockedModulePathPatterns: options.unmockedModulePathPatterns, + watchPathIgnorePatterns: options.watchPathIgnorePatterns + }) +}); +const ensureNoDuplicateConfigs = (parsedConfigs, projects) => { + if (projects.length <= 1) { + return; + } + const configPathMap = new Map(); + for (const config of parsedConfigs) { + const {configPath} = config; + if (configPathMap.has(configPath)) { + const message = `Whoops! Two projects resolved to the same config path: ${_chalk().default.bold( + String(configPath) + )}: + + Project 1: ${_chalk().default.bold( + projects[parsedConfigs.findIndex(x => x === config)] + )} + Project 2: ${_chalk().default.bold( + projects[parsedConfigs.findIndex(x => x === configPathMap.get(configPath))] + )} + +This usually means that your ${_chalk().default.bold( + '"projects"' + )} config includes a directory that doesn't have any configuration recognizable by Jest. Please fix it. +`; + throw new Error(message); + } + if (configPath !== null) { + configPathMap.set(configPath, config); + } + } +}; +/** + * Reads the jest config, without validating them or filling it out with defaults. + * @param config The path to the file or serialized config. + * @param param1 Additional options + * @returns The raw initial config (not validated) + */ +async function readInitialOptions( + config, + { + packageRootOrConfig = process.cwd(), + parentConfigDirname = null, + readFromCwd = false, + skipMultipleConfigError = false + } = {} +) { + if (typeof packageRootOrConfig !== 'string') { + if (parentConfigDirname) { + const rawOptions = packageRootOrConfig; + rawOptions.rootDir = rawOptions.rootDir + ? (0, _utils.replaceRootDirInPath)( + parentConfigDirname, + rawOptions.rootDir + ) + : parentConfigDirname; + return { + config: rawOptions, + configPath: null + }; + } else { + throw new Error( + 'Jest: Cannot use configuration as an object without a file path.' + ); + } + } + if ((0, _utils.isJSONString)(config)) { + try { + // A JSON string was passed to `--config` argument and we can parse it + // and use as is. + const initialOptions = JSON.parse(config); + // NOTE: we might need to resolve this dir to an absolute path in the future + initialOptions.rootDir = initialOptions.rootDir || packageRootOrConfig; + return { + config: initialOptions, + configPath: null + }; + } catch { + throw new Error( + 'There was an error while parsing the `--config` argument as a JSON string.' + ); + } + } + if (!readFromCwd && typeof config == 'string') { + // A string passed to `--config`, which is either a direct path to the config + // or a path to directory containing `package.json`, `jest.config.js` or `jest.config.ts` + const configPath = (0, _resolveConfigPath.default)( + config, + process.cwd(), + skipMultipleConfigError + ); + return { + config: await (0, _readConfigFileAndSetRootDir.default)(configPath), + configPath + }; + } + // Otherwise just try to find config in the current rootDir. + const configPath = (0, _resolveConfigPath.default)( + packageRootOrConfig, + process.cwd(), + skipMultipleConfigError + ); + return { + config: await (0, _readConfigFileAndSetRootDir.default)(configPath), + configPath + }; +} + +// Possible scenarios: +// 1. jest --config config.json +// 2. jest --projects p1 p2 +// 3. jest --projects p1 p2 --config config.json +// 4. jest --projects p1 +// 5. jest +// +// If no projects are specified, process.cwd() will be used as the default +// (and only) project. +async function readConfigs(argv, projectPaths) { + let globalConfig; + let hasDeprecationWarnings; + let configs = []; + let projects = projectPaths; + let configPath; + if (projectPaths.length === 1) { + const parsedConfig = await readConfig(argv, projects[0]); + configPath = parsedConfig.configPath; + hasDeprecationWarnings = parsedConfig.hasDeprecationWarnings; + globalConfig = parsedConfig.globalConfig; + configs = [parsedConfig.projectConfig]; + if (globalConfig.projects && globalConfig.projects.length) { + // Even though we had one project in CLI args, there might be more + // projects defined in the config. + // In other words, if this was a single project, + // and its config has `projects` settings, use that value instead. + projects = globalConfig.projects; + } + } + if (projects.length > 0) { + const cwd = + process.platform === 'win32' + ? (0, _jestUtil().tryRealpath)(process.cwd()) + : process.cwd(); + const projectIsCwd = projects[0] === cwd; + const parsedConfigs = await Promise.all( + projects + .filter(root => { + // Ignore globbed files that cannot be `require`d. + if ( + typeof root === 'string' && + fs().existsSync(root) && + !fs().lstatSync(root).isDirectory() && + !constants.JEST_CONFIG_EXT_ORDER.some(ext => root.endsWith(ext)) + ) { + return false; + } + return true; + }) + .map((root, projectIndex) => { + const projectIsTheOnlyProject = + projectIndex === 0 && projects.length === 1; + const skipArgvConfigOption = !( + projectIsTheOnlyProject && projectIsCwd + ); + return readConfig( + argv, + root, + skipArgvConfigOption, + configPath ? path().dirname(configPath) : cwd, + projectIndex, + // we wanna skip the warning if this is the "main" project + projectIsCwd + ); + }) + ); + ensureNoDuplicateConfigs(parsedConfigs, projects); + configs = parsedConfigs.map(({projectConfig}) => projectConfig); + if (!hasDeprecationWarnings) { + hasDeprecationWarnings = parsedConfigs.some( + ({hasDeprecationWarnings}) => !!hasDeprecationWarnings + ); + } + // If no config was passed initially, use the one from the first project + if (!globalConfig) { + globalConfig = parsedConfigs[0].globalConfig; + } + } + if (!globalConfig || !configs.length) { + throw new Error('jest: No configuration found for any project.'); + } + return { + configs, + globalConfig, + hasDeprecationWarnings: !!hasDeprecationWarnings + }; +} diff --git a/node_modules/jest-config/build/normalize.js b/node_modules/jest-config/build/normalize.js new file mode 100644 index 00000000..62246fa8 --- /dev/null +++ b/node_modules/jest-config/build/normalize.js @@ -0,0 +1,1180 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = normalize; +function _crypto() { + const data = require('crypto'); + _crypto = function () { + return data; + }; + return data; +} +function _os() { + const data = require('os'); + _os = function () { + return data; + }; + return data; +} +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _deepmerge() { + const data = _interopRequireDefault(require('deepmerge')); + _deepmerge = function () { + return data; + }; + return data; +} +function _glob() { + const data = require('glob'); + _glob = function () { + return data; + }; + return data; +} +function _gracefulFs() { + const data = require('graceful-fs'); + _gracefulFs = function () { + return data; + }; + return data; +} +function _micromatch() { + const data = _interopRequireDefault(require('micromatch')); + _micromatch = function () { + return data; + }; + return data; +} +function _jestRegexUtil() { + const data = require('jest-regex-util'); + _jestRegexUtil = function () { + return data; + }; + return data; +} +function _jestResolve() { + const data = _interopRequireWildcard(require('jest-resolve')); + _jestResolve = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +function _jestValidate() { + const data = require('jest-validate'); + _jestValidate = function () { + return data; + }; + return data; +} +var _Defaults = _interopRequireDefault(require('./Defaults')); +var _Deprecated = _interopRequireDefault(require('./Deprecated')); +var _ReporterValidationErrors = require('./ReporterValidationErrors'); +var _ValidConfig = require('./ValidConfig'); +var _color = require('./color'); +var _constants = require('./constants'); +var _getMaxWorkers = _interopRequireDefault(require('./getMaxWorkers')); +var _parseShardPair = require('./parseShardPair'); +var _setFromArgv = _interopRequireDefault(require('./setFromArgv')); +var _stringToBytes = _interopRequireDefault(require('./stringToBytes')); +var _utils = require('./utils'); +var _validatePattern = _interopRequireDefault(require('./validatePattern')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const ERROR = `${_utils.BULLET}Validation Error`; +const PRESET_EXTENSIONS = ['.json', '.js', '.cjs', '.mjs']; +const PRESET_NAME = 'jest-preset'; +const createConfigError = message => + new (_jestValidate().ValidationError)( + ERROR, + message, + _utils.DOCUMENTATION_NOTE + ); +function verifyDirectoryExists(path, key) { + try { + const rootStat = (0, _gracefulFs().statSync)(path); + if (!rootStat.isDirectory()) { + throw createConfigError( + ` ${_chalk().default.bold(path)} in the ${_chalk().default.bold( + key + )} option is not a directory.` + ); + } + } catch (err) { + if (err instanceof _jestValidate().ValidationError) { + throw err; + } + if (err.code === 'ENOENT') { + throw createConfigError( + ` Directory ${_chalk().default.bold( + path + )} in the ${_chalk().default.bold(key)} option was not found.` + ); + } + + // Not sure in which cases `statSync` can throw, so let's just show the underlying error to the user + throw createConfigError( + ` Got an error trying to find ${_chalk().default.bold( + path + )} in the ${_chalk().default.bold(key)} option.\n\n Error was: ${ + err.message + }` + ); + } +} +const mergeOptionWithPreset = (options, preset, optionName) => { + if (options[optionName] && preset[optionName]) { + options[optionName] = { + ...options[optionName], + ...preset[optionName], + ...options[optionName] + }; + } +}; +const mergeGlobalsWithPreset = (options, preset) => { + if (options.globals && preset.globals) { + options.globals = (0, _deepmerge().default)( + preset.globals, + options.globals + ); + } +}; +const setupPreset = async (options, optionsPreset) => { + let preset; + const presetPath = (0, _utils.replaceRootDirInPath)( + options.rootDir, + optionsPreset + ); + const presetModule = _jestResolve().default.findNodeModule( + presetPath.startsWith('.') + ? presetPath + : path().join(presetPath, PRESET_NAME), + { + basedir: options.rootDir, + extensions: PRESET_EXTENSIONS + } + ); + try { + if (!presetModule) { + throw new Error(`Cannot find module '${presetPath}'`); + } + + // Force re-evaluation to support multiple projects + try { + delete require.cache[require.resolve(presetModule)]; + } catch {} + preset = await (0, _jestUtil().requireOrImportModule)(presetModule); + } catch (error) { + if (error instanceof SyntaxError || error instanceof TypeError) { + throw createConfigError( + ` Preset ${_chalk().default.bold(presetPath)} is invalid:\n\n ${ + error.message + }\n ${error.stack}` + ); + } + if (error.message.includes('Cannot find module')) { + if (error.message.includes(presetPath)) { + const preset = _jestResolve().default.findNodeModule(presetPath, { + basedir: options.rootDir + }); + if (preset) { + throw createConfigError( + ` Module ${_chalk().default.bold( + presetPath + )} should have "jest-preset.js" or "jest-preset.json" file at the root.` + ); + } + throw createConfigError( + ` Preset ${_chalk().default.bold(presetPath)} not found.` + ); + } + throw createConfigError( + ` Missing dependency in ${_chalk().default.bold(presetPath)}:\n\n ${ + error.message + }\n ${error.stack}` + ); + } + throw createConfigError( + ` An unknown error occurred in ${_chalk().default.bold( + presetPath + )}:\n\n ${error.message}\n ${error.stack}` + ); + } + if (options.setupFiles) { + options.setupFiles = (preset.setupFiles || []).concat(options.setupFiles); + } + if (options.setupFilesAfterEnv) { + options.setupFilesAfterEnv = (preset.setupFilesAfterEnv || []).concat( + options.setupFilesAfterEnv + ); + } + if (options.modulePathIgnorePatterns && preset.modulePathIgnorePatterns) { + options.modulePathIgnorePatterns = preset.modulePathIgnorePatterns.concat( + options.modulePathIgnorePatterns + ); + } + mergeOptionWithPreset(options, preset, 'moduleNameMapper'); + mergeOptionWithPreset(options, preset, 'transform'); + mergeGlobalsWithPreset(options, preset); + return { + ...preset, + ...options + }; +}; +const setupBabelJest = options => { + const transform = options.transform; + let babelJest; + if (transform) { + const customJSPattern = Object.keys(transform).find(pattern => { + const regex = new RegExp(pattern); + return regex.test('a.js') || regex.test('a.jsx'); + }); + const customTSPattern = Object.keys(transform).find(pattern => { + const regex = new RegExp(pattern); + return regex.test('a.ts') || regex.test('a.tsx'); + }); + [customJSPattern, customTSPattern].forEach(pattern => { + if (pattern) { + const customTransformer = transform[pattern]; + if (Array.isArray(customTransformer)) { + if (customTransformer[0] === 'babel-jest') { + babelJest = require.resolve('babel-jest'); + customTransformer[0] = babelJest; + } else if (customTransformer[0].includes('babel-jest')) { + babelJest = customTransformer[0]; + } + } else { + if (customTransformer === 'babel-jest') { + babelJest = require.resolve('babel-jest'); + transform[pattern] = babelJest; + } else if (customTransformer.includes('babel-jest')) { + babelJest = customTransformer; + } + } + } + }); + } else { + babelJest = require.resolve('babel-jest'); + options.transform = { + [_constants.DEFAULT_JS_PATTERN]: babelJest + }; + } +}; +const normalizeCollectCoverageFrom = (options, key) => { + const initialCollectCoverageFrom = options[key]; + let value; + if (!initialCollectCoverageFrom) { + value = []; + } + if (!Array.isArray(initialCollectCoverageFrom)) { + try { + value = JSON.parse(initialCollectCoverageFrom); + } catch {} + if (options[key] && !Array.isArray(value)) { + value = [initialCollectCoverageFrom]; + } + } else { + value = initialCollectCoverageFrom; + } + if (value) { + value = value.map(filePath => + filePath.replace(/^(!?)(\/)(.*)/, '$1$3') + ); + } + return value; +}; +const normalizeUnmockedModulePathPatterns = (options, key) => + // _replaceRootDirTags is specifically well-suited for substituting + // in paths (it deals with properly interpreting relative path + // separators, etc). + // + // For patterns, direct global substitution is far more ideal, so we + // special case substitutions for patterns here. + options[key].map(pattern => + (0, _jestRegexUtil().replacePathSepForRegex)( + pattern.replace(//g, options.rootDir) + ) + ); +const normalizeMissingOptions = (options, configPath, projectIndex) => { + if (!options.id) { + options.id = (0, _crypto().createHash)('sha1') + .update(options.rootDir) + // In case we load config from some path that has the same root dir + .update(configPath || '') + .update(String(projectIndex)) + .digest('hex') + .substring(0, 32); + } + if (!options.setupFiles) { + options.setupFiles = []; + } + return options; +}; +const normalizeRootDir = options => { + // Assert that there *is* a rootDir + if (!options.rootDir) { + throw createConfigError( + ` Configuration option ${_chalk().default.bold( + 'rootDir' + )} must be specified.` + ); + } + options.rootDir = path().normalize(options.rootDir); + try { + // try to resolve windows short paths, ignoring errors (permission errors, mostly) + options.rootDir = (0, _jestUtil().tryRealpath)(options.rootDir); + } catch { + // ignored + } + verifyDirectoryExists(options.rootDir, 'rootDir'); + return { + ...options, + rootDir: options.rootDir + }; +}; +const normalizeReporters = ({reporters, rootDir}) => { + if (!reporters || !Array.isArray(reporters)) { + return undefined; + } + (0, _ReporterValidationErrors.validateReporters)(reporters); + return reporters.map(reporterConfig => { + const normalizedReporterConfig = + typeof reporterConfig === 'string' + ? // if reporter config is a string, we wrap it in an array + // and pass an empty object for options argument, to normalize + // the shape. + [reporterConfig, {}] + : reporterConfig; + const reporterPath = (0, _utils.replaceRootDirInPath)( + rootDir, + normalizedReporterConfig[0] + ); + if (!['default', 'github-actions', 'summary'].includes(reporterPath)) { + const reporter = _jestResolve().default.findNodeModule(reporterPath, { + basedir: rootDir + }); + if (!reporter) { + throw new (_jestResolve().default.ModuleNotFoundError)( + 'Could not resolve a module for a custom reporter.\n' + + ` Module name: ${reporterPath}` + ); + } + normalizedReporterConfig[0] = reporter; + } + return normalizedReporterConfig; + }); +}; +const buildTestPathPattern = argv => { + const patterns = []; + if (argv._) { + patterns.push(...argv._); + } + if (argv.testPathPattern) { + patterns.push(...argv.testPathPattern); + } + const replacePosixSep = pattern => { + // yargs coerces positional args into numbers + const patternAsString = pattern.toString(); + if (path().sep === '/') { + return patternAsString; + } + return patternAsString.replace(/\//g, '\\\\'); + }; + const testPathPattern = patterns.map(replacePosixSep).join('|'); + if ((0, _validatePattern.default)(testPathPattern)) { + return testPathPattern; + } else { + showTestPathPatternError(testPathPattern); + return ''; + } +}; +const showTestPathPatternError = testPathPattern => { + (0, _jestUtil().clearLine)(process.stdout); + + // eslint-disable-next-line no-console + console.log( + _chalk().default.red( + ` Invalid testPattern ${testPathPattern} supplied. ` + + 'Running all tests instead.' + ) + ); +}; +function validateExtensionsToTreatAsEsm(extensionsToTreatAsEsm) { + if (!extensionsToTreatAsEsm || extensionsToTreatAsEsm.length === 0) { + return; + } + function printConfig(opts) { + const string = opts.map(ext => `'${ext}'`).join(', '); + return _chalk().default.bold(`extensionsToTreatAsEsm: [${string}]`); + } + const extensionWithoutDot = extensionsToTreatAsEsm.some( + ext => !ext.startsWith('.') + ); + if (extensionWithoutDot) { + throw createConfigError(` Option: ${printConfig( + extensionsToTreatAsEsm + )} includes a string that does not start with a period (${_chalk().default.bold( + '.' + )}). + Please change your configuration to ${printConfig( + extensionsToTreatAsEsm.map(ext => (ext.startsWith('.') ? ext : `.${ext}`)) + )}.`); + } + if (extensionsToTreatAsEsm.includes('.js')) { + throw createConfigError( + ` Option: ${printConfig( + extensionsToTreatAsEsm + )} includes ${_chalk().default.bold( + "'.js'" + )} which is always inferred based on ${_chalk().default.bold( + 'type' + )} in its nearest ${_chalk().default.bold('package.json')}.` + ); + } + if (extensionsToTreatAsEsm.includes('.cjs')) { + throw createConfigError( + ` Option: ${printConfig( + extensionsToTreatAsEsm + )} includes ${_chalk().default.bold( + "'.cjs'" + )} which is always treated as CommonJS.` + ); + } + if (extensionsToTreatAsEsm.includes('.mjs')) { + throw createConfigError( + ` Option: ${printConfig( + extensionsToTreatAsEsm + )} includes ${_chalk().default.bold( + "'.mjs'" + )} which is always treated as an ECMAScript Module.` + ); + } +} +async function normalize( + initialOptions, + argv, + configPath, + projectIndex = Infinity, + isProjectOptions +) { + const {hasDeprecationWarnings} = (0, _jestValidate().validate)( + initialOptions, + { + comment: _utils.DOCUMENTATION_NOTE, + deprecatedConfig: _Deprecated.default, + exampleConfig: isProjectOptions + ? _ValidConfig.initialProjectOptions + : _ValidConfig.initialOptions, + recursiveDenylist: [ + // 'coverageThreshold' allows to use 'global' and glob strings on the same + // level, there's currently no way we can deal with such config + 'coverageThreshold', + 'globals', + 'moduleNameMapper', + 'testEnvironmentOptions', + 'transform' + ] + } + ); + let options = normalizeMissingOptions( + normalizeRootDir((0, _setFromArgv.default)(initialOptions, argv)), + configPath, + projectIndex + ); + if (options.preset) { + options = await setupPreset(options, options.preset); + } + if (!options.setupFilesAfterEnv) { + options.setupFilesAfterEnv = []; + } + options.testEnvironment = (0, _jestResolve().resolveTestEnvironment)({ + requireResolveFunction: require.resolve, + rootDir: options.rootDir, + testEnvironment: + options.testEnvironment || + require.resolve(_Defaults.default.testEnvironment) + }); + if (!options.roots) { + options.roots = [options.rootDir]; + } + if ( + !options.testRunner || + options.testRunner === 'circus' || + options.testRunner === 'jest-circus' || + options.testRunner === 'jest-circus/runner' + ) { + options.testRunner = require.resolve('jest-circus/runner'); + } else if (options.testRunner === 'jasmine2') { + try { + options.testRunner = require.resolve('jest-jasmine2'); + } catch (error) { + if (error.code === 'MODULE_NOT_FOUND') { + throw createConfigError( + 'jest-jasmine is no longer shipped by default with Jest, you need to install it explicitly or provide an absolute path to Jest' + ); + } + throw error; + } + } + if (!options.coverageDirectory) { + options.coverageDirectory = path().resolve(options.rootDir, 'coverage'); + } + setupBabelJest(options); + // TODO: Type this properly + const newOptions = { + ..._Defaults.default + }; + if (options.resolver) { + newOptions.resolver = (0, _utils.resolve)(null, { + filePath: options.resolver, + key: 'resolver', + rootDir: options.rootDir + }); + } + validateExtensionsToTreatAsEsm(options.extensionsToTreatAsEsm); + if (options.watchman == null) { + options.watchman = _Defaults.default.watchman; + } + const optionKeys = Object.keys(options); + optionKeys.reduce((newOptions, key) => { + // The resolver has been resolved separately; skip it + if (key === 'resolver') { + return newOptions; + } + + // This is cheating, because it claims that all keys of InitialOptions are Required. + // We only really know it's Required for oldOptions[key], not for oldOptions.someOtherKey, + // so oldOptions[key] is the only way it should be used. + const oldOptions = options; + let value; + switch (key) { + case 'setupFiles': + case 'setupFilesAfterEnv': + case 'snapshotSerializers': + { + const option = oldOptions[key]; + value = + option && + option.map(filePath => + (0, _utils.resolve)(newOptions.resolver, { + filePath, + key, + rootDir: options.rootDir + }) + ); + } + break; + case 'modulePaths': + case 'roots': + { + const option = oldOptions[key]; + value = + option && + option.map(filePath => + path().resolve( + options.rootDir, + (0, _utils.replaceRootDirInPath)(options.rootDir, filePath) + ) + ); + } + break; + case 'collectCoverageFrom': + value = normalizeCollectCoverageFrom(oldOptions, key); + break; + case 'cacheDirectory': + case 'coverageDirectory': + { + const option = oldOptions[key]; + value = + option && + path().resolve( + options.rootDir, + (0, _utils.replaceRootDirInPath)(options.rootDir, option) + ); + } + break; + case 'dependencyExtractor': + case 'globalSetup': + case 'globalTeardown': + case 'runtime': + case 'snapshotResolver': + case 'testResultsProcessor': + case 'testRunner': + case 'filter': + { + const option = oldOptions[key]; + value = + option && + (0, _utils.resolve)(newOptions.resolver, { + filePath: option, + key, + rootDir: options.rootDir + }); + } + break; + case 'runner': + { + const option = oldOptions[key]; + value = + option && + (0, _jestResolve().resolveRunner)(newOptions.resolver, { + filePath: option, + requireResolveFunction: require.resolve, + rootDir: options.rootDir + }); + } + break; + case 'prettierPath': + { + // We only want this to throw if "prettierPath" is explicitly passed + // from config or CLI, and the requested path isn't found. Otherwise we + // set it to null and throw an error lazily when it is used. + + const option = oldOptions[key]; + value = + option && + (0, _utils.resolve)(newOptions.resolver, { + filePath: option, + key, + optional: option === _Defaults.default[key], + rootDir: options.rootDir + }); + } + break; + case 'moduleNameMapper': + const moduleNameMapper = oldOptions[key]; + value = + moduleNameMapper && + Object.keys(moduleNameMapper).map(regex => { + const item = moduleNameMapper && moduleNameMapper[regex]; + return ( + item && [ + regex, + (0, _utils._replaceRootDirTags)(options.rootDir, item) + ] + ); + }); + break; + case 'transform': + const transform = oldOptions[key]; + value = + transform && + Object.keys(transform).map(regex => { + const transformElement = transform[regex]; + return [ + regex, + (0, _utils.resolve)(newOptions.resolver, { + filePath: Array.isArray(transformElement) + ? transformElement[0] + : transformElement, + key, + rootDir: options.rootDir + }), + Array.isArray(transformElement) ? transformElement[1] : {} + ]; + }); + break; + case 'reporters': + value = normalizeReporters(oldOptions); + break; + case 'coveragePathIgnorePatterns': + case 'modulePathIgnorePatterns': + case 'testPathIgnorePatterns': + case 'transformIgnorePatterns': + case 'watchPathIgnorePatterns': + case 'unmockedModulePathPatterns': + value = normalizeUnmockedModulePathPatterns(oldOptions, key); + break; + case 'haste': + value = { + ...oldOptions[key] + }; + if (value.hasteImplModulePath != null) { + const resolvedHasteImpl = (0, _utils.resolve)(newOptions.resolver, { + filePath: (0, _utils.replaceRootDirInPath)( + options.rootDir, + value.hasteImplModulePath + ), + key: 'haste.hasteImplModulePath', + rootDir: options.rootDir + }); + value.hasteImplModulePath = resolvedHasteImpl || undefined; + } + break; + case 'projects': + value = (oldOptions[key] || []) + .map(project => + typeof project === 'string' + ? (0, _utils._replaceRootDirTags)(options.rootDir, project) + : project + ) + .reduce((projects, project) => { + // Project can be specified as globs. If a glob matches any files, + // We expand it to these paths. If not, we keep the original path + // for the future resolution. + const globMatches = + typeof project === 'string' ? (0, _glob().sync)(project) : []; + return projects.concat(globMatches.length ? globMatches : project); + }, []); + break; + case 'moduleDirectories': + case 'testMatch': + { + const replacedRootDirTags = (0, _utils._replaceRootDirTags)( + (0, _utils.escapeGlobCharacters)(options.rootDir), + oldOptions[key] + ); + if (replacedRootDirTags) { + value = Array.isArray(replacedRootDirTags) + ? replacedRootDirTags.map(_jestUtil().replacePathSepForGlob) + : (0, _jestUtil().replacePathSepForGlob)(replacedRootDirTags); + } else { + value = replacedRootDirTags; + } + } + break; + case 'testRegex': + { + const option = oldOptions[key]; + value = option + ? (Array.isArray(option) ? option : [option]).map( + _jestRegexUtil().replacePathSepForRegex + ) + : []; + } + break; + case 'moduleFileExtensions': { + value = oldOptions[key]; + if ( + Array.isArray(value) && + // If it's the wrong type, it can throw at a later time + (options.runner === undefined || + options.runner === _Defaults.default.runner) && + // Only require 'js' for the default jest-runner + !value.includes('js') + ) { + const errorMessage = + " moduleFileExtensions must include 'js':\n" + + ' but instead received:\n' + + ` ${_chalk().default.bold.red(JSON.stringify(value))}`; + + // If `js` is not included, any dependency Jest itself injects into + // the environment, like jasmine or sourcemap-support, will need to + // `require` its modules with a file extension. This is not plausible + // in the long run, so it's way easier to just fail hard early. + // We might consider throwing if `json` is missing as well, as it's a + // fair assumption from modules that they can do + // `require('some-package/package') without the trailing `.json` as it + // works in Node normally. + throw createConfigError( + `${errorMessage}\n Please change your configuration to include 'js'.` + ); + } + break; + } + case 'bail': { + const bail = oldOptions[key]; + if (typeof bail === 'boolean') { + value = bail ? 1 : 0; + } else if (typeof bail === 'string') { + value = 1; + // If Jest is invoked as `jest --bail someTestPattern` then need to + // move the pattern from the `bail` configuration and into `argv._` + // to be processed as an extra parameter + argv._.push(bail); + } else { + value = oldOptions[key]; + } + break; + } + case 'displayName': { + const displayName = oldOptions[key]; + /** + * Ensuring that displayName shape is correct here so that the + * reporters can trust the shape of the data + */ + if (typeof displayName === 'object') { + const {name, color} = displayName; + if ( + !name || + !color || + typeof name !== 'string' || + typeof color !== 'string' + ) { + const errorMessage = + ` Option "${_chalk().default.bold( + 'displayName' + )}" must be of type:\n\n` + + ' {\n' + + ' name: string;\n' + + ' color: string;\n' + + ' }\n'; + throw createConfigError(errorMessage); + } + value = oldOptions[key]; + } else { + value = { + color: (0, _color.getDisplayNameColor)(options.runner), + name: displayName + }; + } + break; + } + case 'testTimeout': { + if (oldOptions[key] < 0) { + throw createConfigError( + ` Option "${_chalk().default.bold( + 'testTimeout' + )}" must be a natural number.` + ); + } + value = oldOptions[key]; + break; + } + case 'snapshotFormat': { + value = { + ..._Defaults.default.snapshotFormat, + ...oldOptions[key] + }; + break; + } + case 'automock': + case 'cache': + case 'changedSince': + case 'changedFilesWithAncestor': + case 'clearMocks': + case 'collectCoverage': + case 'coverageProvider': + case 'coverageReporters': + case 'coverageThreshold': + case 'detectLeaks': + case 'detectOpenHandles': + case 'errorOnDeprecated': + case 'expand': + case 'extensionsToTreatAsEsm': + case 'globals': + case 'fakeTimers': + case 'findRelatedTests': + case 'forceCoverageMatch': + case 'forceExit': + case 'injectGlobals': + case 'lastCommit': + case 'listTests': + case 'logHeapUsage': + case 'maxConcurrency': + case 'id': + case 'noStackTrace': + case 'notify': + case 'notifyMode': + case 'onlyChanged': + case 'onlyFailures': + case 'openHandlesTimeout': + case 'outputFile': + case 'passWithNoTests': + case 'randomize': + case 'replname': + case 'resetMocks': + case 'resetModules': + case 'restoreMocks': + case 'rootDir': + case 'runTestsByPath': + case 'sandboxInjectedGlobals': + case 'silent': + case 'showSeed': + case 'skipFilter': + case 'skipNodeResolution': + case 'slowTestThreshold': + case 'testEnvironment': + case 'testEnvironmentOptions': + case 'testFailureExitCode': + case 'testLocationInResults': + case 'testNamePattern': + case 'useStderr': + case 'verbose': + case 'watch': + case 'watchAll': + case 'watchman': + case 'workerThreads': + value = oldOptions[key]; + break; + case 'workerIdleMemoryLimit': + value = (0, _stringToBytes.default)( + oldOptions[key], + (0, _os().totalmem)() + ); + break; + case 'watchPlugins': + value = (oldOptions[key] || []).map(watchPlugin => { + if (typeof watchPlugin === 'string') { + return { + config: {}, + path: (0, _jestResolve().resolveWatchPlugin)( + newOptions.resolver, + { + filePath: watchPlugin, + requireResolveFunction: require.resolve, + rootDir: options.rootDir + } + ) + }; + } else { + return { + config: watchPlugin[1] || {}, + path: (0, _jestResolve().resolveWatchPlugin)( + newOptions.resolver, + { + filePath: watchPlugin[0], + requireResolveFunction: require.resolve, + rootDir: options.rootDir + } + ) + }; + } + }); + break; + } + // @ts-expect-error: automock is missing in GlobalConfig, so what + newOptions[key] = value; + return newOptions; + }, newOptions); + if (options.watchman && options.haste?.enableSymlinks) { + throw new (_jestValidate().ValidationError)( + 'Validation Error', + 'haste.enableSymlinks is incompatible with watchman', + 'Either set haste.enableSymlinks to false or do not use watchman' + ); + } + newOptions.roots.forEach((root, i) => { + verifyDirectoryExists(root, `roots[${i}]`); + }); + try { + // try to resolve windows short paths, ignoring errors (permission errors, mostly) + newOptions.cwd = (0, _jestUtil().tryRealpath)(process.cwd()); + } catch { + // ignored + } + newOptions.testSequencer = (0, _jestResolve().resolveSequencer)( + newOptions.resolver, + { + filePath: + options.testSequencer || + require.resolve(_Defaults.default.testSequencer), + requireResolveFunction: require.resolve, + rootDir: options.rootDir + } + ); + if (newOptions.runner === _Defaults.default.runner) { + newOptions.runner = require.resolve(newOptions.runner); + } + newOptions.nonFlagArgs = argv._?.map(arg => `${arg}`); + newOptions.testPathPattern = buildTestPathPattern(argv); + newOptions.json = !!argv.json; + newOptions.testFailureExitCode = parseInt(newOptions.testFailureExitCode, 10); + if ( + newOptions.lastCommit || + newOptions.changedFilesWithAncestor || + newOptions.changedSince + ) { + newOptions.onlyChanged = true; + } + if (argv.all) { + newOptions.onlyChanged = false; + newOptions.onlyFailures = false; + } else if (newOptions.testPathPattern) { + // When passing a test path pattern we don't want to only monitor changed + // files unless `--watch` is also passed. + newOptions.onlyChanged = newOptions.watch; + } + newOptions.randomize = newOptions.randomize || argv.randomize; + newOptions.showSeed = + newOptions.randomize || newOptions.showSeed || argv.showSeed; + const upperBoundSeedValue = 2 ** 31; + + // bounds are determined by xoroshiro128plus which is used in v8 and is used here (at time of writing) + newOptions.seed = + argv.seed ?? + Math.floor((2 ** 32 - 1) * Math.random() - upperBoundSeedValue); + if ( + newOptions.seed < -upperBoundSeedValue || + newOptions.seed > upperBoundSeedValue - 1 + ) { + throw new (_jestValidate().ValidationError)( + 'Validation Error', + `seed value must be between \`-0x80000000\` and \`0x7fffffff\` inclusive - instead it is ${newOptions.seed}` + ); + } + if (!newOptions.onlyChanged) { + newOptions.onlyChanged = false; + } + if (!newOptions.lastCommit) { + newOptions.lastCommit = false; + } + if (!newOptions.onlyFailures) { + newOptions.onlyFailures = false; + } + if (!newOptions.watchAll) { + newOptions.watchAll = false; + } + + // as unknown since it can happen. We really need to fix the types here + if (newOptions.moduleNameMapper === _Defaults.default.moduleNameMapper) { + newOptions.moduleNameMapper = []; + } + if (argv.ci != null) { + newOptions.ci = argv.ci; + } + newOptions.updateSnapshot = + newOptions.ci && !argv.updateSnapshot + ? 'none' + : argv.updateSnapshot + ? 'all' + : 'new'; + newOptions.maxConcurrency = parseInt(newOptions.maxConcurrency, 10); + newOptions.maxWorkers = (0, _getMaxWorkers.default)(argv, options); + if (newOptions.testRegex.length > 0 && options.testMatch) { + throw createConfigError( + ` Configuration options ${_chalk().default.bold('testMatch')} and` + + ` ${_chalk().default.bold('testRegex')} cannot be used together.` + ); + } + if (newOptions.testRegex.length > 0 && !options.testMatch) { + // Prevent the default testMatch conflicting with any explicitly + // configured `testRegex` value + newOptions.testMatch = []; + } + + // If argv.json is set, coverageReporters shouldn't print a text report. + if (argv.json) { + newOptions.coverageReporters = (newOptions.coverageReporters || []).filter( + reporter => reporter !== 'text' + ); + } + + // If collectCoverage is enabled while using --findRelatedTests we need to + // avoid having false negatives in the generated coverage report. + // The following: `--findRelatedTests '/rootDir/file1.js' --coverage` + // Is transformed to: `--findRelatedTests '/rootDir/file1.js' --coverage --collectCoverageFrom 'file1.js'` + // where arguments to `--collectCoverageFrom` should be globs (or relative + // paths to the rootDir) + if (newOptions.collectCoverage && argv.findRelatedTests) { + let collectCoverageFrom = newOptions.nonFlagArgs.map(filename => { + filename = (0, _utils.replaceRootDirInPath)(options.rootDir, filename); + return path().isAbsolute(filename) + ? path().relative(options.rootDir, filename) + : filename; + }); + + // Don't override existing collectCoverageFrom options + if (newOptions.collectCoverageFrom) { + collectCoverageFrom = collectCoverageFrom.reduce((patterns, filename) => { + if ( + (0, _micromatch().default)( + [ + (0, _jestUtil().replacePathSepForGlob)( + path().relative(options.rootDir, filename) + ) + ], + newOptions.collectCoverageFrom + ).length === 0 + ) { + return patterns; + } + return [...patterns, filename]; + }, newOptions.collectCoverageFrom); + } + newOptions.collectCoverageFrom = collectCoverageFrom; + } else if (!newOptions.collectCoverageFrom) { + newOptions.collectCoverageFrom = []; + } + if (!newOptions.findRelatedTests) { + newOptions.findRelatedTests = false; + } + if (!newOptions.projects) { + newOptions.projects = []; + } + if (!newOptions.sandboxInjectedGlobals) { + newOptions.sandboxInjectedGlobals = []; + } + if (!newOptions.forceExit) { + newOptions.forceExit = false; + } + if (!newOptions.logHeapUsage) { + newOptions.logHeapUsage = false; + } + if (argv.shard) { + newOptions.shard = (0, _parseShardPair.parseShardPair)(argv.shard); + } + return { + hasDeprecationWarnings, + options: newOptions + }; +} diff --git a/node_modules/jest-config/build/parseShardPair.js b/node_modules/jest-config/build/parseShardPair.js new file mode 100644 index 00000000..f45d2dca --- /dev/null +++ b/node_modules/jest-config/build/parseShardPair.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.parseShardPair = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const parseShardPair = pair => { + const shardPair = pair + .split('/') + .filter(d => /^\d+$/.test(d)) + .map(d => parseInt(d, 10)) + .filter(shard => !Number.isNaN(shard)); + const [shardIndex, shardCount] = shardPair; + if (shardPair.length !== 2) { + throw new Error( + 'The shard option requires a string in the format of /.' + ); + } + if (shardIndex === 0 || shardCount === 0) { + throw new Error( + 'The shard option requires 1-based values, received 0 or lower in the pair.' + ); + } + if (shardIndex > shardCount) { + throw new Error( + 'The shard option / requires to be lower or equal than .' + ); + } + return { + shardCount, + shardIndex + }; +}; +exports.parseShardPair = parseShardPair; diff --git a/node_modules/jest-config/build/readConfigFileAndSetRootDir.js b/node_modules/jest-config/build/readConfigFileAndSetRootDir.js new file mode 100644 index 00000000..e989961b --- /dev/null +++ b/node_modules/jest-config/build/readConfigFileAndSetRootDir.js @@ -0,0 +1,195 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = readConfigFileAndSetRootDir; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +function _parseJson() { + const data = _interopRequireDefault(require('parse-json')); + _parseJson = function () { + return data; + }; + return data; +} +function _stripJsonComments() { + const data = _interopRequireDefault(require('strip-json-comments')); + _stripJsonComments = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +var _constants = require('./constants'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Read the configuration and set its `rootDir` +// 1. If it's a `package.json` file, we look into its "jest" property +// 2. If it's a `jest.config.ts` file, we use `ts-node` to transpile & require it +// 3. For any other file, we just require it. If we receive an 'ERR_REQUIRE_ESM' +// from node, perform a dynamic import instead. +async function readConfigFileAndSetRootDir(configPath) { + const isTS = configPath.endsWith(_constants.JEST_CONFIG_EXT_TS); + const isJSON = configPath.endsWith(_constants.JEST_CONFIG_EXT_JSON); + let configObject; + try { + if (isTS) { + configObject = await loadTSConfigFile(configPath); + } else if (isJSON) { + const fileContent = fs().readFileSync(configPath, 'utf8'); + configObject = (0, _parseJson().default)( + (0, _stripJsonComments().default)(fileContent), + configPath + ); + } else { + configObject = await (0, _jestUtil().requireOrImportModule)(configPath); + } + } catch (error) { + if (isTS) { + throw new Error( + `Jest: Failed to parse the TypeScript config file ${configPath}\n` + + ` ${error}` + ); + } + throw error; + } + if (configPath.endsWith(_constants.PACKAGE_JSON)) { + // Event if there's no "jest" property in package.json we will still use + // an empty object. + configObject = configObject.jest || {}; + } + if (typeof configObject === 'function') { + configObject = await configObject(); + } + if (configObject.rootDir) { + // We don't touch it if it has an absolute path specified + if (!path().isAbsolute(configObject.rootDir)) { + // otherwise, we'll resolve it relative to the file's __dirname + configObject = { + ...configObject, + rootDir: path().resolve( + path().dirname(configPath), + configObject.rootDir + ) + }; + } + } else { + // If rootDir is not there, we'll set it to this file's __dirname + configObject = { + ...configObject, + rootDir: path().dirname(configPath) + }; + } + return configObject; +} + +// Load the TypeScript configuration +const loadTSConfigFile = async configPath => { + // Get registered TypeScript compiler instance + const registeredCompiler = await getRegisteredCompiler(); + registeredCompiler.enabled(true); + let configObject = (0, _jestUtil().interopRequireDefault)( + require(configPath) + ).default; + + // In case the config is a function which imports more Typescript code + if (typeof configObject === 'function') { + configObject = await configObject(); + } + registeredCompiler.enabled(false); + return configObject; +}; +let registeredCompilerPromise; +function getRegisteredCompiler() { + // Cache the promise to avoid multiple registrations + registeredCompilerPromise = registeredCompilerPromise ?? registerTsNode(); + return registeredCompilerPromise; +} +async function registerTsNode() { + try { + // Register TypeScript compiler instance + const tsNode = await import('ts-node'); + return tsNode.register({ + compilerOptions: { + module: 'CommonJS' + }, + moduleTypes: { + '**': 'cjs' + } + }); + } catch (e) { + if (e.code === 'ERR_MODULE_NOT_FOUND') { + throw new Error( + `Jest: 'ts-node' is required for the TypeScript configuration files. Make sure it is installed\nError: ${e.message}` + ); + } + throw e; + } +} diff --git a/node_modules/jest-config/build/resolveConfigPath.js b/node_modules/jest-config/build/resolveConfigPath.js new file mode 100644 index 00000000..7dd8e02b --- /dev/null +++ b/node_modules/jest-config/build/resolveConfigPath.js @@ -0,0 +1,217 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = resolveConfigPath; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +function _slash() { + const data = _interopRequireDefault(require('slash')); + _slash = function () { + return data; + }; + return data; +} +function _jestValidate() { + const data = require('jest-validate'); + _jestValidate = function () { + return data; + }; + return data; +} +var _constants = require('./constants'); +var _utils = require('./utils'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const isFile = filePath => + fs().existsSync(filePath) && !fs().lstatSync(filePath).isDirectory(); +const getConfigFilename = ext => _constants.JEST_CONFIG_BASE_NAME + ext; +function resolveConfigPath( + pathToResolve, + cwd, + skipMultipleConfigError = false +) { + if (!path().isAbsolute(cwd)) { + throw new Error(`"cwd" must be an absolute path. cwd: ${cwd}`); + } + const absolutePath = path().isAbsolute(pathToResolve) + ? pathToResolve + : path().resolve(cwd, pathToResolve); + if (isFile(absolutePath)) { + return absolutePath; + } + + // This is a guard against passing non existing path as a project/config, + // that will otherwise result in a very confusing situation. + // e.g. + // With a directory structure like this: + // my_project/ + // package.json + // + // Passing a `my_project/some_directory_that_doesnt_exist` as a project + // name will resolve into a (possibly empty) `my_project/package.json` and + // try to run all tests it finds under `my_project` directory. + if (!fs().existsSync(absolutePath)) { + throw new Error( + "Can't find a root directory while resolving a config file path.\n" + + `Provided path to resolve: ${pathToResolve}\n` + + `cwd: ${cwd}` + ); + } + return resolveConfigPathByTraversing( + absolutePath, + pathToResolve, + cwd, + skipMultipleConfigError + ); +} +const resolveConfigPathByTraversing = ( + pathToResolve, + initialPath, + cwd, + skipMultipleConfigError +) => { + const configFiles = _constants.JEST_CONFIG_EXT_ORDER.map(ext => + path().resolve(pathToResolve, getConfigFilename(ext)) + ).filter(isFile); + const packageJson = findPackageJson(pathToResolve); + if (packageJson && hasPackageJsonJestKey(packageJson)) { + configFiles.push(packageJson); + } + if (!skipMultipleConfigError && configFiles.length > 1) { + throw new (_jestValidate().ValidationError)( + ...makeMultipleConfigsErrorMessage(configFiles) + ); + } + if (configFiles.length > 0 || packageJson) { + return configFiles[0] ?? packageJson; + } + + // This is the system root. + // We tried everything, config is nowhere to be found ¯\_(ツ)_/¯ + if (pathToResolve === path().dirname(pathToResolve)) { + throw new Error(makeResolutionErrorMessage(initialPath, cwd)); + } + + // go up a level and try it again + return resolveConfigPathByTraversing( + path().dirname(pathToResolve), + initialPath, + cwd, + skipMultipleConfigError + ); +}; +const findPackageJson = pathToResolve => { + const packagePath = path().resolve(pathToResolve, _constants.PACKAGE_JSON); + if (isFile(packagePath)) { + return packagePath; + } + return undefined; +}; +const hasPackageJsonJestKey = packagePath => { + const content = fs().readFileSync(packagePath, 'utf8'); + try { + return 'jest' in JSON.parse(content); + } catch { + // If package is not a valid JSON + return false; + } +}; +const makeResolutionErrorMessage = (initialPath, cwd) => + 'Could not find a config file based on provided values:\n' + + `path: "${initialPath}"\n` + + `cwd: "${cwd}"\n` + + 'Config paths must be specified by either a direct path to a config\n' + + 'file, or a path to a directory. If directory is given, Jest will try to\n' + + `traverse directory tree up, until it finds one of those files in exact order: ${_constants.JEST_CONFIG_EXT_ORDER.map( + ext => `"${getConfigFilename(ext)}"` + ).join(' or ')}.`; +function extraIfPackageJson(configPath) { + if (configPath.endsWith(_constants.PACKAGE_JSON)) { + return '`jest` key in '; + } + return ''; +} +const makeMultipleConfigsErrorMessage = configPaths => [ + `${_utils.BULLET}${_chalk().default.bold('Multiple configurations found')}`, + [ + ...configPaths.map( + configPath => + ` * ${extraIfPackageJson(configPath)}${(0, _slash().default)( + configPath + )}` + ), + '', + ' Implicit config resolution does not allow multiple configuration files.', + ' Either remove unused config files or select one explicitly with `--config`.' + ].join('\n'), + _utils.DOCUMENTATION_NOTE +]; diff --git a/node_modules/jest-config/build/setFromArgv.js b/node_modules/jest-config/build/setFromArgv.js new file mode 100644 index 00000000..9f5c1627 --- /dev/null +++ b/node_modules/jest-config/build/setFromArgv.js @@ -0,0 +1,58 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = setFromArgv; +var _utils = require('./utils'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const specialArgs = ['_', '$0', 'h', 'help', 'config']; +function setFromArgv(options, argv) { + const argvToOptions = Object.keys(argv).reduce((options, key) => { + if (argv[key] === undefined || specialArgs.includes(key)) { + return options; + } + switch (key) { + case 'coverage': + options.collectCoverage = argv[key]; + break; + case 'json': + options.useStderr = argv[key]; + break; + case 'watchAll': + options.watch = false; + options.watchAll = argv[key]; + break; + case 'env': + options.testEnvironment = argv[key]; + break; + case 'config': + break; + case 'coverageThreshold': + case 'globals': + case 'haste': + case 'moduleNameMapper': + case 'testEnvironmentOptions': + case 'transform': + const str = argv[key]; + if ((0, _utils.isJSONString)(str)) { + options[key] = JSON.parse(str); + } + break; + default: + options[key] = argv[key]; + } + return options; + }, {}); + return { + ...options, + ...((0, _utils.isJSONString)(argv.config) ? JSON.parse(argv.config) : null), + ...argvToOptions + }; +} diff --git a/node_modules/jest-config/build/stringToBytes.js b/node_modules/jest-config/build/stringToBytes.js new file mode 100644 index 00000000..a939fac1 --- /dev/null +++ b/node_modules/jest-config/build/stringToBytes.js @@ -0,0 +1,79 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * Converts a string representing an amount of memory to bytes. + * + * @param input The value to convert to bytes. + * @param percentageReference The reference value to use when a '%' value is supplied. + */ +function stringToBytes(input, percentageReference) { + if (input === null || input === undefined) { + return input; + } + if (typeof input === 'string') { + if (isNaN(Number.parseFloat(input.slice(-1)))) { + // eslint-disable-next-line prefer-const + let [, numericString, trailingChars] = + input.match(/(.*?)([^0-9.-]+)$/i) || []; + if (trailingChars && numericString) { + const numericValue = Number.parseFloat(numericString); + trailingChars = trailingChars.toLowerCase(); + switch (trailingChars) { + case '%': + input = numericValue / 100; + break; + case 'kb': + case 'k': + return numericValue * 1000; + case 'kib': + return numericValue * 1024; + case 'mb': + case 'm': + return numericValue * 1000 * 1000; + case 'mib': + return numericValue * 1024 * 1024; + case 'gb': + case 'g': + return numericValue * 1000 * 1000 * 1000; + case 'gib': + return numericValue * 1024 * 1024 * 1024; + } + } + + // It ends in some kind of char so we need to do some parsing + } else { + input = Number.parseFloat(input); + } + } + if (typeof input === 'number') { + if (input <= 1 && input > 0) { + if (percentageReference) { + return Math.floor(input * percentageReference); + } else { + throw new Error( + 'For a percentage based memory limit a percentageReference must be supplied' + ); + } + } else if (input > 1) { + return Math.floor(input); + } else { + throw new Error('Unexpected numerical input'); + } + } + throw new Error('Unexpected input'); +} + +// https://github.com/import-js/eslint-plugin-import/issues/1590 +var _default = stringToBytes; +exports.default = _default; diff --git a/node_modules/jest-config/build/utils.js b/node_modules/jest-config/build/utils.js new file mode 100644 index 00000000..16f6d225 --- /dev/null +++ b/node_modules/jest-config/build/utils.js @@ -0,0 +1,172 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.resolve = + exports.replaceRootDirInPath = + exports.isJSONString = + exports.escapeGlobCharacters = + exports._replaceRootDirTags = + exports.DOCUMENTATION_NOTE = + exports.BULLET = + void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _jestResolve() { + const data = _interopRequireDefault(require('jest-resolve')); + _jestResolve = function () { + return data; + }; + return data; +} +function _jestValidate() { + const data = require('jest-validate'); + _jestValidate = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const BULLET = _chalk().default.bold('\u25cf '); +exports.BULLET = BULLET; +const DOCUMENTATION_NOTE = ` ${_chalk().default.bold( + 'Configuration Documentation:' +)} + https://jestjs.io/docs/configuration +`; +exports.DOCUMENTATION_NOTE = DOCUMENTATION_NOTE; +const createValidationError = message => + new (_jestValidate().ValidationError)( + `${BULLET}Validation Error`, + message, + DOCUMENTATION_NOTE + ); +const resolve = (resolver, {key, filePath, rootDir, optional}) => { + const module = _jestResolve().default.findNodeModule( + replaceRootDirInPath(rootDir, filePath), + { + basedir: rootDir, + resolver: resolver || undefined + } + ); + if (!module && !optional) { + throw createValidationError(` Module ${_chalk().default.bold( + filePath + )} in the ${_chalk().default.bold(key)} option was not found. + ${_chalk().default.bold('')} is: ${rootDir}`); + } + /// can cast as string since nulls will be thrown + return module; +}; +exports.resolve = resolve; +const escapeGlobCharacters = path => path.replace(/([()*{}[\]!?\\])/g, '\\$1'); +exports.escapeGlobCharacters = escapeGlobCharacters; +const replaceRootDirInPath = (rootDir, filePath) => { + if (!/^/.test(filePath)) { + return filePath; + } + return path().resolve( + rootDir, + path().normalize(`./${filePath.substring(''.length)}`) + ); +}; +exports.replaceRootDirInPath = replaceRootDirInPath; +const _replaceRootDirInObject = (rootDir, config) => { + const newConfig = {}; + for (const configKey in config) { + newConfig[configKey] = + configKey === 'rootDir' + ? config[configKey] + : _replaceRootDirTags(rootDir, config[configKey]); + } + return newConfig; +}; +const _replaceRootDirTags = (rootDir, config) => { + if (config == null) { + return config; + } + switch (typeof config) { + case 'object': + if (Array.isArray(config)) { + /// can be string[] or {}[] + return config.map(item => _replaceRootDirTags(rootDir, item)); + } + if (config instanceof RegExp) { + return config; + } + return _replaceRootDirInObject(rootDir, config); + case 'string': + return replaceRootDirInPath(rootDir, config); + } + return config; +}; +exports._replaceRootDirTags = _replaceRootDirTags; +// newtype +const isJSONString = text => + text != null && + typeof text === 'string' && + text.startsWith('{') && + text.endsWith('}'); +exports.isJSONString = isJSONString; diff --git a/node_modules/jest-config/build/validatePattern.js b/node_modules/jest-config/build/validatePattern.js new file mode 100644 index 00000000..2493833c --- /dev/null +++ b/node_modules/jest-config/build/validatePattern.js @@ -0,0 +1,24 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = validatePattern; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function validatePattern(pattern) { + if (pattern) { + try { + // eslint-disable-next-line no-new + new RegExp(pattern, 'i'); + } catch { + return false; + } + } + return true; +} diff --git a/node_modules/jest-config/package.json b/node_modules/jest-config/package.json new file mode 100644 index 00000000..81b79f0a --- /dev/null +++ b/node_modules/jest-config/package.json @@ -0,0 +1,71 @@ +{ + "name": "jest-config", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-config" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + }, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "devDependencies": { + "@types/glob": "^7.1.1", + "@types/graceful-fs": "^4.1.3", + "@types/micromatch": "^4.0.1", + "@types/parse-json": "^4.0.0", + "semver": "^7.5.3", + "ts-node": "^10.5.0", + "typescript": "^5.0.4" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-diff/LICENSE b/node_modules/jest-diff/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-diff/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-diff/README.md b/node_modules/jest-diff/README.md new file mode 100644 index 00000000..d52f8217 --- /dev/null +++ b/node_modules/jest-diff/README.md @@ -0,0 +1,671 @@ +# jest-diff + +Display differences clearly so people can review changes confidently. + +The `diff` named export serializes JavaScript **values**, compares them line-by-line, and returns a string which includes comparison lines. + +Two named exports compare **strings** character-by-character: + +- `diffStringsUnified` returns a string. +- `diffStringsRaw` returns an array of `Diff` objects. + +Three named exports compare **arrays of strings** line-by-line: + +- `diffLinesUnified` and `diffLinesUnified2` return a string. +- `diffLinesRaw` returns an array of `Diff` objects. + +## Installation + +To add this package as a dependency of a project, run either of the following commands: + +- `npm install jest-diff` +- `yarn add jest-diff` + +## Usage of `diff()` + +Given JavaScript **values**, `diff(a, b, options?)` does the following: + +1. **serialize** the values as strings using the `pretty-format` package +2. **compare** the strings line-by-line using the `diff-sequences` package +3. **format** the changed or common lines using the `chalk` package + +To use this function, write either of the following: + +- `const {diff} = require('jest-diff');` in CommonJS modules +- `import {diff} from 'jest-diff';` in ECMAScript modules + +### Example of `diff()` + +```js +const a = ['delete', 'common', 'changed from']; +const b = ['common', 'changed to', 'insert']; + +const difference = diff(a, b); +``` + +The returned **string** consists of: + +- annotation lines: describe the two change indicators with labels, and a blank line +- comparison lines: similar to “unified” view on GitHub, but `Expected` lines are green, `Received` lines are red, and common lines are dim (by default, see Options) + +```diff +- Expected ++ Received + + Array [ +- "delete", + "common", +- "changed from", ++ "changed to", ++ "insert", + ] +``` + +### Edge cases of `diff()` + +Here are edge cases for the return value: + +- `' Comparing two different types of values. …'` if the arguments have **different types** according to the `jest-get-type` package (instances of different classes have the same `'object'` type) +- `'Compared values have no visual difference.'` if the arguments have either **referential identity** according to `Object.is` method or **same serialization** according to the `pretty-format` package +- `null` if either argument is a so-called **asymmetric matcher** in Jasmine or Jest + +## Usage of diffStringsUnified + +Given **strings**, `diffStringsUnified(a, b, options?)` does the following: + +1. **compare** the strings character-by-character using the `diff-sequences` package +2. **clean up** small (often coincidental) common substrings, also known as chaff +3. **format** the changed or common lines using the `chalk` package + +Although the function is mainly for **multiline** strings, it compares any strings. + +Write either of the following: + +- `const {diffStringsUnified} = require('jest-diff');` in CommonJS modules +- `import {diffStringsUnified} from 'jest-diff';` in ECMAScript modules + +### Example of diffStringsUnified + +```js +const a = 'common\nchanged from'; +const b = 'common\nchanged to'; + +const difference = diffStringsUnified(a, b); +``` + +The returned **string** consists of: + +- annotation lines: describe the two change indicators with labels, and a blank line +- comparison lines: similar to “unified” view on GitHub, and **changed substrings** have **inverse** foreground and background colors (that is, `from` has white-on-green and `to` has white-on-red, which the following example does not show) + +```diff +- Expected ++ Received + + common +- changed from ++ changed to +``` + +### Performance of diffStringsUnified + +To get the benefit of **changed substrings** within the comparison lines, a character-by-character comparison has a higher computational cost (in time and space) than a line-by-line comparison. + +If the input strings can have **arbitrary length**, we recommend that the calling code set a limit, beyond which splits the strings, and then calls `diffLinesUnified` instead. For example, Jest falls back to line-by-line comparison if either string has length greater than 20K characters. + +## Usage of diffLinesUnified + +Given **arrays of strings**, `diffLinesUnified(aLines, bLines, options?)` does the following: + +1. **compare** the arrays line-by-line using the `diff-sequences` package +2. **format** the changed or common lines using the `chalk` package + +You might call this function when strings have been split into lines and you do not need to see changed substrings within lines. + +### Example of diffLinesUnified + +```js +const aLines = ['delete', 'common', 'changed from']; +const bLines = ['common', 'changed to', 'insert']; + +const difference = diffLinesUnified(aLines, bLines); +``` + +```diff +- Expected ++ Received + +- delete + common +- changed from ++ changed to ++ insert +``` + +### Edge cases of diffLinesUnified or diffStringsUnified + +Here are edge cases for arguments and return values: + +- both `a` and `b` are empty strings: no comparison lines +- only `a` is empty string: all comparison lines have `bColor` and `bIndicator` (see Options) +- only `b` is empty string: all comparison lines have `aColor` and `aIndicator` (see Options) +- `a` and `b` are equal non-empty strings: all comparison lines have `commonColor` and `commonIndicator` (see Options) + +## Usage of diffLinesUnified2 + +Given two **pairs** of arrays of strings, `diffLinesUnified2(aLinesDisplay, bLinesDisplay, aLinesCompare, bLinesCompare, options?)` does the following: + +1. **compare** the pair of `Compare` arrays line-by-line using the `diff-sequences` package +2. **format** the corresponding lines in the pair of `Display` arrays using the `chalk` package + +Jest calls this function to consider lines as common instead of changed if the only difference is indentation. + +You might call this function for case insensitive or Unicode equivalence comparison of lines. + +### Example of diffLinesUnified2 + +```js +import {format} from 'pretty-format'; + +const a = { + text: 'Ignore indentation in serialized object', + time: '2019-09-19T12:34:56.000Z', + type: 'CREATE_ITEM', +}; +const b = { + payload: { + text: 'Ignore indentation in serialized object', + time: '2019-09-19T12:34:56.000Z', + }, + type: 'CREATE_ITEM', +}; + +const difference = diffLinesUnified2( + // serialize with indentation to display lines + format(a).split('\n'), + format(b).split('\n'), + // serialize without indentation to compare lines + format(a, {indent: 0}).split('\n'), + format(b, {indent: 0}).split('\n'), +); +``` + +The `text` and `time` properties are common, because their only difference is indentation: + +```diff +- Expected ++ Received + + Object { ++ payload: Object { + text: 'Ignore indentation in serialized object', + time: '2019-09-19T12:34:56.000Z', ++ }, + type: 'CREATE_ITEM', + } +``` + +The preceding example illustrates why (at least for indentation) it seems more intuitive that the function returns the common line from the `bLinesDisplay` array instead of from the `aLinesDisplay` array. + +## Usage of diffStringsRaw + +Given **strings** and a boolean option, `diffStringsRaw(a, b, cleanup)` does the following: + +1. **compare** the strings character-by-character using the `diff-sequences` package +2. optionally **clean up** small (often coincidental) common substrings, also known as chaff + +Because `diffStringsRaw` returns the difference as **data** instead of a string, you can format it as your application requires (for example, enclosed in HTML markup for browser instead of escape sequences for console). + +The returned **array** describes substrings as instances of the `Diff` class, which calling code can access like array tuples: + +The value at index `0` is one of the following: + +| value | named export | description | +| ----: | :------------ | :-------------------- | +| `0` | `DIFF_EQUAL` | in `a` and in `b` | +| `-1` | `DIFF_DELETE` | in `a` but not in `b` | +| `1` | `DIFF_INSERT` | in `b` but not in `a` | + +The value at index `1` is a substring of `a` or `b` or both. + +### Example of diffStringsRaw with cleanup + +```js +const diffs = diffStringsRaw('changed from', 'changed to', true); +``` + +| `i` | `diffs[i][0]` | `diffs[i][1]` | +| --: | ------------: | :------------ | +| `0` | `0` | `'changed '` | +| `1` | `-1` | `'from'` | +| `2` | `1` | `'to'` | + +### Example of diffStringsRaw without cleanup + +```js +const diffs = diffStringsRaw('changed from', 'changed to', false); +``` + +| `i` | `diffs[i][0]` | `diffs[i][1]` | +| --: | ------------: | :------------ | +| `0` | `0` | `'changed '` | +| `1` | `-1` | `'fr'` | +| `2` | `1` | `'t'` | +| `3` | `0` | `'o'` | +| `4` | `-1` | `'m'` | + +### Advanced import for diffStringsRaw + +Here are all the named imports that you might need for the `diffStringsRaw` function: + +- `const {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff, diffStringsRaw} = require('jest-diff');` in CommonJS modules +- `import {DIFF_DELETE, DIFF_EQUAL, DIFF_INSERT, Diff, diffStringsRaw} from 'jest-diff';` in ECMAScript modules + +To write a **formatting** function, you might need the named constants (and `Diff` in TypeScript annotations). + +If you write an application-specific **cleanup** algorithm, then you might need to call the `Diff` constructor: + +```js +const diffCommon = new Diff(DIFF_EQUAL, 'changed '); +const diffDelete = new Diff(DIFF_DELETE, 'from'); +const diffInsert = new Diff(DIFF_INSERT, 'to'); +``` + +## Usage of diffLinesRaw + +Given **arrays of strings**, `diffLinesRaw(aLines, bLines)` does the following: + +- **compare** the arrays line-by-line using the `diff-sequences` package + +Because `diffLinesRaw` returns the difference as **data** instead of a string, you can format it as your application requires. + +### Example of diffLinesRaw + +```js +const aLines = ['delete', 'common', 'changed from']; +const bLines = ['common', 'changed to', 'insert']; + +const diffs = diffLinesRaw(aLines, bLines); +``` + +| `i` | `diffs[i][0]` | `diffs[i][1]` | +| --: | ------------: | :--------------- | +| `0` | `-1` | `'delete'` | +| `1` | `0` | `'common'` | +| `2` | `-1` | `'changed from'` | +| `3` | `1` | `'changed to'` | +| `4` | `1` | `'insert'` | + +### Edge case of diffLinesRaw + +If you call `string.split('\n')` for an empty string: + +- the result is `['']` an array which contains an empty string +- instead of `[]` an empty array + +Depending of your application, you might call `diffLinesRaw` with either array. + +### Example of split method + +```js +import {diffLinesRaw} from 'jest-diff'; + +const a = 'non-empty string'; +const b = ''; + +const diffs = diffLinesRaw(a.split('\n'), b.split('\n')); +``` + +| `i` | `diffs[i][0]` | `diffs[i][1]` | +| --: | ------------: | :------------------- | +| `0` | `-1` | `'non-empty string'` | +| `1` | `1` | `''` | + +Which you might format as follows: + +```diff +- Expected - 1 ++ Received + 1 + +- non-empty string ++ +``` + +### Example of splitLines0 function + +For edge case behavior like the `diffLinesUnified` function, you might define a `splitLines0` function, which given an empty string, returns `[]` an empty array: + +```js +export const splitLines0 = string => + string.length === 0 ? [] : string.split('\n'); +``` + +```js +import {diffLinesRaw} from 'jest-diff'; + +const a = ''; +const b = 'line 1\nline 2\nline 3'; + +const diffs = diffLinesRaw(a.split('\n'), b.split('\n')); +``` + +| `i` | `diffs[i][0]` | `diffs[i][1]` | +| --: | ------------: | :------------ | +| `0` | `1` | `'line 1'` | +| `1` | `1` | `'line 2'` | +| `2` | `1` | `'line 3'` | + +Which you might format as follows: + +```diff +- Expected - 0 ++ Received + 3 + ++ line 1 ++ line 2 ++ line 3 +``` + +In contrast to the `diffLinesRaw` function, the `diffLinesUnified` and `diffLinesUnified2` functions **automatically** convert array arguments computed by string `split` method, so callers do **not** need a `splitLine0` function. + +## Options + +The default options are for the report when an assertion fails from the `expect` package used by Jest. + +For other applications, you can provide an options object as a third argument: + +- `diff(a, b, options)` +- `diffStringsUnified(a, b, options)` +- `diffLinesUnified(aLines, bLines, options)` +- `diffLinesUnified2(aLinesDisplay, bLinesDisplay, aLinesCompare, bLinesCompare, options)` + +### Properties of options object + +| name | default | +| :-------------------------------- | :----------------- | +| `aAnnotation` | `'Expected'` | +| `aColor` | `chalk.green` | +| `aIndicator` | `'-'` | +| `bAnnotation` | `'Received'` | +| `bColor` | `chalk.red` | +| `bIndicator` | `'+'` | +| `changeColor` | `chalk.inverse` | +| `changeLineTrailingSpaceColor` | `string => string` | +| `commonColor` | `chalk.dim` | +| `commonIndicator` | `' '` | +| `commonLineTrailingSpaceColor` | `string => string` | +| `compareKeys` | `undefined` | +| `contextLines` | `5` | +| `emptyFirstOrLastLinePlaceholder` | `''` | +| `expand` | `true` | +| `includeChangeCounts` | `false` | +| `omitAnnotationLines` | `false` | +| `patchColor` | `chalk.yellow` | + +For more information about the options, see the following examples. + +### Example of options for labels + +If the application is code modification, you might replace the labels: + +```js +const options = { + aAnnotation: 'Original', + bAnnotation: 'Modified', +}; +``` + +```diff +- Original ++ Modified + + common +- changed from ++ changed to +``` + +The `jest-diff` package does not assume that the 2 labels have equal length. + +### Example of options for colors of changed lines + +For consistency with most diff tools, you might exchange the colors: + +```ts +import chalk = require('chalk'); + +const options = { + aColor: chalk.red, + bColor: chalk.green, +}; +``` + +### Example of option for color of changed substrings + +Although the default inverse of foreground and background colors is hard to beat for changed substrings **within lines**, especially because it highlights spaces, if you want bold font weight on yellow background color: + +```ts +import chalk = require('chalk'); + +const options = { + changeColor: chalk.bold.bgYellowBright, +}; +``` + +### Example of option to format trailing spaces + +Because `diff()` does not display substring differences within lines, formatting can help you see when lines differ by the presence or absence of trailing spaces found by `/\s+$/` regular expression. + +- If change lines have a background color, then you can see trailing spaces. +- If common lines have default dim color, then you cannot see trailing spaces. You might want yellowish background color to see them. + +```js +const options = { + aColor: chalk.rgb(128, 0, 128).bgRgb(255, 215, 255), // magenta + bColor: chalk.rgb(0, 95, 0).bgRgb(215, 255, 215), // green + commonLineTrailingSpaceColor: chalk.bgYellow, +}; +``` + +The value of a Color option is a function, which given a string, returns a string. + +If you want to replace trailing spaces with middle dot characters: + +```js +const replaceSpacesWithMiddleDot = string => '·'.repeat(string.length); + +const options = { + changeLineTrailingSpaceColor: replaceSpacesWithMiddleDot, + commonLineTrailingSpaceColor: replaceSpacesWithMiddleDot, +}; +``` + +If you need the TypeScript type of a Color option: + +```ts +import {DiffOptionsColor} from 'jest-diff'; +``` + +### Example of options for no colors + +To store the difference in a file without escape codes for colors, provide an identity function: + +```js +const noColor = string => string; + +const options = { + aColor: noColor, + bColor: noColor, + changeColor: noColor, + commonColor: noColor, + patchColor: noColor, +}; +``` + +### Example of options for indicators + +For consistency with the `diff` command, you might replace the indicators: + +```js +const options = { + aIndicator: '<', + bIndicator: '>', +}; +``` + +The `jest-diff` package assumes (but does not enforce) that the 3 indicators have equal length. + +### Example of options to limit common lines + +By default, the output includes all common lines. + +To emphasize the changes, you might limit the number of common “context” lines: + +```js +const options = { + contextLines: 1, + expand: false, +}; +``` + +A patch mark like `@@ -12,7 +12,9 @@` accounts for omitted common lines. + +### Example of option for color of patch marks + +If you want patch marks to have the same dim color as common lines: + +```ts +import chalk = require('chalk'); + +const options = { + expand: false, + patchColor: chalk.dim, +}; +``` + +### Example of option to include change counts + +To display the number of changed lines at the right of annotation lines: + +```js +const a = ['common', 'changed from']; +const b = ['common', 'changed to', 'insert']; + +const options = { + includeChangeCounts: true, +}; + +const difference = diff(a, b, options); +``` + +```diff +- Expected - 1 ++ Received + 2 + + Array [ + "common", +- "changed from", ++ "changed to", ++ "insert", + ] +``` + +### Example of option to omit annotation lines + +To display only the comparison lines: + +```js +const a = 'common\nchanged from'; +const b = 'common\nchanged to'; + +const options = { + omitAnnotationLines: true, +}; + +const difference = diffStringsUnified(a, b, options); +``` + +```diff + common +- changed from ++ changed to +``` + +### Example of option for empty first or last lines + +If the **first** or **last** comparison line is **empty**, because the content is empty and the indicator is a space, you might not notice it. + +The replacement option is a string whose default value is `''` empty string. + +Because Jest trims the report when a matcher fails, it deletes an empty last line. + +Therefore, Jest uses as placeholder the downwards arrow with corner leftwards: + +```js +const options = { + emptyFirstOrLastLinePlaceholder: '↵', // U+21B5 +}; +``` + +If a content line is empty, then the corresponding comparison line is automatically trimmed to remove the margin space (represented as a middle dot below) for the default indicators: + +| Indicator | untrimmed | trimmed | +| ----------------: | :-------- | :------ | +| `aIndicator` | `'-·'` | `'-'` | +| `bIndicator` | `'+·'` | `'+'` | +| `commonIndicator` | `' ·'` | `''` | + +### Example of option for sorting object keys + +When two objects are compared their keys are printed in alphabetical order by default. If this was not the original order of the keys the diff becomes harder to read as the keys are not in their original position. + +Use `compareKeys` to pass a function which will be used when sorting the object keys. + +```js +const a = {c: 'c', b: 'b1', a: 'a'}; +const b = {c: 'c', b: 'b2', a: 'a'}; + +const options = { + // The keys will be in their original order + compareKeys: () => 0, +}; + +const difference = diff(a, b, options); +``` + +```diff +- Expected ++ Received + + Object { + "c": "c", +- "b": "b1", ++ "b": "b2", + "a": "a", + } +``` + +Depending on the implementation of `compareKeys` any sort order can be used. + +```js +const a = {c: 'c', b: 'b1', a: 'a'}; +const b = {c: 'c', b: 'b2', a: 'a'}; + +const options = { + // The keys will be in reverse order + compareKeys: (a, b) => (a > b ? -1 : 1), +}; + +const difference = diff(a, b, options); +``` + +```diff +- Expected ++ Received + + Object { + "a": "a", +- "b": "b1", ++ "b": "b2", + "c": "c", + } +``` diff --git a/node_modules/jest-diff/build/cleanupSemantic.js b/node_modules/jest-diff/build/cleanupSemantic.js new file mode 100644 index 00000000..bc84226e --- /dev/null +++ b/node_modules/jest-diff/build/cleanupSemantic.js @@ -0,0 +1,599 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.cleanupSemantic = + exports.Diff = + exports.DIFF_INSERT = + exports.DIFF_EQUAL = + exports.DIFF_DELETE = + void 0; +/** + * Diff Match and Patch + * Copyright 2018 The diff-match-patch Authors. + * https://github.com/google/diff-match-patch + * + * 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 at + * + * 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. + */ + +/** + * @fileoverview Computes the difference between two texts to create a patch. + * Applies the patch onto another text, allowing for errors. + * @author fraser@google.com (Neil Fraser) + */ + +/** + * CHANGES by pedrottimark to diff_match_patch_uncompressed.ts file: + * + * 1. Delete anything not needed to use diff_cleanupSemantic method + * 2. Convert from prototype properties to var declarations + * 3. Convert Diff to class from constructor and prototype + * 4. Add type annotations for arguments and return values + * 5. Add exports + */ + +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +var DIFF_DELETE = -1; +exports.DIFF_DELETE = DIFF_DELETE; +var DIFF_INSERT = 1; +exports.DIFF_INSERT = DIFF_INSERT; +var DIFF_EQUAL = 0; + +/** + * Class representing one diff tuple. + * Attempts to look like a two-element array (which is what this used to be). + * @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL. + * @param {string} text Text to be deleted, inserted, or retained. + * @constructor + */ +exports.DIFF_EQUAL = DIFF_EQUAL; +class Diff { + 0; + 1; + constructor(op, text) { + this[0] = op; + this[1] = text; + } +} + +/** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ +exports.Diff = Diff; +var diff_commonPrefix = function (text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: https://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if ( + text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid) + ) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + +/** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ +var diff_commonSuffix = function (text1, text2) { + // Quick check for common null cases. + if ( + !text1 || + !text2 || + text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1) + ) { + return 0; + } + // Binary search. + // Performance analysis: https://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if ( + text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend) + ) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + +/** + * Determine if the suffix of one string is the prefix of another. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of the first + * string and the start of the second string. + * @private + */ +var diff_commonOverlap_ = function (text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + // Eliminate the null case. + if (text1_length == 0 || text2_length == 0) { + return 0; + } + // Truncate the longer string. + if (text1_length > text2_length) { + text1 = text1.substring(text1_length - text2_length); + } else if (text1_length < text2_length) { + text2 = text2.substring(0, text1_length); + } + var text_length = Math.min(text1_length, text2_length); + // Quick check for the worst case. + if (text1 == text2) { + return text_length; + } + + // Start by looking for a single character match + // and increase length until no match is found. + // Performance analysis: https://neil.fraser.name/news/2010/11/04/ + var best = 0; + var length = 1; + while (true) { + var pattern = text1.substring(text_length - length); + var found = text2.indexOf(pattern); + if (found == -1) { + return best; + } + length += found; + if ( + found == 0 || + text1.substring(text_length - length) == text2.substring(0, length) + ) { + best = length; + length++; + } + } +}; + +/** + * Reduce the number of edits by eliminating semantically trivial equalities. + * @param {!Array.} diffs Array of diff tuples. + */ +var diff_cleanupSemantic = function (diffs) { + var changes = false; + var equalities = []; // Stack of indices where equalities are found. + var equalitiesLength = 0; // Keeping our own length var is faster in JS. + /** @type {?string} */ + var lastEquality = null; + // Always equal to diffs[equalities[equalitiesLength - 1]][1] + var pointer = 0; // Index of current position. + // Number of characters that changed prior to the equality. + var length_insertions1 = 0; + var length_deletions1 = 0; + // Number of characters that changed after the equality. + var length_insertions2 = 0; + var length_deletions2 = 0; + while (pointer < diffs.length) { + if (diffs[pointer][0] == DIFF_EQUAL) { + // Equality found. + equalities[equalitiesLength++] = pointer; + length_insertions1 = length_insertions2; + length_deletions1 = length_deletions2; + length_insertions2 = 0; + length_deletions2 = 0; + lastEquality = diffs[pointer][1]; + } else { + // An insertion or deletion. + if (diffs[pointer][0] == DIFF_INSERT) { + length_insertions2 += diffs[pointer][1].length; + } else { + length_deletions2 += diffs[pointer][1].length; + } + // Eliminate an equality that is smaller or equal to the edits on both + // sides of it. + if ( + lastEquality && + lastEquality.length <= + Math.max(length_insertions1, length_deletions1) && + lastEquality.length <= Math.max(length_insertions2, length_deletions2) + ) { + // Duplicate record. + diffs.splice( + equalities[equalitiesLength - 1], + 0, + new Diff(DIFF_DELETE, lastEquality) + ); + // Change second copy to insert. + diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT; + // Throw away the equality we just deleted. + equalitiesLength--; + // Throw away the previous equality (it needs to be reevaluated). + equalitiesLength--; + pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1; + length_insertions1 = 0; // Reset the counters. + length_deletions1 = 0; + length_insertions2 = 0; + length_deletions2 = 0; + lastEquality = null; + changes = true; + } + } + pointer++; + } + + // Normalize the diff. + if (changes) { + diff_cleanupMerge(diffs); + } + diff_cleanupSemanticLossless(diffs); + + // Find any overlaps between deletions and insertions. + // e.g: abcxxxxxxdef + // -> abcxxxdef + // e.g: xxxabcdefxxx + // -> defxxxabc + // Only extract an overlap if it is as big as the edit ahead or behind it. + pointer = 1; + while (pointer < diffs.length) { + if ( + diffs[pointer - 1][0] == DIFF_DELETE && + diffs[pointer][0] == DIFF_INSERT + ) { + var deletion = diffs[pointer - 1][1]; + var insertion = diffs[pointer][1]; + var overlap_length1 = diff_commonOverlap_(deletion, insertion); + var overlap_length2 = diff_commonOverlap_(insertion, deletion); + if (overlap_length1 >= overlap_length2) { + if ( + overlap_length1 >= deletion.length / 2 || + overlap_length1 >= insertion.length / 2 + ) { + // Overlap found. Insert an equality and trim the surrounding edits. + diffs.splice( + pointer, + 0, + new Diff(DIFF_EQUAL, insertion.substring(0, overlap_length1)) + ); + diffs[pointer - 1][1] = deletion.substring( + 0, + deletion.length - overlap_length1 + ); + diffs[pointer + 1][1] = insertion.substring(overlap_length1); + pointer++; + } + } else { + if ( + overlap_length2 >= deletion.length / 2 || + overlap_length2 >= insertion.length / 2 + ) { + // Reverse overlap found. + // Insert an equality and swap and trim the surrounding edits. + diffs.splice( + pointer, + 0, + new Diff(DIFF_EQUAL, deletion.substring(0, overlap_length2)) + ); + diffs[pointer - 1][0] = DIFF_INSERT; + diffs[pointer - 1][1] = insertion.substring( + 0, + insertion.length - overlap_length2 + ); + diffs[pointer + 1][0] = DIFF_DELETE; + diffs[pointer + 1][1] = deletion.substring(overlap_length2); + pointer++; + } + } + pointer++; + } + pointer++; + } +}; + +/** + * Look for single edits surrounded on both sides by equalities + * which can be shifted sideways to align the edit to a word boundary. + * e.g: The cat came. -> The cat came. + * @param {!Array.} diffs Array of diff tuples. + */ +exports.cleanupSemantic = diff_cleanupSemantic; +var diff_cleanupSemanticLossless = function (diffs) { + /** + * Given two strings, compute a score representing whether the internal + * boundary falls on logical boundaries. + * Scores range from 6 (best) to 0 (worst). + * Closure, but does not reference any external variables. + * @param {string} one First string. + * @param {string} two Second string. + * @return {number} The score. + * @private + */ + function diff_cleanupSemanticScore_(one, two) { + if (!one || !two) { + // Edges are the best. + return 6; + } + + // Each port of this function behaves slightly differently due to + // subtle differences in each language's definition of things like + // 'whitespace'. Since this function's purpose is largely cosmetic, + // the choice has been made to use each language's native features + // rather than force total conformity. + var char1 = one.charAt(one.length - 1); + var char2 = two.charAt(0); + var nonAlphaNumeric1 = char1.match(nonAlphaNumericRegex_); + var nonAlphaNumeric2 = char2.match(nonAlphaNumericRegex_); + var whitespace1 = nonAlphaNumeric1 && char1.match(whitespaceRegex_); + var whitespace2 = nonAlphaNumeric2 && char2.match(whitespaceRegex_); + var lineBreak1 = whitespace1 && char1.match(linebreakRegex_); + var lineBreak2 = whitespace2 && char2.match(linebreakRegex_); + var blankLine1 = lineBreak1 && one.match(blanklineEndRegex_); + var blankLine2 = lineBreak2 && two.match(blanklineStartRegex_); + if (blankLine1 || blankLine2) { + // Five points for blank lines. + return 5; + } else if (lineBreak1 || lineBreak2) { + // Four points for line breaks. + return 4; + } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) { + // Three points for end of sentences. + return 3; + } else if (whitespace1 || whitespace2) { + // Two points for whitespace. + return 2; + } else if (nonAlphaNumeric1 || nonAlphaNumeric2) { + // One point for non-alphanumeric. + return 1; + } + return 0; + } + var pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if ( + diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL + ) { + // This is a single edit surrounded by equalities. + var equality1 = diffs[pointer - 1][1]; + var edit = diffs[pointer][1]; + var equality2 = diffs[pointer + 1][1]; + + // First, shift the edit as far left as possible. + var commonOffset = diff_commonSuffix(equality1, edit); + if (commonOffset) { + var commonString = edit.substring(edit.length - commonOffset); + equality1 = equality1.substring(0, equality1.length - commonOffset); + edit = commonString + edit.substring(0, edit.length - commonOffset); + equality2 = commonString + equality2; + } + + // Second, step character by character right, looking for the best fit. + var bestEquality1 = equality1; + var bestEdit = edit; + var bestEquality2 = equality2; + var bestScore = + diff_cleanupSemanticScore_(equality1, edit) + + diff_cleanupSemanticScore_(edit, equality2); + while (edit.charAt(0) === equality2.charAt(0)) { + equality1 += edit.charAt(0); + edit = edit.substring(1) + equality2.charAt(0); + equality2 = equality2.substring(1); + var score = + diff_cleanupSemanticScore_(equality1, edit) + + diff_cleanupSemanticScore_(edit, equality2); + // The >= encourages trailing rather than leading whitespace on edits. + if (score >= bestScore) { + bestScore = score; + bestEquality1 = equality1; + bestEdit = edit; + bestEquality2 = equality2; + } + } + if (diffs[pointer - 1][1] != bestEquality1) { + // We have an improvement, save it back to the diff. + if (bestEquality1) { + diffs[pointer - 1][1] = bestEquality1; + } else { + diffs.splice(pointer - 1, 1); + pointer--; + } + diffs[pointer][1] = bestEdit; + if (bestEquality2) { + diffs[pointer + 1][1] = bestEquality2; + } else { + diffs.splice(pointer + 1, 1); + pointer--; + } + } + } + pointer++; + } +}; + +// Define some regex patterns for matching boundaries. +var nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/; +var whitespaceRegex_ = /\s/; +var linebreakRegex_ = /[\r\n]/; +var blanklineEndRegex_ = /\n\r?\n$/; +var blanklineStartRegex_ = /^\r?\n\r?\n/; + +/** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {!Array.} diffs Array of diff tuples. + */ +var diff_cleanupMerge = function (diffs) { + // Add a dummy entry at the end. + diffs.push(new Diff(DIFF_EQUAL, '')); + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ''; + var text_insert = ''; + var commonlength; + while (pointer < diffs.length) { + switch (diffs[pointer][0]) { + case DIFF_INSERT: + count_insert++; + text_insert += diffs[pointer][1]; + pointer++; + break; + case DIFF_DELETE: + count_delete++; + text_delete += diffs[pointer][1]; + pointer++; + break; + case DIFF_EQUAL: + // Upon reaching an equality, check for prior redundancies. + if (count_delete + count_insert > 1) { + if (count_delete !== 0 && count_insert !== 0) { + // Factor out any common prefixies. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if ( + pointer - count_delete - count_insert > 0 && + diffs[pointer - count_delete - count_insert - 1][0] == + DIFF_EQUAL + ) { + diffs[pointer - count_delete - count_insert - 1][1] += + text_insert.substring(0, commonlength); + } else { + diffs.splice( + 0, + 0, + new Diff(DIFF_EQUAL, text_insert.substring(0, commonlength)) + ); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixies. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (commonlength !== 0) { + diffs[pointer][1] = + text_insert.substring(text_insert.length - commonlength) + + diffs[pointer][1]; + text_insert = text_insert.substring( + 0, + text_insert.length - commonlength + ); + text_delete = text_delete.substring( + 0, + text_delete.length - commonlength + ); + } + } + // Delete the offending records and add the merged ones. + pointer -= count_delete + count_insert; + diffs.splice(pointer, count_delete + count_insert); + if (text_delete.length) { + diffs.splice(pointer, 0, new Diff(DIFF_DELETE, text_delete)); + pointer++; + } + if (text_insert.length) { + diffs.splice(pointer, 0, new Diff(DIFF_INSERT, text_insert)); + pointer++; + } + pointer++; + } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ''; + text_insert = ''; + break; + } + } + if (diffs[diffs.length - 1][1] === '') { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if ( + diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL + ) { + // This is a single edit surrounded by equalities. + if ( + diffs[pointer][1].substring( + diffs[pointer][1].length - diffs[pointer - 1][1].length + ) == diffs[pointer - 1][1] + ) { + // Shift the edit over the previous equality. + diffs[pointer][1] = + diffs[pointer - 1][1] + + diffs[pointer][1].substring( + 0, + diffs[pointer][1].length - diffs[pointer - 1][1].length + ); + diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; + diffs.splice(pointer - 1, 1); + changes = true; + } else if ( + diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1] + ) { + // Shift the edit over the next equality. + diffs[pointer - 1][1] += diffs[pointer + 1][1]; + diffs[pointer][1] = + diffs[pointer][1].substring(diffs[pointer + 1][1].length) + + diffs[pointer + 1][1]; + diffs.splice(pointer + 1, 1); + changes = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs); + } +}; diff --git a/node_modules/jest-diff/build/constants.js b/node_modules/jest-diff/build/constants.js new file mode 100644 index 00000000..ed4f9276 --- /dev/null +++ b/node_modules/jest-diff/build/constants.js @@ -0,0 +1,19 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.SIMILAR_MESSAGE = exports.NO_DIFF_MESSAGE = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const NO_DIFF_MESSAGE = 'Compared values have no visual difference.'; +exports.NO_DIFF_MESSAGE = NO_DIFF_MESSAGE; +const SIMILAR_MESSAGE = + 'Compared values serialize to the same structure.\n' + + 'Printing internal object structure without calling `toJSON` instead.'; +exports.SIMILAR_MESSAGE = SIMILAR_MESSAGE; diff --git a/node_modules/jest-diff/build/diffLines.js b/node_modules/jest-diff/build/diffLines.js new file mode 100644 index 00000000..c4632c6d --- /dev/null +++ b/node_modules/jest-diff/build/diffLines.js @@ -0,0 +1,193 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.printDiffLines = + exports.diffLinesUnified2 = + exports.diffLinesUnified = + exports.diffLinesRaw = + void 0; +var _diffSequences = _interopRequireDefault(require('diff-sequences')); +var _cleanupSemantic = require('./cleanupSemantic'); +var _joinAlignedDiffs = require('./joinAlignedDiffs'); +var _normalizeDiffOptions = require('./normalizeDiffOptions'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const isEmptyString = lines => lines.length === 1 && lines[0].length === 0; +const countChanges = diffs => { + let a = 0; + let b = 0; + diffs.forEach(diff => { + switch (diff[0]) { + case _cleanupSemantic.DIFF_DELETE: + a += 1; + break; + case _cleanupSemantic.DIFF_INSERT: + b += 1; + break; + } + }); + return { + a, + b + }; +}; +const printAnnotation = ( + { + aAnnotation, + aColor, + aIndicator, + bAnnotation, + bColor, + bIndicator, + includeChangeCounts, + omitAnnotationLines + }, + changeCounts +) => { + if (omitAnnotationLines) { + return ''; + } + let aRest = ''; + let bRest = ''; + if (includeChangeCounts) { + const aCount = String(changeCounts.a); + const bCount = String(changeCounts.b); + + // Padding right aligns the ends of the annotations. + const baAnnotationLengthDiff = bAnnotation.length - aAnnotation.length; + const aAnnotationPadding = ' '.repeat(Math.max(0, baAnnotationLengthDiff)); + const bAnnotationPadding = ' '.repeat(Math.max(0, -baAnnotationLengthDiff)); + + // Padding left aligns the ends of the counts. + const baCountLengthDiff = bCount.length - aCount.length; + const aCountPadding = ' '.repeat(Math.max(0, baCountLengthDiff)); + const bCountPadding = ' '.repeat(Math.max(0, -baCountLengthDiff)); + aRest = `${aAnnotationPadding} ${aIndicator} ${aCountPadding}${aCount}`; + bRest = `${bAnnotationPadding} ${bIndicator} ${bCountPadding}${bCount}`; + } + const a = `${aIndicator} ${aAnnotation}${aRest}`; + const b = `${bIndicator} ${bAnnotation}${bRest}`; + return `${aColor(a)}\n${bColor(b)}\n\n`; +}; +const printDiffLines = (diffs, options) => + printAnnotation(options, countChanges(diffs)) + + (options.expand + ? (0, _joinAlignedDiffs.joinAlignedDiffsExpand)(diffs, options) + : (0, _joinAlignedDiffs.joinAlignedDiffsNoExpand)(diffs, options)); + +// Compare two arrays of strings line-by-line. Format as comparison lines. +exports.printDiffLines = printDiffLines; +const diffLinesUnified = (aLines, bLines, options) => + printDiffLines( + diffLinesRaw( + isEmptyString(aLines) ? [] : aLines, + isEmptyString(bLines) ? [] : bLines + ), + (0, _normalizeDiffOptions.normalizeDiffOptions)(options) + ); + +// Given two pairs of arrays of strings: +// Compare the pair of comparison arrays line-by-line. +// Format the corresponding lines in the pair of displayable arrays. +exports.diffLinesUnified = diffLinesUnified; +const diffLinesUnified2 = ( + aLinesDisplay, + bLinesDisplay, + aLinesCompare, + bLinesCompare, + options +) => { + if (isEmptyString(aLinesDisplay) && isEmptyString(aLinesCompare)) { + aLinesDisplay = []; + aLinesCompare = []; + } + if (isEmptyString(bLinesDisplay) && isEmptyString(bLinesCompare)) { + bLinesDisplay = []; + bLinesCompare = []; + } + if ( + aLinesDisplay.length !== aLinesCompare.length || + bLinesDisplay.length !== bLinesCompare.length + ) { + // Fall back to diff of display lines. + return diffLinesUnified(aLinesDisplay, bLinesDisplay, options); + } + const diffs = diffLinesRaw(aLinesCompare, bLinesCompare); + + // Replace comparison lines with displayable lines. + let aIndex = 0; + let bIndex = 0; + diffs.forEach(diff => { + switch (diff[0]) { + case _cleanupSemantic.DIFF_DELETE: + diff[1] = aLinesDisplay[aIndex]; + aIndex += 1; + break; + case _cleanupSemantic.DIFF_INSERT: + diff[1] = bLinesDisplay[bIndex]; + bIndex += 1; + break; + default: + diff[1] = bLinesDisplay[bIndex]; + aIndex += 1; + bIndex += 1; + } + }); + return printDiffLines( + diffs, + (0, _normalizeDiffOptions.normalizeDiffOptions)(options) + ); +}; + +// Compare two arrays of strings line-by-line. +exports.diffLinesUnified2 = diffLinesUnified2; +const diffLinesRaw = (aLines, bLines) => { + const aLength = aLines.length; + const bLength = bLines.length; + const isCommon = (aIndex, bIndex) => aLines[aIndex] === bLines[bIndex]; + const diffs = []; + let aIndex = 0; + let bIndex = 0; + const foundSubsequence = (nCommon, aCommon, bCommon) => { + for (; aIndex !== aCommon; aIndex += 1) { + diffs.push( + new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_DELETE, aLines[aIndex]) + ); + } + for (; bIndex !== bCommon; bIndex += 1) { + diffs.push( + new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_INSERT, bLines[bIndex]) + ); + } + for (; nCommon !== 0; nCommon -= 1, aIndex += 1, bIndex += 1) { + diffs.push( + new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_EQUAL, bLines[bIndex]) + ); + } + }; + (0, _diffSequences.default)(aLength, bLength, isCommon, foundSubsequence); + + // After the last common subsequence, push remaining change items. + for (; aIndex !== aLength; aIndex += 1) { + diffs.push( + new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_DELETE, aLines[aIndex]) + ); + } + for (; bIndex !== bLength; bIndex += 1) { + diffs.push( + new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_INSERT, bLines[bIndex]) + ); + } + return diffs; +}; +exports.diffLinesRaw = diffLinesRaw; diff --git a/node_modules/jest-diff/build/diffStrings.js b/node_modules/jest-diff/build/diffStrings.js new file mode 100644 index 00000000..e11c5a52 --- /dev/null +++ b/node_modules/jest-diff/build/diffStrings.js @@ -0,0 +1,66 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _diffSequences = _interopRequireDefault(require('diff-sequences')); +var _cleanupSemantic = require('./cleanupSemantic'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const diffStrings = (a, b) => { + const isCommon = (aIndex, bIndex) => a[aIndex] === b[bIndex]; + let aIndex = 0; + let bIndex = 0; + const diffs = []; + const foundSubsequence = (nCommon, aCommon, bCommon) => { + if (aIndex !== aCommon) { + diffs.push( + new _cleanupSemantic.Diff( + _cleanupSemantic.DIFF_DELETE, + a.slice(aIndex, aCommon) + ) + ); + } + if (bIndex !== bCommon) { + diffs.push( + new _cleanupSemantic.Diff( + _cleanupSemantic.DIFF_INSERT, + b.slice(bIndex, bCommon) + ) + ); + } + aIndex = aCommon + nCommon; // number of characters compared in a + bIndex = bCommon + nCommon; // number of characters compared in b + diffs.push( + new _cleanupSemantic.Diff( + _cleanupSemantic.DIFF_EQUAL, + b.slice(bCommon, bIndex) + ) + ); + }; + (0, _diffSequences.default)(a.length, b.length, isCommon, foundSubsequence); + + // After the last common subsequence, push remaining change items. + if (aIndex !== a.length) { + diffs.push( + new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_DELETE, a.slice(aIndex)) + ); + } + if (bIndex !== b.length) { + diffs.push( + new _cleanupSemantic.Diff(_cleanupSemantic.DIFF_INSERT, b.slice(bIndex)) + ); + } + return diffs; +}; +var _default = diffStrings; +exports.default = _default; diff --git a/node_modules/jest-diff/build/getAlignedDiffs.js b/node_modules/jest-diff/build/getAlignedDiffs.js new file mode 100644 index 00000000..04da5471 --- /dev/null +++ b/node_modules/jest-diff/build/getAlignedDiffs.js @@ -0,0 +1,223 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _cleanupSemantic = require('./cleanupSemantic'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Given change op and array of diffs, return concatenated string: +// * include common strings +// * include change strings which have argument op with changeColor +// * exclude change strings which have opposite op +const concatenateRelevantDiffs = (op, diffs, changeColor) => + diffs.reduce( + (reduced, diff) => + reduced + + (diff[0] === _cleanupSemantic.DIFF_EQUAL + ? diff[1] + : diff[0] === op && diff[1].length !== 0 // empty if change is newline + ? changeColor(diff[1]) + : ''), + '' + ); + +// Encapsulate change lines until either a common newline or the end. +class ChangeBuffer { + op; + line; // incomplete line + lines; // complete lines + changeColor; + constructor(op, changeColor) { + this.op = op; + this.line = []; + this.lines = []; + this.changeColor = changeColor; + } + pushSubstring(substring) { + this.pushDiff(new _cleanupSemantic.Diff(this.op, substring)); + } + pushLine() { + // Assume call only if line has at least one diff, + // therefore an empty line must have a diff which has an empty string. + + // If line has multiple diffs, then assume it has a common diff, + // therefore change diffs have change color; + // otherwise then it has line color only. + this.lines.push( + this.line.length !== 1 + ? new _cleanupSemantic.Diff( + this.op, + concatenateRelevantDiffs(this.op, this.line, this.changeColor) + ) + : this.line[0][0] === this.op + ? this.line[0] // can use instance + : new _cleanupSemantic.Diff(this.op, this.line[0][1]) // was common diff + ); + + this.line.length = 0; + } + isLineEmpty() { + return this.line.length === 0; + } + + // Minor input to buffer. + pushDiff(diff) { + this.line.push(diff); + } + + // Main input to buffer. + align(diff) { + const string = diff[1]; + if (string.includes('\n')) { + const substrings = string.split('\n'); + const iLast = substrings.length - 1; + substrings.forEach((substring, i) => { + if (i < iLast) { + // The first substring completes the current change line. + // A middle substring is a change line. + this.pushSubstring(substring); + this.pushLine(); + } else if (substring.length !== 0) { + // The last substring starts a change line, if it is not empty. + // Important: This non-empty condition also automatically omits + // the newline appended to the end of expected and received strings. + this.pushSubstring(substring); + } + }); + } else { + // Append non-multiline string to current change line. + this.pushDiff(diff); + } + } + + // Output from buffer. + moveLinesTo(lines) { + if (!this.isLineEmpty()) { + this.pushLine(); + } + lines.push(...this.lines); + this.lines.length = 0; + } +} + +// Encapsulate common and change lines. +class CommonBuffer { + deleteBuffer; + insertBuffer; + lines; + constructor(deleteBuffer, insertBuffer) { + this.deleteBuffer = deleteBuffer; + this.insertBuffer = insertBuffer; + this.lines = []; + } + pushDiffCommonLine(diff) { + this.lines.push(diff); + } + pushDiffChangeLines(diff) { + const isDiffEmpty = diff[1].length === 0; + + // An empty diff string is redundant, unless a change line is empty. + if (!isDiffEmpty || this.deleteBuffer.isLineEmpty()) { + this.deleteBuffer.pushDiff(diff); + } + if (!isDiffEmpty || this.insertBuffer.isLineEmpty()) { + this.insertBuffer.pushDiff(diff); + } + } + flushChangeLines() { + this.deleteBuffer.moveLinesTo(this.lines); + this.insertBuffer.moveLinesTo(this.lines); + } + + // Input to buffer. + align(diff) { + const op = diff[0]; + const string = diff[1]; + if (string.includes('\n')) { + const substrings = string.split('\n'); + const iLast = substrings.length - 1; + substrings.forEach((substring, i) => { + if (i === 0) { + const subdiff = new _cleanupSemantic.Diff(op, substring); + if ( + this.deleteBuffer.isLineEmpty() && + this.insertBuffer.isLineEmpty() + ) { + // If both current change lines are empty, + // then the first substring is a common line. + this.flushChangeLines(); + this.pushDiffCommonLine(subdiff); + } else { + // If either current change line is non-empty, + // then the first substring completes the change lines. + this.pushDiffChangeLines(subdiff); + this.flushChangeLines(); + } + } else if (i < iLast) { + // A middle substring is a common line. + this.pushDiffCommonLine(new _cleanupSemantic.Diff(op, substring)); + } else if (substring.length !== 0) { + // The last substring starts a change line, if it is not empty. + // Important: This non-empty condition also automatically omits + // the newline appended to the end of expected and received strings. + this.pushDiffChangeLines(new _cleanupSemantic.Diff(op, substring)); + } + }); + } else { + // Append non-multiline string to current change lines. + // Important: It cannot be at the end following empty change lines, + // because newline appended to the end of expected and received strings. + this.pushDiffChangeLines(diff); + } + } + + // Output from buffer. + getLines() { + this.flushChangeLines(); + return this.lines; + } +} + +// Given diffs from expected and received strings, +// return new array of diffs split or joined into lines. +// +// To correctly align a change line at the end, the algorithm: +// * assumes that a newline was appended to the strings +// * omits the last newline from the output array +// +// Assume the function is not called: +// * if either expected or received is empty string +// * if neither expected nor received is multiline string +const getAlignedDiffs = (diffs, changeColor) => { + const deleteBuffer = new ChangeBuffer( + _cleanupSemantic.DIFF_DELETE, + changeColor + ); + const insertBuffer = new ChangeBuffer( + _cleanupSemantic.DIFF_INSERT, + changeColor + ); + const commonBuffer = new CommonBuffer(deleteBuffer, insertBuffer); + diffs.forEach(diff => { + switch (diff[0]) { + case _cleanupSemantic.DIFF_DELETE: + deleteBuffer.align(diff); + break; + case _cleanupSemantic.DIFF_INSERT: + insertBuffer.align(diff); + break; + default: + commonBuffer.align(diff); + } + }); + return commonBuffer.getLines(); +}; +var _default = getAlignedDiffs; +exports.default = _default; diff --git a/node_modules/jest-diff/build/index.d.ts b/node_modules/jest-diff/build/index.d.ts new file mode 100644 index 00000000..f84a803c --- /dev/null +++ b/node_modules/jest-diff/build/index.d.ts @@ -0,0 +1,93 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {CompareKeys} from 'pretty-format'; + +/** + * Class representing one diff tuple. + * Attempts to look like a two-element array (which is what this used to be). + * @param {number} op Operation, one of: DIFF_DELETE, DIFF_INSERT, DIFF_EQUAL. + * @param {string} text Text to be deleted, inserted, or retained. + * @constructor + */ +export declare class Diff { + 0: number; + 1: string; + constructor(op: number, text: string); +} + +export declare function diff( + a: any, + b: any, + options?: DiffOptions, +): string | null; + +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +export declare var DIFF_DELETE: number; + +export declare var DIFF_EQUAL: number; + +export declare var DIFF_INSERT: number; + +export declare const diffLinesRaw: ( + aLines: Array, + bLines: Array, +) => Array; + +export declare const diffLinesUnified: ( + aLines: Array, + bLines: Array, + options?: DiffOptions, +) => string; + +export declare const diffLinesUnified2: ( + aLinesDisplay: Array, + bLinesDisplay: Array, + aLinesCompare: Array, + bLinesCompare: Array, + options?: DiffOptions, +) => string; + +export declare type DiffOptions = { + aAnnotation?: string; + aColor?: DiffOptionsColor; + aIndicator?: string; + bAnnotation?: string; + bColor?: DiffOptionsColor; + bIndicator?: string; + changeColor?: DiffOptionsColor; + changeLineTrailingSpaceColor?: DiffOptionsColor; + commonColor?: DiffOptionsColor; + commonIndicator?: string; + commonLineTrailingSpaceColor?: DiffOptionsColor; + contextLines?: number; + emptyFirstOrLastLinePlaceholder?: string; + expand?: boolean; + includeChangeCounts?: boolean; + omitAnnotationLines?: boolean; + patchColor?: DiffOptionsColor; + compareKeys?: CompareKeys; +}; + +export declare type DiffOptionsColor = (arg: string) => string; + +export declare const diffStringsRaw: ( + a: string, + b: string, + cleanup: boolean, +) => Array; + +export declare const diffStringsUnified: ( + a: string, + b: string, + options?: DiffOptions, +) => string; + +export {}; diff --git a/node_modules/jest-diff/build/index.js b/node_modules/jest-diff/build/index.js new file mode 100644 index 00000000..7efc7bfa --- /dev/null +++ b/node_modules/jest-diff/build/index.js @@ -0,0 +1,232 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +Object.defineProperty(exports, 'DIFF_DELETE', { + enumerable: true, + get: function () { + return _cleanupSemantic.DIFF_DELETE; + } +}); +Object.defineProperty(exports, 'DIFF_EQUAL', { + enumerable: true, + get: function () { + return _cleanupSemantic.DIFF_EQUAL; + } +}); +Object.defineProperty(exports, 'DIFF_INSERT', { + enumerable: true, + get: function () { + return _cleanupSemantic.DIFF_INSERT; + } +}); +Object.defineProperty(exports, 'Diff', { + enumerable: true, + get: function () { + return _cleanupSemantic.Diff; + } +}); +exports.diff = diff; +Object.defineProperty(exports, 'diffLinesRaw', { + enumerable: true, + get: function () { + return _diffLines.diffLinesRaw; + } +}); +Object.defineProperty(exports, 'diffLinesUnified', { + enumerable: true, + get: function () { + return _diffLines.diffLinesUnified; + } +}); +Object.defineProperty(exports, 'diffLinesUnified2', { + enumerable: true, + get: function () { + return _diffLines.diffLinesUnified2; + } +}); +Object.defineProperty(exports, 'diffStringsRaw', { + enumerable: true, + get: function () { + return _printDiffs.diffStringsRaw; + } +}); +Object.defineProperty(exports, 'diffStringsUnified', { + enumerable: true, + get: function () { + return _printDiffs.diffStringsUnified; + } +}); +var _chalk = _interopRequireDefault(require('chalk')); +var _jestGetType = require('jest-get-type'); +var _prettyFormat = require('pretty-format'); +var _cleanupSemantic = require('./cleanupSemantic'); +var _constants = require('./constants'); +var _diffLines = require('./diffLines'); +var _normalizeDiffOptions = require('./normalizeDiffOptions'); +var _printDiffs = require('./printDiffs'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +const getCommonMessage = (message, options) => { + const {commonColor} = (0, _normalizeDiffOptions.normalizeDiffOptions)( + options + ); + return commonColor(message); +}; +const { + AsymmetricMatcher, + DOMCollection, + DOMElement, + Immutable, + ReactElement, + ReactTestComponent +} = _prettyFormat.plugins; +const PLUGINS = [ + ReactTestComponent, + ReactElement, + DOMElement, + DOMCollection, + Immutable, + AsymmetricMatcher +]; +const FORMAT_OPTIONS = { + plugins: PLUGINS +}; +const FALLBACK_FORMAT_OPTIONS = { + callToJSON: false, + maxDepth: 10, + plugins: PLUGINS +}; + +// Generate a string that will highlight the difference between two values +// with green and red. (similar to how github does code diffing) +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function diff(a, b, options) { + if (Object.is(a, b)) { + return getCommonMessage(_constants.NO_DIFF_MESSAGE, options); + } + const aType = (0, _jestGetType.getType)(a); + let expectedType = aType; + let omitDifference = false; + if (aType === 'object' && typeof a.asymmetricMatch === 'function') { + if (a.$$typeof !== Symbol.for('jest.asymmetricMatcher')) { + // Do not know expected type of user-defined asymmetric matcher. + return null; + } + if (typeof a.getExpectedType !== 'function') { + // For example, expect.anything() matches either null or undefined + return null; + } + expectedType = a.getExpectedType(); + // Primitive types boolean and number omit difference below. + // For example, omit difference for expect.stringMatching(regexp) + omitDifference = expectedType === 'string'; + } + if (expectedType !== (0, _jestGetType.getType)(b)) { + return ( + ' Comparing two different types of values.' + + ` Expected ${_chalk.default.green(expectedType)} but ` + + `received ${_chalk.default.red((0, _jestGetType.getType)(b))}.` + ); + } + if (omitDifference) { + return null; + } + switch (aType) { + case 'string': + return (0, _diffLines.diffLinesUnified)( + a.split('\n'), + b.split('\n'), + options + ); + case 'boolean': + case 'number': + return comparePrimitive(a, b, options); + case 'map': + return compareObjects(sortMap(a), sortMap(b), options); + case 'set': + return compareObjects(sortSet(a), sortSet(b), options); + default: + return compareObjects(a, b, options); + } +} +function comparePrimitive(a, b, options) { + const aFormat = (0, _prettyFormat.format)(a, FORMAT_OPTIONS); + const bFormat = (0, _prettyFormat.format)(b, FORMAT_OPTIONS); + return aFormat === bFormat + ? getCommonMessage(_constants.NO_DIFF_MESSAGE, options) + : (0, _diffLines.diffLinesUnified)( + aFormat.split('\n'), + bFormat.split('\n'), + options + ); +} +function sortMap(map) { + return new Map(Array.from(map.entries()).sort()); +} +function sortSet(set) { + return new Set(Array.from(set.values()).sort()); +} +function compareObjects(a, b, options) { + let difference; + let hasThrown = false; + try { + const formatOptions = getFormatOptions(FORMAT_OPTIONS, options); + difference = getObjectsDifference(a, b, formatOptions, options); + } catch { + hasThrown = true; + } + const noDiffMessage = getCommonMessage(_constants.NO_DIFF_MESSAGE, options); + // If the comparison yields no results, compare again but this time + // without calling `toJSON`. It's also possible that toJSON might throw. + if (difference === undefined || difference === noDiffMessage) { + const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options); + difference = getObjectsDifference(a, b, formatOptions, options); + if (difference !== noDiffMessage && !hasThrown) { + difference = `${getCommonMessage( + _constants.SIMILAR_MESSAGE, + options + )}\n\n${difference}`; + } + } + return difference; +} +function getFormatOptions(formatOptions, options) { + const {compareKeys} = (0, _normalizeDiffOptions.normalizeDiffOptions)( + options + ); + return { + ...formatOptions, + compareKeys + }; +} +function getObjectsDifference(a, b, formatOptions, options) { + const formatOptionsZeroIndent = { + ...formatOptions, + indent: 0 + }; + const aCompare = (0, _prettyFormat.format)(a, formatOptionsZeroIndent); + const bCompare = (0, _prettyFormat.format)(b, formatOptionsZeroIndent); + if (aCompare === bCompare) { + return getCommonMessage(_constants.NO_DIFF_MESSAGE, options); + } else { + const aDisplay = (0, _prettyFormat.format)(a, formatOptions); + const bDisplay = (0, _prettyFormat.format)(b, formatOptions); + return (0, _diffLines.diffLinesUnified2)( + aDisplay.split('\n'), + bDisplay.split('\n'), + aCompare.split('\n'), + bCompare.split('\n'), + options + ); + } +} diff --git a/node_modules/jest-diff/build/joinAlignedDiffs.js b/node_modules/jest-diff/build/joinAlignedDiffs.js new file mode 100644 index 00000000..af5eb53c --- /dev/null +++ b/node_modules/jest-diff/build/joinAlignedDiffs.js @@ -0,0 +1,271 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.joinAlignedDiffsNoExpand = exports.joinAlignedDiffsExpand = void 0; +var _cleanupSemantic = require('./cleanupSemantic'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const formatTrailingSpaces = (line, trailingSpaceFormatter) => + line.replace(/\s+$/, match => trailingSpaceFormatter(match)); +const printDiffLine = ( + line, + isFirstOrLast, + color, + indicator, + trailingSpaceFormatter, + emptyFirstOrLastLinePlaceholder +) => + line.length !== 0 + ? color( + `${indicator} ${formatTrailingSpaces(line, trailingSpaceFormatter)}` + ) + : indicator !== ' ' + ? color(indicator) + : isFirstOrLast && emptyFirstOrLastLinePlaceholder.length !== 0 + ? color(`${indicator} ${emptyFirstOrLastLinePlaceholder}`) + : ''; +const printDeleteLine = ( + line, + isFirstOrLast, + { + aColor, + aIndicator, + changeLineTrailingSpaceColor, + emptyFirstOrLastLinePlaceholder + } +) => + printDiffLine( + line, + isFirstOrLast, + aColor, + aIndicator, + changeLineTrailingSpaceColor, + emptyFirstOrLastLinePlaceholder + ); +const printInsertLine = ( + line, + isFirstOrLast, + { + bColor, + bIndicator, + changeLineTrailingSpaceColor, + emptyFirstOrLastLinePlaceholder + } +) => + printDiffLine( + line, + isFirstOrLast, + bColor, + bIndicator, + changeLineTrailingSpaceColor, + emptyFirstOrLastLinePlaceholder + ); +const printCommonLine = ( + line, + isFirstOrLast, + { + commonColor, + commonIndicator, + commonLineTrailingSpaceColor, + emptyFirstOrLastLinePlaceholder + } +) => + printDiffLine( + line, + isFirstOrLast, + commonColor, + commonIndicator, + commonLineTrailingSpaceColor, + emptyFirstOrLastLinePlaceholder + ); + +// In GNU diff format, indexes are one-based instead of zero-based. +const createPatchMark = (aStart, aEnd, bStart, bEnd, {patchColor}) => + patchColor( + `@@ -${aStart + 1},${aEnd - aStart} +${bStart + 1},${bEnd - bStart} @@` + ); + +// jest --no-expand +// +// Given array of aligned strings with inverse highlight formatting, +// return joined lines with diff formatting (and patch marks, if needed). +const joinAlignedDiffsNoExpand = (diffs, options) => { + const iLength = diffs.length; + const nContextLines = options.contextLines; + const nContextLines2 = nContextLines + nContextLines; + + // First pass: count output lines and see if it has patches. + let jLength = iLength; + let hasExcessAtStartOrEnd = false; + let nExcessesBetweenChanges = 0; + let i = 0; + while (i !== iLength) { + const iStart = i; + while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_EQUAL) { + i += 1; + } + if (iStart !== i) { + if (iStart === 0) { + // at start + if (i > nContextLines) { + jLength -= i - nContextLines; // subtract excess common lines + hasExcessAtStartOrEnd = true; + } + } else if (i === iLength) { + // at end + const n = i - iStart; + if (n > nContextLines) { + jLength -= n - nContextLines; // subtract excess common lines + hasExcessAtStartOrEnd = true; + } + } else { + // between changes + const n = i - iStart; + if (n > nContextLines2) { + jLength -= n - nContextLines2; // subtract excess common lines + nExcessesBetweenChanges += 1; + } + } + } + while (i !== iLength && diffs[i][0] !== _cleanupSemantic.DIFF_EQUAL) { + i += 1; + } + } + const hasPatch = nExcessesBetweenChanges !== 0 || hasExcessAtStartOrEnd; + if (nExcessesBetweenChanges !== 0) { + jLength += nExcessesBetweenChanges + 1; // add patch lines + } else if (hasExcessAtStartOrEnd) { + jLength += 1; // add patch line + } + + const jLast = jLength - 1; + const lines = []; + let jPatchMark = 0; // index of placeholder line for current patch mark + if (hasPatch) { + lines.push(''); // placeholder line for first patch mark + } + + // Indexes of expected or received lines in current patch: + let aStart = 0; + let bStart = 0; + let aEnd = 0; + let bEnd = 0; + const pushCommonLine = line => { + const j = lines.length; + lines.push(printCommonLine(line, j === 0 || j === jLast, options)); + aEnd += 1; + bEnd += 1; + }; + const pushDeleteLine = line => { + const j = lines.length; + lines.push(printDeleteLine(line, j === 0 || j === jLast, options)); + aEnd += 1; + }; + const pushInsertLine = line => { + const j = lines.length; + lines.push(printInsertLine(line, j === 0 || j === jLast, options)); + bEnd += 1; + }; + + // Second pass: push lines with diff formatting (and patch marks, if needed). + i = 0; + while (i !== iLength) { + let iStart = i; + while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_EQUAL) { + i += 1; + } + if (iStart !== i) { + if (iStart === 0) { + // at beginning + if (i > nContextLines) { + iStart = i - nContextLines; + aStart = iStart; + bStart = iStart; + aEnd = aStart; + bEnd = bStart; + } + for (let iCommon = iStart; iCommon !== i; iCommon += 1) { + pushCommonLine(diffs[iCommon][1]); + } + } else if (i === iLength) { + // at end + const iEnd = i - iStart > nContextLines ? iStart + nContextLines : i; + for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) { + pushCommonLine(diffs[iCommon][1]); + } + } else { + // between changes + const nCommon = i - iStart; + if (nCommon > nContextLines2) { + const iEnd = iStart + nContextLines; + for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) { + pushCommonLine(diffs[iCommon][1]); + } + lines[jPatchMark] = createPatchMark( + aStart, + aEnd, + bStart, + bEnd, + options + ); + jPatchMark = lines.length; + lines.push(''); // placeholder line for next patch mark + + const nOmit = nCommon - nContextLines2; + aStart = aEnd + nOmit; + bStart = bEnd + nOmit; + aEnd = aStart; + bEnd = bStart; + for (let iCommon = i - nContextLines; iCommon !== i; iCommon += 1) { + pushCommonLine(diffs[iCommon][1]); + } + } else { + for (let iCommon = iStart; iCommon !== i; iCommon += 1) { + pushCommonLine(diffs[iCommon][1]); + } + } + } + } + while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_DELETE) { + pushDeleteLine(diffs[i][1]); + i += 1; + } + while (i !== iLength && diffs[i][0] === _cleanupSemantic.DIFF_INSERT) { + pushInsertLine(diffs[i][1]); + i += 1; + } + } + if (hasPatch) { + lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options); + } + return lines.join('\n'); +}; + +// jest --expand +// +// Given array of aligned strings with inverse highlight formatting, +// return joined lines with diff formatting. +exports.joinAlignedDiffsNoExpand = joinAlignedDiffsNoExpand; +const joinAlignedDiffsExpand = (diffs, options) => + diffs + .map((diff, i, diffs) => { + const line = diff[1]; + const isFirstOrLast = i === 0 || i === diffs.length - 1; + switch (diff[0]) { + case _cleanupSemantic.DIFF_DELETE: + return printDeleteLine(line, isFirstOrLast, options); + case _cleanupSemantic.DIFF_INSERT: + return printInsertLine(line, isFirstOrLast, options); + default: + return printCommonLine(line, isFirstOrLast, options); + } + }) + .join('\n'); +exports.joinAlignedDiffsExpand = joinAlignedDiffsExpand; diff --git a/node_modules/jest-diff/build/normalizeDiffOptions.js b/node_modules/jest-diff/build/normalizeDiffOptions.js new file mode 100644 index 00000000..c8eaeb98 --- /dev/null +++ b/node_modules/jest-diff/build/normalizeDiffOptions.js @@ -0,0 +1,59 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.normalizeDiffOptions = exports.noColor = void 0; +var _chalk = _interopRequireDefault(require('chalk')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const noColor = string => string; +exports.noColor = noColor; +const DIFF_CONTEXT_DEFAULT = 5; +const OPTIONS_DEFAULT = { + aAnnotation: 'Expected', + aColor: _chalk.default.green, + aIndicator: '-', + bAnnotation: 'Received', + bColor: _chalk.default.red, + bIndicator: '+', + changeColor: _chalk.default.inverse, + changeLineTrailingSpaceColor: noColor, + commonColor: _chalk.default.dim, + commonIndicator: ' ', + commonLineTrailingSpaceColor: noColor, + compareKeys: undefined, + contextLines: DIFF_CONTEXT_DEFAULT, + emptyFirstOrLastLinePlaceholder: '', + expand: true, + includeChangeCounts: false, + omitAnnotationLines: false, + patchColor: _chalk.default.yellow +}; +const getCompareKeys = compareKeys => + compareKeys && typeof compareKeys === 'function' + ? compareKeys + : OPTIONS_DEFAULT.compareKeys; +const getContextLines = contextLines => + typeof contextLines === 'number' && + Number.isSafeInteger(contextLines) && + contextLines >= 0 + ? contextLines + : DIFF_CONTEXT_DEFAULT; + +// Pure function returns options with all properties. +const normalizeDiffOptions = (options = {}) => ({ + ...OPTIONS_DEFAULT, + ...options, + compareKeys: getCompareKeys(options.compareKeys), + contextLines: getContextLines(options.contextLines) +}); +exports.normalizeDiffOptions = normalizeDiffOptions; diff --git a/node_modules/jest-diff/build/printDiffs.js b/node_modules/jest-diff/build/printDiffs.js new file mode 100644 index 00000000..2b8f27ed --- /dev/null +++ b/node_modules/jest-diff/build/printDiffs.js @@ -0,0 +1,79 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.diffStringsUnified = exports.diffStringsRaw = void 0; +var _cleanupSemantic = require('./cleanupSemantic'); +var _diffLines = require('./diffLines'); +var _diffStrings = _interopRequireDefault(require('./diffStrings')); +var _getAlignedDiffs = _interopRequireDefault(require('./getAlignedDiffs')); +var _normalizeDiffOptions = require('./normalizeDiffOptions'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const hasCommonDiff = (diffs, isMultiline) => { + if (isMultiline) { + // Important: Ignore common newline that was appended to multiline strings! + const iLast = diffs.length - 1; + return diffs.some( + (diff, i) => + diff[0] === _cleanupSemantic.DIFF_EQUAL && + (i !== iLast || diff[1] !== '\n') + ); + } + return diffs.some(diff => diff[0] === _cleanupSemantic.DIFF_EQUAL); +}; + +// Compare two strings character-by-character. +// Format as comparison lines in which changed substrings have inverse colors. +const diffStringsUnified = (a, b, options) => { + if (a !== b && a.length !== 0 && b.length !== 0) { + const isMultiline = a.includes('\n') || b.includes('\n'); + + // getAlignedDiffs assumes that a newline was appended to the strings. + const diffs = diffStringsRaw( + isMultiline ? `${a}\n` : a, + isMultiline ? `${b}\n` : b, + true // cleanupSemantic + ); + + if (hasCommonDiff(diffs, isMultiline)) { + const optionsNormalized = (0, _normalizeDiffOptions.normalizeDiffOptions)( + options + ); + const lines = (0, _getAlignedDiffs.default)( + diffs, + optionsNormalized.changeColor + ); + return (0, _diffLines.printDiffLines)(lines, optionsNormalized); + } + } + + // Fall back to line-by-line diff. + return (0, _diffLines.diffLinesUnified)( + a.split('\n'), + b.split('\n'), + options + ); +}; + +// Compare two strings character-by-character. +// Optionally clean up small common substrings, also known as chaff. +exports.diffStringsUnified = diffStringsUnified; +const diffStringsRaw = (a, b, cleanup) => { + const diffs = (0, _diffStrings.default)(a, b); + if (cleanup) { + (0, _cleanupSemantic.cleanupSemantic)(diffs); // impure function + } + + return diffs; +}; +exports.diffStringsRaw = diffStringsRaw; diff --git a/node_modules/jest-diff/build/types.js b/node_modules/jest-diff/build/types.js new file mode 100644 index 00000000..ad9a93a7 --- /dev/null +++ b/node_modules/jest-diff/build/types.js @@ -0,0 +1 @@ +'use strict'; diff --git a/node_modules/jest-diff/package.json b/node_modules/jest-diff/package.json new file mode 100644 index 00000000..41a1d236 --- /dev/null +++ b/node_modules/jest-diff/package.json @@ -0,0 +1,36 @@ +{ + "name": "jest-diff", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-diff" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "devDependencies": { + "@jest/test-utils": "^29.7.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-docblock/LICENSE b/node_modules/jest-docblock/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-docblock/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-docblock/README.md b/node_modules/jest-docblock/README.md new file mode 100644 index 00000000..ba3fc7b6 --- /dev/null +++ b/node_modules/jest-docblock/README.md @@ -0,0 +1,108 @@ +# jest-docblock + +`jest-docblock` is a package that can extract and parse a specially-formatted comment called a "docblock" at the top of a file. + +A docblock looks like this: + +```js +/** + * Stuff goes here! + */ +``` + +Docblocks can contain pragmas, which are words prefixed by `@`: + +```js +/** + * Pragma incoming! + * + * @flow + */ +``` + +Pragmas can also take arguments: + +```js +/** + * Check this out: + * + * @myPragma it is so cool + */ +``` + +`jest-docblock` can: + +- extract the docblock from some code as a string +- parse a docblock string's pragmas into an object +- print an object and some comments back to a string + +## Installation + +```sh +# with yarn +$ yarn add jest-docblock +# with npm +$ npm install jest-docblock +``` + +## Usage + +```js +const code = ` +/** + * Everything is awesome! + * + * @everything is:awesome + * @flow + */ + + export const everything = Object.create(null); + export default function isAwesome(something) { + return something === everything; + } +`; + +const { + extract, + strip, + parse, + parseWithComments, + print, +} = require('jest-docblock'); + +const docblock = extract(code); +console.log(docblock); // "/**\n * Everything is awesome!\n * \n * @everything is:awesome\n * @flow\n */" + +const stripped = strip(code); +console.log(stripped); // "export const everything = Object.create(null);\n export default function isAwesome(something) {\n return something === everything;\n }" + +const pragmas = parse(docblock); +console.log(pragmas); // { everything: "is:awesome", flow: "" } + +const parsed = parseWithComments(docblock); +console.log(parsed); // { comments: "Everything is awesome!", pragmas: { everything: "is:awesome", flow: "" } } + +console.log(print({pragmas, comments: 'hi!'})); // /**\n * hi!\n *\n * @everything is:awesome\n * @flow\n */; +``` + +## API Documentation + +### `extract(contents: string): string` + +Extracts a docblock from some file contents. Returns the docblock contained in `contents`. If `contents` did not contain a docblock, it will return the empty string (`""`). + +### `strip(contents: string): string` + +Strips the top docblock from a file and return the result. If a file does not have a docblock at the top, then return the file unchanged. + +### `parse(docblock: string): {[key: string]: string | string[] }` + +Parses the pragmas in a docblock string into an object whose keys are the pragma tags and whose values are the arguments to those pragmas. + +### `parseWithComments(docblock: string): { comments: string, pragmas: {[key: string]: string | string[]} }` + +Similar to `parse` except this method also returns the comments from the docblock. Useful when used with `print()`. + +### `print({ comments?: string, pragmas?: {[key: string]: string | string[]} }): string` + +Prints an object of key-value pairs back into a docblock. If `comments` are provided, they will be positioned on the top of the docblock. diff --git a/node_modules/jest-docblock/build/index.d.ts b/node_modules/jest-docblock/build/index.d.ts new file mode 100644 index 00000000..b4e72f5a --- /dev/null +++ b/node_modules/jest-docblock/build/index.d.ts @@ -0,0 +1,29 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare function extract(contents: string): string; + +export declare function parse(docblock: string): Pragmas; + +export declare function parseWithComments(docblock: string): { + comments: string; + pragmas: Pragmas; +}; + +declare type Pragmas = Record>; + +declare function print_2({ + comments, + pragmas, +}: { + comments?: string; + pragmas?: Pragmas; +}): string; +export {print_2 as print}; + +export declare function strip(contents: string): string; + +export {}; diff --git a/node_modules/jest-docblock/build/index.js b/node_modules/jest-docblock/build/index.js new file mode 100644 index 00000000..267aa012 --- /dev/null +++ b/node_modules/jest-docblock/build/index.js @@ -0,0 +1,130 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.extract = extract; +exports.parse = parse; +exports.parseWithComments = parseWithComments; +exports.print = print; +exports.strip = strip; +function _os() { + const data = require('os'); + _os = function () { + return data; + }; + return data; +} +function _detectNewline() { + const data = _interopRequireDefault(require('detect-newline')); + _detectNewline = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const commentEndRe = /\*\/$/; +const commentStartRe = /^\/\*\*?/; +const docblockRe = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/; +const lineCommentRe = /(^|\s+)\/\/([^\r\n]*)/g; +const ltrimNewlineRe = /^(\r?\n)+/; +const multilineRe = + /(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g; +const propertyRe = /(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g; +const stringStartRe = /(\r?\n|^) *\* ?/g; +const STRING_ARRAY = []; +function extract(contents) { + const match = contents.match(docblockRe); + return match ? match[0].trimLeft() : ''; +} +function strip(contents) { + const match = contents.match(docblockRe); + return match && match[0] ? contents.substring(match[0].length) : contents; +} +function parse(docblock) { + return parseWithComments(docblock).pragmas; +} +function parseWithComments(docblock) { + const line = (0, _detectNewline().default)(docblock) ?? _os().EOL; + docblock = docblock + .replace(commentStartRe, '') + .replace(commentEndRe, '') + .replace(stringStartRe, '$1'); + + // Normalize multi-line directives + let prev = ''; + while (prev !== docblock) { + prev = docblock; + docblock = docblock.replace(multilineRe, `${line}$1 $2${line}`); + } + docblock = docblock.replace(ltrimNewlineRe, '').trimRight(); + const result = Object.create(null); + const comments = docblock + .replace(propertyRe, '') + .replace(ltrimNewlineRe, '') + .trimRight(); + let match; + while ((match = propertyRe.exec(docblock))) { + // strip linecomments from pragmas + const nextPragma = match[2].replace(lineCommentRe, ''); + if ( + typeof result[match[1]] === 'string' || + Array.isArray(result[match[1]]) + ) { + result[match[1]] = STRING_ARRAY.concat(result[match[1]], nextPragma); + } else { + result[match[1]] = nextPragma; + } + } + return { + comments, + pragmas: result + }; +} +function print({comments = '', pragmas = {}}) { + const line = (0, _detectNewline().default)(comments) ?? _os().EOL; + const head = '/**'; + const start = ' *'; + const tail = ' */'; + const keys = Object.keys(pragmas); + const printedObject = keys + .flatMap(key => printKeyValues(key, pragmas[key])) + .map(keyValue => `${start} ${keyValue}${line}`) + .join(''); + if (!comments) { + if (keys.length === 0) { + return ''; + } + if (keys.length === 1 && !Array.isArray(pragmas[keys[0]])) { + const value = pragmas[keys[0]]; + return `${head} ${printKeyValues(keys[0], value)[0]}${tail}`; + } + } + const printedComments = + comments + .split(line) + .map(textLine => `${start} ${textLine}`) + .join(line) + line; + return ( + head + + line + + (comments ? printedComments : '') + + (comments && keys.length ? start + line : '') + + printedObject + + tail + ); +} +function printKeyValues(key, valueOrArray) { + return STRING_ARRAY.concat(valueOrArray).map(value => + `@${key} ${value}`.trim() + ); +} diff --git a/node_modules/jest-docblock/package.json b/node_modules/jest-docblock/package.json new file mode 100644 index 00000000..22432f8f --- /dev/null +++ b/node_modules/jest-docblock/package.json @@ -0,0 +1,32 @@ +{ + "name": "jest-docblock", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-docblock" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "devDependencies": { + "@types/node": "*" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-each/LICENSE b/node_modules/jest-each/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-each/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-each/README.md b/node_modules/jest-each/README.md new file mode 100644 index 00000000..3b438438 --- /dev/null +++ b/node_modules/jest-each/README.md @@ -0,0 +1,548 @@ +
+

jest-each

+ Jest Parameterised Testing +
+ +
+ +[![version](https://img.shields.io/npm/v/jest-each.svg?style=flat-square)](https://www.npmjs.com/package/jest-each) [![downloads](https://img.shields.io/npm/dm/jest-each.svg?style=flat-square)](http://npm-stat.com/charts.html?package=jest-each&from=2017-03-21) [![MIT License](https://img.shields.io/npm/l/jest-each.svg?style=flat-square)](https://github.com/jestjs/jest/blob/main/LICENSE) + +A parameterised testing library for [Jest](https://jestjs.io/) inspired by [mocha-each](https://github.com/ryym/mocha-each). + +jest-each allows you to provide multiple arguments to your `test`/`describe` which results in the test/suite being run once per row of parameters. + +## Features + +- `.test` to runs multiple tests with parameterised data + - Also under the alias: `.it` +- `.test.only` to only run the parameterised tests + - Also under the aliases: `.it.only` or `.fit` +- `.test.skip` to skip the parameterised tests + - Also under the aliases: `.it.skip` or `.xit` or `.xtest` +- `.test.concurrent` + - Also under the alias: `.it.concurrent` +- `.test.concurrent.only` + - Also under the alias: `.it.concurrent.only` +- `.test.concurrent.skip` + - Also under the alias: `.it.concurrent.skip` +- `.describe` to runs test suites with parameterised data +- `.describe.only` to only run the parameterised suite of tests + - Also under the aliases: `.fdescribe` +- `.describe.skip` to skip the parameterised suite of tests + - Also under the aliases: `.xdescribe` +- Asynchronous tests with `done` +- Unique test titles with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args): + - `%p` - [pretty-format](https://www.npmjs.com/package/pretty-format). + - `%s`- String. + - `%d`- Number. + - `%i` - Integer. + - `%f` - Floating point value. + - `%j` - JSON. + - `%o` - Object. + - `%#` - Index of the test case. + - `%%` - single percent sign ('%'). This does not consume an argument. +- Unique test titles by injecting properties of test case object +- 🖖 Spock like data tables with [Tagged Template Literals](#tagged-template-literal-of-rows) + +--- + +- [Demo](#demo) +- [Installation](#installation) +- [Importing](#importing) +- APIs + - [Array of Rows](#array-of-rows) + - [Usage](#usage) + - [Tagged Template Literal of rows](#tagged-template-literal-of-rows) + - [Usage](#usage-1) + +## Demo + +#### Tests without jest-each + +![Current jest tests](assets/default-demo.gif) + +#### Tests can be re-written with jest-each to: + +**`.test`** + +![Current jest tests](assets/test-demo.gif) + +**`.test` with Tagged Template Literals** + +![Current jest tests](assets/tagged-template-literal.gif) + +**`.describe`** + +![Current jest tests](assets/describe-demo.gif) + +## Installation + +`npm i --save-dev jest-each` + +`yarn add -D jest-each` + +## Importing + +jest-each is a default export so it can be imported with whatever name you like. + +```js +// es6 +import each from 'jest-each'; +``` + +```js +// es5 +const each = require('jest-each').default; +``` + +## Array of rows + +### API + +#### `each([parameters]).test(name, testFn)` + +##### `each`: + +- parameters: `Array` of Arrays with the arguments that are passed into the `testFn` for each row + - _Note_ If you pass in a 1D array of primitives, internally it will be mapped to a table i.e. `[1, 2, 3] -> [[1], [2], [3]]` + +##### `.test`: + +- name: `String` the title of the `test`. + - Generate unique test titles by positionally injecting parameters with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args): + - `%p` - [pretty-format](https://www.npmjs.com/package/pretty-format). + - `%s`- String. + - `%d`- Number. + - `%i` - Integer. + - `%f` - Floating point value. + - `%j` - JSON. + - `%o` - Object. + - `%#` - Index of the test case. + - `%%` - single percent sign ('%'). This does not consume an argument. + - Or generate unique test titles by injecting properties of test case object with `$variable` + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` + - You can use `$#` to inject the index of the test case + - You cannot use `$variable` with the `printf` formatting except for `%%` +- testFn: `Function` the test logic, this is the function that will receive the parameters of each row as function arguments + +#### `each([parameters]).describe(name, suiteFn)` + +##### `each`: + +- parameters: `Array` of Arrays with the arguments that are passed into the `suiteFn` for each row + - _Note_ If you pass in a 1D array of primitives, internally it will be mapped to a table i.e. `[1, 2, 3] -> [[1], [2], [3]]` + +##### `.describe`: + +- name: `String` the title of the `describe` + - Generate unique test titles by positionally injecting parameters with [`printf` formatting](https://nodejs.org/api/util.html#util_util_format_format_args): + - `%p` - [pretty-format](https://www.npmjs.com/package/pretty-format). + - `%s`- String. + - `%d`- Number. + - `%i` - Integer. + - `%f` - Floating point value. + - `%j` - JSON. + - `%o` - Object. + - `%#` - Index of the test case. + - `%%` - single percent sign ('%'). This does not consume an argument. + - Or generate unique test titles by injecting properties of test case object with `$variable` + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` + - You can use `$#` to inject the index of the test case + - You cannot use `$variable` with the `printf` formatting except for `%%` +- suiteFn: `Function` the suite of `test`/`it`s to be ran, this is the function that will receive the parameters in each row as function arguments + +### Usage + +#### `.test(name, fn)` + +Alias: `.it(name, fn)` + +```js +each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +]).test('returns the result of adding %d to %d', (a, b, expected) => { + expect(a + b).toBe(expected); +}); +``` + +```js +each([ + {a: 1, b: 1, expected: 2}, + {a: 1, b: 2, expected: 3}, + {a: 2, b: 1, expected: 3}, +]).test('returns the result of adding $a to $b', ({a, b, expected}) => { + expect(a + b).toBe(expected); +}); +``` + +#### `.test.only(name, fn)` + +Aliases: `.it.only(name, fn)` or `.fit(name, fn)` + +```js +each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +]).test.only('returns the result of adding %d to %d', (a, b, expected) => { + expect(a + b).toBe(expected); +}); +``` + +#### `.test.skip(name, fn)` + +Aliases: `.it.skip(name, fn)` or `.xit(name, fn)` or `.xtest(name, fn)` + +```js +each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +]).test.skip('returns the result of adding %d to %d', (a, b, expected) => { + expect(a + b).toBe(expected); +}); +``` + +#### `.test.concurrent(name, fn)` + +Aliases: `.it.concurrent(name, fn)` + +```js +each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +]).test.concurrent( + 'returns the result of adding %d to %d', + (a, b, expected) => { + expect(a + b).toBe(expected); + }, +); +``` + +#### `.test.concurrent.only(name, fn)` + +Aliases: `.it.concurrent.only(name, fn)` + +```js +each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +]).test.concurrent.only( + 'returns the result of adding %d to %d', + (a, b, expected) => { + expect(a + b).toBe(expected); + }, +); +``` + +#### `.test.concurrent.skip(name, fn)` + +Aliases: `.it.concurrent.skip(name, fn)` + +```js +each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +]).test.concurrent.skip( + 'returns the result of adding %d to %d', + (a, b, expected) => { + expect(a + b).toBe(expected); + }, +); +``` + +#### Asynchronous `.test(name, fn(done))` + +Alias: `.it(name, fn(done))` + +```js +each([['hello'], ['mr'], ['spy']]).test( + 'gives 007 secret message: %s', + (str, done) => { + const asynchronousSpy = message => { + expect(message).toBe(str); + done(); + }; + callSomeAsynchronousFunction(asynchronousSpy)(str); + }, +); +``` + +#### `.describe(name, fn)` + +```js +each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +]).describe('.add(%d, %d)', (a, b, expected) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); + + test('does not mutate first arg', () => { + a + b; + expect(a).toBe(a); + }); + + test('does not mutate second arg', () => { + a + b; + expect(b).toBe(b); + }); +}); +``` + +```js +each([ + {a: 1, b: 1, expected: 2}, + {a: 1, b: 2, expected: 3}, + {a: 2, b: 1, expected: 3}, +]).describe('.add($a, $b)', ({a, b, expected}) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); + + test('does not mutate first arg', () => { + a + b; + expect(a).toBe(a); + }); + + test('does not mutate second arg', () => { + a + b; + expect(b).toBe(b); + }); +}); +``` + +#### `.describe.only(name, fn)` + +Aliases: `.fdescribe(name, fn)` + +```js +each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +]).describe.only('.add(%d, %d)', (a, b, expected) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); +}); +``` + +#### `.describe.skip(name, fn)` + +Aliases: `.xdescribe(name, fn)` + +```js +each([ + [1, 1, 2], + [1, 2, 3], + [2, 1, 3], +]).describe.skip('.add(%d, %d)', (a, b, expected) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); +}); +``` + +--- + +## Tagged Template Literal of rows + +### API + +#### `each[tagged template].test(name, suiteFn)` + +```js +each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`.test('returns $expected when adding $a to $b', ({a, b, expected}) => { + expect(a + b).toBe(expected); +}); +``` + +##### `each` takes a tagged template string with: + +- First row of variable name column headings separated with `|` +- One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. + +##### `.test`: + +- name: `String` the title of the `test`, use `$variable` in the name string to inject test values into the test title from the tagged template expressions + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` + - You can use `$#` to inject the index of the table row. +- testFn: `Function` the test logic, this is the function that will receive the parameters of each row as function arguments + +#### `each[tagged template].describe(name, suiteFn)` + +```js +each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`.describe('$a + $b', ({a, b, expected}) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); + + test('does not mutate first arg', () => { + a + b; + expect(a).toBe(a); + }); + + test('does not mutate second arg', () => { + a + b; + expect(b).toBe(b); + }); +}); +``` + +##### `each` takes a tagged template string with: + +- First row of variable name column headings separated with `|` +- One or more subsequent rows of data supplied as template literal expressions using `${value}` syntax. + +##### `.describe`: + +- name: `String` the title of the `test`, use `$variable` in the name string to inject test values into the test title from the tagged template expressions + - To inject nested object values use you can supply a keyPath i.e. `$variable.path.to.value` +- suiteFn: `Function` the suite of `test`/`it`s to be ran, this is the function that will receive the parameters in each row as function arguments + +### Usage + +#### `.test(name, fn)` + +Alias: `.it(name, fn)` + +```js +each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`.test('returns $expected when adding $a to $b', ({a, b, expected}) => { + expect(a + b).toBe(expected); +}); +``` + +#### `.test.only(name, fn)` + +Aliases: `.it.only(name, fn)` or `.fit(name, fn)` + +```js +each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`.test.only('returns $expected when adding $a to $b', ({a, b, expected}) => { + expect(a + b).toBe(expected); +}); +``` + +#### `.test.skip(name, fn)` + +Aliases: `.it.skip(name, fn)` or `.xit(name, fn)` or `.xtest(name, fn)` + +```js +each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`.test.skip('returns $expected when adding $a to $b', ({a, b, expected}) => { + expect(a + b).toBe(expected); +}); +``` + +#### Asynchronous `.test(name, fn(done))` + +Alias: `.it(name, fn(done))` + +```js +each` + str + ${'hello'} + ${'mr'} + ${'spy'} +`.test('gives 007 secret message: $str', ({str}, done) => { + const asynchronousSpy = message => { + expect(message).toBe(str); + done(); + }; + callSomeAsynchronousFunction(asynchronousSpy)(str); +}); +``` + +#### `.describe(name, fn)` + +```js +each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`.describe('$a + $b', ({a, b, expected}) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); + + test('does not mutate first arg', () => { + a + b; + expect(a).toBe(a); + }); + + test('does not mutate second arg', () => { + a + b; + expect(b).toBe(b); + }); +}); +``` + +#### `.describe.only(name, fn)` + +Aliases: `.fdescribe(name, fn)` + +```js +each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`.describe.only('$a + $b', ({a, b, expected}) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); +}); +``` + +#### `.describe.skip(name, fn)` + +Aliases: `.xdescribe(name, fn)` + +```js +each` + a | b | expected + ${1} | ${1} | ${2} + ${1} | ${2} | ${3} + ${2} | ${1} | ${3} +`.describe.skip('$a + $b', ({a, b, expected}) => { + test(`returns ${expected}`, () => { + expect(a + b).toBe(expected); + }); +}); +``` + +## License + +MIT diff --git a/node_modules/jest-each/build/bind.js b/node_modules/jest-each/build/bind.js new file mode 100644 index 00000000..8e042063 --- /dev/null +++ b/node_modules/jest-each/build/bind.js @@ -0,0 +1,81 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = bind; +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +var _array = _interopRequireDefault(require('./table/array')); +var _template = _interopRequireDefault(require('./table/template')); +var _validation = require('./validation'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +// type TestFn = (done?: Global.DoneFn) => Promise | void | undefined; + +function bind(cb, supportsDone = true, needsEachError = false) { + const bindWrap = (table, ...taggedTemplateData) => { + const error = new (_jestUtil().ErrorWithStack)(undefined, bindWrap); + return function eachBind(title, test, timeout) { + title = (0, _jestUtil().convertDescriptorToString)(title); + try { + const tests = isArrayTable(taggedTemplateData) + ? buildArrayTests(title, table) + : buildTemplateTests(title, table, taggedTemplateData); + return tests.forEach(row => + needsEachError + ? cb( + row.title, + applyArguments(supportsDone, row.arguments, test), + timeout, + error + ) + : cb( + row.title, + applyArguments(supportsDone, row.arguments, test), + timeout + ) + ); + } catch (e) { + const err = new Error(e.message); + err.stack = error.stack?.replace(/^Error: /s, `Error: ${e.message}`); + return cb(title, () => { + throw err; + }); + } + }; + }; + return bindWrap; +} +const isArrayTable = data => data.length === 0; +const buildArrayTests = (title, table) => { + (0, _validation.validateArrayTable)(table); + return (0, _array.default)(title, table); +}; +const buildTemplateTests = (title, table, taggedTemplateData) => { + const headings = getHeadingKeys(table[0]); + (0, _validation.validateTemplateTableArguments)(headings, taggedTemplateData); + return (0, _template.default)(title, headings, taggedTemplateData); +}; +const getHeadingKeys = headings => + (0, _validation.extractValidTemplateHeadings)(headings) + .replace(/\s/g, '') + .split('|'); +const applyArguments = (supportsDone, params, test) => + supportsDone && params.length < test.length + ? done => test(...params, done) + : () => test(...params); diff --git a/node_modules/jest-each/build/index.d.ts b/node_modules/jest-each/build/index.d.ts new file mode 100644 index 00000000..86ca927b --- /dev/null +++ b/node_modules/jest-each/build/index.d.ts @@ -0,0 +1,141 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {Global} from '@jest/types'; + +export declare function bind( + cb: GlobalCallback, + supportsDone?: boolean, + needsEachError?: boolean, +): Global.EachTestFn; + +declare const each: { + (table: Global.EachTable, ...data: Global.TemplateData): ReturnType< + typeof install + >; + withGlobal(g: Global): ( + table: Global.EachTable, + ...data: Global.TemplateData + ) => { + describe: { + ( + title: string, + suite: Global.EachTestFn, + timeout?: number, + ): any; + skip: any; + only: any; + }; + fdescribe: any; + fit: any; + it: { + ( + title: string, + test: Global.EachTestFn, + timeout?: number, + ): any; + skip: any; + only: any; + concurrent: { + ( + title: string, + test: Global.EachTestFn, + timeout?: number, + ): any; + only: any; + skip: any; + }; + }; + test: { + ( + title: string, + test: Global.EachTestFn, + timeout?: number, + ): any; + skip: any; + only: any; + concurrent: { + ( + title: string, + test: Global.EachTestFn, + timeout?: number, + ): any; + only: any; + skip: any; + }; + }; + xdescribe: any; + xit: any; + xtest: any; + }; +}; +export default each; + +declare type GlobalCallback = ( + testName: string, + fn: Global.ConcurrentTestFn, + timeout?: number, + eachError?: Error, +) => void; + +declare const install: ( + g: Global, + table: Global.EachTable, + ...data: Global.TemplateData +) => { + describe: { + ( + title: string, + suite: Global.EachTestFn, + timeout?: number, + ): any; + skip: any; + only: any; + }; + fdescribe: any; + fit: any; + it: { + ( + title: string, + test: Global.EachTestFn, + timeout?: number, + ): any; + skip: any; + only: any; + concurrent: { + ( + title: string, + test: Global.EachTestFn, + timeout?: number, + ): any; + only: any; + skip: any; + }; + }; + test: { + ( + title: string, + test: Global.EachTestFn, + timeout?: number, + ): any; + skip: any; + only: any; + concurrent: { + ( + title: string, + test: Global.EachTestFn, + timeout?: number, + ): any; + only: any; + skip: any; + }; + }; + xdescribe: any; + xit: any; + xtest: any; +}; + +export {}; diff --git a/node_modules/jest-each/build/index.js b/node_modules/jest-each/build/index.js new file mode 100644 index 00000000..56de956d --- /dev/null +++ b/node_modules/jest-each/build/index.js @@ -0,0 +1,83 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +Object.defineProperty(exports, 'bind', { + enumerable: true, + get: function () { + return _bind.default; + } +}); +exports.default = void 0; +var _bind = _interopRequireDefault(require('./bind')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +const install = (g, table, ...data) => { + const bindingWithArray = data.length === 0; + const bindingWithTemplate = Array.isArray(table) && !!table.raw; + if (!bindingWithArray && !bindingWithTemplate) { + throw new Error( + '`.each` must only be called with an Array or Tagged Template Literal.' + ); + } + const test = (title, test, timeout) => + (0, _bind.default)(g.test)(table, ...data)(title, test, timeout); + test.skip = (0, _bind.default)(g.test.skip)(table, ...data); + test.only = (0, _bind.default)(g.test.only)(table, ...data); + const testConcurrent = (title, test, timeout) => + (0, _bind.default)(g.test.concurrent)(table, ...data)(title, test, timeout); + test.concurrent = testConcurrent; + testConcurrent.only = (0, _bind.default)(g.test.concurrent.only)( + table, + ...data + ); + testConcurrent.skip = (0, _bind.default)(g.test.concurrent.skip)( + table, + ...data + ); + const it = (title, test, timeout) => + (0, _bind.default)(g.it)(table, ...data)(title, test, timeout); + it.skip = (0, _bind.default)(g.it.skip)(table, ...data); + it.only = (0, _bind.default)(g.it.only)(table, ...data); + it.concurrent = testConcurrent; + const xit = (0, _bind.default)(g.xit)(table, ...data); + const fit = (0, _bind.default)(g.fit)(table, ...data); + const xtest = (0, _bind.default)(g.xtest)(table, ...data); + const describe = (title, suite, timeout) => + (0, _bind.default)(g.describe, false)(table, ...data)( + title, + suite, + timeout + ); + describe.skip = (0, _bind.default)(g.describe.skip, false)(table, ...data); + describe.only = (0, _bind.default)(g.describe.only, false)(table, ...data); + const fdescribe = (0, _bind.default)(g.fdescribe, false)(table, ...data); + const xdescribe = (0, _bind.default)(g.xdescribe, false)(table, ...data); + return { + describe, + fdescribe, + fit, + it, + test, + xdescribe, + xit, + xtest + }; +}; +const each = (table, ...data) => install(globalThis, table, ...data); +each.withGlobal = + g => + (table, ...data) => + install(g, table, ...data); +var _default = each; +exports.default = _default; diff --git a/node_modules/jest-each/build/table/array.js b/node_modules/jest-each/build/table/array.js new file mode 100644 index 00000000..a0251565 --- /dev/null +++ b/node_modules/jest-each/build/table/array.js @@ -0,0 +1,130 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = array; +function util() { + const data = _interopRequireWildcard(require('util')); + util = function () { + return data; + }; + return data; +} +function _prettyFormat() { + const data = require('pretty-format'); + _prettyFormat = function () { + return data; + }; + return data; +} +var _interpolation = require('./interpolation'); +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +const SUPPORTED_PLACEHOLDERS = /%[sdifjoOp#]/g; +const PRETTY_PLACEHOLDER = '%p'; +const INDEX_PLACEHOLDER = '%#'; +const PLACEHOLDER_PREFIX = '%'; +const ESCAPED_PLACEHOLDER_PREFIX = /%%/g; +const JEST_EACH_PLACEHOLDER_ESCAPE = '@@__JEST_EACH_PLACEHOLDER_ESCAPE__@@'; +function array(title, arrayTable) { + if (isTemplates(title, arrayTable)) { + return arrayTable.map((template, index) => ({ + arguments: [template], + title: (0, _interpolation.interpolateVariables)( + title, + template, + index + ).replace(ESCAPED_PLACEHOLDER_PREFIX, PLACEHOLDER_PREFIX) + })); + } + return normaliseTable(arrayTable).map((row, index) => ({ + arguments: row, + title: formatTitle(title, row, index) + })); +} +const isTemplates = (title, arrayTable) => + !SUPPORTED_PLACEHOLDERS.test(interpolateEscapedPlaceholders(title)) && + !isTable(arrayTable) && + arrayTable.every(col => col != null && typeof col === 'object'); +const normaliseTable = table => (isTable(table) ? table : table.map(colToRow)); +const isTable = table => table.every(Array.isArray); +const colToRow = col => [col]; +const formatTitle = (title, row, rowIndex) => + row + .reduce((formattedTitle, value) => { + const [placeholder] = getMatchingPlaceholders(formattedTitle); + const normalisedValue = normalisePlaceholderValue(value); + if (!placeholder) return formattedTitle; + if (placeholder === PRETTY_PLACEHOLDER) + return interpolatePrettyPlaceholder(formattedTitle, normalisedValue); + return util().format(formattedTitle, normalisedValue); + }, interpolateTitleIndex(interpolateEscapedPlaceholders(title), rowIndex)) + .replace(new RegExp(JEST_EACH_PLACEHOLDER_ESCAPE, 'g'), PLACEHOLDER_PREFIX); +const normalisePlaceholderValue = value => + typeof value === 'string' + ? value.replace( + new RegExp(PLACEHOLDER_PREFIX, 'g'), + JEST_EACH_PLACEHOLDER_ESCAPE + ) + : value; +const getMatchingPlaceholders = title => + title.match(SUPPORTED_PLACEHOLDERS) || []; +const interpolateEscapedPlaceholders = title => + title.replace(ESCAPED_PLACEHOLDER_PREFIX, JEST_EACH_PLACEHOLDER_ESCAPE); +const interpolateTitleIndex = (title, index) => + title.replace(INDEX_PLACEHOLDER, index.toString()); +const interpolatePrettyPlaceholder = (title, value) => + title.replace( + PRETTY_PLACEHOLDER, + (0, _prettyFormat().format)(value, { + maxDepth: 1, + min: true + }) + ); diff --git a/node_modules/jest-each/build/table/interpolation.js b/node_modules/jest-each/build/table/interpolation.js new file mode 100644 index 00000000..acf63070 --- /dev/null +++ b/node_modules/jest-each/build/table/interpolation.js @@ -0,0 +1,53 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.getPath = getPath; +exports.interpolateVariables = void 0; +function _jestGetType() { + const data = require('jest-get-type'); + _jestGetType = function () { + return data; + }; + return data; +} +function _prettyFormat() { + const data = require('pretty-format'); + _prettyFormat = function () { + return data; + }; + return data; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +const interpolateVariables = (title, template, index) => + title + .replace( + new RegExp(`\\$(${Object.keys(template).join('|')})[.\\w]*`, 'g'), + match => { + const keyPath = match.slice(1).split('.'); + const value = getPath(template, keyPath); + return (0, _jestGetType().isPrimitive)(value) + ? String(value) + : (0, _prettyFormat().format)(value, { + maxDepth: 1, + min: true + }); + } + ) + .replace('$#', `${index}`); + +/* eslint import/export: 0*/ +exports.interpolateVariables = interpolateVariables; +function getPath(template, [head, ...tail]) { + if (!head || !Object.prototype.hasOwnProperty.call(template, head)) + return template; + return getPath(template[head], tail); +} diff --git a/node_modules/jest-each/build/table/template.js b/node_modules/jest-each/build/table/template.js new file mode 100644 index 00000000..49b84ca2 --- /dev/null +++ b/node_modules/jest-each/build/table/template.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = template; +var _interpolation = require('./interpolation'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +function template(title, headings, row) { + const table = convertRowToTable(row, headings); + const templates = convertTableToTemplates(table, headings); + return templates.map((template, index) => ({ + arguments: [template], + title: (0, _interpolation.interpolateVariables)(title, template, index) + })); +} +const convertRowToTable = (row, headings) => + Array.from( + { + length: row.length / headings.length + }, + (_, index) => + row.slice( + index * headings.length, + index * headings.length + headings.length + ) + ); +const convertTableToTemplates = (table, headings) => + table.map(row => + row.reduce( + (acc, value, index) => + Object.assign(acc, { + [headings[index]]: value + }), + {} + ) + ); diff --git a/node_modules/jest-each/build/validation.js b/node_modules/jest-each/build/validation.js new file mode 100644 index 00000000..9f421dbc --- /dev/null +++ b/node_modules/jest-each/build/validation.js @@ -0,0 +1,107 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.validateTemplateTableArguments = + exports.validateArrayTable = + exports.extractValidTemplateHeadings = + void 0; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _prettyFormat() { + const data = require('pretty-format'); + _prettyFormat = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +const EXPECTED_COLOR = _chalk().default.green; +const RECEIVED_COLOR = _chalk().default.red; +const validateArrayTable = table => { + if (!Array.isArray(table)) { + throw new Error( + '`.each` must be called with an Array or Tagged Template Literal.\n\n' + + `Instead was called with: ${(0, _prettyFormat().format)(table, { + maxDepth: 1, + min: true + })}\n` + ); + } + if (isTaggedTemplateLiteral(table)) { + if (isEmptyString(table[0])) { + throw new Error( + 'Error: `.each` called with an empty Tagged Template Literal of table data.\n' + ); + } + throw new Error( + 'Error: `.each` called with a Tagged Template Literal with no data, remember to interpolate with ${expression} syntax.\n' + ); + } + if (isEmptyTable(table)) { + throw new Error( + 'Error: `.each` called with an empty Array of table data.\n' + ); + } +}; +exports.validateArrayTable = validateArrayTable; +const isTaggedTemplateLiteral = array => array.raw !== undefined; +const isEmptyTable = table => table.length === 0; +const isEmptyString = str => typeof str === 'string' && str.trim() === ''; +const validateTemplateTableArguments = (headings, data) => { + const incompleteData = data.length % headings.length; + const missingData = headings.length - incompleteData; + if (incompleteData > 0) { + throw new Error( + `Not enough arguments supplied for given headings:\n${EXPECTED_COLOR( + headings.join(' | ') + )}\n\n` + + `Received:\n${RECEIVED_COLOR((0, _prettyFormat().format)(data))}\n\n` + + `Missing ${RECEIVED_COLOR(missingData.toString())} ${pluralize( + 'argument', + missingData + )}` + ); + } +}; +exports.validateTemplateTableArguments = validateTemplateTableArguments; +const pluralize = (word, count) => word + (count === 1 ? '' : 's'); +const START_OF_LINE = '^'; +const NEWLINE = '\\n'; +const HEADING = '\\s*[^\\s]+\\s*'; +const PIPE = '\\|'; +const REPEATABLE_HEADING = `(${PIPE}${HEADING})*`; +const HEADINGS_FORMAT = new RegExp( + START_OF_LINE + NEWLINE + HEADING + REPEATABLE_HEADING + NEWLINE, + 'g' +); +const extractValidTemplateHeadings = headings => { + const matches = headings.match(HEADINGS_FORMAT); + if (matches === null) { + throw new Error( + `Table headings do not conform to expected format:\n\n${EXPECTED_COLOR( + 'heading1 | headingN' + )}\n\nReceived:\n\n${RECEIVED_COLOR( + (0, _prettyFormat().format)(headings) + )}` + ); + } + return matches[0]; +}; +exports.extractValidTemplateHeadings = extractValidTemplateHeadings; diff --git a/node_modules/jest-each/package.json b/node_modules/jest-each/package.json new file mode 100644 index 00000000..a271f71b --- /dev/null +++ b/node_modules/jest-each/package.json @@ -0,0 +1,41 @@ +{ + "name": "jest-each", + "version": "29.7.0", + "description": "Parameterised tests for Jest", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-each" + }, + "keywords": [ + "jest", + "parameterised", + "test", + "each" + ], + "author": "Matt Phillips (mattphillips)", + "license": "MIT", + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-environment-node/LICENSE b/node_modules/jest-environment-node/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-environment-node/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-environment-node/build/index.d.ts b/node_modules/jest-environment-node/build/index.d.ts new file mode 100644 index 00000000..11bf4d10 --- /dev/null +++ b/node_modules/jest-environment-node/build/index.d.ts @@ -0,0 +1,42 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// + +import {Context} from 'vm'; +import type {EnvironmentContext} from '@jest/environment'; +import type {Global} from '@jest/types'; +import type {JestEnvironment} from '@jest/environment'; +import type {JestEnvironmentConfig} from '@jest/environment'; +import {LegacyFakeTimers} from '@jest/fake-timers'; +import {ModernFakeTimers} from '@jest/fake-timers'; +import {ModuleMocker} from 'jest-mock'; + +declare class NodeEnvironment implements JestEnvironment { + context: Context | null; + fakeTimers: LegacyFakeTimers | null; + fakeTimersModern: ModernFakeTimers | null; + global: Global.Global; + moduleMocker: ModuleMocker | null; + customExportConditions: string[]; + private _configuredExportConditions?; + constructor(config: JestEnvironmentConfig, _context: EnvironmentContext); + setup(): Promise; + teardown(): Promise; + exportConditions(): Array; + getVmContext(): Context | null; +} +export default NodeEnvironment; + +export declare const TestEnvironment: typeof NodeEnvironment; + +declare type Timer = { + id: number; + ref: () => Timer; + unref: () => Timer; +}; + +export {}; diff --git a/node_modules/jest-environment-node/build/index.js b/node_modules/jest-environment-node/build/index.js new file mode 100644 index 00000000..5be7c088 --- /dev/null +++ b/node_modules/jest-environment-node/build/index.js @@ -0,0 +1,212 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = exports.TestEnvironment = void 0; +function _vm() { + const data = require('vm'); + _vm = function () { + return data; + }; + return data; +} +function _fakeTimers() { + const data = require('@jest/fake-timers'); + _fakeTimers = function () { + return data; + }; + return data; +} +function _jestMock() { + const data = require('jest-mock'); + _jestMock = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// some globals we do not want, either because deprecated or we set it ourselves +const denyList = new Set([ + 'GLOBAL', + 'root', + 'global', + 'globalThis', + 'Buffer', + 'ArrayBuffer', + 'Uint8Array', + // if env is loaded within a jest test + 'jest-symbol-do-not-touch' +]); +const nodeGlobals = new Map( + Object.getOwnPropertyNames(globalThis) + .filter(global => !denyList.has(global)) + .map(nodeGlobalsKey => { + const descriptor = Object.getOwnPropertyDescriptor( + globalThis, + nodeGlobalsKey + ); + if (!descriptor) { + throw new Error( + `No property descriptor for ${nodeGlobalsKey}, this is a bug in Jest.` + ); + } + return [nodeGlobalsKey, descriptor]; + }) +); +function isString(value) { + return typeof value === 'string'; +} +class NodeEnvironment { + context; + fakeTimers; + fakeTimersModern; + global; + moduleMocker; + customExportConditions = ['node', 'node-addons']; + _configuredExportConditions; + + // while `context` is unused, it should always be passed + constructor(config, _context) { + const {projectConfig} = config; + this.context = (0, _vm().createContext)(); + const global = (0, _vm().runInContext)( + 'this', + Object.assign(this.context, projectConfig.testEnvironmentOptions) + ); + this.global = global; + const contextGlobals = new Set(Object.getOwnPropertyNames(global)); + for (const [nodeGlobalsKey, descriptor] of nodeGlobals) { + if (!contextGlobals.has(nodeGlobalsKey)) { + if (descriptor.configurable) { + Object.defineProperty(global, nodeGlobalsKey, { + configurable: true, + enumerable: descriptor.enumerable, + get() { + const value = globalThis[nodeGlobalsKey]; + + // override lazy getter + Object.defineProperty(global, nodeGlobalsKey, { + configurable: true, + enumerable: descriptor.enumerable, + value, + writable: true + }); + return value; + }, + set(value) { + // override lazy getter + Object.defineProperty(global, nodeGlobalsKey, { + configurable: true, + enumerable: descriptor.enumerable, + value, + writable: true + }); + } + }); + } else if ('value' in descriptor) { + Object.defineProperty(global, nodeGlobalsKey, { + configurable: false, + enumerable: descriptor.enumerable, + value: descriptor.value, + writable: descriptor.writable + }); + } else { + Object.defineProperty(global, nodeGlobalsKey, { + configurable: false, + enumerable: descriptor.enumerable, + get: descriptor.get, + set: descriptor.set + }); + } + } + } + + // @ts-expect-error - Buffer and gc is "missing" + global.global = global; + global.Buffer = Buffer; + global.ArrayBuffer = ArrayBuffer; + // TextEncoder (global or via 'util') references a Uint8Array constructor + // different than the global one used by users in tests. This makes sure the + // same constructor is referenced by both. + global.Uint8Array = Uint8Array; + (0, _jestUtil().installCommonGlobals)(global, projectConfig.globals); + + // Node's error-message stack size is limited at 10, but it's pretty useful + // to see more than that when a test fails. + global.Error.stackTraceLimit = 100; + if ('customExportConditions' in projectConfig.testEnvironmentOptions) { + const {customExportConditions} = projectConfig.testEnvironmentOptions; + if ( + Array.isArray(customExportConditions) && + customExportConditions.every(isString) + ) { + this._configuredExportConditions = customExportConditions; + } else { + throw new Error( + 'Custom export conditions specified but they are not an array of strings' + ); + } + } + this.moduleMocker = new (_jestMock().ModuleMocker)(global); + const timerIdToRef = id => ({ + id, + ref() { + return this; + }, + unref() { + return this; + } + }); + const timerRefToId = timer => timer?.id; + this.fakeTimers = new (_fakeTimers().LegacyFakeTimers)({ + config: projectConfig, + global, + moduleMocker: this.moduleMocker, + timerConfig: { + idToRef: timerIdToRef, + refToId: timerRefToId + } + }); + this.fakeTimersModern = new (_fakeTimers().ModernFakeTimers)({ + config: projectConfig, + global + }); + } + + // eslint-disable-next-line @typescript-eslint/no-empty-function + async setup() {} + async teardown() { + if (this.fakeTimers) { + this.fakeTimers.dispose(); + } + if (this.fakeTimersModern) { + this.fakeTimersModern.dispose(); + } + this.context = null; + this.fakeTimers = null; + this.fakeTimersModern = null; + } + exportConditions() { + return this._configuredExportConditions ?? this.customExportConditions; + } + getVmContext() { + return this.context; + } +} +exports.default = NodeEnvironment; +const TestEnvironment = NodeEnvironment; +exports.TestEnvironment = TestEnvironment; diff --git a/node_modules/jest-environment-node/package.json b/node_modules/jest-environment-node/package.json new file mode 100644 index 00000000..c1c7d197 --- /dev/null +++ b/node_modules/jest-environment-node/package.json @@ -0,0 +1,37 @@ +{ + "name": "jest-environment-node", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-environment-node" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "devDependencies": { + "@jest/test-utils": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-get-type/LICENSE b/node_modules/jest-get-type/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-get-type/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-get-type/build/index.d.ts b/node_modules/jest-get-type/build/index.d.ts new file mode 100644 index 00000000..20931392 --- /dev/null +++ b/node_modules/jest-get-type/build/index.d.ts @@ -0,0 +1,27 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare function getType(value: unknown): ValueType; + +export declare const isPrimitive: (value: unknown) => boolean; + +declare type ValueType = + | 'array' + | 'bigint' + | 'boolean' + | 'function' + | 'null' + | 'number' + | 'object' + | 'regexp' + | 'map' + | 'set' + | 'date' + | 'string' + | 'symbol' + | 'undefined'; + +export {}; diff --git a/node_modules/jest-get-type/build/index.js b/node_modules/jest-get-type/build/index.js new file mode 100644 index 00000000..3368978e --- /dev/null +++ b/node_modules/jest-get-type/build/index.js @@ -0,0 +1,53 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.getType = getType; +exports.isPrimitive = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// get the type of a value with handling the edge cases like `typeof []` +// and `typeof null` +function getType(value) { + if (value === undefined) { + return 'undefined'; + } else if (value === null) { + return 'null'; + } else if (Array.isArray(value)) { + return 'array'; + } else if (typeof value === 'boolean') { + return 'boolean'; + } else if (typeof value === 'function') { + return 'function'; + } else if (typeof value === 'number') { + return 'number'; + } else if (typeof value === 'string') { + return 'string'; + } else if (typeof value === 'bigint') { + return 'bigint'; + } else if (typeof value === 'object') { + if (value != null) { + if (value.constructor === RegExp) { + return 'regexp'; + } else if (value.constructor === Map) { + return 'map'; + } else if (value.constructor === Set) { + return 'set'; + } else if (value.constructor === Date) { + return 'date'; + } + } + return 'object'; + } else if (typeof value === 'symbol') { + return 'symbol'; + } + throw new Error(`value of unknown type: ${value}`); +} +const isPrimitive = value => Object(value) !== value; +exports.isPrimitive = isPrimitive; diff --git a/node_modules/jest-get-type/package.json b/node_modules/jest-get-type/package.json new file mode 100644 index 00000000..ffd8a152 --- /dev/null +++ b/node_modules/jest-get-type/package.json @@ -0,0 +1,27 @@ +{ + "name": "jest-get-type", + "description": "A utility function to get the type of a value", + "version": "29.6.3", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-get-type" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "fb7d95c8af6e0d65a8b65348433d8a0ea0725b5b" +} diff --git a/node_modules/jest-haste-map/LICENSE b/node_modules/jest-haste-map/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-haste-map/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-haste-map/build/HasteFS.js b/node_modules/jest-haste-map/build/HasteFS.js new file mode 100644 index 00000000..09384ba5 --- /dev/null +++ b/node_modules/jest-haste-map/build/HasteFS.js @@ -0,0 +1,139 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +var _constants = _interopRequireDefault(require('./constants')); +var fastPath = _interopRequireWildcard(require('./lib/fast_path')); +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class HasteFS { + _rootDir; + _files; + constructor({rootDir, files}) { + this._rootDir = rootDir; + this._files = files; + } + getModuleName(file) { + const fileMetadata = this._getFileData(file); + return (fileMetadata && fileMetadata[_constants.default.ID]) || null; + } + getSize(file) { + const fileMetadata = this._getFileData(file); + return (fileMetadata && fileMetadata[_constants.default.SIZE]) || null; + } + getDependencies(file) { + const fileMetadata = this._getFileData(file); + if (fileMetadata) { + return fileMetadata[_constants.default.DEPENDENCIES] + ? fileMetadata[_constants.default.DEPENDENCIES].split( + _constants.default.DEPENDENCY_DELIM + ) + : []; + } else { + return null; + } + } + getSha1(file) { + const fileMetadata = this._getFileData(file); + return (fileMetadata && fileMetadata[_constants.default.SHA1]) || null; + } + exists(file) { + return this._getFileData(file) != null; + } + getAllFiles() { + return Array.from(this.getAbsoluteFileIterator()); + } + getFileIterator() { + return this._files.keys(); + } + *getAbsoluteFileIterator() { + for (const file of this.getFileIterator()) { + yield fastPath.resolve(this._rootDir, file); + } + } + matchFiles(pattern) { + if (!(pattern instanceof RegExp)) { + pattern = new RegExp(pattern); + } + const files = []; + for (const file of this.getAbsoluteFileIterator()) { + if (pattern.test(file)) { + files.push(file); + } + } + return files; + } + matchFilesWithGlob(globs, root) { + const files = new Set(); + const matcher = (0, _jestUtil().globsToMatcher)(globs); + for (const file of this.getAbsoluteFileIterator()) { + const filePath = root ? fastPath.relative(root, file) : file; + if (matcher((0, _jestUtil().replacePathSepForGlob)(filePath))) { + files.add(file); + } + } + return files; + } + _getFileData(file) { + const relativePath = fastPath.relative(this._rootDir, file); + return this._files.get(relativePath); + } +} +exports.default = HasteFS; diff --git a/node_modules/jest-haste-map/build/ModuleMap.js b/node_modules/jest-haste-map/build/ModuleMap.js new file mode 100644 index 00000000..5ddd1fd8 --- /dev/null +++ b/node_modules/jest-haste-map/build/ModuleMap.js @@ -0,0 +1,249 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _constants = _interopRequireDefault(require('./constants')); +var fastPath = _interopRequireWildcard(require('./lib/fast_path')); +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const EMPTY_OBJ = {}; +const EMPTY_MAP = new Map(); +class ModuleMap { + static DuplicateHasteCandidatesError; + _raw; + json; + static mapToArrayRecursive(map) { + let arr = Array.from(map); + if (arr[0] && arr[0][1] instanceof Map) { + arr = arr.map(el => [el[0], this.mapToArrayRecursive(el[1])]); + } + return arr; + } + static mapFromArrayRecursive(arr) { + if (arr[0] && Array.isArray(arr[1])) { + arr = arr.map(el => [el[0], this.mapFromArrayRecursive(el[1])]); + } + return new Map(arr); + } + constructor(raw) { + this._raw = raw; + } + getModule(name, platform, supportsNativePlatform, type) { + if (type == null) { + type = _constants.default.MODULE; + } + const module = this._getModuleMetadata( + name, + platform, + !!supportsNativePlatform + ); + if (module && module[_constants.default.TYPE] === type) { + const modulePath = module[_constants.default.PATH]; + return modulePath && fastPath.resolve(this._raw.rootDir, modulePath); + } + return null; + } + getPackage(name, platform, _supportsNativePlatform) { + return this.getModule(name, platform, null, _constants.default.PACKAGE); + } + getMockModule(name) { + const mockPath = + this._raw.mocks.get(name) || this._raw.mocks.get(`${name}/index`); + return mockPath && fastPath.resolve(this._raw.rootDir, mockPath); + } + getRawModuleMap() { + return { + duplicates: this._raw.duplicates, + map: this._raw.map, + mocks: this._raw.mocks, + rootDir: this._raw.rootDir + }; + } + toJSON() { + if (!this.json) { + this.json = { + duplicates: ModuleMap.mapToArrayRecursive(this._raw.duplicates), + map: Array.from(this._raw.map), + mocks: Array.from(this._raw.mocks), + rootDir: this._raw.rootDir + }; + } + return this.json; + } + static fromJSON(serializableModuleMap) { + return new ModuleMap({ + duplicates: ModuleMap.mapFromArrayRecursive( + serializableModuleMap.duplicates + ), + map: new Map(serializableModuleMap.map), + mocks: new Map(serializableModuleMap.mocks), + rootDir: serializableModuleMap.rootDir + }); + } + + /** + * When looking up a module's data, we walk through each eligible platform for + * the query. For each platform, we want to check if there are known + * duplicates for that name+platform pair. The duplication logic normally + * removes elements from the `map` object, but we want to check upfront to be + * extra sure. If metadata exists both in the `duplicates` object and the + * `map`, this would be a bug. + */ + _getModuleMetadata(name, platform, supportsNativePlatform) { + const map = this._raw.map.get(name) || EMPTY_OBJ; + const dupMap = this._raw.duplicates.get(name) || EMPTY_MAP; + if (platform != null) { + this._assertNoDuplicates( + name, + platform, + supportsNativePlatform, + dupMap.get(platform) + ); + if (map[platform] != null) { + return map[platform]; + } + } + if (supportsNativePlatform) { + this._assertNoDuplicates( + name, + _constants.default.NATIVE_PLATFORM, + supportsNativePlatform, + dupMap.get(_constants.default.NATIVE_PLATFORM) + ); + if (map[_constants.default.NATIVE_PLATFORM]) { + return map[_constants.default.NATIVE_PLATFORM]; + } + } + this._assertNoDuplicates( + name, + _constants.default.GENERIC_PLATFORM, + supportsNativePlatform, + dupMap.get(_constants.default.GENERIC_PLATFORM) + ); + if (map[_constants.default.GENERIC_PLATFORM]) { + return map[_constants.default.GENERIC_PLATFORM]; + } + return null; + } + _assertNoDuplicates(name, platform, supportsNativePlatform, relativePathSet) { + if (relativePathSet == null) { + return; + } + // Force flow refinement + const previousSet = relativePathSet; + const duplicates = new Map(); + for (const [relativePath, type] of previousSet) { + const duplicatePath = fastPath.resolve(this._raw.rootDir, relativePath); + duplicates.set(duplicatePath, type); + } + throw new DuplicateHasteCandidatesError( + name, + platform, + supportsNativePlatform, + duplicates + ); + } + static create(rootDir) { + return new ModuleMap({ + duplicates: new Map(), + map: new Map(), + mocks: new Map(), + rootDir + }); + } +} +exports.default = ModuleMap; +class DuplicateHasteCandidatesError extends Error { + hasteName; + platform; + supportsNativePlatform; + duplicatesSet; + constructor(name, platform, supportsNativePlatform, duplicatesSet) { + const platformMessage = getPlatformMessage(platform); + super( + `The name \`${name}\` was looked up in the Haste module map. It ` + + 'cannot be resolved, because there exists several different ' + + 'files, or packages, that provide a module for ' + + `that particular name and platform. ${platformMessage} You must ` + + `delete or exclude files until there remains only one of these:\n\n${Array.from( + duplicatesSet + ) + .map( + ([dupFilePath, dupFileType]) => + ` * \`${dupFilePath}\` (${getTypeMessage(dupFileType)})\n` + ) + .sort() + .join('')}` + ); + this.hasteName = name; + this.platform = platform; + this.supportsNativePlatform = supportsNativePlatform; + this.duplicatesSet = duplicatesSet; + } +} +function getPlatformMessage(platform) { + if (platform === _constants.default.GENERIC_PLATFORM) { + return 'The platform is generic (no extension).'; + } + return `The platform extension is \`${platform}\`.`; +} +function getTypeMessage(type) { + switch (type) { + case _constants.default.MODULE: + return 'module'; + case _constants.default.PACKAGE: + return 'package'; + } + return 'unknown'; +} +ModuleMap.DuplicateHasteCandidatesError = DuplicateHasteCandidatesError; diff --git a/node_modules/jest-haste-map/build/blacklist.js b/node_modules/jest-haste-map/build/blacklist.js new file mode 100644 index 00000000..ae90b1a7 --- /dev/null +++ b/node_modules/jest-haste-map/build/blacklist.js @@ -0,0 +1,64 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// This list is compiled after the MDN list of the most common MIME types (see +// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/ +// Complete_list_of_MIME_types). +// +// Only MIME types starting with "image/", "video/", "audio/" and "font/" are +// reflected in the list. Adding "application/" is too risky since some text +// file formats (like ".js" and ".json") have an "application/" MIME type. +// +// Feel free to add any extensions that cannot be a Haste module. + +const extensions = new Set([ + // JSONs are never haste modules, except for "package.json", which is handled. + '.json', + // Image extensions. + '.bmp', + '.gif', + '.ico', + '.jpeg', + '.jpg', + '.png', + '.svg', + '.tiff', + '.tif', + '.webp', + // Video extensions. + '.avi', + '.mp4', + '.mpeg', + '.mpg', + '.ogv', + '.webm', + '.3gp', + '.3g2', + // Audio extensions. + '.aac', + '.midi', + '.mid', + '.mp3', + '.oga', + '.wav', + '.3gp', + '.3g2', + // Font extensions. + '.eot', + '.otf', + '.ttf', + '.woff', + '.woff2' +]); +var _default = extensions; +exports.default = _default; diff --git a/node_modules/jest-haste-map/build/constants.js b/node_modules/jest-haste-map/build/constants.js new file mode 100644 index 00000000..1b8804ec --- /dev/null +++ b/node_modules/jest-haste-map/build/constants.js @@ -0,0 +1,46 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/* + * This file exports a set of constants that are used for Jest's haste map + * serialization. On very large repositories, the haste map cache becomes very + * large to the point where it is the largest overhead in starting up Jest. + * + * This constant key map allows to keep the map smaller without having to build + * a custom serialization library. + */ + +/* eslint-disable sort-keys */ +const constants = { + /* dependency serialization */ + DEPENDENCY_DELIM: '\0', + /* file map attributes */ + ID: 0, + MTIME: 1, + SIZE: 2, + VISITED: 3, + DEPENDENCIES: 4, + SHA1: 5, + /* module map attributes */ + PATH: 0, + TYPE: 1, + /* module types */ + MODULE: 0, + PACKAGE: 1, + /* platforms */ + GENERIC_PLATFORM: 'g', + NATIVE_PLATFORM: 'native' +}; +/* eslint-enable */ +var _default = constants; +exports.default = _default; diff --git a/node_modules/jest-haste-map/build/crawlers/node.js b/node_modules/jest-haste-map/build/crawlers/node.js new file mode 100644 index 00000000..eb90b4e1 --- /dev/null +++ b/node_modules/jest-haste-map/build/crawlers/node.js @@ -0,0 +1,269 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.nodeCrawl = nodeCrawl; +function _child_process() { + const data = require('child_process'); + _child_process = function () { + return data; + }; + return data; +} +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +var _constants = _interopRequireDefault(require('../constants')); +var fastPath = _interopRequireWildcard(require('../lib/fast_path')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +async function hasNativeFindSupport(forceNodeFilesystemAPI) { + if (forceNodeFilesystemAPI) { + return false; + } + try { + return await new Promise(resolve => { + // Check the find binary supports the non-POSIX -iname parameter wrapped in parens. + const args = [ + '.', + '-type', + 'f', + '(', + '-iname', + '*.ts', + '-o', + '-iname', + '*.js', + ')' + ]; + const child = (0, _child_process().spawn)('find', args, { + cwd: __dirname + }); + child.on('error', () => { + resolve(false); + }); + child.on('exit', code => { + resolve(code === 0); + }); + }); + } catch { + return false; + } +} +function find(roots, extensions, ignore, enableSymlinks, callback) { + const result = []; + let activeCalls = 0; + function search(directory) { + activeCalls++; + fs().readdir( + directory, + { + withFileTypes: true + }, + (err, entries) => { + activeCalls--; + if (err) { + if (activeCalls === 0) { + callback(result); + } + return; + } + entries.forEach(entry => { + const file = path().join(directory, entry.name); + if (ignore(file)) { + return; + } + if (entry.isSymbolicLink()) { + return; + } + if (entry.isDirectory()) { + search(file); + return; + } + activeCalls++; + const stat = enableSymlinks ? fs().stat : fs().lstat; + stat(file, (err, stat) => { + activeCalls--; + + // This logic is unnecessary for node > v10.10, but leaving it in + // since we need it for backwards-compatibility still. + if (!err && stat && !stat.isSymbolicLink()) { + if (stat.isDirectory()) { + search(file); + } else { + const ext = path().extname(file).substr(1); + if (extensions.indexOf(ext) !== -1) { + result.push([file, stat.mtime.getTime(), stat.size]); + } + } + } + if (activeCalls === 0) { + callback(result); + } + }); + }); + if (activeCalls === 0) { + callback(result); + } + } + ); + } + if (roots.length > 0) { + roots.forEach(search); + } else { + callback(result); + } +} +function findNative(roots, extensions, ignore, enableSymlinks, callback) { + const args = Array.from(roots); + if (enableSymlinks) { + args.push('(', '-type', 'f', '-o', '-type', 'l', ')'); + } else { + args.push('-type', 'f'); + } + if (extensions.length) { + args.push('('); + } + extensions.forEach((ext, index) => { + if (index) { + args.push('-o'); + } + args.push('-iname'); + args.push(`*.${ext}`); + }); + if (extensions.length) { + args.push(')'); + } + const child = (0, _child_process().spawn)('find', args); + let stdout = ''; + if (child.stdout === null) { + throw new Error( + 'stdout is null - this should never happen. Please open up an issue at https://github.com/jestjs/jest' + ); + } + child.stdout.setEncoding('utf-8'); + child.stdout.on('data', data => (stdout += data)); + child.stdout.on('close', () => { + const lines = stdout + .trim() + .split('\n') + .filter(x => !ignore(x)); + const result = []; + let count = lines.length; + if (!count) { + callback([]); + } else { + lines.forEach(path => { + fs().stat(path, (err, stat) => { + // Filter out symlinks that describe directories + if (!err && stat && !stat.isDirectory()) { + result.push([path, stat.mtime.getTime(), stat.size]); + } + if (--count === 0) { + callback(result); + } + }); + }); + } + }); +} +async function nodeCrawl(options) { + const { + data, + extensions, + forceNodeFilesystemAPI, + ignore, + rootDir, + enableSymlinks, + roots + } = options; + const useNativeFind = await hasNativeFindSupport(forceNodeFilesystemAPI); + return new Promise(resolve => { + const callback = list => { + const files = new Map(); + const removedFiles = new Map(data.files); + list.forEach(fileData => { + const [filePath, mtime, size] = fileData; + const relativeFilePath = fastPath.relative(rootDir, filePath); + const existingFile = data.files.get(relativeFilePath); + if (existingFile && existingFile[_constants.default.MTIME] === mtime) { + files.set(relativeFilePath, existingFile); + } else { + // See ../constants.js; SHA-1 will always be null and fulfilled later. + files.set(relativeFilePath, ['', mtime, size, 0, '', null]); + } + removedFiles.delete(relativeFilePath); + }); + data.files = files; + resolve({ + hasteMap: data, + removedFiles + }); + }; + if (useNativeFind) { + findNative(roots, extensions, ignore, enableSymlinks, callback); + } else { + find(roots, extensions, ignore, enableSymlinks, callback); + } + }); +} diff --git a/node_modules/jest-haste-map/build/crawlers/watchman.js b/node_modules/jest-haste-map/build/crawlers/watchman.js new file mode 100644 index 00000000..3b2fbfff --- /dev/null +++ b/node_modules/jest-haste-map/build/crawlers/watchman.js @@ -0,0 +1,339 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.watchmanCrawl = watchmanCrawl; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _fbWatchman() { + const data = _interopRequireDefault(require('fb-watchman')); + _fbWatchman = function () { + return data; + }; + return data; +} +var _constants = _interopRequireDefault(require('../constants')); +var fastPath = _interopRequireWildcard(require('../lib/fast_path')); +var _normalizePathSep = _interopRequireDefault( + require('../lib/normalizePathSep') +); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const watchmanURL = 'https://facebook.github.io/watchman/docs/troubleshooting'; +function WatchmanError(error) { + error.message = + `Watchman error: ${error.message.trim()}. Make sure watchman ` + + `is running for this project. See ${watchmanURL}.`; + return error; +} + +/** + * Wrap watchman capabilityCheck method as a promise. + * + * @param client watchman client + * @param caps capabilities to verify + * @returns a promise resolving to a list of verified capabilities + */ +async function capabilityCheck(client, caps) { + return new Promise((resolve, reject) => { + client.capabilityCheck( + // @ts-expect-error: incorrectly typed + caps, + (error, response) => { + if (error) { + reject(error); + } else { + resolve(response); + } + } + ); + }); +} +async function watchmanCrawl(options) { + const fields = ['name', 'exists', 'mtime_ms', 'size']; + const {data, extensions, ignore, rootDir, roots} = options; + const defaultWatchExpression = ['allof', ['type', 'f']]; + const clocks = data.clocks; + const client = new (_fbWatchman().default.Client)(); + + // https://facebook.github.io/watchman/docs/capabilities.html + // Check adds about ~28ms + const capabilities = await capabilityCheck(client, { + // If a required capability is missing then an error will be thrown, + // we don't need this assertion, so using optional instead. + optional: ['suffix-set'] + }); + if (capabilities?.capabilities['suffix-set']) { + // If available, use the optimized `suffix-set` operation: + // https://facebook.github.io/watchman/docs/expr/suffix.html#suffix-set + defaultWatchExpression.push(['suffix', extensions]); + } else { + // Otherwise use the older and less optimal suffix tuple array + defaultWatchExpression.push([ + 'anyof', + ...extensions.map(extension => ['suffix', extension]) + ]); + } + let clientError; + client.on('error', error => (clientError = WatchmanError(error))); + const cmd = (...args) => + new Promise((resolve, reject) => + client.command(args, (error, result) => + error ? reject(WatchmanError(error)) : resolve(result) + ) + ); + if (options.computeSha1) { + const {capabilities} = await cmd('list-capabilities'); + if (capabilities.indexOf('field-content.sha1hex') !== -1) { + fields.push('content.sha1hex'); + } + } + async function getWatchmanRoots(roots) { + const watchmanRoots = new Map(); + await Promise.all( + roots.map(async root => { + const response = await cmd('watch-project', root); + const existing = watchmanRoots.get(response.watch); + // A root can only be filtered if it was never seen with a + // relative_path before. + const canBeFiltered = !existing || existing.length > 0; + if (canBeFiltered) { + if (response.relative_path) { + watchmanRoots.set( + response.watch, + (existing || []).concat(response.relative_path) + ); + } else { + // Make the filter directories an empty array to signal that this + // root was already seen and needs to be watched for all files or + // directories. + watchmanRoots.set(response.watch, []); + } + } + }) + ); + return watchmanRoots; + } + async function queryWatchmanForDirs(rootProjectDirMappings) { + const results = new Map(); + let isFresh = false; + await Promise.all( + Array.from(rootProjectDirMappings).map( + async ([root, directoryFilters]) => { + const expression = Array.from(defaultWatchExpression); + const glob = []; + if (directoryFilters.length > 0) { + expression.push([ + 'anyof', + ...directoryFilters.map(dir => ['dirname', dir]) + ]); + for (const directory of directoryFilters) { + for (const extension of extensions) { + glob.push(`${directory}/**/*.${extension}`); + } + } + } else { + for (const extension of extensions) { + glob.push(`**/*.${extension}`); + } + } + + // Jest is only going to store one type of clock; a string that + // represents a local clock. However, the Watchman crawler supports + // a second type of clock that can be written by automation outside of + // Jest, called an "scm query", which fetches changed files based on + // source control mergebases. The reason this is necessary is because + // local clocks are not portable across systems, but scm queries are. + // By using scm queries, we can create the haste map on a different + // system and import it, transforming the clock into a local clock. + const since = clocks.get(fastPath.relative(rootDir, root)); + const query = + since !== undefined + ? // Use the `since` generator if we have a clock available + { + expression, + fields, + since + } + : // Otherwise use the `glob` filter + { + expression, + fields, + glob, + glob_includedotfiles: true + }; + const response = await cmd('query', root, query); + if ('warning' in response) { + console.warn('watchman warning: ', response.warning); + } + + // When a source-control query is used, we ignore the "is fresh" + // response from Watchman because it will be true despite the query + // being incremental. + const isSourceControlQuery = + typeof since !== 'string' && + since?.scm?.['mergebase-with'] !== undefined; + if (!isSourceControlQuery) { + isFresh = isFresh || response.is_fresh_instance; + } + results.set(root, response); + } + ) + ); + return { + isFresh, + results + }; + } + let files = data.files; + let removedFiles = new Map(); + const changedFiles = new Map(); + let results; + let isFresh = false; + try { + const watchmanRoots = await getWatchmanRoots(roots); + const watchmanFileResults = await queryWatchmanForDirs(watchmanRoots); + + // Reset the file map if watchman was restarted and sends us a list of + // files. + if (watchmanFileResults.isFresh) { + files = new Map(); + removedFiles = new Map(data.files); + isFresh = true; + } + results = watchmanFileResults.results; + } finally { + client.end(); + } + if (clientError) { + throw clientError; + } + for (const [watchRoot, response] of results) { + const fsRoot = (0, _normalizePathSep.default)(watchRoot); + const relativeFsRoot = fastPath.relative(rootDir, fsRoot); + clocks.set( + relativeFsRoot, + // Ensure we persist only the local clock. + typeof response.clock === 'string' ? response.clock : response.clock.clock + ); + for (const fileData of response.files) { + const filePath = + fsRoot + path().sep + (0, _normalizePathSep.default)(fileData.name); + const relativeFilePath = fastPath.relative(rootDir, filePath); + const existingFileData = data.files.get(relativeFilePath); + + // If watchman is fresh, the removed files map starts with all files + // and we remove them as we verify they still exist. + if (isFresh && existingFileData && fileData.exists) { + removedFiles.delete(relativeFilePath); + } + if (!fileData.exists) { + // No need to act on files that do not exist and were not tracked. + if (existingFileData) { + files.delete(relativeFilePath); + + // If watchman is not fresh, we will know what specific files were + // deleted since we last ran and can track only those files. + if (!isFresh) { + removedFiles.set(relativeFilePath, existingFileData); + } + } + } else if (!ignore(filePath)) { + const mtime = + typeof fileData.mtime_ms === 'number' + ? fileData.mtime_ms + : fileData.mtime_ms.toNumber(); + const size = fileData.size; + let sha1hex = fileData['content.sha1hex']; + if (typeof sha1hex !== 'string' || sha1hex.length !== 40) { + sha1hex = undefined; + } + let nextData; + if ( + existingFileData && + existingFileData[_constants.default.MTIME] === mtime + ) { + nextData = existingFileData; + } else if ( + existingFileData && + sha1hex && + existingFileData[_constants.default.SHA1] === sha1hex + ) { + nextData = [ + existingFileData[0], + mtime, + existingFileData[2], + existingFileData[3], + existingFileData[4], + existingFileData[5] + ]; + } else { + // See ../constants.ts + nextData = ['', mtime, size, 0, '', sha1hex ?? null]; + } + files.set(relativeFilePath, nextData); + changedFiles.set(relativeFilePath, nextData); + } + } + } + data.files = files; + return { + changedFiles: isFresh ? undefined : changedFiles, + hasteMap: data, + removedFiles + }; +} diff --git a/node_modules/jest-haste-map/build/getMockName.js b/node_modules/jest-haste-map/build/getMockName.js new file mode 100644 index 00000000..445e0b27 --- /dev/null +++ b/node_modules/jest-haste-map/build/getMockName.js @@ -0,0 +1,69 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const MOCKS_PATTERN = `${path().sep}__mocks__${path().sep}`; +const getMockName = filePath => { + const mockPath = filePath.split(MOCKS_PATTERN)[1]; + return mockPath + .substring(0, mockPath.lastIndexOf(path().extname(mockPath))) + .replace(/\\/g, '/'); +}; +var _default = getMockName; +exports.default = _default; diff --git a/node_modules/jest-haste-map/build/index.d.ts b/node_modules/jest-haste-map/build/index.d.ts new file mode 100644 index 00000000..a0466fe8 --- /dev/null +++ b/node_modules/jest-haste-map/build/index.d.ts @@ -0,0 +1,242 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// + +import type {Config} from '@jest/types'; +import type {Stats} from 'graceful-fs'; + +declare type ChangeEvent = { + eventsQueue: EventsQueue; + hasteFS: HasteFS; + moduleMap: ModuleMap_2; +}; + +export declare class DuplicateError extends Error { + mockPath1: string; + mockPath2: string; + constructor(mockPath1: string, mockPath2: string); +} + +declare class DuplicateHasteCandidatesError extends Error { + hasteName: string; + platform: string | null; + supportsNativePlatform: boolean; + duplicatesSet: DuplicatesSet; + constructor( + name: string, + platform: string, + supportsNativePlatform: boolean, + duplicatesSet: DuplicatesSet, + ); +} + +declare type DuplicatesIndex = Map>; + +declare type DuplicatesSet = Map; + +declare type EventsQueue = Array<{ + filePath: string; + stat: Stats | undefined; + type: string; +}>; + +declare type FileData = Map; + +declare type FileMetaData = [ + id: string, + mtime: number, + size: number, + visited: 0 | 1, + dependencies: string, + sha1: string | null | undefined, +]; + +declare class HasteFS implements IHasteFS { + private readonly _rootDir; + private readonly _files; + constructor({rootDir, files}: {rootDir: string; files: FileData}); + getModuleName(file: string): string | null; + getSize(file: string): number | null; + getDependencies(file: string): Array | null; + getSha1(file: string): string | null; + exists(file: string): boolean; + getAllFiles(): Array; + getFileIterator(): Iterable; + getAbsoluteFileIterator(): Iterable; + matchFiles(pattern: RegExp | string): Array; + matchFilesWithGlob(globs: Array, root: string | null): Set; + private _getFileData; +} + +declare type HasteMapStatic = { + getCacheFilePath( + tmpdir: string, + name: string, + ...extra: Array + ): string; + getModuleMapFromJSON(json: S): IModuleMap; +}; + +declare type HasteRegExp = RegExp | ((str: string) => boolean); + +declare type HType = { + ID: 0; + MTIME: 1; + SIZE: 2; + VISITED: 3; + DEPENDENCIES: 4; + SHA1: 5; + PATH: 0; + TYPE: 1; + MODULE: 0; + PACKAGE: 1; + GENERIC_PLATFORM: 'g'; + NATIVE_PLATFORM: 'native'; + DEPENDENCY_DELIM: '\0'; +}; + +declare type HTypeValue = HType[keyof HType]; + +export declare interface IHasteFS { + exists(path: string): boolean; + getAbsoluteFileIterator(): Iterable; + getAllFiles(): Array; + getDependencies(file: string): Array | null; + getSize(path: string): number | null; + matchFiles(pattern: RegExp | string): Array; + matchFilesWithGlob( + globs: ReadonlyArray, + root: string | null, + ): Set; +} + +export declare interface IHasteMap { + on(eventType: 'change', handler: (event: ChangeEvent) => void): void; + build(): Promise<{ + hasteFS: IHasteFS; + moduleMap: IModuleMap; + }>; +} + +declare type IJestHasteMap = HasteMapStatic & { + create(options: Options): Promise; + getStatic(config: Config.ProjectConfig): HasteMapStatic; +}; + +export declare interface IModuleMap { + getModule( + name: string, + platform?: string | null, + supportsNativePlatform?: boolean | null, + type?: HTypeValue | null, + ): string | null; + getPackage( + name: string, + platform: string | null | undefined, + _supportsNativePlatform: boolean | null, + ): string | null; + getMockModule(name: string): string | undefined; + getRawModuleMap(): RawModuleMap; + toJSON(): S; +} + +declare const JestHasteMap: IJestHasteMap; +export default JestHasteMap; + +declare type MockData = Map; + +export declare const ModuleMap: { + create: (rootPath: string) => IModuleMap; +}; + +declare class ModuleMap_2 implements IModuleMap { + static DuplicateHasteCandidatesError: typeof DuplicateHasteCandidatesError; + private readonly _raw; + private json; + private static mapToArrayRecursive; + private static mapFromArrayRecursive; + constructor(raw: RawModuleMap); + getModule( + name: string, + platform?: string | null, + supportsNativePlatform?: boolean | null, + type?: HTypeValue | null, + ): string | null; + getPackage( + name: string, + platform: string | null | undefined, + _supportsNativePlatform: boolean | null, + ): string | null; + getMockModule(name: string): string | undefined; + getRawModuleMap(): RawModuleMap; + toJSON(): SerializableModuleMap; + static fromJSON(serializableModuleMap: SerializableModuleMap): ModuleMap_2; + /** + * When looking up a module's data, we walk through each eligible platform for + * the query. For each platform, we want to check if there are known + * duplicates for that name+platform pair. The duplication logic normally + * removes elements from the `map` object, but we want to check upfront to be + * extra sure. If metadata exists both in the `duplicates` object and the + * `map`, this would be a bug. + */ + private _getModuleMetadata; + private _assertNoDuplicates; + static create(rootDir: string): ModuleMap_2; +} + +declare type ModuleMapData = Map; + +declare type ModuleMapItem = { + [platform: string]: ModuleMetaData; +}; + +declare type ModuleMetaData = [path: string, type: number]; + +declare type Options = { + cacheDirectory?: string; + computeDependencies?: boolean; + computeSha1?: boolean; + console?: Console; + dependencyExtractor?: string | null; + enableSymlinks?: boolean; + extensions: Array; + forceNodeFilesystemAPI?: boolean; + hasteImplModulePath?: string; + hasteMapModulePath?: string; + id: string; + ignorePattern?: HasteRegExp; + maxWorkers: number; + mocksPattern?: string; + platforms: Array; + resetCache?: boolean; + retainAllFiles: boolean; + rootDir: string; + roots: Array; + skipPackageJson?: boolean; + throwOnModuleCollision?: boolean; + useWatchman?: boolean; + watch?: boolean; + workerThreads?: boolean; +}; + +declare type RawModuleMap = { + rootDir: string; + duplicates: DuplicatesIndex; + map: ModuleMapData; + mocks: MockData; +}; + +export declare type SerializableModuleMap = { + duplicates: ReadonlyArray<[string, [string, [string, [string, number]]]]>; + map: ReadonlyArray<[string, ValueType]>; + mocks: ReadonlyArray<[string, ValueType]>; + rootDir: string; +}; + +declare type ValueType = T extends Map ? V : never; + +export {}; diff --git a/node_modules/jest-haste-map/build/index.js b/node_modules/jest-haste-map/build/index.js new file mode 100644 index 00000000..d8a3b5ec --- /dev/null +++ b/node_modules/jest-haste-map/build/index.js @@ -0,0 +1,1107 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = exports.ModuleMap = exports.DuplicateError = void 0; +function _crypto() { + const data = require('crypto'); + _crypto = function () { + return data; + }; + return data; +} +function _events() { + const data = require('events'); + _events = function () { + return data; + }; + return data; +} +function _os() { + const data = require('os'); + _os = function () { + return data; + }; + return data; +} +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _v() { + const data = require('v8'); + _v = function () { + return data; + }; + return data; +} +function _gracefulFs() { + const data = require('graceful-fs'); + _gracefulFs = function () { + return data; + }; + return data; +} +function _jestRegexUtil() { + const data = require('jest-regex-util'); + _jestRegexUtil = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +function _jestWorker() { + const data = require('jest-worker'); + _jestWorker = function () { + return data; + }; + return data; +} +var _HasteFS = _interopRequireDefault(require('./HasteFS')); +var _ModuleMap = _interopRequireDefault(require('./ModuleMap')); +var _constants = _interopRequireDefault(require('./constants')); +var _node = require('./crawlers/node'); +var _watchman = require('./crawlers/watchman'); +var _getMockName = _interopRequireDefault(require('./getMockName')); +var fastPath = _interopRequireWildcard(require('./lib/fast_path')); +var _getPlatformExtension = _interopRequireDefault( + require('./lib/getPlatformExtension') +); +var _isWatchmanInstalled = _interopRequireDefault( + require('./lib/isWatchmanInstalled') +); +var _normalizePathSep = _interopRequireDefault( + require('./lib/normalizePathSep') +); +var _FSEventsWatcher = require('./watchers/FSEventsWatcher'); +var _NodeWatcher = _interopRequireDefault(require('./watchers/NodeWatcher')); +var _WatchmanWatcher = _interopRequireDefault( + require('./watchers/WatchmanWatcher') +); +var _worker = require('./worker'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// @ts-expect-error: not converted to TypeScript - it's a fork: https://github.com/jestjs/jest/pull/10919 + +// @ts-expect-error: not converted to TypeScript - it's a fork: https://github.com/jestjs/jest/pull/5387 + +// TypeScript doesn't like us importing from outside `rootDir`, but it doesn't +// understand `require`. +const {version: VERSION} = require('../package.json'); +const ModuleMap = _ModuleMap.default; +exports.ModuleMap = ModuleMap; +const CHANGE_INTERVAL = 30; +const MAX_WAIT_TIME = 240000; +const NODE_MODULES = `${path().sep}node_modules${path().sep}`; +const PACKAGE_JSON = `${path().sep}package.json`; +const VCS_DIRECTORIES = ['.git', '.hg', '.sl'] + .map(vcs => + (0, _jestRegexUtil().escapePathForRegex)(path().sep + vcs + path().sep) + ) + .join('|'); + +/** + * HasteMap is a JavaScript implementation of Facebook's haste module system. + * + * This implementation is inspired by https://github.com/facebook/node-haste + * and was built with for high-performance in large code repositories with + * hundreds of thousands of files. This implementation is scalable and provides + * predictable performance. + * + * Because the haste map creation and synchronization is critical to startup + * performance and most tasks are blocked by I/O this class makes heavy use of + * synchronous operations. It uses worker processes for parallelizing file + * access and metadata extraction. + * + * The data structures created by `jest-haste-map` can be used directly from the + * cache without further processing. The metadata objects in the `files` and + * `map` objects contain cross-references: a metadata object from one can look + * up the corresponding metadata object in the other map. Note that in most + * projects, the number of files will be greater than the number of haste + * modules one module can refer to many files based on platform extensions. + * + * type HasteMap = { + * clocks: WatchmanClocks, + * files: {[filepath: string]: FileMetaData}, + * map: {[id: string]: ModuleMapItem}, + * mocks: {[id: string]: string}, + * } + * + * // Watchman clocks are used for query synchronization and file system deltas. + * type WatchmanClocks = {[filepath: string]: string}; + * + * type FileMetaData = { + * id: ?string, // used to look up module metadata objects in `map`. + * mtime: number, // check for outdated files. + * size: number, // size of the file in bytes. + * visited: boolean, // whether the file has been parsed or not. + * dependencies: Array, // all relative dependencies of this file. + * sha1: ?string, // SHA-1 of the file, if requested via options. + * }; + * + * // Modules can be targeted to a specific platform based on the file name. + * // Example: platform.ios.js and Platform.android.js will both map to the same + * // `Platform` module. The platform should be specified during resolution. + * type ModuleMapItem = {[platform: string]: ModuleMetaData}; + * + * // + * type ModuleMetaData = { + * path: string, // the path to look up the file object in `files`. + * type: string, // the module type (either `package` or `module`). + * }; + * + * Note that the data structures described above are conceptual only. The actual + * implementation uses arrays and constant keys for metadata storage. Instead of + * `{id: 'flatMap', mtime: 3421, size: 42, visited: true, dependencies: []}` the real + * representation is similar to `['flatMap', 3421, 42, 1, []]` to save storage space + * and reduce parse and write time of a big JSON blob. + * + * The HasteMap is created as follows: + * 1. read data from the cache or create an empty structure. + * + * 2. crawl the file system. + * * empty cache: crawl the entire file system. + * * cache available: + * * if watchman is available: get file system delta changes. + * * if watchman is unavailable: crawl the entire file system. + * * build metadata objects for every file. This builds the `files` part of + * the `HasteMap`. + * + * 3. parse and extract metadata from changed files. + * * this is done in parallel over worker processes to improve performance. + * * the worst case is to parse all files. + * * the best case is no file system access and retrieving all data from + * the cache. + * * the average case is a small number of changed files. + * + * 4. serialize the new `HasteMap` in a cache file. + * Worker processes can directly access the cache through `HasteMap.read()`. + * + */ +class HasteMap extends _events().EventEmitter { + _buildPromise = null; + _cachePath = ''; + _changeInterval; + _console; + _isWatchmanInstalledPromise = null; + _options; + _watchers = []; + _worker = null; + static getStatic(config) { + if (config.haste.hasteMapModulePath) { + return require(config.haste.hasteMapModulePath); + } + return HasteMap; + } + static async create(options) { + if (options.hasteMapModulePath) { + const CustomHasteMap = require(options.hasteMapModulePath); + return new CustomHasteMap(options); + } + const hasteMap = new HasteMap(options); + await hasteMap.setupCachePath(options); + return hasteMap; + } + constructor(options) { + super(); + this._options = { + cacheDirectory: options.cacheDirectory || (0, _os().tmpdir)(), + computeDependencies: options.computeDependencies ?? true, + computeSha1: options.computeSha1 || false, + dependencyExtractor: options.dependencyExtractor || null, + enableSymlinks: options.enableSymlinks || false, + extensions: options.extensions, + forceNodeFilesystemAPI: !!options.forceNodeFilesystemAPI, + hasteImplModulePath: options.hasteImplModulePath, + id: options.id, + maxWorkers: options.maxWorkers, + mocksPattern: options.mocksPattern + ? new RegExp(options.mocksPattern) + : null, + platforms: options.platforms, + resetCache: options.resetCache, + retainAllFiles: options.retainAllFiles, + rootDir: options.rootDir, + roots: Array.from(new Set(options.roots)), + skipPackageJson: !!options.skipPackageJson, + throwOnModuleCollision: !!options.throwOnModuleCollision, + useWatchman: options.useWatchman ?? true, + watch: !!options.watch, + workerThreads: options.workerThreads + }; + this._console = options.console || globalThis.console; + if (options.ignorePattern) { + if (options.ignorePattern instanceof RegExp) { + this._options.ignorePattern = new RegExp( + options.ignorePattern.source.concat(`|${VCS_DIRECTORIES}`), + options.ignorePattern.flags + ); + } else { + throw new Error( + 'jest-haste-map: the `ignorePattern` option must be a RegExp' + ); + } + } else { + this._options.ignorePattern = new RegExp(VCS_DIRECTORIES); + } + if (this._options.enableSymlinks && this._options.useWatchman) { + throw new Error( + 'jest-haste-map: enableSymlinks config option was set, but ' + + 'is incompatible with watchman.\n' + + 'Set either `enableSymlinks` to false or `useWatchman` to false.' + ); + } + } + async setupCachePath(options) { + const rootDirHash = (0, _crypto().createHash)('sha1') + .update(options.rootDir) + .digest('hex') + .substring(0, 32); + let hasteImplHash = ''; + let dependencyExtractorHash = ''; + if (options.hasteImplModulePath) { + const hasteImpl = require(options.hasteImplModulePath); + if (hasteImpl.getCacheKey) { + hasteImplHash = String(hasteImpl.getCacheKey()); + } + } + if (options.dependencyExtractor) { + const dependencyExtractor = await (0, _jestUtil().requireOrImportModule)( + options.dependencyExtractor, + false + ); + if (dependencyExtractor.getCacheKey) { + dependencyExtractorHash = String(dependencyExtractor.getCacheKey()); + } + } + this._cachePath = HasteMap.getCacheFilePath( + this._options.cacheDirectory, + `haste-map-${this._options.id}-${rootDirHash}`, + VERSION, + this._options.id, + this._options.roots + .map(root => fastPath.relative(options.rootDir, root)) + .join(':'), + this._options.extensions.join(':'), + this._options.platforms.join(':'), + this._options.computeSha1.toString(), + options.mocksPattern || '', + (options.ignorePattern || '').toString(), + hasteImplHash, + dependencyExtractorHash, + this._options.computeDependencies.toString() + ); + } + static getCacheFilePath(tmpdir, id, ...extra) { + const hash = (0, _crypto().createHash)('sha1').update(extra.join('')); + return path().join( + tmpdir, + `${id.replace(/\W/g, '-')}-${hash.digest('hex').substring(0, 32)}` + ); + } + static getModuleMapFromJSON(json) { + return _ModuleMap.default.fromJSON(json); + } + getCacheFilePath() { + return this._cachePath; + } + build() { + if (!this._buildPromise) { + this._buildPromise = (async () => { + const data = await this._buildFileMap(); + + // Persist when we don't know if files changed (changedFiles undefined) + // or when we know a file was changed or deleted. + let hasteMap; + if ( + data.changedFiles === undefined || + data.changedFiles.size > 0 || + data.removedFiles.size > 0 + ) { + hasteMap = await this._buildHasteMap(data); + this._persist(hasteMap); + } else { + hasteMap = data.hasteMap; + } + const rootDir = this._options.rootDir; + const hasteFS = new _HasteFS.default({ + files: hasteMap.files, + rootDir + }); + const moduleMap = new _ModuleMap.default({ + duplicates: hasteMap.duplicates, + map: hasteMap.map, + mocks: hasteMap.mocks, + rootDir + }); + const __hasteMapForTest = + (process.env.NODE_ENV === 'test' && hasteMap) || null; + await this._watch(hasteMap); + return { + __hasteMapForTest, + hasteFS, + moduleMap + }; + })(); + } + return this._buildPromise; + } + + /** + * 1. read data from the cache or create an empty structure. + */ + read() { + let hasteMap; + try { + hasteMap = (0, _v().deserialize)( + (0, _gracefulFs().readFileSync)(this._cachePath) + ); + } catch { + hasteMap = this._createEmptyMap(); + } + return hasteMap; + } + readModuleMap() { + const data = this.read(); + return new _ModuleMap.default({ + duplicates: data.duplicates, + map: data.map, + mocks: data.mocks, + rootDir: this._options.rootDir + }); + } + + /** + * 2. crawl the file system. + */ + async _buildFileMap() { + let hasteMap; + try { + const read = this._options.resetCache ? this._createEmptyMap : this.read; + hasteMap = read.call(this); + } catch { + hasteMap = this._createEmptyMap(); + } + return this._crawl(hasteMap); + } + + /** + * 3. parse and extract metadata from changed files. + */ + _processFile(hasteMap, map, mocks, filePath, workerOptions) { + const rootDir = this._options.rootDir; + const setModule = (id, module) => { + let moduleMap = map.get(id); + if (!moduleMap) { + moduleMap = Object.create(null); + map.set(id, moduleMap); + } + const platform = + (0, _getPlatformExtension.default)( + module[_constants.default.PATH], + this._options.platforms + ) || _constants.default.GENERIC_PLATFORM; + const existingModule = moduleMap[platform]; + if ( + existingModule && + existingModule[_constants.default.PATH] !== + module[_constants.default.PATH] + ) { + const method = this._options.throwOnModuleCollision ? 'error' : 'warn'; + this._console[method]( + [ + `jest-haste-map: Haste module naming collision: ${id}`, + ' The following files share their name; please adjust your hasteImpl:', + ` * ${path().sep}${ + existingModule[_constants.default.PATH] + }`, + ` * ${path().sep}${module[_constants.default.PATH]}`, + '' + ].join('\n') + ); + if (this._options.throwOnModuleCollision) { + throw new DuplicateError( + existingModule[_constants.default.PATH], + module[_constants.default.PATH] + ); + } + + // We do NOT want consumers to use a module that is ambiguous. + delete moduleMap[platform]; + if (Object.keys(moduleMap).length === 1) { + map.delete(id); + } + let dupsByPlatform = hasteMap.duplicates.get(id); + if (dupsByPlatform == null) { + dupsByPlatform = new Map(); + hasteMap.duplicates.set(id, dupsByPlatform); + } + const dups = new Map([ + [module[_constants.default.PATH], module[_constants.default.TYPE]], + [ + existingModule[_constants.default.PATH], + existingModule[_constants.default.TYPE] + ] + ]); + dupsByPlatform.set(platform, dups); + return; + } + const dupsByPlatform = hasteMap.duplicates.get(id); + if (dupsByPlatform != null) { + const dups = dupsByPlatform.get(platform); + if (dups != null) { + dups.set( + module[_constants.default.PATH], + module[_constants.default.TYPE] + ); + } + return; + } + moduleMap[platform] = module; + }; + const relativeFilePath = fastPath.relative(rootDir, filePath); + const fileMetadata = hasteMap.files.get(relativeFilePath); + if (!fileMetadata) { + throw new Error( + 'jest-haste-map: File to process was not found in the haste map.' + ); + } + const moduleMetadata = hasteMap.map.get( + fileMetadata[_constants.default.ID] + ); + const computeSha1 = + this._options.computeSha1 && !fileMetadata[_constants.default.SHA1]; + + // Callback called when the response from the worker is successful. + const workerReply = metadata => { + // `1` for truthy values instead of `true` to save cache space. + fileMetadata[_constants.default.VISITED] = 1; + const metadataId = metadata.id; + const metadataModule = metadata.module; + if (metadataId && metadataModule) { + fileMetadata[_constants.default.ID] = metadataId; + setModule(metadataId, metadataModule); + } + fileMetadata[_constants.default.DEPENDENCIES] = metadata.dependencies + ? metadata.dependencies.join(_constants.default.DEPENDENCY_DELIM) + : ''; + if (computeSha1) { + fileMetadata[_constants.default.SHA1] = metadata.sha1; + } + }; + + // Callback called when the response from the worker is an error. + const workerError = error => { + if (typeof error !== 'object' || !error.message || !error.stack) { + error = new Error(error); + error.stack = ''; // Remove stack for stack-less errors. + } + + if (!['ENOENT', 'EACCES'].includes(error.code)) { + throw error; + } + + // If a file cannot be read we remove it from the file list and + // ignore the failure silently. + hasteMap.files.delete(relativeFilePath); + }; + + // If we retain all files in the virtual HasteFS representation, we avoid + // reading them if they aren't important (node_modules). + if (this._options.retainAllFiles && filePath.includes(NODE_MODULES)) { + if (computeSha1) { + return this._getWorker(workerOptions) + .getSha1({ + computeDependencies: this._options.computeDependencies, + computeSha1, + dependencyExtractor: this._options.dependencyExtractor, + filePath, + hasteImplModulePath: this._options.hasteImplModulePath, + rootDir + }) + .then(workerReply, workerError); + } + return null; + } + if ( + this._options.mocksPattern && + this._options.mocksPattern.test(filePath) + ) { + const mockPath = (0, _getMockName.default)(filePath); + const existingMockPath = mocks.get(mockPath); + if (existingMockPath) { + const secondMockPath = fastPath.relative(rootDir, filePath); + if (existingMockPath !== secondMockPath) { + const method = this._options.throwOnModuleCollision + ? 'error' + : 'warn'; + this._console[method]( + [ + `jest-haste-map: duplicate manual mock found: ${mockPath}`, + ' The following files share their name; please delete one of them:', + ` * ${path().sep}${existingMockPath}`, + ` * ${path().sep}${secondMockPath}`, + '' + ].join('\n') + ); + if (this._options.throwOnModuleCollision) { + throw new DuplicateError(existingMockPath, secondMockPath); + } + } + } + mocks.set(mockPath, relativeFilePath); + } + if (fileMetadata[_constants.default.VISITED]) { + if (!fileMetadata[_constants.default.ID]) { + return null; + } + if (moduleMetadata != null) { + const platform = + (0, _getPlatformExtension.default)( + filePath, + this._options.platforms + ) || _constants.default.GENERIC_PLATFORM; + const module = moduleMetadata[platform]; + if (module == null) { + return null; + } + const moduleId = fileMetadata[_constants.default.ID]; + let modulesByPlatform = map.get(moduleId); + if (!modulesByPlatform) { + modulesByPlatform = Object.create(null); + map.set(moduleId, modulesByPlatform); + } + modulesByPlatform[platform] = module; + return null; + } + } + return this._getWorker(workerOptions) + .worker({ + computeDependencies: this._options.computeDependencies, + computeSha1, + dependencyExtractor: this._options.dependencyExtractor, + filePath, + hasteImplModulePath: this._options.hasteImplModulePath, + rootDir + }) + .then(workerReply, workerError); + } + _buildHasteMap(data) { + const {removedFiles, changedFiles, hasteMap} = data; + + // If any files were removed or we did not track what files changed, process + // every file looking for changes. Otherwise, process only changed files. + let map; + let mocks; + let filesToProcess; + if (changedFiles === undefined || removedFiles.size) { + map = new Map(); + mocks = new Map(); + filesToProcess = hasteMap.files; + } else { + map = hasteMap.map; + mocks = hasteMap.mocks; + filesToProcess = changedFiles; + } + for (const [relativeFilePath, fileMetadata] of removedFiles) { + this._recoverDuplicates( + hasteMap, + relativeFilePath, + fileMetadata[_constants.default.ID] + ); + } + const promises = []; + for (const relativeFilePath of filesToProcess.keys()) { + if ( + this._options.skipPackageJson && + relativeFilePath.endsWith(PACKAGE_JSON) + ) { + continue; + } + // SHA-1, if requested, should already be present thanks to the crawler. + const filePath = fastPath.resolve( + this._options.rootDir, + relativeFilePath + ); + const promise = this._processFile(hasteMap, map, mocks, filePath); + if (promise) { + promises.push(promise); + } + } + return Promise.all(promises).then( + () => { + this._cleanup(); + hasteMap.map = map; + hasteMap.mocks = mocks; + return hasteMap; + }, + error => { + this._cleanup(); + throw error; + } + ); + } + _cleanup() { + const worker = this._worker; + if (worker && 'end' in worker) { + worker.end(); + } + this._worker = null; + } + + /** + * 4. serialize the new `HasteMap` in a cache file. + */ + _persist(hasteMap) { + (0, _gracefulFs().writeFileSync)( + this._cachePath, + (0, _v().serialize)(hasteMap) + ); + } + + /** + * Creates workers or parses files and extracts metadata in-process. + */ + _getWorker( + options = { + forceInBand: false + } + ) { + if (!this._worker) { + if (options.forceInBand || this._options.maxWorkers <= 1) { + this._worker = { + getSha1: _worker.getSha1, + worker: _worker.worker + }; + } else { + this._worker = new (_jestWorker().Worker)(require.resolve('./worker'), { + enableWorkerThreads: this._options.workerThreads, + exposedMethods: ['getSha1', 'worker'], + forkOptions: { + serialization: 'json' + }, + maxRetries: 3, + numWorkers: this._options.maxWorkers + }); + } + } + return this._worker; + } + async _crawl(hasteMap) { + const options = this._options; + const ignore = this._ignore.bind(this); + const crawl = (await this._shouldUseWatchman()) + ? _watchman.watchmanCrawl + : _node.nodeCrawl; + const crawlerOptions = { + computeSha1: options.computeSha1, + data: hasteMap, + enableSymlinks: options.enableSymlinks, + extensions: options.extensions, + forceNodeFilesystemAPI: options.forceNodeFilesystemAPI, + ignore, + rootDir: options.rootDir, + roots: options.roots + }; + const retry = error => { + if (crawl === _watchman.watchmanCrawl) { + this._console.warn( + 'jest-haste-map: Watchman crawl failed. Retrying once with node ' + + 'crawler.\n' + + " Usually this happens when watchman isn't running. Create an " + + "empty `.watchmanconfig` file in your project's root folder or " + + 'initialize a git or hg repository in your project.\n' + + ` ${error}` + ); + return (0, _node.nodeCrawl)(crawlerOptions).catch(e => { + throw new Error( + 'Crawler retry failed:\n' + + ` Original error: ${error.message}\n` + + ` Retry error: ${e.message}\n` + ); + }); + } + throw error; + }; + try { + return await crawl(crawlerOptions); + } catch (error) { + return retry(error); + } + } + + /** + * Watch mode + */ + async _watch(hasteMap) { + if (!this._options.watch) { + return Promise.resolve(); + } + + // In watch mode, we'll only warn about module collisions and we'll retain + // all files, even changes to node_modules. + this._options.throwOnModuleCollision = false; + this._options.retainAllFiles = true; + + // WatchmanWatcher > FSEventsWatcher > sane.NodeWatcher + const Watcher = (await this._shouldUseWatchman()) + ? _WatchmanWatcher.default + : _FSEventsWatcher.FSEventsWatcher.isSupported() + ? _FSEventsWatcher.FSEventsWatcher + : _NodeWatcher.default; + const extensions = this._options.extensions; + const ignorePattern = this._options.ignorePattern; + const rootDir = this._options.rootDir; + let changeQueue = Promise.resolve(); + let eventsQueue = []; + // We only need to copy the entire haste map once on every "frame". + let mustCopy = true; + const createWatcher = root => { + const watcher = new Watcher(root, { + dot: true, + glob: extensions.map(extension => `**/*.${extension}`), + ignored: ignorePattern + }); + return new Promise((resolve, reject) => { + const rejectTimeout = setTimeout( + () => reject(new Error('Failed to start watch mode.')), + MAX_WAIT_TIME + ); + watcher.once('ready', () => { + clearTimeout(rejectTimeout); + watcher.on('all', onChange); + resolve(watcher); + }); + }); + }; + const emitChange = () => { + if (eventsQueue.length) { + mustCopy = true; + const changeEvent = { + eventsQueue, + hasteFS: new _HasteFS.default({ + files: hasteMap.files, + rootDir + }), + moduleMap: new _ModuleMap.default({ + duplicates: hasteMap.duplicates, + map: hasteMap.map, + mocks: hasteMap.mocks, + rootDir + }) + }; + this.emit('change', changeEvent); + eventsQueue = []; + } + }; + const onChange = (type, filePath, root, stat) => { + filePath = path().join(root, (0, _normalizePathSep.default)(filePath)); + if ( + (stat && stat.isDirectory()) || + this._ignore(filePath) || + !extensions.some(extension => filePath.endsWith(extension)) + ) { + return; + } + const relativeFilePath = fastPath.relative(rootDir, filePath); + const fileMetadata = hasteMap.files.get(relativeFilePath); + + // The file has been accessed, not modified + if ( + type === 'change' && + fileMetadata && + stat && + fileMetadata[_constants.default.MTIME] === stat.mtime.getTime() + ) { + return; + } + changeQueue = changeQueue + .then(() => { + // If we get duplicate events for the same file, ignore them. + if ( + eventsQueue.find( + event => + event.type === type && + event.filePath === filePath && + ((!event.stat && !stat) || + (!!event.stat && + !!stat && + event.stat.mtime.getTime() === stat.mtime.getTime())) + ) + ) { + return null; + } + if (mustCopy) { + mustCopy = false; + hasteMap = { + clocks: new Map(hasteMap.clocks), + duplicates: new Map(hasteMap.duplicates), + files: new Map(hasteMap.files), + map: new Map(hasteMap.map), + mocks: new Map(hasteMap.mocks) + }; + } + const add = () => { + eventsQueue.push({ + filePath, + stat, + type + }); + return null; + }; + const fileMetadata = hasteMap.files.get(relativeFilePath); + + // If it's not an addition, delete the file and all its metadata + if (fileMetadata != null) { + const moduleName = fileMetadata[_constants.default.ID]; + const platform = + (0, _getPlatformExtension.default)( + filePath, + this._options.platforms + ) || _constants.default.GENERIC_PLATFORM; + hasteMap.files.delete(relativeFilePath); + let moduleMap = hasteMap.map.get(moduleName); + if (moduleMap != null) { + // We are forced to copy the object because jest-haste-map exposes + // the map as an immutable entity. + moduleMap = copy(moduleMap); + delete moduleMap[platform]; + if (Object.keys(moduleMap).length === 0) { + hasteMap.map.delete(moduleName); + } else { + hasteMap.map.set(moduleName, moduleMap); + } + } + if ( + this._options.mocksPattern && + this._options.mocksPattern.test(filePath) + ) { + const mockName = (0, _getMockName.default)(filePath); + hasteMap.mocks.delete(mockName); + } + this._recoverDuplicates(hasteMap, relativeFilePath, moduleName); + } + + // If the file was added or changed, + // parse it and update the haste map. + if (type === 'add' || type === 'change') { + (0, _jestUtil().invariant)( + stat, + 'since the file exists or changed, it should have stats' + ); + const fileMetadata = [ + '', + stat.mtime.getTime(), + stat.size, + 0, + '', + null + ]; + hasteMap.files.set(relativeFilePath, fileMetadata); + const promise = this._processFile( + hasteMap, + hasteMap.map, + hasteMap.mocks, + filePath, + { + forceInBand: true + } + ); + // Cleanup + this._cleanup(); + if (promise) { + return promise.then(add); + } else { + // If a file in node_modules has changed, + // emit an event regardless. + add(); + } + } else { + add(); + } + return null; + }) + .catch(error => { + this._console.error( + `jest-haste-map: watch error:\n ${error.stack}\n` + ); + }); + }; + this._changeInterval = setInterval(emitChange, CHANGE_INTERVAL); + return Promise.all(this._options.roots.map(createWatcher)).then( + watchers => { + this._watchers = watchers; + } + ); + } + + /** + * This function should be called when the file under `filePath` is removed + * or changed. When that happens, we want to figure out if that file was + * part of a group of files that had the same ID. If it was, we want to + * remove it from the group. Furthermore, if there is only one file + * remaining in the group, then we want to restore that single file as the + * correct resolution for its ID, and cleanup the duplicates index. + */ + _recoverDuplicates(hasteMap, relativeFilePath, moduleName) { + let dupsByPlatform = hasteMap.duplicates.get(moduleName); + if (dupsByPlatform == null) { + return; + } + const platform = + (0, _getPlatformExtension.default)( + relativeFilePath, + this._options.platforms + ) || _constants.default.GENERIC_PLATFORM; + let dups = dupsByPlatform.get(platform); + if (dups == null) { + return; + } + dupsByPlatform = copyMap(dupsByPlatform); + hasteMap.duplicates.set(moduleName, dupsByPlatform); + dups = copyMap(dups); + dupsByPlatform.set(platform, dups); + dups.delete(relativeFilePath); + if (dups.size !== 1) { + return; + } + const uniqueModule = dups.entries().next().value; + if (!uniqueModule) { + return; + } + let dedupMap = hasteMap.map.get(moduleName); + if (!dedupMap) { + dedupMap = Object.create(null); + hasteMap.map.set(moduleName, dedupMap); + } + dedupMap[platform] = uniqueModule; + dupsByPlatform.delete(platform); + if (dupsByPlatform.size === 0) { + hasteMap.duplicates.delete(moduleName); + } + } + async end() { + if (this._changeInterval) { + clearInterval(this._changeInterval); + } + if (!this._watchers.length) { + return; + } + await Promise.all(this._watchers.map(watcher => watcher.close())); + this._watchers = []; + } + + /** + * Helpers + */ + _ignore(filePath) { + const ignorePattern = this._options.ignorePattern; + const ignoreMatched = + ignorePattern instanceof RegExp + ? ignorePattern.test(filePath) + : ignorePattern && ignorePattern(filePath); + return ( + ignoreMatched || + (!this._options.retainAllFiles && filePath.includes(NODE_MODULES)) + ); + } + async _shouldUseWatchman() { + if (!this._options.useWatchman) { + return false; + } + if (!this._isWatchmanInstalledPromise) { + this._isWatchmanInstalledPromise = (0, _isWatchmanInstalled.default)(); + } + return this._isWatchmanInstalledPromise; + } + _createEmptyMap() { + return { + clocks: new Map(), + duplicates: new Map(), + files: new Map(), + map: new Map(), + mocks: new Map() + }; + } + static H = _constants.default; +} +class DuplicateError extends Error { + mockPath1; + mockPath2; + constructor(mockPath1, mockPath2) { + super('Duplicated files or mocks. Please check the console for more info'); + this.mockPath1 = mockPath1; + this.mockPath2 = mockPath2; + } +} +exports.DuplicateError = DuplicateError; +function copy(object) { + return Object.assign(Object.create(null), object); +} +function copyMap(input) { + return new Map(input); +} + +// Export the smallest API surface required by Jest + +const JestHasteMap = HasteMap; +var _default = JestHasteMap; +exports.default = _default; diff --git a/node_modules/jest-haste-map/build/lib/dependencyExtractor.js b/node_modules/jest-haste-map/build/lib/dependencyExtractor.js new file mode 100644 index 00000000..9a2a14f8 --- /dev/null +++ b/node_modules/jest-haste-map/build/lib/dependencyExtractor.js @@ -0,0 +1,84 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.extractor = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const NOT_A_DOT = '(? `([\`'"])([^'"\`]*?)(?:\\${pos})`; +const WORD_SEPARATOR = '\\b'; +const LEFT_PARENTHESIS = '\\('; +const RIGHT_PARENTHESIS = '\\)'; +const WHITESPACE = '\\s*'; +const OPTIONAL_COMMA = '(:?,\\s*)?'; +function createRegExp(parts, flags) { + return new RegExp(parts.join(''), flags); +} +function alternatives(...parts) { + return `(?:${parts.join('|')})`; +} +function functionCallStart(...names) { + return [ + NOT_A_DOT, + WORD_SEPARATOR, + alternatives(...names), + WHITESPACE, + LEFT_PARENTHESIS, + WHITESPACE + ]; +} +const BLOCK_COMMENT_RE = /\/\*[^]*?\*\//g; +const LINE_COMMENT_RE = /\/\/.*/g; +const REQUIRE_OR_DYNAMIC_IMPORT_RE = createRegExp( + [ + ...functionCallStart('require', 'import'), + CAPTURE_STRING_LITERAL(1), + WHITESPACE, + OPTIONAL_COMMA, + RIGHT_PARENTHESIS + ], + 'g' +); +const IMPORT_OR_EXPORT_RE = createRegExp( + [ + '\\b(?:import|export)\\s+(?!type(?:of)?\\s+)(?:[^\'"]+\\s+from\\s+)?', + CAPTURE_STRING_LITERAL(1) + ], + 'g' +); +const JEST_EXTENSIONS_RE = createRegExp( + [ + ...functionCallStart( + 'jest\\s*\\.\\s*(?:requireActual|requireMock|genMockFromModule|createMockFromModule)' + ), + CAPTURE_STRING_LITERAL(1), + WHITESPACE, + OPTIONAL_COMMA, + RIGHT_PARENTHESIS + ], + 'g' +); +const extractor = { + extract(code) { + const dependencies = new Set(); + const addDependency = (match, _, dep) => { + dependencies.add(dep); + return match; + }; + code + .replace(BLOCK_COMMENT_RE, '') + .replace(LINE_COMMENT_RE, '') + .replace(IMPORT_OR_EXPORT_RE, addDependency) + .replace(REQUIRE_OR_DYNAMIC_IMPORT_RE, addDependency) + .replace(JEST_EXTENSIONS_RE, addDependency); + return dependencies; + } +}; +exports.extractor = extractor; diff --git a/node_modules/jest-haste-map/build/lib/fast_path.js b/node_modules/jest-haste-map/build/lib/fast_path.js new file mode 100644 index 00000000..f82787cc --- /dev/null +++ b/node_modules/jest-haste-map/build/lib/fast_path.js @@ -0,0 +1,76 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.relative = relative; +exports.resolve = resolve; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// rootDir and filename must be absolute paths (resolved) +function relative(rootDir, filename) { + return filename.indexOf(rootDir + path().sep) === 0 + ? filename.substring(rootDir.length + 1) + : path().relative(rootDir, filename); +} +const INDIRECTION_FRAGMENT = `..${path().sep}`; + +// rootDir must be an absolute path and relativeFilename must be simple +// (e.g.: foo/bar or ../foo/bar, but never ./foo or foo/../bar) +function resolve(rootDir, relativeFilename) { + return relativeFilename.indexOf(INDIRECTION_FRAGMENT) === 0 + ? path().resolve(rootDir, relativeFilename) + : rootDir + path().sep + relativeFilename; +} diff --git a/node_modules/jest-haste-map/build/lib/getPlatformExtension.js b/node_modules/jest-haste-map/build/lib/getPlatformExtension.js new file mode 100644 index 00000000..2e1d2045 --- /dev/null +++ b/node_modules/jest-haste-map/build/lib/getPlatformExtension.js @@ -0,0 +1,30 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = getPlatformExtension; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const SUPPORTED_PLATFORM_EXTS = new Set(['android', 'ios', 'native', 'web']); + +// Extract platform extension: index.ios.js -> ios +function getPlatformExtension(file, platforms) { + const last = file.lastIndexOf('.'); + const secondToLast = file.lastIndexOf('.', last - 1); + if (secondToLast === -1) { + return null; + } + const platform = file.substring(secondToLast + 1, last); + // If an overriding platform array is passed, check that first + + if (platforms && platforms.indexOf(platform) !== -1) { + return platform; + } + return SUPPORTED_PLATFORM_EXTS.has(platform) ? platform : null; +} diff --git a/node_modules/jest-haste-map/build/lib/isWatchmanInstalled.js b/node_modules/jest-haste-map/build/lib/isWatchmanInstalled.js new file mode 100644 index 00000000..b04abb24 --- /dev/null +++ b/node_modules/jest-haste-map/build/lib/isWatchmanInstalled.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = isWatchmanInstalled; +function _child_process() { + const data = require('child_process'); + _child_process = function () { + return data; + }; + return data; +} +function _util() { + const data = require('util'); + _util = function () { + return data; + }; + return data; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +async function isWatchmanInstalled() { + try { + await (0, _util().promisify)(_child_process().execFile)('watchman', [ + '--version' + ]); + return true; + } catch { + return false; + } +} diff --git a/node_modules/jest-haste-map/build/lib/normalizePathSep.js b/node_modules/jest-haste-map/build/lib/normalizePathSep.js new file mode 100644 index 00000000..ad8cd1fe --- /dev/null +++ b/node_modules/jest-haste-map/build/lib/normalizePathSep.js @@ -0,0 +1,68 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +let normalizePathSep; +if (path().sep === '/') { + normalizePathSep = filePath => filePath; +} else { + normalizePathSep = filePath => filePath.replace(/\//g, path().sep); +} +var _default = normalizePathSep; +exports.default = _default; diff --git a/node_modules/jest-haste-map/build/types.js b/node_modules/jest-haste-map/build/types.js new file mode 100644 index 00000000..ad9a93a7 --- /dev/null +++ b/node_modules/jest-haste-map/build/types.js @@ -0,0 +1 @@ +'use strict'; diff --git a/node_modules/jest-haste-map/build/watchers/FSEventsWatcher.js b/node_modules/jest-haste-map/build/watchers/FSEventsWatcher.js new file mode 100644 index 00000000..a8b59d7f --- /dev/null +++ b/node_modules/jest-haste-map/build/watchers/FSEventsWatcher.js @@ -0,0 +1,244 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.FSEventsWatcher = void 0; +function _events() { + const data = require('events'); + _events = function () { + return data; + }; + return data; +} +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _anymatch() { + const data = _interopRequireDefault(require('anymatch')); + _anymatch = function () { + return data; + }; + return data; +} +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +function _micromatch() { + const data = _interopRequireDefault(require('micromatch')); + _micromatch = function () { + return data; + }; + return data; +} +function _walker() { + const data = _interopRequireDefault(require('walker')); + _walker = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +// @ts-expect-error no types + +// eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error, @typescript-eslint/ban-ts-comment +// @ts-ignore: this is for CI which runs linux and might not have this +let fsevents = null; +try { + fsevents = require('fsevents'); +} catch { + // Optional dependency, only supported on Darwin. +} +const CHANGE_EVENT = 'change'; +const DELETE_EVENT = 'delete'; +const ADD_EVENT = 'add'; +const ALL_EVENT = 'all'; +/** + * Export `FSEventsWatcher` class. + * Watches `dir`. + */ +class FSEventsWatcher extends _events().EventEmitter { + root; + ignored; + glob; + dot; + hasIgnore; + doIgnore; + fsEventsWatchStopper; + _tracked; + static isSupported() { + return fsevents !== null; + } + static normalizeProxy(callback) { + return (filepath, stats) => callback(path().normalize(filepath), stats); + } + static recReaddir( + dir, + dirCallback, + fileCallback, + endCallback, + errorCallback, + ignored + ) { + (0, _walker().default)(dir) + .filterDir( + currentDir => !ignored || !(0, _anymatch().default)(ignored, currentDir) + ) + .on('dir', FSEventsWatcher.normalizeProxy(dirCallback)) + .on('file', FSEventsWatcher.normalizeProxy(fileCallback)) + .on('error', errorCallback) + .on('end', () => { + endCallback(); + }); + } + constructor(dir, opts) { + if (!fsevents) { + throw new Error( + '`fsevents` unavailable (this watcher can only be used on Darwin)' + ); + } + super(); + this.dot = opts.dot || false; + this.ignored = opts.ignored; + this.glob = Array.isArray(opts.glob) ? opts.glob : [opts.glob]; + this.hasIgnore = + Boolean(opts.ignored) && !(Array.isArray(opts) && opts.length > 0); + this.doIgnore = opts.ignored + ? (0, _anymatch().default)(opts.ignored) + : () => false; + this.root = path().resolve(dir); + this.fsEventsWatchStopper = fsevents.watch( + this.root, + this.handleEvent.bind(this) + ); + this._tracked = new Set(); + FSEventsWatcher.recReaddir( + this.root, + filepath => { + this._tracked.add(filepath); + }, + filepath => { + this._tracked.add(filepath); + }, + this.emit.bind(this, 'ready'), + this.emit.bind(this, 'error'), + this.ignored + ); + } + + /** + * End watching. + */ + async close(callback) { + await this.fsEventsWatchStopper(); + this.removeAllListeners(); + if (typeof callback === 'function') { + process.nextTick(() => callback()); + } + } + isFileIncluded(relativePath) { + if (this.doIgnore(relativePath)) { + return false; + } + return this.glob.length + ? (0, _micromatch().default)([relativePath], this.glob, { + dot: this.dot + }).length > 0 + : this.dot || + (0, _micromatch().default)([relativePath], '**/*').length > 0; + } + handleEvent(filepath) { + const relativePath = path().relative(this.root, filepath); + if (!this.isFileIncluded(relativePath)) { + return; + } + fs().lstat(filepath, (error, stat) => { + if (error && error.code !== 'ENOENT') { + this.emit('error', error); + return; + } + if (error) { + // Ignore files that aren't tracked and don't exist. + if (!this._tracked.has(filepath)) { + return; + } + this._emit(DELETE_EVENT, relativePath); + this._tracked.delete(filepath); + return; + } + if (this._tracked.has(filepath)) { + this._emit(CHANGE_EVENT, relativePath, stat); + } else { + this._tracked.add(filepath); + this._emit(ADD_EVENT, relativePath, stat); + } + }); + } + + /** + * Emit events. + */ + _emit(type, file, stat) { + this.emit(type, file, this.root, stat); + this.emit(ALL_EVENT, type, file, this.root, stat); + } +} +exports.FSEventsWatcher = FSEventsWatcher; diff --git a/node_modules/jest-haste-map/build/watchers/NodeWatcher.js b/node_modules/jest-haste-map/build/watchers/NodeWatcher.js new file mode 100644 index 00000000..62cface5 --- /dev/null +++ b/node_modules/jest-haste-map/build/watchers/NodeWatcher.js @@ -0,0 +1,369 @@ +// vendored from https://github.com/amasad/sane/blob/64ff3a870c42e84f744086884bf55a4f9c22d376/src/node_watcher.js + +'use strict'; + +const EventEmitter = require('events').EventEmitter; +const fs = require('fs'); +const platform = require('os').platform(); +const path = require('path'); +const common = require('./common'); + +/** + * Constants + */ + +const DEFAULT_DELAY = common.DEFAULT_DELAY; +const CHANGE_EVENT = common.CHANGE_EVENT; +const DELETE_EVENT = common.DELETE_EVENT; +const ADD_EVENT = common.ADD_EVENT; +const ALL_EVENT = common.ALL_EVENT; + +/** + * Export `NodeWatcher` class. + * Watches `dir`. + * + * @class NodeWatcher + * @param {String} dir + * @param {Object} opts + * @public + */ + +module.exports = class NodeWatcher extends EventEmitter { + constructor(dir, opts) { + super(); + common.assignOptions(this, opts); + this.watched = Object.create(null); + this.changeTimers = Object.create(null); + this.dirRegistery = Object.create(null); + this.root = path.resolve(dir); + this.watchdir = this.watchdir.bind(this); + this.register = this.register.bind(this); + this.checkedEmitError = this.checkedEmitError.bind(this); + this.watchdir(this.root); + common.recReaddir( + this.root, + this.watchdir, + this.register, + this.emit.bind(this, 'ready'), + this.checkedEmitError, + this.ignored + ); + } + + /** + * Register files that matches our globs to know what to type of event to + * emit in the future. + * + * Registery looks like the following: + * + * dirRegister => Map { + * dirpath => Map { + * filename => true + * } + * } + * + * @param {string} filepath + * @return {boolean} whether or not we have registered the file. + * @private + */ + + register(filepath) { + const relativePath = path.relative(this.root, filepath); + if ( + !common.isFileIncluded(this.globs, this.dot, this.doIgnore, relativePath) + ) { + return false; + } + const dir = path.dirname(filepath); + if (!this.dirRegistery[dir]) { + this.dirRegistery[dir] = Object.create(null); + } + const filename = path.basename(filepath); + this.dirRegistery[dir][filename] = true; + return true; + } + + /** + * Removes a file from the registery. + * + * @param {string} filepath + * @private + */ + + unregister(filepath) { + const dir = path.dirname(filepath); + if (this.dirRegistery[dir]) { + const filename = path.basename(filepath); + delete this.dirRegistery[dir][filename]; + } + } + + /** + * Removes a dir from the registery. + * + * @param {string} dirpath + * @private + */ + + unregisterDir(dirpath) { + if (this.dirRegistery[dirpath]) { + delete this.dirRegistery[dirpath]; + } + } + + /** + * Checks if a file or directory exists in the registery. + * + * @param {string} fullpath + * @return {boolean} + * @private + */ + + registered(fullpath) { + const dir = path.dirname(fullpath); + return ( + this.dirRegistery[fullpath] || + (this.dirRegistery[dir] && + this.dirRegistery[dir][path.basename(fullpath)]) + ); + } + + /** + * Emit "error" event if it's not an ignorable event + * + * @param error + * @private + */ + checkedEmitError(error) { + if (!isIgnorableFileError(error)) { + this.emit('error', error); + } + } + + /** + * Watch a directory. + * + * @param {string} dir + * @private + */ + + watchdir(dir) { + if (this.watched[dir]) { + return; + } + const watcher = fs.watch( + dir, + { + persistent: true + }, + this.normalizeChange.bind(this, dir) + ); + this.watched[dir] = watcher; + watcher.on('error', this.checkedEmitError); + if (this.root !== dir) { + this.register(dir); + } + } + + /** + * Stop watching a directory. + * + * @param {string} dir + * @private + */ + + stopWatching(dir) { + if (this.watched[dir]) { + this.watched[dir].close(); + delete this.watched[dir]; + } + } + + /** + * End watching. + * + * @public + */ + + close() { + Object.keys(this.watched).forEach(this.stopWatching, this); + this.removeAllListeners(); + return Promise.resolve(); + } + + /** + * On some platforms, as pointed out on the fs docs (most likely just win32) + * the file argument might be missing from the fs event. Try to detect what + * change by detecting if something was deleted or the most recent file change. + * + * @param {string} dir + * @param {string} event + * @param {string} file + * @public + */ + + detectChangedFile(dir, event, callback) { + if (!this.dirRegistery[dir]) { + return; + } + let found = false; + let closest = { + mtime: 0 + }; + let c = 0; + Object.keys(this.dirRegistery[dir]).forEach(function (file, i, arr) { + fs.lstat(path.join(dir, file), (error, stat) => { + if (found) { + return; + } + if (error) { + if (isIgnorableFileError(error)) { + found = true; + callback(file); + } else { + this.emit('error', error); + } + } else { + if (stat.mtime > closest.mtime) { + stat.file = file; + closest = stat; + } + if (arr.length === ++c) { + callback(closest.file); + } + } + }); + }, this); + } + + /** + * Normalize fs events and pass it on to be processed. + * + * @param {string} dir + * @param {string} event + * @param {string} file + * @public + */ + + normalizeChange(dir, event, file) { + if (!file) { + this.detectChangedFile(dir, event, actualFile => { + if (actualFile) { + this.processChange(dir, event, actualFile); + } + }); + } else { + this.processChange(dir, event, path.normalize(file)); + } + } + + /** + * Process changes. + * + * @param {string} dir + * @param {string} event + * @param {string} file + * @public + */ + + processChange(dir, event, file) { + const fullPath = path.join(dir, file); + const relativePath = path.join(path.relative(this.root, dir), file); + fs.lstat(fullPath, (error, stat) => { + if (error && error.code !== 'ENOENT') { + this.emit('error', error); + } else if (!error && stat.isDirectory()) { + // win32 emits usless change events on dirs. + if (event !== 'change') { + this.watchdir(fullPath); + if ( + common.isFileIncluded( + this.globs, + this.dot, + this.doIgnore, + relativePath + ) + ) { + this.emitEvent(ADD_EVENT, relativePath, stat); + } + } + } else { + const registered = this.registered(fullPath); + if (error && error.code === 'ENOENT') { + this.unregister(fullPath); + this.stopWatching(fullPath); + this.unregisterDir(fullPath); + if (registered) { + this.emitEvent(DELETE_EVENT, relativePath); + } + } else if (registered) { + this.emitEvent(CHANGE_EVENT, relativePath, stat); + } else { + if (this.register(fullPath)) { + this.emitEvent(ADD_EVENT, relativePath, stat); + } + } + } + }); + } + + /** + * Triggers a 'change' event after debounding it to take care of duplicate + * events on os x. + * + * @private + */ + + emitEvent(type, file, stat) { + const key = `${type}-${file}`; + const addKey = `${ADD_EVENT}-${file}`; + if (type === CHANGE_EVENT && this.changeTimers[addKey]) { + // Ignore the change event that is immediately fired after an add event. + // (This happens on Linux). + return; + } + clearTimeout(this.changeTimers[key]); + this.changeTimers[key] = setTimeout(() => { + delete this.changeTimers[key]; + if (type === ADD_EVENT && stat.isDirectory()) { + // Recursively emit add events and watch for sub-files/folders + common.recReaddir( + path.resolve(this.root, file), + function emitAddDir(dir, stats) { + this.watchdir(dir); + this.rawEmitEvent(ADD_EVENT, path.relative(this.root, dir), stats); + }.bind(this), + function emitAddFile(file, stats) { + this.register(file); + this.rawEmitEvent(ADD_EVENT, path.relative(this.root, file), stats); + }.bind(this), + function endCallback() {}, + this.checkedEmitError, + this.ignored + ); + } else { + this.rawEmitEvent(type, file, stat); + } + }, DEFAULT_DELAY); + } + + /** + * Actually emit the events + */ + rawEmitEvent(type, file, stat) { + this.emit(type, file, this.root, stat); + this.emit(ALL_EVENT, type, file, this.root, stat); + } +}; +/** + * Determine if a given FS error can be ignored + * + * @private + */ +function isIgnorableFileError(error) { + return ( + error.code === 'ENOENT' || + // Workaround Windows node issue #4337. + (error.code === 'EPERM' && platform === 'win32') + ); +} diff --git a/node_modules/jest-haste-map/build/watchers/RecrawlWarning.js b/node_modules/jest-haste-map/build/watchers/RecrawlWarning.js new file mode 100644 index 00000000..5b1b6d35 --- /dev/null +++ b/node_modules/jest-haste-map/build/watchers/RecrawlWarning.js @@ -0,0 +1,49 @@ +// vendored from https://github.com/amasad/sane/blob/64ff3a870c42e84f744086884bf55a4f9c22d376/src/utils/recrawl-warning-dedupe.js + +'use strict'; + +class RecrawlWarning { + constructor(root, count) { + this.root = root; + this.count = count; + } + static findByRoot(root) { + for (let i = 0; i < this.RECRAWL_WARNINGS.length; i++) { + const warning = this.RECRAWL_WARNINGS[i]; + if (warning.root === root) { + return warning; + } + } + return undefined; + } + static isRecrawlWarningDupe(warningMessage) { + if (typeof warningMessage !== 'string') { + return false; + } + const match = warningMessage.match(this.REGEXP); + if (!match) { + return false; + } + const count = Number(match[1]); + const root = match[2]; + const warning = this.findByRoot(root); + if (warning) { + // only keep the highest count, assume count to either stay the same or + // increase. + if (warning.count >= count) { + return true; + } else { + // update the existing warning to the latest (highest) count + warning.count = count; + return false; + } + } else { + this.RECRAWL_WARNINGS.push(new RecrawlWarning(root, count)); + return false; + } + } +} +RecrawlWarning.RECRAWL_WARNINGS = []; +RecrawlWarning.REGEXP = + /Recrawled this watch (\d+) times, most recently because:\n([^:]+)/; +module.exports = RecrawlWarning; diff --git a/node_modules/jest-haste-map/build/watchers/WatchmanWatcher.js b/node_modules/jest-haste-map/build/watchers/WatchmanWatcher.js new file mode 100644 index 00000000..7b341687 --- /dev/null +++ b/node_modules/jest-haste-map/build/watchers/WatchmanWatcher.js @@ -0,0 +1,383 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = WatchmanWatcher; +function _assert() { + const data = require('assert'); + _assert = function () { + return data; + }; + return data; +} +function _events() { + const data = require('events'); + _events = function () { + return data; + }; + return data; +} +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _fbWatchman() { + const data = _interopRequireDefault(require('fb-watchman')); + _fbWatchman = function () { + return data; + }; + return data; +} +function _gracefulFs() { + const data = _interopRequireDefault(require('graceful-fs')); + _gracefulFs = function () { + return data; + }; + return data; +} +var _RecrawlWarning = _interopRequireDefault(require('./RecrawlWarning')); +var _common = _interopRequireDefault(require('./common')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const CHANGE_EVENT = _common.default.CHANGE_EVENT; +const DELETE_EVENT = _common.default.DELETE_EVENT; +const ADD_EVENT = _common.default.ADD_EVENT; +const ALL_EVENT = _common.default.ALL_EVENT; +const SUB_NAME = 'sane-sub'; + +/** + * Watches `dir`. + * + * @class PollWatcher + * @param String dir + * @param {Object} opts + * @public + */ + +function WatchmanWatcher(dir, opts) { + _common.default.assignOptions(this, opts); + this.root = path().resolve(dir); + this.init(); +} +Object.setPrototypeOf( + WatchmanWatcher.prototype, + _events().EventEmitter.prototype +); + +/** + * Run the watchman `watch` command on the root and subscribe to changes. + * + * @private + */ + +WatchmanWatcher.prototype.init = function () { + if (this.client) { + this.client.removeAllListeners(); + } + const self = this; + this.client = new (_fbWatchman().default.Client)(); + this.client.on('error', error => { + self.emit('error', error); + }); + this.client.on('subscription', this.handleChangeEvent.bind(this)); + this.client.on('end', () => { + console.warn('[sane] Warning: Lost connection to watchman, reconnecting..'); + self.init(); + }); + this.watchProjectInfo = null; + function getWatchRoot() { + return self.watchProjectInfo ? self.watchProjectInfo.root : self.root; + } + function onCapability(error, resp) { + if (handleError(self, error)) { + // The Watchman watcher is unusable on this system, we cannot continue + return; + } + handleWarning(resp); + self.capabilities = resp.capabilities; + if (self.capabilities.relative_root) { + self.client.command(['watch-project', getWatchRoot()], onWatchProject); + } else { + self.client.command(['watch', getWatchRoot()], onWatch); + } + } + function onWatchProject(error, resp) { + if (handleError(self, error)) { + return; + } + handleWarning(resp); + self.watchProjectInfo = { + relativePath: resp.relative_path ? resp.relative_path : '', + root: resp.watch + }; + self.client.command(['clock', getWatchRoot()], onClock); + } + function onWatch(error, resp) { + if (handleError(self, error)) { + return; + } + handleWarning(resp); + self.client.command(['clock', getWatchRoot()], onClock); + } + function onClock(error, resp) { + if (handleError(self, error)) { + return; + } + handleWarning(resp); + const options = { + fields: ['name', 'exists', 'new'], + since: resp.clock + }; + + // If the server has the wildmatch capability available it supports + // the recursive **/*.foo style match and we can offload our globs + // to the watchman server. This saves both on data size to be + // communicated back to us and compute for evaluating the globs + // in our node process. + if (self.capabilities.wildmatch) { + if (self.globs.length === 0) { + if (!self.dot) { + // Make sure we honor the dot option if even we're not using globs. + options.expression = [ + 'match', + '**', + 'wholename', + { + includedotfiles: false + } + ]; + } + } else { + options.expression = ['anyof']; + for (const i in self.globs) { + options.expression.push([ + 'match', + self.globs[i], + 'wholename', + { + includedotfiles: self.dot + } + ]); + } + } + } + if (self.capabilities.relative_root) { + options.relative_root = self.watchProjectInfo.relativePath; + } + self.client.command( + ['subscribe', getWatchRoot(), SUB_NAME, options], + onSubscribe + ); + } + function onSubscribe(error, resp) { + if (handleError(self, error)) { + return; + } + handleWarning(resp); + self.emit('ready'); + } + self.client.capabilityCheck( + { + optional: ['wildmatch', 'relative_root'] + }, + onCapability + ); +}; + +/** + * Handles a change event coming from the subscription. + * + * @param {Object} resp + * @private + */ + +WatchmanWatcher.prototype.handleChangeEvent = function (resp) { + _assert().strict.equal( + resp.subscription, + SUB_NAME, + 'Invalid subscription event.' + ); + if (resp.is_fresh_instance) { + this.emit('fresh_instance'); + } + if (resp.is_fresh_instance) { + this.emit('fresh_instance'); + } + if (Array.isArray(resp.files)) { + resp.files.forEach(this.handleFileChange, this); + } +}; + +/** + * Handles a single change event record. + * + * @param {Object} changeDescriptor + * @private + */ + +WatchmanWatcher.prototype.handleFileChange = function (changeDescriptor) { + const self = this; + let absPath; + let relativePath; + if (this.capabilities.relative_root) { + relativePath = changeDescriptor.name; + absPath = path().join( + this.watchProjectInfo.root, + this.watchProjectInfo.relativePath, + relativePath + ); + } else { + absPath = path().join(this.root, changeDescriptor.name); + relativePath = changeDescriptor.name; + } + if ( + !(self.capabilities.wildmatch && !this.hasIgnore) && + !_common.default.isFileIncluded( + this.globs, + this.dot, + this.doIgnore, + relativePath + ) + ) { + return; + } + if (!changeDescriptor.exists) { + self.emitEvent(DELETE_EVENT, relativePath, self.root); + } else { + _gracefulFs().default.lstat(absPath, (error, stat) => { + // Files can be deleted between the event and the lstat call + // the most reliable thing to do here is to ignore the event. + if (error && error.code === 'ENOENT') { + return; + } + if (handleError(self, error)) { + return; + } + const eventType = changeDescriptor.new ? ADD_EVENT : CHANGE_EVENT; + + // Change event on dirs are mostly useless. + if (!(eventType === CHANGE_EVENT && stat.isDirectory())) { + self.emitEvent(eventType, relativePath, self.root, stat); + } + }); + } +}; + +/** + * Dispatches the event. + * + * @param {string} eventType + * @param {string} filepath + * @param {string} root + * @param {fs.Stat} stat + * @private + */ + +WatchmanWatcher.prototype.emitEvent = function ( + eventType, + filepath, + root, + stat +) { + this.emit(eventType, filepath, root, stat); + this.emit(ALL_EVENT, eventType, filepath, root, stat); +}; + +/** + * Closes the watcher. + * + */ + +WatchmanWatcher.prototype.close = function () { + this.client.removeAllListeners(); + this.client.end(); + return Promise.resolve(); +}; + +/** + * Handles an error and returns true if exists. + * + * @param {WatchmanWatcher} self + * @param {Error} error + * @private + */ + +function handleError(self, error) { + if (error != null) { + self.emit('error', error); + return true; + } else { + return false; + } +} + +/** + * Handles a warning in the watchman resp object. + * + * @param {object} resp + * @private + */ + +function handleWarning(resp) { + if ('warning' in resp) { + if (_RecrawlWarning.default.isRecrawlWarningDupe(resp.warning)) { + return true; + } + console.warn(resp.warning); + return true; + } else { + return false; + } +} diff --git a/node_modules/jest-haste-map/build/watchers/common.js b/node_modules/jest-haste-map/build/watchers/common.js new file mode 100644 index 00000000..b8fa0c30 --- /dev/null +++ b/node_modules/jest-haste-map/build/watchers/common.js @@ -0,0 +1,111 @@ +// vendored from https://github.com/amasad/sane/blob/64ff3a870c42e84f744086884bf55a4f9c22d376/src/common.js + +'use strict'; + +const platform = require('os').platform(); +const path = require('path'); +const anymatch = require('anymatch'); +const micromatch = require('micromatch'); +const walker = require('walker'); + +/** + * Constants + */ + +exports.DEFAULT_DELAY = 100; +exports.CHANGE_EVENT = 'change'; +exports.DELETE_EVENT = 'delete'; +exports.ADD_EVENT = 'add'; +exports.ALL_EVENT = 'all'; + +/** + * Assigns options to the watcher. + * + * @param {NodeWatcher|PollWatcher|WatchmanWatcher} watcher + * @param {?object} opts + * @return {boolean} + * @public + */ + +exports.assignOptions = function (watcher, opts) { + opts = opts || {}; + watcher.globs = opts.glob || []; + watcher.dot = opts.dot || false; + watcher.ignored = opts.ignored || false; + if (!Array.isArray(watcher.globs)) { + watcher.globs = [watcher.globs]; + } + watcher.hasIgnore = + Boolean(opts.ignored) && !(Array.isArray(opts) && opts.length > 0); + watcher.doIgnore = opts.ignored ? anymatch(opts.ignored) : () => false; + if (opts.watchman && opts.watchmanPath) { + watcher.watchmanPath = opts.watchmanPath; + } + return opts; +}; + +/** + * Checks a file relative path against the globs array. + * + * @param {array} globs + * @param {string} relativePath + * @return {boolean} + * @public + */ + +exports.isFileIncluded = function (globs, dot, doIgnore, relativePath) { + if (doIgnore(relativePath)) { + return false; + } + return globs.length + ? micromatch.some(relativePath, globs, { + dot + }) + : dot || micromatch.some(relativePath, '**/*'); +}; + +/** + * Traverse a directory recursively calling `callback` on every directory. + * + * @param {string} dir + * @param {function} dirCallback + * @param {function} fileCallback + * @param {function} endCallback + * @param {*} ignored + * @public + */ + +exports.recReaddir = function ( + dir, + dirCallback, + fileCallback, + endCallback, + errorCallback, + ignored +) { + walker(dir) + .filterDir(currentDir => !anymatch(ignored, currentDir)) + .on('dir', normalizeProxy(dirCallback)) + .on('file', normalizeProxy(fileCallback)) + .on('error', errorCallback) + .on('end', () => { + if (platform === 'win32') { + setTimeout(endCallback, 1000); + } else { + endCallback(); + } + }); +}; + +/** + * Returns a callback that when called will normalize a path and call the + * original callback + * + * @param {function} callback + * @return {function} + * @private + */ + +function normalizeProxy(callback) { + return (filepath, stats) => callback(path.normalize(filepath), stats); +} diff --git a/node_modules/jest-haste-map/build/worker.js b/node_modules/jest-haste-map/build/worker.js new file mode 100644 index 00000000..7f27df08 --- /dev/null +++ b/node_modules/jest-haste-map/build/worker.js @@ -0,0 +1,180 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.getSha1 = getSha1; +exports.worker = worker; +function _crypto() { + const data = require('crypto'); + _crypto = function () { + return data; + }; + return data; +} +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +var _blacklist = _interopRequireDefault(require('./blacklist')); +var _constants = _interopRequireDefault(require('./constants')); +var _dependencyExtractor = require('./lib/dependencyExtractor'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const PACKAGE_JSON = `${path().sep}package.json`; +let hasteImpl = null; +let hasteImplModulePath = null; +function sha1hex(content) { + return (0, _crypto().createHash)('sha1').update(content).digest('hex'); +} +async function worker(data) { + if ( + data.hasteImplModulePath && + data.hasteImplModulePath !== hasteImplModulePath + ) { + if (hasteImpl) { + throw new Error('jest-haste-map: hasteImplModulePath changed'); + } + hasteImplModulePath = data.hasteImplModulePath; + hasteImpl = require(hasteImplModulePath); + } + let content; + let dependencies; + let id; + let module; + let sha1; + const {computeDependencies, computeSha1, rootDir, filePath} = data; + const getContent = () => { + if (content === undefined) { + content = fs().readFileSync(filePath, 'utf8'); + } + return content; + }; + if (filePath.endsWith(PACKAGE_JSON)) { + // Process a package.json that is returned as a PACKAGE type with its name. + try { + const fileData = JSON.parse(getContent()); + if (fileData.name) { + const relativeFilePath = path().relative(rootDir, filePath); + id = fileData.name; + module = [relativeFilePath, _constants.default.PACKAGE]; + } + } catch (err) { + throw new Error(`Cannot parse ${filePath} as JSON: ${err.message}`); + } + } else if ( + !_blacklist.default.has(filePath.substring(filePath.lastIndexOf('.'))) + ) { + // Process a random file that is returned as a MODULE. + if (hasteImpl) { + id = hasteImpl.getHasteName(filePath); + } + if (computeDependencies) { + const content = getContent(); + const extractor = data.dependencyExtractor + ? await (0, _jestUtil().requireOrImportModule)( + data.dependencyExtractor, + false + ) + : _dependencyExtractor.extractor; + dependencies = Array.from( + extractor.extract( + content, + filePath, + _dependencyExtractor.extractor.extract + ) + ); + } + if (id) { + const relativeFilePath = path().relative(rootDir, filePath); + module = [relativeFilePath, _constants.default.MODULE]; + } + } + + // If a SHA-1 is requested on update, compute it. + if (computeSha1) { + sha1 = sha1hex(content || fs().readFileSync(filePath)); + } + return { + dependencies, + id, + module, + sha1 + }; +} +async function getSha1(data) { + const sha1 = data.computeSha1 + ? sha1hex(fs().readFileSync(data.filePath)) + : null; + return { + dependencies: undefined, + id: undefined, + module: undefined, + sha1 + }; +} diff --git a/node_modules/jest-haste-map/package.json b/node_modules/jest-haste-map/package.json new file mode 100644 index 00000000..ee459fdf --- /dev/null +++ b/node_modules/jest-haste-map/package.json @@ -0,0 +1,47 @@ +{ + "name": "jest-haste-map", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-haste-map" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "devDependencies": { + "@types/fb-watchman": "^2.0.0", + "@types/micromatch": "^4.0.1", + "slash": "^3.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-leak-detector/LICENSE b/node_modules/jest-leak-detector/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-leak-detector/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-leak-detector/README.md b/node_modules/jest-leak-detector/README.md new file mode 100644 index 00000000..5e650b73 --- /dev/null +++ b/node_modules/jest-leak-detector/README.md @@ -0,0 +1,27 @@ +# jest-leak-detector + +Module for verifying whether an object has been garbage collected or not. + +Internally creates a weak reference to the object, and forces garbage collection to happen. If the reference is gone, it meant no one else was pointing to the object. + +## Example + +```javascript +(async function () { + let reference = {}; + let isLeaking; + + const detector = new LeakDetector(reference); + + // Reference is held in memory. + isLeaking = await detector.isLeaking(); + console.log(isLeaking); // true + + // We destroy the only reference to the object. + reference = null; + + // Reference is gone. + isLeaking = await detector.isLeaking(); + console.log(isLeaking); // false +})(); +``` diff --git a/node_modules/jest-leak-detector/build/index.d.ts b/node_modules/jest-leak-detector/build/index.d.ts new file mode 100644 index 00000000..53555839 --- /dev/null +++ b/node_modules/jest-leak-detector/build/index.d.ts @@ -0,0 +1,19 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// + +/// +declare class LeakDetector { + private _isReferenceBeingHeld; + private readonly _finalizationRegistry?; + constructor(value: unknown); + isLeaking(): Promise; + private _runGarbageCollector; +} +export default LeakDetector; + +export {}; diff --git a/node_modules/jest-leak-detector/build/index.js b/node_modules/jest-leak-detector/build/index.js new file mode 100644 index 00000000..a8ccb1e3 --- /dev/null +++ b/node_modules/jest-leak-detector/build/index.js @@ -0,0 +1,99 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _util() { + const data = require('util'); + _util = function () { + return data; + }; + return data; +} +function _v() { + const data = require('v8'); + _v = function () { + return data; + }; + return data; +} +function _vm() { + const data = require('vm'); + _vm = function () { + return data; + }; + return data; +} +function _jestGetType() { + const data = require('jest-get-type'); + _jestGetType = function () { + return data; + }; + return data; +} +function _prettyFormat() { + const data = require('pretty-format'); + _prettyFormat = function () { + return data; + }; + return data; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// + +const tick = (0, _util().promisify)(setImmediate); +class LeakDetector { + _isReferenceBeingHeld; + _finalizationRegistry; + constructor(value) { + if ((0, _jestGetType().isPrimitive)(value)) { + throw new TypeError( + [ + 'Primitives cannot leak memory.', + `You passed a ${typeof value}: <${(0, _prettyFormat().format)( + value + )}>` + ].join(' ') + ); + } + + // When `_finalizationRegistry` is GCed the callback we set will no longer be called, + this._finalizationRegistry = new FinalizationRegistry(() => { + this._isReferenceBeingHeld = false; + }); + this._finalizationRegistry.register(value, undefined); + this._isReferenceBeingHeld = true; + + // Ensure value is not leaked by the closure created by the "weak" callback. + value = null; + } + async isLeaking() { + this._runGarbageCollector(); + + // wait some ticks to allow GC to run properly, see https://github.com/nodejs/node/issues/34636#issuecomment-669366235 + for (let i = 0; i < 10; i++) { + await tick(); + } + return this._isReferenceBeingHeld; + } + _runGarbageCollector() { + // @ts-expect-error: not a function on `globalThis` + const isGarbageCollectorHidden = globalThis.gc == null; + + // GC is usually hidden, so we have to expose it before running. + (0, _v().setFlagsFromString)('--expose-gc'); + (0, _vm().runInNewContext)('gc')(); + + // The GC was not initially exposed, so let's hide it again. + if (isGarbageCollectorHidden) { + (0, _v().setFlagsFromString)('--no-expose-gc'); + } + } +} +exports.default = LeakDetector; diff --git a/node_modules/jest-leak-detector/package.json b/node_modules/jest-leak-detector/package.json new file mode 100644 index 00000000..3cb14af6 --- /dev/null +++ b/node_modules/jest-leak-detector/package.json @@ -0,0 +1,33 @@ +{ + "name": "jest-leak-detector", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-leak-detector" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "devDependencies": { + "@types/node": "*" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-matcher-utils/LICENSE b/node_modules/jest-matcher-utils/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-matcher-utils/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-matcher-utils/README.md b/node_modules/jest-matcher-utils/README.md new file mode 100644 index 00000000..17e19c2b --- /dev/null +++ b/node_modules/jest-matcher-utils/README.md @@ -0,0 +1,24 @@ +# jest-matcher-utils + +This package's exports are most notably used by `expect`'s [`this.utils`](https://jestjs.io/docs/expect#thisutils). + +## Installation + +To add this package as a dependency of a project, run either of the following commands: + +- `npm install jest-matcher-utils` +- `yarn add jest-matcher-utils` + +## Exports ([src/index.ts](https://github.com/jestjs/jest/blob/HEAD/packages/jest-matcher-utils/src/index.ts)) + +### Functions + +`stringify` `highlightTrailingWhitespace` `printReceived` `printExpected` `printWithType` `ensureNoExpected` `ensureActualIsNumber` `ensureExpectedIsNumber` `ensureNumbers` `ensureExpectedIsNonNegativeInteger` `printDiffOrStringify` `diff` `pluralize` `getLabelPrinter` `matcherErrorMessage` `matcherHint` + +### Types + +`MatcherHintOptions` `DiffOptions` + +### Constants + +`EXPECTED_COLOR` `RECEIVED_COLOR` `INVERTED_COLOR` `BOLD_WEIGHT` `DIM_COLOR` `SUGGEST_TO_CONTAIN_EQUAL` diff --git a/node_modules/jest-matcher-utils/build/Replaceable.js b/node_modules/jest-matcher-utils/build/Replaceable.js new file mode 100644 index 00000000..f86596dc --- /dev/null +++ b/node_modules/jest-matcher-utils/build/Replaceable.js @@ -0,0 +1,64 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _jestGetType = require('jest-get-type'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const supportTypes = ['map', 'array', 'object']; +/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ +class Replaceable { + object; + type; + constructor(object) { + this.object = object; + this.type = (0, _jestGetType.getType)(object); + if (!supportTypes.includes(this.type)) { + throw new Error(`Type ${this.type} is not support in Replaceable!`); + } + } + static isReplaceable(obj1, obj2) { + const obj1Type = (0, _jestGetType.getType)(obj1); + const obj2Type = (0, _jestGetType.getType)(obj2); + return obj1Type === obj2Type && supportTypes.includes(obj1Type); + } + forEach(cb) { + if (this.type === 'object') { + const descriptors = Object.getOwnPropertyDescriptors(this.object); + [ + ...Object.keys(descriptors), + ...Object.getOwnPropertySymbols(descriptors) + ] + //@ts-expect-error because typescript do not support symbol key in object + //https://github.com/microsoft/TypeScript/issues/1863 + .filter(key => descriptors[key].enumerable) + .forEach(key => { + cb(this.object[key], key, this.object); + }); + } else { + this.object.forEach(cb); + } + } + get(key) { + if (this.type === 'map') { + return this.object.get(key); + } + return this.object[key]; + } + set(key, value) { + if (this.type === 'map') { + this.object.set(key, value); + } else { + this.object[key] = value; + } + } +} +/* eslint-enable */ +exports.default = Replaceable; diff --git a/node_modules/jest-matcher-utils/build/deepCyclicCopyReplaceable.js b/node_modules/jest-matcher-utils/build/deepCyclicCopyReplaceable.js new file mode 100644 index 00000000..2a16e578 --- /dev/null +++ b/node_modules/jest-matcher-utils/build/deepCyclicCopyReplaceable.js @@ -0,0 +1,111 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = deepCyclicCopyReplaceable; +var _prettyFormat = require('pretty-format'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const builtInObject = [ + Array, + Date, + Float32Array, + Float64Array, + Int16Array, + Int32Array, + Int8Array, + Map, + Set, + RegExp, + Uint16Array, + Uint32Array, + Uint8Array, + Uint8ClampedArray +]; +if (typeof Buffer !== 'undefined') { + builtInObject.push(Buffer); +} +const isBuiltInObject = object => builtInObject.includes(object.constructor); +const isMap = value => value.constructor === Map; +function deepCyclicCopyReplaceable(value, cycles = new WeakMap()) { + if (typeof value !== 'object' || value === null) { + return value; + } else if (cycles.has(value)) { + return cycles.get(value); + } else if (Array.isArray(value)) { + return deepCyclicCopyArray(value, cycles); + } else if (isMap(value)) { + return deepCyclicCopyMap(value, cycles); + } else if (isBuiltInObject(value)) { + return value; + } else if (_prettyFormat.plugins.DOMElement.test(value)) { + return value.cloneNode(true); + } else { + return deepCyclicCopyObject(value, cycles); + } +} +function deepCyclicCopyObject(object, cycles) { + const newObject = Object.create(Object.getPrototypeOf(object)); + let descriptors = {}; + let obj = object; + do { + descriptors = Object.assign( + {}, + Object.getOwnPropertyDescriptors(obj), + descriptors + ); + } while ( + (obj = Object.getPrototypeOf(obj)) && + obj !== Object.getPrototypeOf({}) + ); + cycles.set(object, newObject); + const newDescriptors = [ + ...Object.keys(descriptors), + ...Object.getOwnPropertySymbols(descriptors) + ].reduce( + //@ts-expect-error because typescript do not support symbol key in object + //https://github.com/microsoft/TypeScript/issues/1863 + (newDescriptors, key) => { + const enumerable = descriptors[key].enumerable; + newDescriptors[key] = { + configurable: true, + enumerable, + value: deepCyclicCopyReplaceable( + // this accesses the value or getter, depending. We just care about the value anyways, and this allows us to not mess with accessors + // it has the side effect of invoking the getter here though, rather than copying it over + object[key], + cycles + ), + writable: true + }; + return newDescriptors; + }, + {} + ); + //@ts-expect-error because typescript do not support symbol key in object + //https://github.com/microsoft/TypeScript/issues/1863 + return Object.defineProperties(newObject, newDescriptors); +} +function deepCyclicCopyArray(array, cycles) { + const newArray = new (Object.getPrototypeOf(array).constructor)(array.length); + const length = array.length; + cycles.set(array, newArray); + for (let i = 0; i < length; i++) { + newArray[i] = deepCyclicCopyReplaceable(array[i], cycles); + } + return newArray; +} +function deepCyclicCopyMap(map, cycles) { + const newMap = new Map(); + cycles.set(map, newMap); + map.forEach((value, key) => { + newMap.set(key, deepCyclicCopyReplaceable(value, cycles)); + }); + return newMap; +} diff --git a/node_modules/jest-matcher-utils/build/index.d.ts b/node_modules/jest-matcher-utils/build/index.d.ts new file mode 100644 index 00000000..a84b60b1 --- /dev/null +++ b/node_modules/jest-matcher-utils/build/index.d.ts @@ -0,0 +1,138 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import chalk = require('chalk'); +import {DiffOptions as DiffOptions_2} from 'jest-diff'; + +export declare const BOLD_WEIGHT: chalk.Chalk; + +export declare const diff: ( + a: unknown, + b: unknown, + options?: DiffOptions, +) => string | null; + +export declare type DiffOptions = DiffOptions_2; + +export declare const DIM_COLOR: chalk.Chalk; + +/** + * Ensures that `actual` is of type `number | bigint` + */ +export declare const ensureActualIsNumber: ( + actual: unknown, + matcherName: string, + options?: MatcherHintOptions, +) => void; + +export declare const ensureExpectedIsNonNegativeInteger: ( + expected: unknown, + matcherName: string, + options?: MatcherHintOptions, +) => void; + +/** + * Ensures that `expected` is of type `number | bigint` + */ +export declare const ensureExpectedIsNumber: ( + expected: unknown, + matcherName: string, + options?: MatcherHintOptions, +) => void; + +export declare const ensureNoExpected: ( + expected: unknown, + matcherName: string, + options?: MatcherHintOptions, +) => void; + +/** + * Ensures that `actual` & `expected` are of type `number | bigint` + */ +export declare const ensureNumbers: ( + actual: unknown, + expected: unknown, + matcherName: string, + options?: MatcherHintOptions, +) => void; + +export declare const EXPECTED_COLOR: chalk.Chalk; + +export declare const getLabelPrinter: (...strings: Array) => PrintLabel; + +export declare const highlightTrailingWhitespace: (text: string) => string; + +export declare const INVERTED_COLOR: chalk.Chalk; + +export declare const matcherErrorMessage: ( + hint: string, + generic: string, + specific?: string, +) => string; + +export declare const matcherHint: ( + matcherName: string, + received?: string, + expected?: string, + options?: MatcherHintOptions, +) => string; + +declare type MatcherHintColor = (arg: string) => string; + +export declare type MatcherHintOptions = { + comment?: string; + expectedColor?: MatcherHintColor; + isDirectExpectCall?: boolean; + isNot?: boolean; + promise?: string; + receivedColor?: MatcherHintColor; + secondArgument?: string; + secondArgumentColor?: MatcherHintColor; +}; + +export declare const pluralize: (word: string, count: number) => string; + +export declare const printDiffOrStringify: ( + expected: unknown, + received: unknown, + expectedLabel: string, + receivedLabel: string, + expand: boolean, +) => string; + +export declare const printExpected: (value: unknown) => string; + +declare type PrintLabel = (string: string) => string; + +export declare const printReceived: (object: unknown) => string; + +export declare function printWithType( + name: string, + value: T, + print: (value: T) => string, +): string; + +export declare const RECEIVED_COLOR: chalk.Chalk; + +export declare function replaceMatchedToAsymmetricMatcher( + replacedExpected: unknown, + replacedReceived: unknown, + expectedCycles: Array, + receivedCycles: Array, +): { + replacedExpected: unknown; + replacedReceived: unknown; +}; + +export declare const stringify: ( + object: unknown, + maxDepth?: number, + maxWidth?: number, +) => string; + +export declare const SUGGEST_TO_CONTAIN_EQUAL: string; + +export {}; diff --git a/node_modules/jest-matcher-utils/build/index.js b/node_modules/jest-matcher-utils/build/index.js new file mode 100644 index 00000000..fd64b63e --- /dev/null +++ b/node_modules/jest-matcher-utils/build/index.js @@ -0,0 +1,542 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.printReceived = + exports.printExpected = + exports.printDiffOrStringify = + exports.pluralize = + exports.matcherHint = + exports.matcherErrorMessage = + exports.highlightTrailingWhitespace = + exports.getLabelPrinter = + exports.ensureNumbers = + exports.ensureNoExpected = + exports.ensureExpectedIsNumber = + exports.ensureExpectedIsNonNegativeInteger = + exports.ensureActualIsNumber = + exports.diff = + exports.SUGGEST_TO_CONTAIN_EQUAL = + exports.RECEIVED_COLOR = + exports.INVERTED_COLOR = + exports.EXPECTED_COLOR = + exports.DIM_COLOR = + exports.BOLD_WEIGHT = + void 0; +exports.printWithType = printWithType; +exports.replaceMatchedToAsymmetricMatcher = replaceMatchedToAsymmetricMatcher; +exports.stringify = void 0; +var _chalk = _interopRequireDefault(require('chalk')); +var _jestDiff = require('jest-diff'); +var _jestGetType = require('jest-get-type'); +var _prettyFormat = require('pretty-format'); +var _Replaceable = _interopRequireDefault(require('./Replaceable')); +var _deepCyclicCopyReplaceable = _interopRequireDefault( + require('./deepCyclicCopyReplaceable') +); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/* eslint-disable local/ban-types-eventually */ + +const { + AsymmetricMatcher, + DOMCollection, + DOMElement, + Immutable, + ReactElement, + ReactTestComponent +} = _prettyFormat.plugins; +const PLUGINS = [ + ReactTestComponent, + ReactElement, + DOMElement, + DOMCollection, + Immutable, + AsymmetricMatcher +]; + +// subset of Chalk type + +const EXPECTED_COLOR = _chalk.default.green; +exports.EXPECTED_COLOR = EXPECTED_COLOR; +const RECEIVED_COLOR = _chalk.default.red; +exports.RECEIVED_COLOR = RECEIVED_COLOR; +const INVERTED_COLOR = _chalk.default.inverse; +exports.INVERTED_COLOR = INVERTED_COLOR; +const BOLD_WEIGHT = _chalk.default.bold; +exports.BOLD_WEIGHT = BOLD_WEIGHT; +const DIM_COLOR = _chalk.default.dim; +exports.DIM_COLOR = DIM_COLOR; +const MULTILINE_REGEXP = /\n/; +const SPACE_SYMBOL = '\u{00B7}'; // middle dot + +const NUMBERS = [ + 'zero', + 'one', + 'two', + 'three', + 'four', + 'five', + 'six', + 'seven', + 'eight', + 'nine', + 'ten', + 'eleven', + 'twelve', + 'thirteen' +]; +const SUGGEST_TO_CONTAIN_EQUAL = _chalk.default.dim( + 'Looks like you wanted to test for object/array equality with the stricter `toContain` matcher. You probably need to use `toContainEqual` instead.' +); +exports.SUGGEST_TO_CONTAIN_EQUAL = SUGGEST_TO_CONTAIN_EQUAL; +const stringify = (object, maxDepth = 10, maxWidth = 10) => { + const MAX_LENGTH = 10000; + let result; + try { + result = (0, _prettyFormat.format)(object, { + maxDepth, + maxWidth, + min: true, + plugins: PLUGINS + }); + } catch { + result = (0, _prettyFormat.format)(object, { + callToJSON: false, + maxDepth, + maxWidth, + min: true, + plugins: PLUGINS + }); + } + if (result.length >= MAX_LENGTH && maxDepth > 1) { + return stringify(object, Math.floor(maxDepth / 2), maxWidth); + } else if (result.length >= MAX_LENGTH && maxWidth > 1) { + return stringify(object, maxDepth, Math.floor(maxWidth / 2)); + } else { + return result; + } +}; +exports.stringify = stringify; +const highlightTrailingWhitespace = text => + text.replace(/\s+$/gm, _chalk.default.inverse('$&')); + +// Instead of inverse highlight which now implies a change, +// replace common spaces with middle dot at the end of any line. +exports.highlightTrailingWhitespace = highlightTrailingWhitespace; +const replaceTrailingSpaces = text => + text.replace(/\s+$/gm, spaces => SPACE_SYMBOL.repeat(spaces.length)); +const printReceived = object => + RECEIVED_COLOR(replaceTrailingSpaces(stringify(object))); +exports.printReceived = printReceived; +const printExpected = value => + EXPECTED_COLOR(replaceTrailingSpaces(stringify(value))); +exports.printExpected = printExpected; +function printWithType(name, value, print) { + const type = (0, _jestGetType.getType)(value); + const hasType = + type !== 'null' && type !== 'undefined' + ? `${name} has type: ${type}\n` + : ''; + const hasValue = `${name} has value: ${print(value)}`; + return hasType + hasValue; +} +const ensureNoExpected = (expected, matcherName, options) => { + if (typeof expected !== 'undefined') { + // Prepend maybe not only for backward compatibility. + const matcherString = (options ? '' : '[.not]') + matcherName; + throw new Error( + matcherErrorMessage( + matcherHint(matcherString, undefined, '', options), + // Because expected is omitted in hint above, + // expected is black instead of green in message below. + 'this matcher must not have an expected argument', + printWithType('Expected', expected, printExpected) + ) + ); + } +}; + +/** + * Ensures that `actual` is of type `number | bigint` + */ +exports.ensureNoExpected = ensureNoExpected; +const ensureActualIsNumber = (actual, matcherName, options) => { + if (typeof actual !== 'number' && typeof actual !== 'bigint') { + // Prepend maybe not only for backward compatibility. + const matcherString = (options ? '' : '[.not]') + matcherName; + throw new Error( + matcherErrorMessage( + matcherHint(matcherString, undefined, undefined, options), + `${RECEIVED_COLOR('received')} value must be a number or bigint`, + printWithType('Received', actual, printReceived) + ) + ); + } +}; + +/** + * Ensures that `expected` is of type `number | bigint` + */ +exports.ensureActualIsNumber = ensureActualIsNumber; +const ensureExpectedIsNumber = (expected, matcherName, options) => { + if (typeof expected !== 'number' && typeof expected !== 'bigint') { + // Prepend maybe not only for backward compatibility. + const matcherString = (options ? '' : '[.not]') + matcherName; + throw new Error( + matcherErrorMessage( + matcherHint(matcherString, undefined, undefined, options), + `${EXPECTED_COLOR('expected')} value must be a number or bigint`, + printWithType('Expected', expected, printExpected) + ) + ); + } +}; + +/** + * Ensures that `actual` & `expected` are of type `number | bigint` + */ +exports.ensureExpectedIsNumber = ensureExpectedIsNumber; +const ensureNumbers = (actual, expected, matcherName, options) => { + ensureActualIsNumber(actual, matcherName, options); + ensureExpectedIsNumber(expected, matcherName, options); +}; +exports.ensureNumbers = ensureNumbers; +const ensureExpectedIsNonNegativeInteger = (expected, matcherName, options) => { + if ( + typeof expected !== 'number' || + !Number.isSafeInteger(expected) || + expected < 0 + ) { + // Prepend maybe not only for backward compatibility. + const matcherString = (options ? '' : '[.not]') + matcherName; + throw new Error( + matcherErrorMessage( + matcherHint(matcherString, undefined, undefined, options), + `${EXPECTED_COLOR('expected')} value must be a non-negative integer`, + printWithType('Expected', expected, printExpected) + ) + ); + } +}; + +// Given array of diffs, return concatenated string: +// * include common substrings +// * exclude change substrings which have opposite op +// * include change substrings which have argument op +// with inverse highlight only if there is a common substring +exports.ensureExpectedIsNonNegativeInteger = ensureExpectedIsNonNegativeInteger; +const getCommonAndChangedSubstrings = (diffs, op, hasCommonDiff) => + diffs.reduce( + (reduced, diff) => + reduced + + (diff[0] === _jestDiff.DIFF_EQUAL + ? diff[1] + : diff[0] !== op + ? '' + : hasCommonDiff + ? INVERTED_COLOR(diff[1]) + : diff[1]), + '' + ); +const isLineDiffable = (expected, received) => { + const expectedType = (0, _jestGetType.getType)(expected); + const receivedType = (0, _jestGetType.getType)(received); + if (expectedType !== receivedType) { + return false; + } + if ((0, _jestGetType.isPrimitive)(expected)) { + // Print generic line diff for strings only: + // * if neither string is empty + // * if either string has more than one line + return ( + typeof expected === 'string' && + typeof received === 'string' && + expected.length !== 0 && + received.length !== 0 && + (MULTILINE_REGEXP.test(expected) || MULTILINE_REGEXP.test(received)) + ); + } + if ( + expectedType === 'date' || + expectedType === 'function' || + expectedType === 'regexp' + ) { + return false; + } + if (expected instanceof Error && received instanceof Error) { + return false; + } + if ( + receivedType === 'object' && + typeof received.asymmetricMatch === 'function' + ) { + return false; + } + return true; +}; +const MAX_DIFF_STRING_LENGTH = 20000; +const printDiffOrStringify = ( + expected, + received, + expectedLabel, + receivedLabel, + expand // CLI options: true if `--expand` or false if `--no-expand` +) => { + if ( + typeof expected === 'string' && + typeof received === 'string' && + expected.length !== 0 && + received.length !== 0 && + expected.length <= MAX_DIFF_STRING_LENGTH && + received.length <= MAX_DIFF_STRING_LENGTH && + expected !== received + ) { + if (expected.includes('\n') || received.includes('\n')) { + return (0, _jestDiff.diffStringsUnified)(expected, received, { + aAnnotation: expectedLabel, + bAnnotation: receivedLabel, + changeLineTrailingSpaceColor: _chalk.default.bgYellow, + commonLineTrailingSpaceColor: _chalk.default.bgYellow, + emptyFirstOrLastLinePlaceholder: '↵', + // U+21B5 + expand, + includeChangeCounts: true + }); + } + const diffs = (0, _jestDiff.diffStringsRaw)(expected, received, true); + const hasCommonDiff = diffs.some(diff => diff[0] === _jestDiff.DIFF_EQUAL); + const printLabel = getLabelPrinter(expectedLabel, receivedLabel); + const expectedLine = + printLabel(expectedLabel) + + printExpected( + getCommonAndChangedSubstrings( + diffs, + _jestDiff.DIFF_DELETE, + hasCommonDiff + ) + ); + const receivedLine = + printLabel(receivedLabel) + + printReceived( + getCommonAndChangedSubstrings( + diffs, + _jestDiff.DIFF_INSERT, + hasCommonDiff + ) + ); + return `${expectedLine}\n${receivedLine}`; + } + if (isLineDiffable(expected, received)) { + const {replacedExpected, replacedReceived} = + replaceMatchedToAsymmetricMatcher(expected, received, [], []); + const difference = (0, _jestDiff.diff)(replacedExpected, replacedReceived, { + aAnnotation: expectedLabel, + bAnnotation: receivedLabel, + expand, + includeChangeCounts: true + }); + if ( + typeof difference === 'string' && + difference.includes(`- ${expectedLabel}`) && + difference.includes(`+ ${receivedLabel}`) + ) { + return difference; + } + } + const printLabel = getLabelPrinter(expectedLabel, receivedLabel); + const expectedLine = printLabel(expectedLabel) + printExpected(expected); + const receivedLine = + printLabel(receivedLabel) + + (stringify(expected) === stringify(received) + ? 'serializes to the same string' + : printReceived(received)); + return `${expectedLine}\n${receivedLine}`; +}; + +// Sometimes, e.g. when comparing two numbers, the output from jest-diff +// does not contain more information than the `Expected:` / `Received:` already gives. +// In those cases, we do not print a diff to make the output shorter and not redundant. +exports.printDiffOrStringify = printDiffOrStringify; +const shouldPrintDiff = (actual, expected) => { + if (typeof actual === 'number' && typeof expected === 'number') { + return false; + } + if (typeof actual === 'bigint' && typeof expected === 'bigint') { + return false; + } + if (typeof actual === 'boolean' && typeof expected === 'boolean') { + return false; + } + return true; +}; +function replaceMatchedToAsymmetricMatcher( + replacedExpected, + replacedReceived, + expectedCycles, + receivedCycles +) { + return _replaceMatchedToAsymmetricMatcher( + (0, _deepCyclicCopyReplaceable.default)(replacedExpected), + (0, _deepCyclicCopyReplaceable.default)(replacedReceived), + expectedCycles, + receivedCycles + ); +} +function _replaceMatchedToAsymmetricMatcher( + replacedExpected, + replacedReceived, + expectedCycles, + receivedCycles +) { + if (!_Replaceable.default.isReplaceable(replacedExpected, replacedReceived)) { + return { + replacedExpected, + replacedReceived + }; + } + if ( + expectedCycles.includes(replacedExpected) || + receivedCycles.includes(replacedReceived) + ) { + return { + replacedExpected, + replacedReceived + }; + } + expectedCycles.push(replacedExpected); + receivedCycles.push(replacedReceived); + const expectedReplaceable = new _Replaceable.default(replacedExpected); + const receivedReplaceable = new _Replaceable.default(replacedReceived); + expectedReplaceable.forEach((expectedValue, key) => { + const receivedValue = receivedReplaceable.get(key); + if (isAsymmetricMatcher(expectedValue)) { + if (expectedValue.asymmetricMatch(receivedValue)) { + receivedReplaceable.set(key, expectedValue); + } + } else if (isAsymmetricMatcher(receivedValue)) { + if (receivedValue.asymmetricMatch(expectedValue)) { + expectedReplaceable.set(key, receivedValue); + } + } else if ( + _Replaceable.default.isReplaceable(expectedValue, receivedValue) + ) { + const replaced = _replaceMatchedToAsymmetricMatcher( + expectedValue, + receivedValue, + expectedCycles, + receivedCycles + ); + expectedReplaceable.set(key, replaced.replacedExpected); + receivedReplaceable.set(key, replaced.replacedReceived); + } + }); + return { + replacedExpected: expectedReplaceable.object, + replacedReceived: receivedReplaceable.object + }; +} +function isAsymmetricMatcher(data) { + const type = (0, _jestGetType.getType)(data); + return type === 'object' && typeof data.asymmetricMatch === 'function'; +} +const diff = (a, b, options) => + shouldPrintDiff(a, b) ? (0, _jestDiff.diff)(a, b, options) : null; +exports.diff = diff; +const pluralize = (word, count) => + `${NUMBERS[count] || count} ${word}${count === 1 ? '' : 's'}`; + +// To display lines of labeled values as two columns with monospace alignment: +// given the strings which will describe the values, +// return function which given each string, returns the label: +// string, colon, space, and enough padding spaces to align the value. +exports.pluralize = pluralize; +const getLabelPrinter = (...strings) => { + const maxLength = strings.reduce( + (max, string) => (string.length > max ? string.length : max), + 0 + ); + return string => `${string}: ${' '.repeat(maxLength - string.length)}`; +}; +exports.getLabelPrinter = getLabelPrinter; +const matcherErrorMessage = ( + hint, + generic, + specific // incorrect value returned from call to printWithType +) => + `${hint}\n\n${_chalk.default.bold('Matcher error')}: ${generic}${ + typeof specific === 'string' ? `\n\n${specific}` : '' + }`; + +// Display assertion for the report when a test fails. +// New format: rejects/resolves, not, and matcher name have black color +// Old format: matcher name has dim color +exports.matcherErrorMessage = matcherErrorMessage; +const matcherHint = ( + matcherName, + received = 'received', + expected = 'expected', + options = {} +) => { + const { + comment = '', + expectedColor = EXPECTED_COLOR, + isDirectExpectCall = false, + // seems redundant with received === '' + isNot = false, + promise = '', + receivedColor = RECEIVED_COLOR, + secondArgument = '', + secondArgumentColor = EXPECTED_COLOR + } = options; + let hint = ''; + let dimString = 'expect'; // concatenate adjacent dim substrings + + if (!isDirectExpectCall && received !== '') { + hint += DIM_COLOR(`${dimString}(`) + receivedColor(received); + dimString = ')'; + } + if (promise !== '') { + hint += DIM_COLOR(`${dimString}.`) + promise; + dimString = ''; + } + if (isNot) { + hint += `${DIM_COLOR(`${dimString}.`)}not`; + dimString = ''; + } + if (matcherName.includes('.')) { + // Old format: for backward compatibility, + // especially without promise or isNot options + dimString += matcherName; + } else { + // New format: omit period from matcherName arg + hint += DIM_COLOR(`${dimString}.`) + matcherName; + dimString = ''; + } + if (expected === '') { + dimString += '()'; + } else { + hint += DIM_COLOR(`${dimString}(`) + expectedColor(expected); + if (secondArgument) { + hint += DIM_COLOR(', ') + secondArgumentColor(secondArgument); + } + dimString = ')'; + } + if (comment !== '') { + dimString += ` // ${comment}`; + } + if (dimString !== '') { + hint += DIM_COLOR(dimString); + } + return hint; +}; +exports.matcherHint = matcherHint; diff --git a/node_modules/jest-matcher-utils/package.json b/node_modules/jest-matcher-utils/package.json new file mode 100644 index 00000000..aa2a50ab --- /dev/null +++ b/node_modules/jest-matcher-utils/package.json @@ -0,0 +1,37 @@ +{ + "name": "jest-matcher-utils", + "description": "A set of utility functions for expect and related packages", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-matcher-utils" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "devDependencies": { + "@jest/test-utils": "^29.7.0", + "@types/node": "*" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-message-util/LICENSE b/node_modules/jest-message-util/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-message-util/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-message-util/build/index.d.ts b/node_modules/jest-message-util/build/index.d.ts new file mode 100644 index 00000000..05591794 --- /dev/null +++ b/node_modules/jest-message-util/build/index.d.ts @@ -0,0 +1,68 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {Config} from '@jest/types'; +import type {StackData} from 'stack-utils'; +import type {TestResult} from '@jest/types'; + +export declare const formatExecError: ( + error: Error | TestResult.SerializableError | string | number | undefined, + config: StackTraceConfig, + options: StackTraceOptions, + testPath?: string, + reuseMessage?: boolean, + noTitle?: boolean, +) => string; + +export declare const formatPath: ( + line: string, + config: StackTraceConfig, + relativeTestPath?: string | null, +) => string; + +export declare const formatResultsErrors: ( + testResults: Array, + config: StackTraceConfig, + options: StackTraceOptions, + testPath?: string, +) => string | null; + +export declare const formatStackTrace: ( + stack: string, + config: StackTraceConfig, + options: StackTraceOptions, + testPath?: string, +) => string; + +export declare interface Frame extends StackData { + file: string; +} + +export declare const getStackTraceLines: ( + stack: string, + options?: StackTraceOptions, +) => Array; + +export declare const getTopFrame: (lines: Array) => Frame | null; + +export declare const indentAllLines: (lines: string) => string; + +export declare const separateMessageFromStack: (content: string) => { + message: string; + stack: string; +}; + +export declare type StackTraceConfig = Pick< + Config.ProjectConfig, + 'rootDir' | 'testMatch' +>; + +export declare type StackTraceOptions = { + noStackTrace: boolean; + noCodeFrame?: boolean; +}; + +export {}; diff --git a/node_modules/jest-message-util/build/index.js b/node_modules/jest-message-util/build/index.js new file mode 100644 index 00000000..d1cff260 --- /dev/null +++ b/node_modules/jest-message-util/build/index.js @@ -0,0 +1,518 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.separateMessageFromStack = + exports.indentAllLines = + exports.getTopFrame = + exports.getStackTraceLines = + exports.formatStackTrace = + exports.formatResultsErrors = + exports.formatPath = + exports.formatExecError = + void 0; +var path = _interopRequireWildcard(require('path')); +var _url = require('url'); +var _util = require('util'); +var _codeFrame = require('@babel/code-frame'); +var _chalk = _interopRequireDefault(require('chalk')); +var fs = _interopRequireWildcard(require('graceful-fs')); +var _micromatch = _interopRequireDefault(require('micromatch')); +var _slash = _interopRequireDefault(require('slash')); +var _stackUtils = _interopRequireDefault(require('stack-utils')); +var _prettyFormat = require('pretty-format'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var jestReadFile = + globalThis[Symbol.for('jest-native-read-file')] || fs.readFileSync; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +// stack utils tries to create pretty stack by making paths relative. +const stackUtils = new _stackUtils.default({ + cwd: 'something which does not exist' +}); +let nodeInternals = []; +try { + nodeInternals = _stackUtils.default.nodeInternals(); +} catch { + // `StackUtils.nodeInternals()` fails in browsers. We don't need to remove + // node internals in the browser though, so no issue. +} +const PATH_NODE_MODULES = `${path.sep}node_modules${path.sep}`; +const PATH_JEST_PACKAGES = `${path.sep}jest${path.sep}packages${path.sep}`; + +// filter for noisy stack trace lines +const JASMINE_IGNORE = + /^\s+at(?:(?:.jasmine-)|\s+jasmine\.buildExpectationResult)/; +const JEST_INTERNALS_IGNORE = + /^\s+at.*?jest(-.*?)?(\/|\\)(build|node_modules|packages)(\/|\\)/; +const ANONYMOUS_FN_IGNORE = /^\s+at .*$/; +const ANONYMOUS_PROMISE_IGNORE = /^\s+at (new )?Promise \(\).*$/; +const ANONYMOUS_GENERATOR_IGNORE = /^\s+at Generator.next \(\).*$/; +const NATIVE_NEXT_IGNORE = /^\s+at next \(native\).*$/; +const TITLE_INDENT = ' '; +const MESSAGE_INDENT = ' '; +const STACK_INDENT = ' '; +const ANCESTRY_SEPARATOR = ' \u203A '; +const TITLE_BULLET = _chalk.default.bold('\u25cf '); +const STACK_TRACE_COLOR = _chalk.default.dim; +const STACK_PATH_REGEXP = /\s*at.*\(?(:\d*:\d*|native)\)?/; +const EXEC_ERROR_MESSAGE = 'Test suite failed to run'; +const NOT_EMPTY_LINE_REGEXP = /^(?!$)/gm; +const indentAllLines = lines => + lines.replace(NOT_EMPTY_LINE_REGEXP, MESSAGE_INDENT); +exports.indentAllLines = indentAllLines; +const trim = string => (string || '').trim(); + +// Some errors contain not only line numbers in stack traces +// e.g. SyntaxErrors can contain snippets of code, and we don't +// want to trim those, because they may have pointers to the column/character +// which will get misaligned. +const trimPaths = string => + string.match(STACK_PATH_REGEXP) ? trim(string) : string; +const getRenderedCallsite = (fileContent, line, column) => { + let renderedCallsite = (0, _codeFrame.codeFrameColumns)( + fileContent, + { + start: { + column, + line + } + }, + { + highlightCode: true + } + ); + renderedCallsite = indentAllLines(renderedCallsite); + renderedCallsite = `\n${renderedCallsite}\n`; + return renderedCallsite; +}; +const blankStringRegexp = /^\s*$/; +function checkForCommonEnvironmentErrors(error) { + if ( + error.includes('ReferenceError: document is not defined') || + error.includes('ReferenceError: window is not defined') || + error.includes('ReferenceError: navigator is not defined') + ) { + return warnAboutWrongTestEnvironment(error, 'jsdom'); + } else if (error.includes('.unref is not a function')) { + return warnAboutWrongTestEnvironment(error, 'node'); + } + return error; +} +function warnAboutWrongTestEnvironment(error, env) { + return ( + _chalk.default.bold.red( + `The error below may be caused by using the wrong test environment, see ${_chalk.default.dim.underline( + 'https://jestjs.io/docs/configuration#testenvironment-string' + )}.\nConsider using the "${env}" test environment.\n\n` + ) + error + ); +} + +// ExecError is an error thrown outside of the test suite (not inside an `it` or +// `before/after each` hooks). If it's thrown, none of the tests in the file +// are executed. +const formatExecError = ( + error, + config, + options, + testPath, + reuseMessage, + noTitle +) => { + if (!error || typeof error === 'number') { + error = new Error(`Expected an Error, but "${String(error)}" was thrown`); + error.stack = ''; + } + let message, stack; + let cause = ''; + const subErrors = []; + if (typeof error === 'string' || !error) { + error || (error = 'EMPTY ERROR'); + message = ''; + stack = error; + } else { + message = error.message; + stack = + typeof error.stack === 'string' + ? error.stack + : `thrown: ${(0, _prettyFormat.format)(error, { + maxDepth: 3 + })}`; + if ('cause' in error) { + const prefix = '\n\nCause:\n'; + if (typeof error.cause === 'string' || typeof error.cause === 'number') { + cause += `${prefix}${error.cause}`; + } else if ( + _util.types.isNativeError(error.cause) || + error.cause instanceof Error + ) { + /* `isNativeError` is used, because the error might come from another realm. + `instanceof Error` is used because `isNativeError` does return `false` for some + things that are `instanceof Error` like the errors provided in + [verror](https://www.npmjs.com/package/verror) or [axios](https://axios-http.com). + */ + const formatted = formatExecError( + error.cause, + config, + options, + testPath, + reuseMessage, + true + ); + cause += `${prefix}${formatted}`; + } + } + if ('errors' in error && Array.isArray(error.errors)) { + for (const subError of error.errors) { + subErrors.push( + formatExecError( + subError, + config, + options, + testPath, + reuseMessage, + true + ) + ); + } + } + } + if (cause !== '') { + cause = indentAllLines(cause); + } + const separated = separateMessageFromStack(stack || ''); + stack = separated.stack; + if (separated.message.includes(trim(message))) { + // Often stack trace already contains the duplicate of the message + message = separated.message; + } + message = checkForCommonEnvironmentErrors(message); + message = indentAllLines(message); + stack = + stack && !options.noStackTrace + ? `\n${formatStackTrace(stack, config, options, testPath)}` + : ''; + if ( + typeof stack !== 'string' || + (blankStringRegexp.test(message) && blankStringRegexp.test(stack)) + ) { + // this can happen if an empty object is thrown. + message = `thrown: ${(0, _prettyFormat.format)(error, { + maxDepth: 3 + })}`; + } + let messageToUse; + if (reuseMessage || noTitle) { + messageToUse = ` ${message.trim()}`; + } else { + messageToUse = `${EXEC_ERROR_MESSAGE}\n\n${message}`; + } + const title = noTitle ? '' : `${TITLE_INDENT + TITLE_BULLET}`; + const subErrorStr = + subErrors.length > 0 + ? indentAllLines( + `\n\nErrors contained in AggregateError:\n${subErrors.join('\n')}` + ) + : ''; + return `${title + messageToUse + stack + cause + subErrorStr}\n`; +}; +exports.formatExecError = formatExecError; +const removeInternalStackEntries = (lines, options) => { + let pathCounter = 0; + return lines.filter(line => { + if (ANONYMOUS_FN_IGNORE.test(line)) { + return false; + } + if (ANONYMOUS_PROMISE_IGNORE.test(line)) { + return false; + } + if (ANONYMOUS_GENERATOR_IGNORE.test(line)) { + return false; + } + if (NATIVE_NEXT_IGNORE.test(line)) { + return false; + } + if (nodeInternals.some(internal => internal.test(line))) { + return false; + } + if (!STACK_PATH_REGEXP.test(line)) { + return true; + } + if (JASMINE_IGNORE.test(line)) { + return false; + } + if (++pathCounter === 1) { + return true; // always keep the first line even if it's from Jest + } + + if (options.noStackTrace) { + return false; + } + if (JEST_INTERNALS_IGNORE.test(line)) { + return false; + } + return true; + }); +}; +const formatPath = (line, config, relativeTestPath = null) => { + // Extract the file path from the trace line. + const match = line.match(/(^\s*at .*?\(?)([^()]+)(:[0-9]+:[0-9]+\)?.*$)/); + if (!match) { + return line; + } + let filePath = (0, _slash.default)(path.relative(config.rootDir, match[2])); + // highlight paths from the current test file + if ( + (config.testMatch && + config.testMatch.length && + (0, _micromatch.default)([filePath], config.testMatch).length > 0) || + filePath === relativeTestPath + ) { + filePath = _chalk.default.reset.cyan(filePath); + } + return STACK_TRACE_COLOR(match[1]) + filePath + STACK_TRACE_COLOR(match[3]); +}; +exports.formatPath = formatPath; +const getStackTraceLines = ( + stack, + options = { + noCodeFrame: false, + noStackTrace: false + } +) => removeInternalStackEntries(stack.split(/\n/), options); +exports.getStackTraceLines = getStackTraceLines; +const getTopFrame = lines => { + for (const line of lines) { + if (line.includes(PATH_NODE_MODULES) || line.includes(PATH_JEST_PACKAGES)) { + continue; + } + const parsedFrame = stackUtils.parseLine(line.trim()); + if (parsedFrame && parsedFrame.file) { + if (parsedFrame.file.startsWith('file://')) { + parsedFrame.file = (0, _slash.default)( + (0, _url.fileURLToPath)(parsedFrame.file) + ); + } + return parsedFrame; + } + } + return null; +}; +exports.getTopFrame = getTopFrame; +const formatStackTrace = (stack, config, options, testPath) => { + const lines = getStackTraceLines(stack, options); + let renderedCallsite = ''; + const relativeTestPath = testPath + ? (0, _slash.default)(path.relative(config.rootDir, testPath)) + : null; + if (!options.noStackTrace && !options.noCodeFrame) { + const topFrame = getTopFrame(lines); + if (topFrame) { + const {column, file: filename, line} = topFrame; + if (line && filename && path.isAbsolute(filename)) { + let fileContent; + try { + // TODO: check & read HasteFS instead of reading the filesystem: + // see: https://github.com/jestjs/jest/pull/5405#discussion_r164281696 + fileContent = jestReadFile(filename, 'utf8'); + renderedCallsite = getRenderedCallsite(fileContent, line, column); + } catch { + // the file does not exist or is inaccessible, we ignore + } + } + } + } + const stacktrace = lines + .filter(Boolean) + .map( + line => + STACK_INDENT + formatPath(trimPaths(line), config, relativeTestPath) + ) + .join('\n'); + return renderedCallsite + ? `${renderedCallsite}\n${stacktrace}` + : `\n${stacktrace}`; +}; +exports.formatStackTrace = formatStackTrace; +function isErrorOrStackWithCause(errorOrStack) { + return ( + typeof errorOrStack !== 'string' && + 'cause' in errorOrStack && + (typeof errorOrStack.cause === 'string' || + _util.types.isNativeError(errorOrStack.cause) || + errorOrStack.cause instanceof Error) + ); +} +function formatErrorStack(errorOrStack, config, options, testPath) { + // The stack of new Error('message') contains both the message and the stack, + // thus we need to sanitize and clean it for proper display using separateMessageFromStack. + const sourceStack = + typeof errorOrStack === 'string' ? errorOrStack : errorOrStack.stack || ''; + let {message, stack} = separateMessageFromStack(sourceStack); + stack = options.noStackTrace + ? '' + : `${STACK_TRACE_COLOR( + formatStackTrace(stack, config, options, testPath) + )}\n`; + message = checkForCommonEnvironmentErrors(message); + message = indentAllLines(message); + let cause = ''; + if (isErrorOrStackWithCause(errorOrStack)) { + const nestedCause = formatErrorStack( + errorOrStack.cause, + config, + options, + testPath + ); + cause = `\n${MESSAGE_INDENT}Cause:\n${nestedCause}`; + } + return `${message}\n${stack}${cause}`; +} +function failureDetailsToErrorOrStack(failureDetails, content) { + if (!failureDetails) { + return content; + } + if ( + _util.types.isNativeError(failureDetails) || + failureDetails instanceof Error + ) { + return failureDetails; // receiving raw errors for jest-circus + } + + if ( + typeof failureDetails === 'object' && + 'error' in failureDetails && + (_util.types.isNativeError(failureDetails.error) || + failureDetails.error instanceof Error) + ) { + return failureDetails.error; // receiving instances of FailedAssertion for jest-jasmine + } + + return content; +} +const formatResultsErrors = (testResults, config, options, testPath) => { + const failedResults = testResults.reduce((errors, result) => { + result.failureMessages.forEach((item, index) => { + errors.push({ + content: item, + failureDetails: result.failureDetails[index], + result + }); + }); + return errors; + }, []); + if (!failedResults.length) { + return null; + } + return failedResults + .map(({result, content, failureDetails}) => { + const rootErrorOrStack = failureDetailsToErrorOrStack( + failureDetails, + content + ); + const title = `${_chalk.default.bold.red( + TITLE_INDENT + + TITLE_BULLET + + result.ancestorTitles.join(ANCESTRY_SEPARATOR) + + (result.ancestorTitles.length ? ANCESTRY_SEPARATOR : '') + + result.title + )}\n`; + return `${title}\n${formatErrorStack( + rootErrorOrStack, + config, + options, + testPath + )}`; + }) + .join('\n'); +}; +exports.formatResultsErrors = formatResultsErrors; +const errorRegexp = /^Error:?\s*$/; +const removeBlankErrorLine = str => + str + .split('\n') + // Lines saying just `Error:` are useless + .filter(line => !errorRegexp.test(line)) + .join('\n') + .trimRight(); + +// jasmine and worker farm sometimes don't give us access to the actual +// Error object, so we have to regexp out the message from the stack string +// to format it. +const separateMessageFromStack = content => { + if (!content) { + return { + message: '', + stack: '' + }; + } + + // All lines up to what looks like a stack -- or if nothing looks like a stack + // (maybe it's a code frame instead), just the first non-empty line. + // If the error is a plain "Error:" instead of a SyntaxError or TypeError we + // remove the prefix from the message because it is generally not useful. + const messageMatch = content.match( + /^(?:Error: )?([\s\S]*?(?=\n\s*at\s.*:\d*:\d*)|\s*.*)([\s\S]*)$/ + ); + if (!messageMatch) { + // For typescript + throw new Error('If you hit this error, the regex above is buggy.'); + } + const message = removeBlankErrorLine(messageMatch[1]); + const stack = removeBlankErrorLine(messageMatch[2]); + return { + message, + stack + }; +}; +exports.separateMessageFromStack = separateMessageFromStack; diff --git a/node_modules/jest-message-util/build/types.js b/node_modules/jest-message-util/build/types.js new file mode 100644 index 00000000..ad9a93a7 --- /dev/null +++ b/node_modules/jest-message-util/build/types.js @@ -0,0 +1 @@ +'use strict'; diff --git a/node_modules/jest-message-util/package.json b/node_modules/jest-message-util/package.json new file mode 100644 index 00000000..8accd3f3 --- /dev/null +++ b/node_modules/jest-message-util/package.json @@ -0,0 +1,43 @@ +{ + "name": "jest-message-util", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-message-util" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "devDependencies": { + "@types/babel__code-frame": "^7.0.0", + "@types/graceful-fs": "^4.1.3", + "@types/micromatch": "^4.0.1", + "tempy": "^1.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-mock/LICENSE b/node_modules/jest-mock/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-mock/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-mock/README.md b/node_modules/jest-mock/README.md new file mode 100644 index 00000000..41588a07 --- /dev/null +++ b/node_modules/jest-mock/README.md @@ -0,0 +1,106 @@ +# jest-mock + +**Note:** More details on user side API can be found in [Jest documentation](https://jestjs.io/docs/mock-function-api). + +## API + +```js +import {ModuleMocker} from 'jest-mock'; +``` + +### `constructor(global)` + +Creates a new module mocker that generates mocks as if they were created in an environment with the given global object. + +### `generateFromMetadata(metadata)` + +Generates a mock based on the given metadata (Metadata for the mock in the schema returned by the `getMetadata()` method of this module). Mocks treat functions specially, and all mock functions have additional members, described in the documentation for `fn()` in this module. + +One important note: function prototypes are handled specially by this mocking framework. For functions with prototypes, when called as a constructor, the mock will install mocked function members on the instance. This allows different instances of the same constructor to have different values for its mocks member and its return values. + +### `getMetadata(component)` + +Inspects the argument and returns its schema in the following recursive format: + +``` +{ + type: ... + members: {} +} +``` + +Where type is one of `array`, `object`, `function`, or `ref`, and members is an optional dictionary where the keys are member names and the values are metadata objects. Function prototypes are defined by defining metadata for the `member.prototype` of the function. The type of a function prototype should always be `object`. For instance, a class might be defined like this: + +```js +const classDef = { + type: 'function', + members: { + staticMethod: {type: 'function'}, + prototype: { + type: 'object', + members: { + instanceMethod: {type: 'function'}, + }, + }, + }, +}; +``` + +Metadata may also contain references to other objects defined within the same metadata object. The metadata for the referent must be marked with `refID` key and an arbitrary value. The referrer must be marked with a `ref` key that has the same value as object with refID that it refers to. For instance, this metadata blob: + +```js +const refID = { + type: 'object', + refID: 1, + members: { + self: {ref: 1}, + }, +}; +``` + +Defines an object with a slot named `self` that refers back to the object. + +### `fn(implementation?)` + +Generates a stand-alone function with members that help drive unit tests or confirm expectations. Specifically, functions returned by this method have the following members: + +##### `.mock` + +An object with three members, `calls`, `instances` and `invocationCallOrder`, which are all lists. The items in the `calls` list are the arguments with which the function was called. The "instances" list stores the value of 'this' for each call to the function. This is useful for retrieving instances from a constructor. The `invocationCallOrder` lists the order in which the mock was called in relation to all mock calls, starting at 1. + +##### `.mockReturnValueOnce(value)` + +Pushes the given value onto a FIFO queue of return values for the function. + +##### `.mockReturnValue(value)` + +Sets the default return value for the function. + +##### `.mockImplementationOnce(function)` + +Pushes the given mock implementation onto a FIFO queue of mock implementations for the function. + +##### `.mockImplementation(function)` + +Sets the default mock implementation for the function. + +##### `.mockReturnThis()` + +Syntactic sugar for: + +```js +mockFn.mockImplementation(function () { + return this; +}); +``` + +In case both `.mockImplementationOnce()` / `.mockImplementation()` and `.mockReturnValueOnce()` / `.mockReturnValue()` are called. The priority of which to use is based on what is the last call: + +- if the last call is `.mockReturnValueOnce()` or `.mockReturnValue()`, use the specific return value or default return value. If specific return values are used up or no default return value is set, fall back to try `.mockImplementation()`; +- if the last call is `.mockImplementationOnce()` or `.mockImplementation()`, run the specific implementation and return the result or run default implementation and return the result. + +##### `.withImplementation(function, callback)` + +Temporarily overrides the default mock implementation within the callback, then restores it's previous implementation. + +If the callback is async or returns a `thenable`, `withImplementation` will return a promise. Awaiting the promise will await the callback and reset the implementation. diff --git a/node_modules/jest-mock/build/index.d.ts b/node_modules/jest-mock/build/index.d.ts new file mode 100644 index 00000000..2374fc6d --- /dev/null +++ b/node_modules/jest-mock/build/index.d.ts @@ -0,0 +1,406 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export declare type ClassLike = { + new (...args: any): any; +}; + +export declare type ConstructorLikeKeys = keyof { + [K in keyof T as Required[K] extends ClassLike ? K : never]: T[K]; +}; + +export declare const fn: ( + implementation?: T | undefined, +) => Mock; + +export declare type FunctionLike = (...args: any) => any; + +export declare type MethodLikeKeys = keyof { + [K in keyof T as Required[K] extends FunctionLike ? K : never]: T[K]; +}; + +/** + * All what the internal typings need is to be sure that we have any-function. + * `FunctionLike` type ensures that and helps to constrain the type as well. + * The default of `UnknownFunction` makes sure that `any`s do not leak to the + * user side. For instance, calling `fn()` without implementation will return + * a mock of `(...args: Array) => unknown` type. If implementation + * is provided, its typings are inferred correctly. + */ +export declare interface Mock + extends Function, + MockInstance { + new (...args: Parameters): ReturnType; + (...args: Parameters): ReturnType; +} + +export declare type Mocked = T extends ClassLike + ? MockedClass + : T extends FunctionLike + ? MockedFunction + : T extends object + ? MockedObject + : T; + +export declare const mocked: { + ( + source: T, + options?: { + shallow: false; + }, + ): Mocked; + ( + source: T_1, + options: { + shallow: true; + }, + ): MockedShallow; +}; + +export declare type MockedClass = MockInstance< + (...args: ConstructorParameters) => Mocked> +> & + MockedObject; + +export declare type MockedFunction = MockInstance & + MockedObject; + +declare type MockedFunctionShallow = MockInstance & + T; + +export declare type MockedObject = { + [K in keyof T]: T[K] extends ClassLike + ? MockedClass + : T[K] extends FunctionLike + ? MockedFunction + : T[K] extends object + ? MockedObject + : T[K]; +} & T; + +declare type MockedObjectShallow = { + [K in keyof T]: T[K] extends ClassLike + ? MockedClass + : T[K] extends FunctionLike + ? MockedFunctionShallow + : T[K]; +} & T; + +export declare type MockedShallow = T extends ClassLike + ? MockedClass + : T extends FunctionLike + ? MockedFunctionShallow + : T extends object + ? MockedObjectShallow + : T; + +export declare type MockFunctionMetadata< + T = unknown, + MetadataType = MockMetadataType, +> = MockMetadata; + +export declare type MockFunctionMetadataType = MockMetadataType; + +declare type MockFunctionResult = + | MockFunctionResultIncomplete + | MockFunctionResultReturn + | MockFunctionResultThrow; + +declare type MockFunctionResultIncomplete = { + type: 'incomplete'; + /** + * Result of a single call to a mock function that has not yet completed. + * This occurs if you test the result from within the mock function itself, + * or from within a function that was called by the mock. + */ + value: undefined; +}; + +declare type MockFunctionResultReturn< + T extends FunctionLike = UnknownFunction, +> = { + type: 'return'; + /** + * Result of a single call to a mock function that returned. + */ + value: ReturnType; +}; + +declare type MockFunctionResultThrow = { + type: 'throw'; + /** + * Result of a single call to a mock function that threw. + */ + value: unknown; +}; + +declare type MockFunctionState = { + /** + * List of the call arguments of all calls that have been made to the mock. + */ + calls: Array>; + /** + * List of all the object instances that have been instantiated from the mock. + */ + instances: Array>; + /** + * List of all the function contexts that have been applied to calls to the mock. + */ + contexts: Array>; + /** + * List of the call order indexes of the mock. Jest is indexing the order of + * invocations of all mocks in a test file. The index is starting with `1`. + */ + invocationCallOrder: Array; + /** + * List of the call arguments of the last call that was made to the mock. + * If the function was not called, it will return `undefined`. + */ + lastCall?: Parameters; + /** + * List of the results of all calls that have been made to the mock. + */ + results: Array>; +}; + +export declare interface MockInstance< + T extends FunctionLike = UnknownFunction, +> { + _isMockFunction: true; + _protoImpl: Function; + getMockImplementation(): T | undefined; + getMockName(): string; + mock: MockFunctionState; + mockClear(): this; + mockReset(): this; + mockRestore(): void; + mockImplementation(fn: T): this; + mockImplementationOnce(fn: T): this; + withImplementation(fn: T, callback: () => Promise): Promise; + withImplementation(fn: T, callback: () => void): void; + mockName(name: string): this; + mockReturnThis(): this; + mockReturnValue(value: ReturnType): this; + mockReturnValueOnce(value: ReturnType): this; + mockResolvedValue(value: ResolveType): this; + mockResolvedValueOnce(value: ResolveType): this; + mockRejectedValue(value: RejectType): this; + mockRejectedValueOnce(value: RejectType): this; +} + +export declare type MockMetadata = { + ref?: number; + members?: Record>; + mockImpl?: T; + name?: string; + refID?: number; + type?: MetadataType; + value?: T; + length?: number; +}; + +export declare type MockMetadataType = + | 'object' + | 'array' + | 'regexp' + | 'function' + | 'constant' + | 'collection' + | 'null' + | 'undefined'; + +export declare class ModuleMocker { + private readonly _environmentGlobal; + private _mockState; + private _mockConfigRegistry; + private _spyState; + private _invocationCallCounter; + /** + * @see README.md + * @param global Global object of the test environment, used to create + * mocks + */ + constructor(global: typeof globalThis); + private _getSlots; + private _ensureMockConfig; + private _ensureMockState; + private _defaultMockConfig; + private _defaultMockState; + private _makeComponent; + private _createMockFunction; + private _generateMock; + /** + * Check whether the given property of an object has been already replaced. + */ + private _findReplacedProperty; + /** + * @see README.md + * @param metadata Metadata for the mock in the schema returned by the + * getMetadata method of this module. + */ + generateFromMetadata(metadata: MockMetadata): Mocked; + /** + * @see README.md + * @param component The component for which to retrieve metadata. + */ + getMetadata( + component: T, + _refs?: Map, + ): MockMetadata | null; + isMockFunction( + fn: MockInstance, + ): fn is MockInstance; + isMockFunction

, R>( + fn: (...args: P) => R, + ): fn is Mock<(...args: P) => R>; + isMockFunction(fn: unknown): fn is Mock; + fn(implementation?: T): Mock; + spyOn< + T extends object, + K extends PropertyLikeKeys, + V extends Required[K], + A extends 'get' | 'set', + >( + object: T, + methodKey: K, + accessType: A, + ): A extends 'get' + ? SpiedGetter + : A extends 'set' + ? SpiedSetter + : never; + spyOn< + T extends object, + K extends ConstructorLikeKeys | MethodLikeKeys, + V extends Required[K], + >( + object: T, + methodKey: K, + ): V extends ClassLike | FunctionLike ? Spied : never; + private _spyOnProperty; + replaceProperty( + object: T, + propertyKey: K, + value: T[K], + ): Replaced; + clearAllMocks(): void; + resetAllMocks(): void; + restoreAllMocks(): void; + private _typeOf; + mocked( + source: T, + options?: { + shallow: false; + }, + ): Mocked; + mocked( + source: T, + options: { + shallow: true; + }, + ): MockedShallow; +} + +export declare type PropertyLikeKeys = Exclude< + keyof T, + ConstructorLikeKeys | MethodLikeKeys +>; + +declare type RejectType = + ReturnType extends PromiseLike ? unknown : never; + +export declare interface Replaced { + /** + * Restore property to its original value known at the time of mocking. + */ + restore(): void; + /** + * Change the value of the property. + */ + replaceValue(value: T): this; +} + +export declare const replaceProperty: ( + object: T, + propertyKey: K, + value: T[K], +) => Replaced; + +declare type ResolveType = + ReturnType extends PromiseLike ? U : never; + +export declare type Spied = + T extends ClassLike + ? SpiedClass + : T extends FunctionLike + ? SpiedFunction + : never; + +export declare type SpiedClass = + MockInstance<(...args: ConstructorParameters) => InstanceType>; + +export declare type SpiedFunction = + MockInstance<(...args: Parameters) => ReturnType>; + +export declare type SpiedGetter = MockInstance<() => T>; + +export declare type SpiedSetter = MockInstance<(arg: T) => void>; + +export declare interface SpyInstance + extends MockInstance {} + +export declare const spyOn: { + < + T extends object, + K_2 extends Exclude< + keyof T, + | keyof { + [K in keyof T as Required[K] extends ClassLike ? K : never]: T[K]; + } + | keyof { + [K_1 in keyof T as Required[K_1] extends FunctionLike + ? K_1 + : never]: T[K_1]; + } + >, + V extends Required[K_2], + A extends 'set' | 'get', + >( + object: T, + methodKey: K_2, + accessType: A, + ): A extends 'get' + ? SpiedGetter + : A extends 'set' + ? SpiedSetter + : never; + < + T_1 extends object, + K_5 extends + | keyof { + [K_3 in keyof T_1 as Required[K_3] extends ClassLike + ? K_3 + : never]: T_1[K_3]; + } + | keyof { + [K_4 in keyof T_1 as Required[K_4] extends FunctionLike + ? K_4 + : never]: T_1[K_4]; + }, + V_1 extends Required[K_5], + >( + object: T_1, + methodKey: K_5, + ): V_1 extends ClassLike | FunctionLike ? Spied : never; +}; + +export declare type UnknownClass = { + new (...args: Array): unknown; +}; + +export declare type UnknownFunction = (...args: Array) => unknown; + +export {}; diff --git a/node_modules/jest-mock/build/index.js b/node_modules/jest-mock/build/index.js new file mode 100644 index 00000000..e070a509 --- /dev/null +++ b/node_modules/jest-mock/build/index.js @@ -0,0 +1,978 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.spyOn = + exports.replaceProperty = + exports.mocked = + exports.fn = + exports.ModuleMocker = + void 0; +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/* eslint-disable local/ban-types-eventually, local/prefer-rest-params-eventually */ + +// TODO remove re-export in Jest 30 + +// TODO remove re-export in Jest 30 + +// TODO in Jest 30 remove `SpyInstance` in favour of `Spied` +// eslint-disable-next-line @typescript-eslint/no-empty-interface +/** + * All what the internal typings need is to be sure that we have any-function. + * `FunctionLike` type ensures that and helps to constrain the type as well. + * The default of `UnknownFunction` makes sure that `any`s do not leak to the + * user side. For instance, calling `fn()` without implementation will return + * a mock of `(...args: Array) => unknown` type. If implementation + * is provided, its typings are inferred correctly. + */ +const MOCK_CONSTRUCTOR_NAME = 'mockConstructor'; +const FUNCTION_NAME_RESERVED_PATTERN = /[\s!-/:-@[-`{-~]/; +const FUNCTION_NAME_RESERVED_REPLACE = new RegExp( + FUNCTION_NAME_RESERVED_PATTERN.source, + 'g' +); +const RESERVED_KEYWORDS = new Set([ + 'arguments', + 'await', + 'break', + 'case', + 'catch', + 'class', + 'const', + 'continue', + 'debugger', + 'default', + 'delete', + 'do', + 'else', + 'enum', + 'eval', + 'export', + 'extends', + 'false', + 'finally', + 'for', + 'function', + 'if', + 'implements', + 'import', + 'in', + 'instanceof', + 'interface', + 'let', + 'new', + 'null', + 'package', + 'private', + 'protected', + 'public', + 'return', + 'static', + 'super', + 'switch', + 'this', + 'throw', + 'true', + 'try', + 'typeof', + 'var', + 'void', + 'while', + 'with', + 'yield' +]); +function matchArity(fn, length) { + let mockConstructor; + switch (length) { + case 1: + mockConstructor = function (_a) { + return fn.apply(this, arguments); + }; + break; + case 2: + mockConstructor = function (_a, _b) { + return fn.apply(this, arguments); + }; + break; + case 3: + mockConstructor = function (_a, _b, _c) { + return fn.apply(this, arguments); + }; + break; + case 4: + mockConstructor = function (_a, _b, _c, _d) { + return fn.apply(this, arguments); + }; + break; + case 5: + mockConstructor = function (_a, _b, _c, _d, _e) { + return fn.apply(this, arguments); + }; + break; + case 6: + mockConstructor = function (_a, _b, _c, _d, _e, _f) { + return fn.apply(this, arguments); + }; + break; + case 7: + mockConstructor = function (_a, _b, _c, _d, _e, _f, _g) { + return fn.apply(this, arguments); + }; + break; + case 8: + mockConstructor = function (_a, _b, _c, _d, _e, _f, _g, _h) { + return fn.apply(this, arguments); + }; + break; + case 9: + mockConstructor = function (_a, _b, _c, _d, _e, _f, _g, _h, _i) { + return fn.apply(this, arguments); + }; + break; + default: + mockConstructor = function () { + return fn.apply(this, arguments); + }; + break; + } + return mockConstructor; +} +function getObjectType(value) { + return Object.prototype.toString.apply(value).slice(8, -1); +} +function getType(ref) { + const typeName = getObjectType(ref); + if ( + typeName === 'Function' || + typeName === 'AsyncFunction' || + typeName === 'GeneratorFunction' || + typeName === 'AsyncGeneratorFunction' + ) { + return 'function'; + } else if (Array.isArray(ref)) { + return 'array'; + } else if (typeName === 'Object' || typeName === 'Module') { + return 'object'; + } else if ( + typeName === 'Number' || + typeName === 'String' || + typeName === 'Boolean' || + typeName === 'Symbol' + ) { + return 'constant'; + } else if ( + typeName === 'Map' || + typeName === 'WeakMap' || + typeName === 'Set' + ) { + return 'collection'; + } else if (typeName === 'RegExp') { + return 'regexp'; + } else if (ref === undefined) { + return 'undefined'; + } else if (ref === null) { + return 'null'; + } else { + return null; + } +} +function isReadonlyProp(object, prop) { + if ( + prop === 'arguments' || + prop === 'caller' || + prop === 'callee' || + prop === 'name' || + prop === 'length' + ) { + const typeName = getObjectType(object); + return ( + typeName === 'Function' || + typeName === 'AsyncFunction' || + typeName === 'GeneratorFunction' || + typeName === 'AsyncGeneratorFunction' + ); + } + if ( + prop === 'source' || + prop === 'global' || + prop === 'ignoreCase' || + prop === 'multiline' + ) { + return getObjectType(object) === 'RegExp'; + } + return false; +} +class ModuleMocker { + _environmentGlobal; + _mockState; + _mockConfigRegistry; + _spyState; + _invocationCallCounter; + + /** + * @see README.md + * @param global Global object of the test environment, used to create + * mocks + */ + constructor(global) { + this._environmentGlobal = global; + this._mockState = new WeakMap(); + this._mockConfigRegistry = new WeakMap(); + this._spyState = new Set(); + this._invocationCallCounter = 1; + } + _getSlots(object) { + if (!object) { + return []; + } + const slots = new Set(); + const EnvObjectProto = this._environmentGlobal.Object.prototype; + const EnvFunctionProto = this._environmentGlobal.Function.prototype; + const EnvRegExpProto = this._environmentGlobal.RegExp.prototype; + + // Also check the builtins in the current context as they leak through + // core node modules. + const ObjectProto = Object.prototype; + const FunctionProto = Function.prototype; + const RegExpProto = RegExp.prototype; + + // Properties of Object.prototype, Function.prototype and RegExp.prototype + // are never reported as slots + while ( + object != null && + object !== EnvObjectProto && + object !== EnvFunctionProto && + object !== EnvRegExpProto && + object !== ObjectProto && + object !== FunctionProto && + object !== RegExpProto + ) { + const ownNames = Object.getOwnPropertyNames(object); + for (let i = 0; i < ownNames.length; i++) { + const prop = ownNames[i]; + if (!isReadonlyProp(object, prop)) { + const propDesc = Object.getOwnPropertyDescriptor(object, prop); + if ((propDesc !== undefined && !propDesc.get) || object.__esModule) { + slots.add(prop); + } + } + } + object = Object.getPrototypeOf(object); + } + return Array.from(slots); + } + _ensureMockConfig(f) { + let config = this._mockConfigRegistry.get(f); + if (!config) { + config = this._defaultMockConfig(); + this._mockConfigRegistry.set(f, config); + } + return config; + } + _ensureMockState(f) { + let state = this._mockState.get(f); + if (!state) { + state = this._defaultMockState(); + this._mockState.set(f, state); + } + if (state.calls.length > 0) { + state.lastCall = state.calls[state.calls.length - 1]; + } + return state; + } + _defaultMockConfig() { + return { + mockImpl: undefined, + mockName: 'jest.fn()', + specificMockImpls: [] + }; + } + _defaultMockState() { + return { + calls: [], + contexts: [], + instances: [], + invocationCallOrder: [], + results: [] + }; + } + _makeComponent(metadata, restore) { + if (metadata.type === 'object') { + return new this._environmentGlobal.Object(); + } else if (metadata.type === 'array') { + return new this._environmentGlobal.Array(); + } else if (metadata.type === 'regexp') { + return new this._environmentGlobal.RegExp(''); + } else if ( + metadata.type === 'constant' || + metadata.type === 'collection' || + metadata.type === 'null' || + metadata.type === 'undefined' + ) { + return metadata.value; + } else if (metadata.type === 'function') { + const prototype = + (metadata.members && + metadata.members.prototype && + metadata.members.prototype.members) || + {}; + const prototypeSlots = this._getSlots(prototype); + // eslint-disable-next-line @typescript-eslint/no-this-alias + const mocker = this; + const mockConstructor = matchArity(function (...args) { + const mockState = mocker._ensureMockState(f); + const mockConfig = mocker._ensureMockConfig(f); + mockState.instances.push(this); + mockState.contexts.push(this); + mockState.calls.push(args); + // Create and record an "incomplete" mock result immediately upon + // calling rather than waiting for the mock to return. This avoids + // issues caused by recursion where results can be recorded in the + // wrong order. + const mockResult = { + type: 'incomplete', + value: undefined + }; + mockState.results.push(mockResult); + mockState.invocationCallOrder.push(mocker._invocationCallCounter++); + + // Will be set to the return value of the mock if an error is not thrown + let finalReturnValue; + // Will be set to the error that is thrown by the mock (if it throws) + let thrownError; + // Will be set to true if the mock throws an error. The presence of a + // value in `thrownError` is not a 100% reliable indicator because a + // function could throw a value of undefined. + let callDidThrowError = false; + try { + // The bulk of the implementation is wrapped in an immediately + // executed arrow function so the return value of the mock function + // can be easily captured and recorded, despite the many separate + // return points within the logic. + finalReturnValue = (() => { + if (this instanceof f) { + // This is probably being called as a constructor + prototypeSlots.forEach(slot => { + // Copy prototype methods to the instance to make + // it easier to interact with mock instance call and + // return values + if (prototype[slot].type === 'function') { + // @ts-expect-error no index signature + const protoImpl = this[slot]; + // @ts-expect-error no index signature + this[slot] = mocker.generateFromMetadata(prototype[slot]); + // @ts-expect-error no index signature + this[slot]._protoImpl = protoImpl; + } + }); + + // Run the mock constructor implementation + const mockImpl = mockConfig.specificMockImpls.length + ? mockConfig.specificMockImpls.shift() + : mockConfig.mockImpl; + return mockImpl && mockImpl.apply(this, arguments); + } + + // If mockImplementationOnce()/mockImplementation() is last set, + // implementation use the mock + let specificMockImpl = mockConfig.specificMockImpls.shift(); + if (specificMockImpl === undefined) { + specificMockImpl = mockConfig.mockImpl; + } + if (specificMockImpl) { + return specificMockImpl.apply(this, arguments); + } + // Otherwise use prototype implementation + if (f._protoImpl) { + return f._protoImpl.apply(this, arguments); + } + return undefined; + })(); + } catch (error) { + // Store the thrown error so we can record it, then re-throw it. + thrownError = error; + callDidThrowError = true; + throw error; + } finally { + // Record the result of the function. + // NOTE: Intentionally NOT pushing/indexing into the array of mock + // results here to avoid corrupting results data if mockClear() + // is called during the execution of the mock. + // @ts-expect-error reassigning 'incomplete' + mockResult.type = callDidThrowError ? 'throw' : 'return'; + mockResult.value = callDidThrowError ? thrownError : finalReturnValue; + } + return finalReturnValue; + }, metadata.length || 0); + const f = this._createMockFunction(metadata, mockConstructor); + f._isMockFunction = true; + f.getMockImplementation = () => this._ensureMockConfig(f).mockImpl; + if (typeof restore === 'function') { + this._spyState.add(restore); + } + this._mockState.set(f, this._defaultMockState()); + this._mockConfigRegistry.set(f, this._defaultMockConfig()); + Object.defineProperty(f, 'mock', { + configurable: false, + enumerable: true, + get: () => this._ensureMockState(f), + set: val => this._mockState.set(f, val) + }); + f.mockClear = () => { + this._mockState.delete(f); + return f; + }; + f.mockReset = () => { + f.mockClear(); + this._mockConfigRegistry.delete(f); + return f; + }; + f.mockRestore = () => { + f.mockReset(); + return restore ? restore() : undefined; + }; + f.mockReturnValueOnce = value => + // next function call will return this value or default return value + f.mockImplementationOnce(() => value); + f.mockResolvedValueOnce = value => + f.mockImplementationOnce(() => + this._environmentGlobal.Promise.resolve(value) + ); + f.mockRejectedValueOnce = value => + f.mockImplementationOnce(() => + this._environmentGlobal.Promise.reject(value) + ); + f.mockReturnValue = value => + // next function call will return specified return value or this one + f.mockImplementation(() => value); + f.mockResolvedValue = value => + f.mockImplementation(() => + this._environmentGlobal.Promise.resolve(value) + ); + f.mockRejectedValue = value => + f.mockImplementation(() => + this._environmentGlobal.Promise.reject(value) + ); + f.mockImplementationOnce = fn => { + // next function call will use this mock implementation return value + // or default mock implementation return value + const mockConfig = this._ensureMockConfig(f); + mockConfig.specificMockImpls.push(fn); + return f; + }; + f.withImplementation = withImplementation.bind(this); + function withImplementation(fn, callback) { + // Remember previous mock implementation, then set new one + const mockConfig = this._ensureMockConfig(f); + const previousImplementation = mockConfig.mockImpl; + const previousSpecificImplementations = mockConfig.specificMockImpls; + mockConfig.mockImpl = fn; + mockConfig.specificMockImpls = []; + const returnedValue = callback(); + if ((0, _jestUtil().isPromise)(returnedValue)) { + return returnedValue.then(() => { + mockConfig.mockImpl = previousImplementation; + mockConfig.specificMockImpls = previousSpecificImplementations; + }); + } else { + mockConfig.mockImpl = previousImplementation; + mockConfig.specificMockImpls = previousSpecificImplementations; + } + } + f.mockImplementation = fn => { + // next function call will use mock implementation return value + const mockConfig = this._ensureMockConfig(f); + mockConfig.mockImpl = fn; + return f; + }; + f.mockReturnThis = () => + f.mockImplementation(function () { + return this; + }); + f.mockName = name => { + if (name) { + const mockConfig = this._ensureMockConfig(f); + mockConfig.mockName = name; + } + return f; + }; + f.getMockName = () => { + const mockConfig = this._ensureMockConfig(f); + return mockConfig.mockName || 'jest.fn()'; + }; + if (metadata.mockImpl) { + f.mockImplementation(metadata.mockImpl); + } + return f; + } else { + const unknownType = metadata.type || 'undefined type'; + throw new Error(`Unrecognized type ${unknownType}`); + } + } + _createMockFunction(metadata, mockConstructor) { + let name = metadata.name; + if (!name) { + return mockConstructor; + } + + // Preserve `name` property of mocked function. + const boundFunctionPrefix = 'bound '; + let bindCall = ''; + // if-do-while for perf reasons. The common case is for the if to fail. + if (name.startsWith(boundFunctionPrefix)) { + do { + name = name.substring(boundFunctionPrefix.length); + // Call bind() just to alter the function name. + bindCall = '.bind(null)'; + } while (name && name.startsWith(boundFunctionPrefix)); + } + + // Special case functions named `mockConstructor` to guard for infinite loops + if (name === MOCK_CONSTRUCTOR_NAME) { + return mockConstructor; + } + if ( + // It's a syntax error to define functions with a reserved keyword as name + RESERVED_KEYWORDS.has(name) || + // It's also a syntax error to define functions with a name that starts with a number + /^\d/.test(name) + ) { + name = `$${name}`; + } + + // It's also a syntax error to define a function with a reserved character + // as part of it's name. + if (FUNCTION_NAME_RESERVED_PATTERN.test(name)) { + name = name.replace(FUNCTION_NAME_RESERVED_REPLACE, '$'); + } + const body = + `return function ${name}() {` + + ` return ${MOCK_CONSTRUCTOR_NAME}.apply(this,arguments);` + + `}${bindCall}`; + const createConstructor = new this._environmentGlobal.Function( + MOCK_CONSTRUCTOR_NAME, + body + ); + return createConstructor(mockConstructor); + } + _generateMock(metadata, callbacks, refs) { + // metadata not compatible but it's the same type, maybe problem with + // overloading of _makeComponent and not _generateMock? + // @ts-expect-error - unsure why TSC complains here? + const mock = this._makeComponent(metadata); + if (metadata.refID != null) { + refs[metadata.refID] = mock; + } + this._getSlots(metadata.members).forEach(slot => { + const slotMetadata = (metadata.members && metadata.members[slot]) || {}; + if (slotMetadata.ref != null) { + callbacks.push( + (function (ref) { + return () => (mock[slot] = refs[ref]); + })(slotMetadata.ref) + ); + } else { + mock[slot] = this._generateMock(slotMetadata, callbacks, refs); + } + }); + if ( + metadata.type !== 'undefined' && + metadata.type !== 'null' && + mock.prototype && + typeof mock.prototype === 'object' + ) { + mock.prototype.constructor = mock; + } + return mock; + } + + /** + * Check whether the given property of an object has been already replaced. + */ + _findReplacedProperty(object, propertyKey) { + for (const spyState of this._spyState) { + if ( + 'object' in spyState && + 'property' in spyState && + spyState.object === object && + spyState.property === propertyKey + ) { + return spyState; + } + } + return; + } + + /** + * @see README.md + * @param metadata Metadata for the mock in the schema returned by the + * getMetadata method of this module. + */ + generateFromMetadata(metadata) { + const callbacks = []; + const refs = {}; + const mock = this._generateMock(metadata, callbacks, refs); + callbacks.forEach(setter => setter()); + return mock; + } + + /** + * @see README.md + * @param component The component for which to retrieve metadata. + */ + getMetadata(component, _refs) { + const refs = _refs || new Map(); + const ref = refs.get(component); + if (ref != null) { + return { + ref + }; + } + const type = getType(component); + if (!type) { + return null; + } + const metadata = { + type + }; + if ( + type === 'constant' || + type === 'collection' || + type === 'undefined' || + type === 'null' + ) { + metadata.value = component; + return metadata; + } else if (type === 'function') { + // @ts-expect-error component is a function so it has a name, but not + // necessarily a string: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name#function_names_in_classes + const componentName = component.name; + if (typeof componentName === 'string') { + metadata.name = componentName; + } + if (this.isMockFunction(component)) { + metadata.mockImpl = component.getMockImplementation(); + } + } + metadata.refID = refs.size; + refs.set(component, metadata.refID); + let members = null; + // Leave arrays alone + if (type !== 'array') { + // @ts-expect-error component is object + this._getSlots(component).forEach(slot => { + if ( + type === 'function' && + this.isMockFunction(component) && + slot.match(/^mock/) + ) { + return; + } + // @ts-expect-error no index signature + const slotMetadata = this.getMetadata(component[slot], refs); + if (slotMetadata) { + if (!members) { + members = {}; + } + members[slot] = slotMetadata; + } + }); + } + if (members) { + metadata.members = members; + } + return metadata; + } + isMockFunction(fn) { + return fn != null && fn._isMockFunction === true; + } + fn(implementation) { + const length = implementation ? implementation.length : 0; + const fn = this._makeComponent({ + length, + type: 'function' + }); + if (implementation) { + fn.mockImplementation(implementation); + } + return fn; + } + spyOn(object, methodKey, accessType) { + if ( + object == null || + (typeof object !== 'object' && typeof object !== 'function') + ) { + throw new Error( + `Cannot use spyOn on a primitive value; ${this._typeOf(object)} given` + ); + } + if (methodKey == null) { + throw new Error('No property name supplied'); + } + if (accessType) { + return this._spyOnProperty(object, methodKey, accessType); + } + const original = object[methodKey]; + if (!original) { + throw new Error( + `Property \`${String( + methodKey + )}\` does not exist in the provided object` + ); + } + if (!this.isMockFunction(original)) { + if (typeof original !== 'function') { + throw new Error( + `Cannot spy on the \`${String( + methodKey + )}\` property because it is not a function; ${this._typeOf( + original + )} given instead.${ + typeof original !== 'object' + ? ` If you are trying to mock a property, use \`jest.replaceProperty(object, '${String( + methodKey + )}', value)\` instead.` + : '' + }` + ); + } + const isMethodOwner = Object.prototype.hasOwnProperty.call( + object, + methodKey + ); + let descriptor = Object.getOwnPropertyDescriptor(object, methodKey); + let proto = Object.getPrototypeOf(object); + while (!descriptor && proto !== null) { + descriptor = Object.getOwnPropertyDescriptor(proto, methodKey); + proto = Object.getPrototypeOf(proto); + } + let mock; + if (descriptor && descriptor.get) { + const originalGet = descriptor.get; + mock = this._makeComponent( + { + type: 'function' + }, + () => { + descriptor.get = originalGet; + Object.defineProperty(object, methodKey, descriptor); + } + ); + descriptor.get = () => mock; + Object.defineProperty(object, methodKey, descriptor); + } else { + mock = this._makeComponent( + { + type: 'function' + }, + () => { + if (isMethodOwner) { + object[methodKey] = original; + } else { + delete object[methodKey]; + } + } + ); + // @ts-expect-error overriding original method with a Mock + object[methodKey] = mock; + } + mock.mockImplementation(function () { + return original.apply(this, arguments); + }); + } + return object[methodKey]; + } + _spyOnProperty(object, propertyKey, accessType) { + let descriptor = Object.getOwnPropertyDescriptor(object, propertyKey); + let proto = Object.getPrototypeOf(object); + while (!descriptor && proto !== null) { + descriptor = Object.getOwnPropertyDescriptor(proto, propertyKey); + proto = Object.getPrototypeOf(proto); + } + if (!descriptor) { + throw new Error( + `Property \`${String( + propertyKey + )}\` does not exist in the provided object` + ); + } + if (!descriptor.configurable) { + throw new Error( + `Property \`${String(propertyKey)}\` is not declared configurable` + ); + } + if (!descriptor[accessType]) { + throw new Error( + `Property \`${String( + propertyKey + )}\` does not have access type ${accessType}` + ); + } + const original = descriptor[accessType]; + if (!this.isMockFunction(original)) { + if (typeof original !== 'function') { + throw new Error( + `Cannot spy on the ${String( + propertyKey + )} property because it is not a function; ${this._typeOf( + original + )} given instead.${ + typeof original !== 'object' + ? ` If you are trying to mock a property, use \`jest.replaceProperty(object, '${String( + propertyKey + )}', value)\` instead.` + : '' + }` + ); + } + descriptor[accessType] = this._makeComponent( + { + type: 'function' + }, + () => { + // @ts-expect-error: mock is assignable + descriptor[accessType] = original; + Object.defineProperty(object, propertyKey, descriptor); + } + ); + descriptor[accessType].mockImplementation(function () { + // @ts-expect-error - wrong context + return original.apply(this, arguments); + }); + } + Object.defineProperty(object, propertyKey, descriptor); + return descriptor[accessType]; + } + replaceProperty(object, propertyKey, value) { + if ( + object == null || + (typeof object !== 'object' && typeof object !== 'function') + ) { + throw new Error( + `Cannot use replaceProperty on a primitive value; ${this._typeOf( + object + )} given` + ); + } + if (propertyKey == null) { + throw new Error('No property name supplied'); + } + let descriptor = Object.getOwnPropertyDescriptor(object, propertyKey); + let proto = Object.getPrototypeOf(object); + while (!descriptor && proto !== null) { + descriptor = Object.getOwnPropertyDescriptor(proto, propertyKey); + proto = Object.getPrototypeOf(proto); + } + if (!descriptor) { + throw new Error( + `Property \`${String( + propertyKey + )}\` does not exist in the provided object` + ); + } + if (!descriptor.configurable) { + throw new Error( + `Property \`${String(propertyKey)}\` is not declared configurable` + ); + } + if (descriptor.get !== undefined) { + throw new Error( + `Cannot replace the \`${String( + propertyKey + )}\` property because it has a getter. Use \`jest.spyOn(object, '${String( + propertyKey + )}', 'get').mockReturnValue(value)\` instead.` + ); + } + if (descriptor.set !== undefined) { + throw new Error( + `Cannot replace the \`${String( + propertyKey + )}\` property because it has a setter. Use \`jest.spyOn(object, '${String( + propertyKey + )}', 'set').mockReturnValue(value)\` instead.` + ); + } + if (typeof descriptor.value === 'function') { + throw new Error( + `Cannot replace the \`${String( + propertyKey + )}\` property because it is a function. Use \`jest.spyOn(object, '${String( + propertyKey + )}')\` instead.` + ); + } + const existingRestore = this._findReplacedProperty(object, propertyKey); + if (existingRestore) { + return existingRestore.replaced.replaceValue(value); + } + const isPropertyOwner = Object.prototype.hasOwnProperty.call( + object, + propertyKey + ); + const originalValue = descriptor.value; + const restore = () => { + if (isPropertyOwner) { + object[propertyKey] = originalValue; + } else { + delete object[propertyKey]; + } + }; + const replaced = { + replaceValue: value => { + object[propertyKey] = value; + return replaced; + }, + restore: () => { + restore(); + this._spyState.delete(restore); + } + }; + restore.object = object; + restore.property = propertyKey; + restore.replaced = replaced; + this._spyState.add(restore); + return replaced.replaceValue(value); + } + clearAllMocks() { + this._mockState = new WeakMap(); + } + resetAllMocks() { + this._mockConfigRegistry = new WeakMap(); + this._mockState = new WeakMap(); + } + restoreAllMocks() { + this._spyState.forEach(restore => restore()); + this._spyState = new Set(); + } + _typeOf(value) { + return value == null ? `${value}` : typeof value; + } + mocked(source, _options) { + return source; + } +} +exports.ModuleMocker = ModuleMocker; +const JestMock = new ModuleMocker(globalThis); +const fn = JestMock.fn.bind(JestMock); +exports.fn = fn; +const spyOn = JestMock.spyOn.bind(JestMock); +exports.spyOn = spyOn; +const mocked = JestMock.mocked.bind(JestMock); +exports.mocked = mocked; +const replaceProperty = JestMock.replaceProperty.bind(JestMock); +exports.replaceProperty = replaceProperty; diff --git a/node_modules/jest-mock/package.json b/node_modules/jest-mock/package.json new file mode 100644 index 00000000..e47872ac --- /dev/null +++ b/node_modules/jest-mock/package.json @@ -0,0 +1,35 @@ +{ + "name": "jest-mock", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-mock" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" + }, + "devDependencies": { + "@tsd/typescript": "^5.0.4", + "tsd-lite": "^0.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-pnp-resolver/README.md b/node_modules/jest-pnp-resolver/README.md new file mode 100644 index 00000000..20bf42a2 --- /dev/null +++ b/node_modules/jest-pnp-resolver/README.md @@ -0,0 +1,34 @@ +# [Plug'n'Play](https://github.com/yarnpkg/rfcs/pull/101) resolver for Jest + +[![npm version](https://img.shields.io/npm/v/jest-pnp-resolver.svg)](https://www.npmjs.com/package/jest-pnp-resolver) +[![node version](https://img.shields.io/node/v/jest-pnp-resolver.svg)](https://www.npmjs.com/package/jest-pnp-resolver) + +*This plugin is also available for Rollup ([rollup-plugin-pnp-resolve](https://github.com/arcanis/rollup-plugin-pnp-resolve)), TypeScript ([ts-pnp](https://github.com/arcanis/ts-pnp)), and Webpack ([pnp-webpack-plugin](https://github.com/arcanis/pnp-webpack-plugin))* + +## Installation + +``` +yarn add -D jest-pnp-resolver +``` + +## Usage + +As of `jest@^24.4.0` you don't need to manually add this package anymore. The default resolver will already use PnP. + +Simply add the resolver to your configuration. For example, a minimal `jest.config.js` would be as such: + +```js +module.exports = { + resolver: require.resolve(`jest-pnp-resolver`) +}; +``` + +## License (MIT) + +> **Copyright © 2016 Maël Nison** +> +> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jest-pnp-resolver/createRequire.js b/node_modules/jest-pnp-resolver/createRequire.js new file mode 100644 index 00000000..7da60d67 --- /dev/null +++ b/node_modules/jest-pnp-resolver/createRequire.js @@ -0,0 +1,25 @@ +const nativeModule = require(`module`); + +module.exports = (filename) => { + // Added in Node v12.2.0 + if (nativeModule.createRequire) { + return nativeModule.createRequire(filename); + } + + // Added in Node v10.12.0 and deprecated since Node v12.2.0 + if (nativeModule.createRequireFromPath) { + return nativeModule.createRequireFromPath(filename); + } + + // Polyfill + return _createRequire(filename); +}; + +// Polyfill +function _createRequire (filename) { + const mod = new nativeModule.Module(filename, null) + mod.filename = filename + mod.paths = nativeModule.Module._nodeModulePaths(path.dirname(filename)) + mod._compile(`module.exports = require;`, filename) + return mod.exports +} diff --git a/node_modules/jest-pnp-resolver/getDefaultResolver.js b/node_modules/jest-pnp-resolver/getDefaultResolver.js new file mode 100644 index 00000000..ab90dbc8 --- /dev/null +++ b/node_modules/jest-pnp-resolver/getDefaultResolver.js @@ -0,0 +1,13 @@ +let defaultResolver; + +module.exports = () => { + if (!defaultResolver) { + try { + defaultResolver = require(`jest-resolve/build/defaultResolver`).default; + } catch (error) { + defaultResolver = require(`jest-resolve/build/default_resolver`).default; + } + } + + return defaultResolver; +}; diff --git a/node_modules/jest-pnp-resolver/index.d.ts b/node_modules/jest-pnp-resolver/index.d.ts new file mode 100644 index 00000000..1acbbac8 --- /dev/null +++ b/node_modules/jest-pnp-resolver/index.d.ts @@ -0,0 +1,10 @@ +type JestResolverOptions = { + basedir: string; + defaultResolver: (request: string, opts: any) => string, + extensions?: Array, +}; + +export default function resolve( + request: string, + options: JestResolverOptions, +): string; diff --git a/node_modules/jest-pnp-resolver/index.js b/node_modules/jest-pnp-resolver/index.js new file mode 100644 index 00000000..2b74c083 --- /dev/null +++ b/node_modules/jest-pnp-resolver/index.js @@ -0,0 +1,50 @@ +let globalPnpApi; +try { + globalPnpApi = require(`pnpapi`); +} catch { + // Just ignore if we don't have a global PnP instance - perhaps + // we'll eventually find one at runtime due to multi-tree +} + +const createRequire = require(`./createRequire`); +const getDefaultResolver = require(`./getDefaultResolver`); + +module.exports = (request, options) => { + const { + basedir, + defaultResolver = getDefaultResolver(), + extensions, + } = options; + + if (process.versions.pnp) { + let pnpApi = globalPnpApi; + + // While technically it would be more correct to run this code + // everytime (since they file being run *may* belong to a + // different dependency tree than the one owning Jest), in + // practice this doesn't happen anywhere else than on the Jest + // repository itself (in the test env). So in order to preserve + // the performances, we can afford a slight incoherence here. + if (!pnpApi) { + try { + const baseReq = createRequire(`${basedir}/internal.js`); + pnpApi = baseReq(`pnpapi`); + } catch { + // The file isn't part of a PnP dependency tree, so we can + // just use the default Jest resolver. + } + } + + if (pnpApi) { + const resolution = pnpApi.resolveRequest(request, `${basedir}/`, {extensions}); + + // When the request is a native module, Jest expects to get the string back unmodified, but pnp returns null instead. + if (resolution === null) + return request; + + return resolution; + } + } + + return defaultResolver(request, {...options, allowPnp: false}); +}; diff --git a/node_modules/jest-pnp-resolver/package.json b/node_modules/jest-pnp-resolver/package.json new file mode 100644 index 00000000..01f8e151 --- /dev/null +++ b/node_modules/jest-pnp-resolver/package.json @@ -0,0 +1,31 @@ +{ + "name": "jest-pnp-resolver", + "version": "1.2.3", + "description": "plug'n'play resolver for Webpack", + "license": "MIT", + "engines": { + "node": ">=6" + }, + "homepage": "https://github.com/arcanis/jest-pnp-resolver", + "bugs": { + "url": "https://github.com/arcanis/jest-pnp-resolver/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/arcanis/jest-pnp-resolver.git" + }, + "keywords": [ + "jest", + "yarn", + "plugnplay", + "pnp" + ], + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } +} diff --git a/node_modules/jest-regex-util/LICENSE b/node_modules/jest-regex-util/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-regex-util/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-regex-util/build/index.d.ts b/node_modules/jest-regex-util/build/index.d.ts new file mode 100644 index 00000000..8de70810 --- /dev/null +++ b/node_modules/jest-regex-util/build/index.d.ts @@ -0,0 +1,20 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ +export declare const escapePathForRegex: (dir: string) => string; + +export declare const escapeStrForRegex: (string: string) => string; + +export declare const replacePathSepForRegex: (string: string) => string; + +export {}; diff --git a/node_modules/jest-regex-util/build/index.js b/node_modules/jest-regex-util/build/index.js new file mode 100644 index 00000000..0bb27016 --- /dev/null +++ b/node_modules/jest-regex-util/build/index.js @@ -0,0 +1,40 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.replacePathSepForRegex = + exports.escapeStrForRegex = + exports.escapePathForRegex = + void 0; +var _path = require('path'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +const escapePathForRegex = dir => { + if (_path.sep === '\\') { + // Replace "\" with "/" so it's not escaped by escapeStrForRegex. + // replacePathSepForRegex will convert it back. + dir = dir.replace(/\\/g, '/'); + } + return replacePathSepForRegex(escapeStrForRegex(dir)); +}; +exports.escapePathForRegex = escapePathForRegex; +const escapeStrForRegex = string => + string.replace(/[[\]{}()*+?.\\^$|]/g, '\\$&'); +exports.escapeStrForRegex = escapeStrForRegex; +const replacePathSepForRegex = string => { + if (_path.sep === '\\') { + return string.replace( + /(\/|(.)?\\(?![[\]{}()*+?.^$|\\]))/g, + (_match, _, p2) => (p2 && p2 !== '\\' ? `${p2}\\\\` : '\\\\') + ); + } + return string; +}; +exports.replacePathSepForRegex = replacePathSepForRegex; diff --git a/node_modules/jest-regex-util/package.json b/node_modules/jest-regex-util/package.json new file mode 100644 index 00000000..ed8bc707 --- /dev/null +++ b/node_modules/jest-regex-util/package.json @@ -0,0 +1,29 @@ +{ + "name": "jest-regex-util", + "version": "29.6.3", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-regex-util" + }, + "devDependencies": { + "@types/node": "*" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "fb7d95c8af6e0d65a8b65348433d8a0ea0725b5b" +} diff --git a/node_modules/jest-resolve-dependencies/LICENSE b/node_modules/jest-resolve-dependencies/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-resolve-dependencies/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-resolve-dependencies/build/index.d.ts b/node_modules/jest-resolve-dependencies/build/index.d.ts new file mode 100644 index 00000000..267bfc61 --- /dev/null +++ b/node_modules/jest-resolve-dependencies/build/index.d.ts @@ -0,0 +1,43 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {default as default_2} from 'jest-resolve'; +import type {IHasteFS} from 'jest-haste-map'; +import type {ResolveModuleConfig} from 'jest-resolve'; +import {SnapshotResolver} from 'jest-snapshot'; + +/** + * DependencyResolver is used to resolve the direct dependencies of a module or + * to retrieve a list of all transitive inverse dependencies. + */ +export declare class DependencyResolver { + private readonly _hasteFS; + private readonly _resolver; + private readonly _snapshotResolver; + constructor( + resolver: default_2, + hasteFS: IHasteFS, + snapshotResolver: SnapshotResolver, + ); + resolve(file: string, options?: ResolveModuleConfig): Array; + resolveInverseModuleMap( + paths: Set, + filter: (file: string) => boolean, + options?: ResolveModuleConfig, + ): Array; + resolveInverse( + paths: Set, + filter: (file: string) => boolean, + options?: ResolveModuleConfig, + ): Array; +} + +export declare type ResolvedModule = { + file: string; + dependencies: Array; +}; + +export {}; diff --git a/node_modules/jest-resolve-dependencies/build/index.js b/node_modules/jest-resolve-dependencies/build/index.js new file mode 100644 index 00000000..9decff2c --- /dev/null +++ b/node_modules/jest-resolve-dependencies/build/index.js @@ -0,0 +1,197 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.DependencyResolver = void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _jestSnapshot() { + const data = require('jest-snapshot'); + _jestSnapshot = function () { + return data; + }; + return data; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * DependencyResolver is used to resolve the direct dependencies of a module or + * to retrieve a list of all transitive inverse dependencies. + */ +class DependencyResolver { + _hasteFS; + _resolver; + _snapshotResolver; + constructor(resolver, hasteFS, snapshotResolver) { + this._resolver = resolver; + this._hasteFS = hasteFS; + this._snapshotResolver = snapshotResolver; + } + resolve(file, options) { + const dependencies = this._hasteFS.getDependencies(file); + if (!dependencies) { + return []; + } + return dependencies.reduce((acc, dependency) => { + if (this._resolver.isCoreModule(dependency)) { + return acc; + } + let resolvedDependency; + let resolvedMockDependency; + try { + resolvedDependency = this._resolver.resolveModule( + file, + dependency, + options + ); + } catch { + try { + resolvedDependency = this._resolver.getMockModule(file, dependency); + } catch { + // leave resolvedDependency as undefined if nothing can be found + } + } + if (resolvedDependency == null) { + return acc; + } + acc.push(resolvedDependency); + + // If we resolve a dependency, then look for a mock dependency + // of the same name in that dependency's directory. + try { + resolvedMockDependency = this._resolver.getMockModule( + resolvedDependency, + path().basename(dependency) + ); + } catch { + // leave resolvedMockDependency as undefined if nothing can be found + } + if (resolvedMockDependency != null) { + const dependencyMockDir = path().resolve( + path().dirname(resolvedDependency), + '__mocks__' + ); + resolvedMockDependency = path().resolve(resolvedMockDependency); + + // make sure mock is in the correct directory + if (dependencyMockDir === path().dirname(resolvedMockDependency)) { + acc.push(resolvedMockDependency); + } + } + return acc; + }, []); + } + resolveInverseModuleMap(paths, filter, options) { + if (!paths.size) { + return []; + } + const collectModules = (related, moduleMap, changed) => { + const visitedModules = new Set(); + const result = []; + while (changed.size) { + changed = new Set( + moduleMap.reduce((acc, module) => { + if ( + visitedModules.has(module.file) || + !module.dependencies.some(dep => changed.has(dep)) + ) { + return acc; + } + const file = module.file; + if (filter(file)) { + result.push(module); + related.delete(file); + } + visitedModules.add(file); + acc.push(file); + return acc; + }, []) + ); + } + return result.concat( + Array.from(related).map(file => ({ + dependencies: [], + file + })) + ); + }; + const relatedPaths = new Set(); + const changed = new Set(); + for (const path of paths) { + if (this._hasteFS.exists(path)) { + const modulePath = (0, _jestSnapshot().isSnapshotPath)(path) + ? this._snapshotResolver.resolveTestPath(path) + : path; + changed.add(modulePath); + if (filter(modulePath)) { + relatedPaths.add(modulePath); + } + } + } + const modules = []; + for (const file of this._hasteFS.getAbsoluteFileIterator()) { + modules.push({ + dependencies: this.resolve(file, options), + file + }); + } + return collectModules(relatedPaths, modules, changed); + } + resolveInverse(paths, filter, options) { + return this.resolveInverseModuleMap(paths, filter, options).map( + module => module.file + ); + } +} +exports.DependencyResolver = DependencyResolver; diff --git a/node_modules/jest-resolve-dependencies/package.json b/node_modules/jest-resolve-dependencies/package.json new file mode 100644 index 00000000..bbeeb06c --- /dev/null +++ b/node_modules/jest-resolve-dependencies/package.json @@ -0,0 +1,37 @@ +{ + "name": "jest-resolve-dependencies", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-resolve-dependencies" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, + "devDependencies": { + "@jest/test-utils": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-haste-map": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-resolve/LICENSE b/node_modules/jest-resolve/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-resolve/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-resolve/build/ModuleNotFoundError.js b/node_modules/jest-resolve/build/ModuleNotFoundError.js new file mode 100644 index 00000000..9a877787 --- /dev/null +++ b/node_modules/jest-resolve/build/ModuleNotFoundError.js @@ -0,0 +1,108 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _slash() { + const data = _interopRequireDefault(require('slash')); + _slash = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class ModuleNotFoundError extends Error { + code = 'MODULE_NOT_FOUND'; + hint; + requireStack; + siblingWithSimilarExtensionFound; + moduleName; + _originalMessage; + constructor(message, moduleName) { + super(message); + this._originalMessage = message; + this.moduleName = moduleName; + } + buildMessage(rootDir) { + if (!this._originalMessage) { + this._originalMessage = this.message || ''; + } + let message = this._originalMessage; + if (this.requireStack?.length && this.requireStack.length > 1) { + message += ` + +Require stack: + ${this.requireStack + .map(p => p.replace(`${rootDir}${path().sep}`, '')) + .map(_slash().default) + .join('\n ')} +`; + } + if (this.hint) { + message += this.hint; + } + this.message = message; + } + static duckType(error) { + error.buildMessage = ModuleNotFoundError.prototype.buildMessage; + return error; + } +} +exports.default = ModuleNotFoundError; diff --git a/node_modules/jest-resolve/build/defaultResolver.js b/node_modules/jest-resolve/build/defaultResolver.js new file mode 100644 index 00000000..ecfb3f20 --- /dev/null +++ b/node_modules/jest-resolve/build/defaultResolver.js @@ -0,0 +1,240 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _path() { + const data = require('path'); + _path = function () { + return data; + }; + return data; +} +function _jestPnpResolver() { + const data = _interopRequireDefault(require('jest-pnp-resolver')); + _jestPnpResolver = function () { + return data; + }; + return data; +} +function _resolve() { + const data = require('resolve'); + _resolve = function () { + return data; + }; + return data; +} +var resolve = _interopRequireWildcard(require('resolve.exports')); +var _fileWalkers = require('./fileWalkers'); +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * Allows transforming parsed `package.json` contents. + * + * @param pkg - Parsed `package.json` contents. + * @param file - Path to `package.json` file. + * @param dir - Directory that contains the `package.json`. + * + * @returns Transformed `package.json` contents. + */ + +/** + * Allows transforming a path within a package. + * + * @param pkg - Parsed `package.json` contents. + * @param path - Path being resolved. + * @param relativePath - Path relative from the `package.json` location. + * + * @returns Relative path that will be joined from the `package.json` location. + */ + +const defaultResolver = (path, options) => { + // Yarn 2 adds support to `resolve` automatically so the pnpResolver is only + // needed for Yarn 1 which implements version 1 of the pnp spec + if (process.versions.pnp === '1') { + return (0, _jestPnpResolver().default)(path, options); + } + const resolveOptions = { + ...options, + isDirectory: _fileWalkers.isDirectory, + isFile: _fileWalkers.isFile, + preserveSymlinks: false, + readPackageSync, + realpathSync: _fileWalkers.realpathSync + }; + const pathToResolve = getPathInModule(path, resolveOptions); + + // resolveSync dereferences symlinks to ensure we don't create a separate + // module instance depending on how it was referenced. + const result = (0, _resolve().sync)(pathToResolve, resolveOptions); + return result; +}; +var _default = defaultResolver; +/* + * helper functions + */ +exports.default = _default; +function readPackageSync(_, file) { + return (0, _fileWalkers.readPackageCached)(file); +} +function getPathInModule(path, options) { + if (shouldIgnoreRequestForExports(path)) { + return path; + } + if (path.startsWith('#')) { + const closestPackageJson = (0, _fileWalkers.findClosestPackageJson)( + options.basedir + ); + if (!closestPackageJson) { + throw new Error( + `Jest: unable to locate closest package.json from ${options.basedir} when resolving import "${path}"` + ); + } + const pkg = (0, _fileWalkers.readPackageCached)(closestPackageJson); + const resolved = resolve.imports( + pkg, + path, + createResolveOptions(options.conditions) + ); + if (resolved) { + const target = resolved[0]; + return target.startsWith('.') + ? // internal relative filepath + (0, _path().resolve)((0, _path().dirname)(closestPackageJson), target) + : // this is an external module, re-resolve it + defaultResolver(target, options); + } + if (pkg.imports) { + throw new Error( + '`imports` exists, but no results - this is a bug in Jest. Please report an issue' + ); + } + } + const segments = path.split('/'); + let moduleName = segments.shift(); + if (moduleName) { + if (moduleName.startsWith('@')) { + moduleName = `${moduleName}/${segments.shift()}`; + } + + // self-reference + const closestPackageJson = (0, _fileWalkers.findClosestPackageJson)( + options.basedir + ); + if (closestPackageJson) { + const pkg = (0, _fileWalkers.readPackageCached)(closestPackageJson); + if (pkg.name === moduleName) { + const resolved = resolve.exports( + pkg, + segments.join('/') || '.', + createResolveOptions(options.conditions) + ); + if (resolved) { + return (0, _path().resolve)( + (0, _path().dirname)(closestPackageJson), + resolved[0] + ); + } + if (pkg.exports) { + throw new Error( + '`exports` exists, but no results - this is a bug in Jest. Please report an issue' + ); + } + } + } + let packageJsonPath = ''; + try { + packageJsonPath = (0, _resolve().sync)( + `${moduleName}/package.json`, + options + ); + } catch { + // ignore if package.json cannot be found + } + if (packageJsonPath && (0, _fileWalkers.isFile)(packageJsonPath)) { + const pkg = (0, _fileWalkers.readPackageCached)(packageJsonPath); + const resolved = resolve.exports( + pkg, + segments.join('/') || '.', + createResolveOptions(options.conditions) + ); + if (resolved) { + return (0, _path().resolve)( + (0, _path().dirname)(packageJsonPath), + resolved[0] + ); + } + if (pkg.exports) { + throw new Error( + '`exports` exists, but no results - this is a bug in Jest. Please report an issue' + ); + } + } + } + return path; +} +function createResolveOptions(conditions) { + return conditions + ? { + conditions, + unsafe: true + } + : // no conditions were passed - let's assume this is Jest internal and it should be `require` + { + browser: false, + require: true + }; +} + +// if it's a relative import or an absolute path, imports/exports are ignored +const shouldIgnoreRequestForExports = path => + path.startsWith('.') || (0, _path().isAbsolute)(path); diff --git a/node_modules/jest-resolve/build/fileWalkers.js b/node_modules/jest-resolve/build/fileWalkers.js new file mode 100644 index 00000000..8779a51b --- /dev/null +++ b/node_modules/jest-resolve/build/fileWalkers.js @@ -0,0 +1,178 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.clearFsCache = clearFsCache; +exports.findClosestPackageJson = findClosestPackageJson; +exports.isDirectory = isDirectory; +exports.isFile = isFile; +exports.readPackageCached = readPackageCached; +exports.realpathSync = realpathSync; +function _path() { + const data = require('path'); + _path = function () { + return data; + }; + return data; +} +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function clearFsCache() { + checkedPaths.clear(); + checkedRealpathPaths.clear(); + packageContents.clear(); +} +var IPathType = /*#__PURE__*/ (function (IPathType) { + IPathType[(IPathType['FILE'] = 1)] = 'FILE'; + IPathType[(IPathType['DIRECTORY'] = 2)] = 'DIRECTORY'; + IPathType[(IPathType['OTHER'] = 3)] = 'OTHER'; + return IPathType; +})(IPathType || {}); +const checkedPaths = new Map(); +function statSyncCached(path) { + const result = checkedPaths.get(path); + if (result != null) { + return result; + } + let stat; + try { + // @ts-expect-error TS2554 - throwIfNoEntry is only available in recent version of node, but inclusion of the option is a backward compatible no-op. + stat = fs().statSync(path, { + throwIfNoEntry: false + }); + } catch (e) { + if (!(e && (e.code === 'ENOENT' || e.code === 'ENOTDIR'))) { + throw e; + } + } + if (stat) { + if (stat.isFile() || stat.isFIFO()) { + checkedPaths.set(path, IPathType.FILE); + return IPathType.FILE; + } else if (stat.isDirectory()) { + checkedPaths.set(path, IPathType.DIRECTORY); + return IPathType.DIRECTORY; + } + } + checkedPaths.set(path, IPathType.OTHER); + return IPathType.OTHER; +} +const checkedRealpathPaths = new Map(); +function realpathCached(path) { + let result = checkedRealpathPaths.get(path); + if (result != null) { + return result; + } + result = (0, _jestUtil().tryRealpath)(path); + checkedRealpathPaths.set(path, result); + if (path !== result) { + // also cache the result in case it's ever referenced directly - no reason to `realpath` that as well + checkedRealpathPaths.set(result, result); + } + return result; +} +const packageContents = new Map(); +function readPackageCached(path) { + let result = packageContents.get(path); + if (result != null) { + return result; + } + result = JSON.parse(fs().readFileSync(path, 'utf8')); + packageContents.set(path, result); + return result; +} + +// adapted from +// https://github.com/lukeed/escalade/blob/2477005062cdbd8407afc90d3f48f4930354252b/src/sync.js +// to use cached `fs` calls +function findClosestPackageJson(start) { + let dir = (0, _path().resolve)('.', start); + if (!isDirectory(dir)) { + dir = (0, _path().dirname)(dir); + } + while (true) { + const pkgJsonFile = (0, _path().resolve)(dir, './package.json'); + const hasPackageJson = isFile(pkgJsonFile); + if (hasPackageJson) { + return pkgJsonFile; + } + const prevDir = dir; + dir = (0, _path().dirname)(dir); + if (prevDir === dir) { + return undefined; + } + } +} + +/* + * helper functions + */ +function isFile(file) { + return statSyncCached(file) === IPathType.FILE; +} +function isDirectory(dir) { + return statSyncCached(dir) === IPathType.DIRECTORY; +} +function realpathSync(file) { + return realpathCached(file); +} diff --git a/node_modules/jest-resolve/build/index.d.ts b/node_modules/jest-resolve/build/index.d.ts new file mode 100644 index 00000000..6ec1e443 --- /dev/null +++ b/node_modules/jest-resolve/build/index.d.ts @@ -0,0 +1,320 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {IModuleMap} from 'jest-haste-map'; + +export declare type AsyncResolver = ( + path: string, + options: ResolverOptions, +) => Promise; + +declare function cachedShouldLoadAsEsm( + path: string, + extensionsToTreatAsEsm: Array, +): boolean; + +declare const defaultResolver: SyncResolver; + +export declare type FindNodeModuleConfig = { + basedir: string; + conditions?: Array; + extensions?: Array; + moduleDirectory?: Array; + paths?: Array; + resolver?: string | null; + rootDir?: string; + throwIfNotFound?: boolean; +}; + +export declare type JestResolver = ResolverSyncObject | ResolverAsyncObject; + +declare interface JSONObject { + [key: string]: JSONValue; +} + +declare type JSONValue = + | string + | number + | boolean + | JSONObject + | Array; + +declare type ModuleNameMapperConfig = { + regex: RegExp; + moduleName: string | Array; +}; + +declare class ModuleNotFoundError extends Error { + code: string; + hint?: string; + requireStack?: Array; + siblingWithSimilarExtensionFound?: boolean; + moduleName?: string; + private _originalMessage?; + constructor(message: string, moduleName?: string); + buildMessage(rootDir: string): void; + static duckType(error: ModuleNotFoundError): ModuleNotFoundError; +} + +/** + * Allows transforming parsed `package.json` contents. + * + * @param pkg - Parsed `package.json` contents. + * @param file - Path to `package.json` file. + * @param dir - Directory that contains the `package.json`. + * + * @returns Transformed `package.json` contents. + */ +export declare type PackageFilter = ( + pkg: PackageJSON, + file: string, + dir: string, +) => PackageJSON; + +export declare type PackageJSON = JSONObject; + +/** + * Allows transforming a path within a package. + * + * @param pkg - Parsed `package.json` contents. + * @param path - Path being resolved. + * @param relativePath - Path relative from the `package.json` location. + * + * @returns Relative path that will be joined from the `package.json` location. + */ +export declare type PathFilter = ( + pkg: PackageJSON, + path: string, + relativePath: string, +) => string; + +export declare type ResolveModuleConfig = { + conditions?: Array; + skipNodeResolution?: boolean; + paths?: Array; +}; + +declare class Resolver { + private readonly _options; + private readonly _moduleMap; + private readonly _moduleIDCache; + private readonly _moduleNameCache; + private readonly _modulePathCache; + private readonly _supportsNativePlatform; + constructor(moduleMap: IModuleMap, options: ResolverConfig); + static ModuleNotFoundError: typeof ModuleNotFoundError; + static tryCastModuleNotFoundError(error: unknown): ModuleNotFoundError | null; + static clearDefaultResolverCache(): void; + static findNodeModule( + path: string, + options: FindNodeModuleConfig, + ): string | null; + static findNodeModuleAsync( + path: string, + options: FindNodeModuleConfig, + ): Promise; + static unstable_shouldLoadAsEsm: typeof cachedShouldLoadAsEsm; + resolveModuleFromDirIfExists( + dirname: string, + moduleName: string, + options?: ResolveModuleConfig, + ): string | null; + resolveModuleFromDirIfExistsAsync( + dirname: string, + moduleName: string, + options?: ResolveModuleConfig, + ): Promise; + resolveModule( + from: string, + moduleName: string, + options?: ResolveModuleConfig, + ): string; + resolveModuleAsync( + from: string, + moduleName: string, + options?: ResolveModuleConfig, + ): Promise; + /** + * _prepareForResolution is shared between the sync and async module resolution + * methods, to try to keep them as DRY as possible. + */ + private _prepareForResolution; + /** + * _getHasteModulePath attempts to return the path to a haste module. + */ + private _getHasteModulePath; + private _throwModNotFoundError; + private _getMapModuleName; + private _isAliasModule; + isCoreModule(moduleName: string): boolean; + getModule(name: string): string | null; + getModulePath(from: string, moduleName: string): string; + getPackage(name: string): string | null; + getMockModule(from: string, name: string): string | null; + getMockModuleAsync(from: string, name: string): Promise; + getModulePaths(from: string): Array; + getGlobalPaths(moduleName?: string): Array; + getModuleID( + virtualMocks: Map, + from: string, + moduleName?: string, + options?: ResolveModuleConfig, + ): string; + getModuleIDAsync( + virtualMocks: Map, + from: string, + moduleName?: string, + options?: ResolveModuleConfig, + ): Promise; + private _getModuleType; + private _getAbsolutePath; + private _getAbsolutePathAsync; + private _getMockPath; + private _getMockPathAsync; + private _getVirtualMockPath; + private _getVirtualMockPathAsync; + private _isModuleResolved; + private _isModuleResolvedAsync; + resolveStubModuleName(from: string, moduleName: string): string | null; + resolveStubModuleNameAsync( + from: string, + moduleName: string, + ): Promise; +} +export default Resolver; + +declare type ResolverAsyncObject = { + sync?: SyncResolver; + async: AsyncResolver; +}; + +declare type ResolverConfig = { + defaultPlatform?: string | null; + extensions: Array; + hasCoreModules: boolean; + moduleDirectories: Array; + moduleNameMapper?: Array | null; + modulePaths?: Array; + platforms?: Array; + resolver?: string | null; + rootDir: string; +}; + +export declare type ResolverOptions = { + /** Directory to begin resolving from. */ + basedir: string; + /** List of export conditions. */ + conditions?: Array; + /** Instance of default resolver. */ + defaultResolver: typeof defaultResolver; + /** List of file extensions to search in order. */ + extensions?: Array; + /** + * List of directory names to be looked up for modules recursively. + * + * @defaultValue + * The default is `['node_modules']`. + */ + moduleDirectory?: Array; + /** + * List of `require.paths` to use if nothing is found in `node_modules`. + * + * @defaultValue + * The default is `undefined`. + */ + paths?: Array; + /** Allows transforming parsed `package.json` contents. */ + packageFilter?: PackageFilter; + /** Allows transforms a path within a package. */ + pathFilter?: PathFilter; + /** Current root directory. */ + rootDir?: string; +}; + +declare type ResolverSyncObject = { + sync: SyncResolver; + async?: AsyncResolver; +}; + +/** + * Finds the runner to use: + * + * 1. looks for jest-runner- relative to project. + * 1. looks for jest-runner- relative to Jest. + * 1. looks for relative to project. + * 1. looks for relative to Jest. + */ +export declare const resolveRunner: ( + resolver: string | undefined | null, + { + filePath, + rootDir, + requireResolveFunction, + }: { + filePath: string; + rootDir: string; + requireResolveFunction: (moduleName: string) => string; + }, +) => string; + +export declare const resolveSequencer: ( + resolver: string | undefined | null, + { + filePath, + rootDir, + requireResolveFunction, + }: { + filePath: string; + rootDir: string; + requireResolveFunction: (moduleName: string) => string; + }, +) => string; + +/** + * Finds the test environment to use: + * + * 1. looks for jest-environment- relative to project. + * 1. looks for jest-environment- relative to Jest. + * 1. looks for relative to project. + * 1. looks for relative to Jest. + */ +export declare const resolveTestEnvironment: ({ + rootDir, + testEnvironment: filePath, + requireResolveFunction, +}: { + rootDir: string; + testEnvironment: string; + requireResolveFunction: (moduleName: string) => string; +}) => string; + +/** + * Finds the watch plugins to use: + * + * 1. looks for jest-watch- relative to project. + * 1. looks for jest-watch- relative to Jest. + * 1. looks for relative to project. + * 1. looks for relative to Jest. + */ +export declare const resolveWatchPlugin: ( + resolver: string | undefined | null, + { + filePath, + rootDir, + requireResolveFunction, + }: { + filePath: string; + rootDir: string; + requireResolveFunction: (moduleName: string) => string; + }, +) => string; + +export declare type SyncResolver = ( + path: string, + options: ResolverOptions, +) => string; + +export {}; diff --git a/node_modules/jest-resolve/build/index.js b/node_modules/jest-resolve/build/index.js new file mode 100644 index 00000000..9c0f7c85 --- /dev/null +++ b/node_modules/jest-resolve/build/index.js @@ -0,0 +1,31 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +var _exportNames = {}; +exports.default = void 0; +var _resolver = _interopRequireDefault(require('./resolver')); +var _utils = require('./utils'); +Object.keys(_utils).forEach(function (key) { + if (key === 'default' || key === '__esModule') return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _utils[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _utils[key]; + } + }); +}); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var _default = _resolver.default; +exports.default = _default; diff --git a/node_modules/jest-resolve/build/isBuiltinModule.js b/node_modules/jest-resolve/build/isBuiltinModule.js new file mode 100644 index 00000000..80001d11 --- /dev/null +++ b/node_modules/jest-resolve/build/isBuiltinModule.js @@ -0,0 +1,27 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = isBuiltinModule; +function _module() { + const data = _interopRequireDefault(require('module')); + _module = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const BUILTIN_MODULES = new Set(_module().default.builtinModules); +function isBuiltinModule(module) { + return BUILTIN_MODULES.has(module); +} diff --git a/node_modules/jest-resolve/build/nodeModulesPaths.js b/node_modules/jest-resolve/build/nodeModulesPaths.js new file mode 100644 index 00000000..7eb031ae --- /dev/null +++ b/node_modules/jest-resolve/build/nodeModulesPaths.js @@ -0,0 +1,131 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.GlobalPaths = void 0; +exports.default = nodeModulesPaths; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * Adapted from: https://github.com/substack/node-resolve + */ + +function nodeModulesPaths(basedir, options) { + const modules = + options && options.moduleDirectory + ? Array.from(options.moduleDirectory) + : ['node_modules']; + + // ensure that `basedir` is an absolute path at this point, + // resolving against the process' current working directory + const basedirAbs = path().resolve(basedir); + let prefix = '/'; + if (/^([A-Za-z]:)/.test(basedirAbs)) { + prefix = ''; + } else if (/^\\\\/.test(basedirAbs)) { + prefix = '\\\\'; + } + + // The node resolution algorithm (as implemented by NodeJS and TypeScript) + // traverses parents of the physical path, not the symlinked path + let physicalBasedir; + try { + physicalBasedir = (0, _jestUtil().tryRealpath)(basedirAbs); + } catch { + // realpath can throw, e.g. on mapped drives + physicalBasedir = basedirAbs; + } + const paths = [physicalBasedir]; + let parsed = path().parse(physicalBasedir); + while (parsed.dir !== paths[paths.length - 1]) { + paths.push(parsed.dir); + parsed = path().parse(parsed.dir); + } + const dirs = paths.reduce((dirs, aPath) => { + for (const moduleDir of modules) { + if (path().isAbsolute(moduleDir)) { + if (aPath === basedirAbs && moduleDir) { + dirs.push(moduleDir); + } + } else { + dirs.push(path().join(prefix, aPath, moduleDir)); + } + } + return dirs; + }, []); + if (options.paths) { + dirs.push(...options.paths); + } + return dirs; +} +function findGlobalPaths() { + const {root} = path().parse(process.cwd()); + const globalPath = path().join(root, 'node_modules'); + const resolvePaths = require.resolve.paths('/'); + if (resolvePaths) { + // the global paths start one after the root node_modules + const rootIndex = resolvePaths.indexOf(globalPath); + return rootIndex > -1 ? resolvePaths.slice(rootIndex + 1) : []; + } + return []; +} +const GlobalPaths = findGlobalPaths(); +exports.GlobalPaths = GlobalPaths; diff --git a/node_modules/jest-resolve/build/resolver.js b/node_modules/jest-resolve/build/resolver.js new file mode 100644 index 00000000..4373e54e --- /dev/null +++ b/node_modules/jest-resolve/build/resolver.js @@ -0,0 +1,796 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _slash() { + const data = _interopRequireDefault(require('slash')); + _slash = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +var _ModuleNotFoundError = _interopRequireDefault( + require('./ModuleNotFoundError') +); +var _defaultResolver = _interopRequireDefault(require('./defaultResolver')); +var _fileWalkers = require('./fileWalkers'); +var _isBuiltinModule = _interopRequireDefault(require('./isBuiltinModule')); +var _nodeModulesPaths = _interopRequireWildcard(require('./nodeModulesPaths')); +var _shouldLoadAsEsm = _interopRequireWildcard(require('./shouldLoadAsEsm')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/* eslint-disable local/prefer-spread-eventually */ + +const NATIVE_PLATFORM = 'native'; + +// We might be inside a symlink. +const resolvedCwd = (0, _jestUtil().tryRealpath)(process.cwd()); +const {NODE_PATH} = process.env; +const nodePaths = NODE_PATH + ? NODE_PATH.split(path().delimiter) + .filter(Boolean) + // The resolver expects absolute paths. + .map(p => path().resolve(resolvedCwd, p)) + : undefined; +class Resolver { + _options; + _moduleMap; + _moduleIDCache; + _moduleNameCache; + _modulePathCache; + _supportsNativePlatform; + constructor(moduleMap, options) { + this._options = { + defaultPlatform: options.defaultPlatform, + extensions: options.extensions, + hasCoreModules: + options.hasCoreModules === undefined ? true : options.hasCoreModules, + moduleDirectories: options.moduleDirectories || ['node_modules'], + moduleNameMapper: options.moduleNameMapper, + modulePaths: options.modulePaths, + platforms: options.platforms, + resolver: options.resolver, + rootDir: options.rootDir + }; + this._supportsNativePlatform = options.platforms + ? options.platforms.includes(NATIVE_PLATFORM) + : false; + this._moduleMap = moduleMap; + this._moduleIDCache = new Map(); + this._moduleNameCache = new Map(); + this._modulePathCache = new Map(); + } + static ModuleNotFoundError = _ModuleNotFoundError.default; + static tryCastModuleNotFoundError(error) { + if (error instanceof _ModuleNotFoundError.default) { + return error; + } + const casted = error; + if (casted.code === 'MODULE_NOT_FOUND') { + return _ModuleNotFoundError.default.duckType(casted); + } + return null; + } + static clearDefaultResolverCache() { + (0, _fileWalkers.clearFsCache)(); + (0, _shouldLoadAsEsm.clearCachedLookups)(); + } + static findNodeModule(path, options) { + const resolverModule = loadResolver(options.resolver); + let resolver = _defaultResolver.default; + if (typeof resolverModule === 'function') { + resolver = resolverModule; + } else if (typeof resolverModule.sync === 'function') { + resolver = resolverModule.sync; + } + const paths = options.paths; + try { + return resolver(path, { + basedir: options.basedir, + conditions: options.conditions, + defaultResolver: _defaultResolver.default, + extensions: options.extensions, + moduleDirectory: options.moduleDirectory, + paths: paths ? (nodePaths || []).concat(paths) : nodePaths, + rootDir: options.rootDir + }); + } catch (e) { + // we always wanna throw if it's an internal import + if (options.throwIfNotFound || path.startsWith('#')) { + throw e; + } + } + return null; + } + static async findNodeModuleAsync(path, options) { + const resolverModule = loadResolver(options.resolver); + let resolver = _defaultResolver.default; + if (typeof resolverModule === 'function') { + resolver = resolverModule; + } else if ( + typeof resolverModule.async === 'function' || + typeof resolverModule.sync === 'function' + ) { + const asyncOrSync = resolverModule.async || resolverModule.sync; + if (asyncOrSync == null) { + throw new Error(`Unable to load resolver at ${options.resolver}`); + } + resolver = asyncOrSync; + } + const paths = options.paths; + try { + const result = await resolver(path, { + basedir: options.basedir, + conditions: options.conditions, + defaultResolver: _defaultResolver.default, + extensions: options.extensions, + moduleDirectory: options.moduleDirectory, + paths: paths ? (nodePaths || []).concat(paths) : nodePaths, + rootDir: options.rootDir + }); + return result; + } catch (e) { + // we always wanna throw if it's an internal import + if (options.throwIfNotFound || path.startsWith('#')) { + throw e; + } + } + return null; + } + + // unstable as it should be replaced by https://github.com/nodejs/modules/issues/393, and we don't want people to use it + static unstable_shouldLoadAsEsm = _shouldLoadAsEsm.default; + resolveModuleFromDirIfExists(dirname, moduleName, options) { + const {extensions, key, moduleDirectory, paths, skipResolution} = + this._prepareForResolution(dirname, moduleName, options); + let module; + + // 1. If we have already resolved this module for this directory name, + // return a value from the cache. + const cacheResult = this._moduleNameCache.get(key); + if (cacheResult) { + return cacheResult; + } + + // 2. Check if the module is a haste module. + module = this.getModule(moduleName); + if (module) { + this._moduleNameCache.set(key, module); + return module; + } + + // 3. Check if the module is a node module and resolve it based on + // the node module resolution algorithm. If skipNodeResolution is given we + // ignore all modules that look like node modules (ie. are not relative + // requires). This enables us to speed up resolution when we build a + // dependency graph because we don't have to look at modules that may not + // exist and aren't mocked. + const resolveNodeModule = (name, throwIfNotFound = false) => { + // Only skip default resolver + if (this.isCoreModule(name) && !this._options.resolver) { + return name; + } + return Resolver.findNodeModule(name, { + basedir: dirname, + conditions: options?.conditions, + extensions, + moduleDirectory, + paths, + resolver: this._options.resolver, + rootDir: this._options.rootDir, + throwIfNotFound + }); + }; + if (!skipResolution) { + module = resolveNodeModule(moduleName, Boolean(process.versions.pnp)); + if (module) { + this._moduleNameCache.set(key, module); + return module; + } + } + + // 4. Resolve "haste packages" which are `package.json` files outside of + // `node_modules` folders anywhere in the file system. + try { + const hasteModulePath = this._getHasteModulePath(moduleName); + if (hasteModulePath) { + // try resolving with custom resolver first to support extensions, + // then fallback to require.resolve + const resolvedModule = + resolveNodeModule(hasteModulePath) || + require.resolve(hasteModulePath); + this._moduleNameCache.set(key, resolvedModule); + return resolvedModule; + } + } catch {} + return null; + } + async resolveModuleFromDirIfExistsAsync(dirname, moduleName, options) { + const {extensions, key, moduleDirectory, paths, skipResolution} = + this._prepareForResolution(dirname, moduleName, options); + let module; + + // 1. If we have already resolved this module for this directory name, + // return a value from the cache. + const cacheResult = this._moduleNameCache.get(key); + if (cacheResult) { + return cacheResult; + } + + // 2. Check if the module is a haste module. + module = this.getModule(moduleName); + if (module) { + this._moduleNameCache.set(key, module); + return module; + } + + // 3. Check if the module is a node module and resolve it based on + // the node module resolution algorithm. If skipNodeResolution is given we + // ignore all modules that look like node modules (ie. are not relative + // requires). This enables us to speed up resolution when we build a + // dependency graph because we don't have to look at modules that may not + // exist and aren't mocked. + const resolveNodeModule = async (name, throwIfNotFound = false) => { + // Only skip default resolver + if (this.isCoreModule(name) && !this._options.resolver) { + return name; + } + return Resolver.findNodeModuleAsync(name, { + basedir: dirname, + conditions: options?.conditions, + extensions, + moduleDirectory, + paths, + resolver: this._options.resolver, + rootDir: this._options.rootDir, + throwIfNotFound + }); + }; + if (!skipResolution) { + module = await resolveNodeModule( + moduleName, + Boolean(process.versions.pnp) + ); + if (module) { + this._moduleNameCache.set(key, module); + return module; + } + } + + // 4. Resolve "haste packages" which are `package.json` files outside of + // `node_modules` folders anywhere in the file system. + try { + const hasteModulePath = this._getHasteModulePath(moduleName); + if (hasteModulePath) { + // try resolving with custom resolver first to support extensions, + // then fallback to require.resolve + const resolvedModule = + (await resolveNodeModule(hasteModulePath)) || + // QUESTION: should this be async? + require.resolve(hasteModulePath); + this._moduleNameCache.set(key, resolvedModule); + return resolvedModule; + } + } catch {} + return null; + } + resolveModule(from, moduleName, options) { + const dirname = path().dirname(from); + const module = + this.resolveStubModuleName(from, moduleName) || + this.resolveModuleFromDirIfExists(dirname, moduleName, options); + if (module) return module; + + // 5. Throw an error if the module could not be found. `resolve.sync` only + // produces an error based on the dirname but we have the actual current + // module name available. + this._throwModNotFoundError(from, moduleName); + } + async resolveModuleAsync(from, moduleName, options) { + const dirname = path().dirname(from); + const module = + (await this.resolveStubModuleNameAsync(from, moduleName)) || + (await this.resolveModuleFromDirIfExistsAsync( + dirname, + moduleName, + options + )); + if (module) return module; + + // 5. Throw an error if the module could not be found. `resolve` only + // produces an error based on the dirname but we have the actual current + // module name available. + this._throwModNotFoundError(from, moduleName); + } + + /** + * _prepareForResolution is shared between the sync and async module resolution + * methods, to try to keep them as DRY as possible. + */ + _prepareForResolution(dirname, moduleName, options) { + const paths = options?.paths || this._options.modulePaths; + const moduleDirectory = this._options.moduleDirectories; + const stringifiedOptions = options ? JSON.stringify(options) : ''; + const key = dirname + path().delimiter + moduleName + stringifiedOptions; + const defaultPlatform = this._options.defaultPlatform; + const extensions = this._options.extensions.slice(); + if (this._supportsNativePlatform) { + extensions.unshift( + ...this._options.extensions.map(ext => `.${NATIVE_PLATFORM}${ext}`) + ); + } + if (defaultPlatform) { + extensions.unshift( + ...this._options.extensions.map(ext => `.${defaultPlatform}${ext}`) + ); + } + const skipResolution = + options && options.skipNodeResolution && !moduleName.includes(path().sep); + return { + extensions, + key, + moduleDirectory, + paths, + skipResolution + }; + } + + /** + * _getHasteModulePath attempts to return the path to a haste module. + */ + _getHasteModulePath(moduleName) { + const parts = moduleName.split('/'); + const hastePackage = this.getPackage(parts.shift()); + if (hastePackage) { + return path().join.apply( + path(), + [path().dirname(hastePackage)].concat(parts) + ); + } + return null; + } + _throwModNotFoundError(from, moduleName) { + const relativePath = + (0, _slash().default)(path().relative(this._options.rootDir, from)) || + '.'; + throw new _ModuleNotFoundError.default( + `Cannot find module '${moduleName}' from '${relativePath}'`, + moduleName + ); + } + _getMapModuleName(matches) { + return matches + ? moduleName => + moduleName.replace( + /\$([0-9]+)/g, + (_, index) => matches[parseInt(index, 10)] || '' + ) + : moduleName => moduleName; + } + _isAliasModule(moduleName) { + const moduleNameMapper = this._options.moduleNameMapper; + if (!moduleNameMapper) { + return false; + } + return moduleNameMapper.some(({regex}) => regex.test(moduleName)); + } + isCoreModule(moduleName) { + return ( + this._options.hasCoreModules && + ((0, _isBuiltinModule.default)(moduleName) || + moduleName.startsWith('node:')) && + !this._isAliasModule(moduleName) + ); + } + getModule(name) { + return this._moduleMap.getModule( + name, + this._options.defaultPlatform, + this._supportsNativePlatform + ); + } + getModulePath(from, moduleName) { + if (moduleName[0] !== '.' || path().isAbsolute(moduleName)) { + return moduleName; + } + return path().normalize(`${path().dirname(from)}/${moduleName}`); + } + getPackage(name) { + return this._moduleMap.getPackage( + name, + this._options.defaultPlatform, + this._supportsNativePlatform + ); + } + getMockModule(from, name) { + const mock = this._moduleMap.getMockModule(name); + if (mock) { + return mock; + } else { + const moduleName = this.resolveStubModuleName(from, name); + if (moduleName) { + return this.getModule(moduleName) || moduleName; + } + } + return null; + } + async getMockModuleAsync(from, name) { + const mock = this._moduleMap.getMockModule(name); + if (mock) { + return mock; + } else { + const moduleName = await this.resolveStubModuleNameAsync(from, name); + if (moduleName) { + return this.getModule(moduleName) || moduleName; + } + } + return null; + } + getModulePaths(from) { + const cachedModule = this._modulePathCache.get(from); + if (cachedModule) { + return cachedModule; + } + const moduleDirectory = this._options.moduleDirectories; + const paths = (0, _nodeModulesPaths.default)(from, { + moduleDirectory + }); + if (paths[paths.length - 1] === undefined) { + // circumvent node-resolve bug that adds `undefined` as last item. + paths.pop(); + } + this._modulePathCache.set(from, paths); + return paths; + } + getGlobalPaths(moduleName) { + if (!moduleName || moduleName[0] === '.' || this.isCoreModule(moduleName)) { + return []; + } + return _nodeModulesPaths.GlobalPaths; + } + getModuleID(virtualMocks, from, moduleName = '', options) { + const stringifiedOptions = options ? JSON.stringify(options) : ''; + const key = from + path().delimiter + moduleName + stringifiedOptions; + const cachedModuleID = this._moduleIDCache.get(key); + if (cachedModuleID) { + return cachedModuleID; + } + const moduleType = this._getModuleType(moduleName); + const absolutePath = this._getAbsolutePath( + virtualMocks, + from, + moduleName, + options + ); + const mockPath = this._getMockPath(from, moduleName); + const sep = path().delimiter; + const id = + moduleType + + sep + + (absolutePath ? absolutePath + sep : '') + + (mockPath ? mockPath + sep : '') + + (stringifiedOptions ? stringifiedOptions + sep : ''); + this._moduleIDCache.set(key, id); + return id; + } + async getModuleIDAsync(virtualMocks, from, moduleName = '', options) { + const stringifiedOptions = options ? JSON.stringify(options) : ''; + const key = from + path().delimiter + moduleName + stringifiedOptions; + const cachedModuleID = this._moduleIDCache.get(key); + if (cachedModuleID) { + return cachedModuleID; + } + if (moduleName.startsWith('data:')) { + return moduleName; + } + const moduleType = this._getModuleType(moduleName); + const absolutePath = await this._getAbsolutePathAsync( + virtualMocks, + from, + moduleName, + options + ); + const mockPath = await this._getMockPathAsync(from, moduleName); + const sep = path().delimiter; + const id = + moduleType + + sep + + (absolutePath ? absolutePath + sep : '') + + (mockPath ? mockPath + sep : '') + + (stringifiedOptions ? stringifiedOptions + sep : ''); + this._moduleIDCache.set(key, id); + return id; + } + _getModuleType(moduleName) { + return this.isCoreModule(moduleName) ? 'node' : 'user'; + } + _getAbsolutePath(virtualMocks, from, moduleName, options) { + if (this.isCoreModule(moduleName)) { + return moduleName; + } + if (moduleName.startsWith('data:')) { + return moduleName; + } + return this._isModuleResolved(from, moduleName) + ? this.getModule(moduleName) + : this._getVirtualMockPath(virtualMocks, from, moduleName, options); + } + async _getAbsolutePathAsync(virtualMocks, from, moduleName, options) { + if (this.isCoreModule(moduleName)) { + return moduleName; + } + if (moduleName.startsWith('data:')) { + return moduleName; + } + const isModuleResolved = await this._isModuleResolvedAsync( + from, + moduleName + ); + return isModuleResolved + ? this.getModule(moduleName) + : this._getVirtualMockPathAsync(virtualMocks, from, moduleName, options); + } + _getMockPath(from, moduleName) { + return !this.isCoreModule(moduleName) + ? this.getMockModule(from, moduleName) + : null; + } + async _getMockPathAsync(from, moduleName) { + return !this.isCoreModule(moduleName) + ? this.getMockModuleAsync(from, moduleName) + : null; + } + _getVirtualMockPath(virtualMocks, from, moduleName, options) { + const virtualMockPath = this.getModulePath(from, moduleName); + return virtualMocks.get(virtualMockPath) + ? virtualMockPath + : moduleName + ? this.resolveModule(from, moduleName, options) + : from; + } + async _getVirtualMockPathAsync(virtualMocks, from, moduleName, options) { + const virtualMockPath = this.getModulePath(from, moduleName); + return virtualMocks.get(virtualMockPath) + ? virtualMockPath + : moduleName + ? this.resolveModuleAsync(from, moduleName, options) + : from; + } + _isModuleResolved(from, moduleName) { + return !!( + this.getModule(moduleName) || this.getMockModule(from, moduleName) + ); + } + async _isModuleResolvedAsync(from, moduleName) { + return !!( + this.getModule(moduleName) || + (await this.getMockModuleAsync(from, moduleName)) + ); + } + resolveStubModuleName(from, moduleName) { + const dirname = path().dirname(from); + const {extensions, moduleDirectory, paths} = this._prepareForResolution( + dirname, + moduleName + ); + const moduleNameMapper = this._options.moduleNameMapper; + const resolver = this._options.resolver; + if (moduleNameMapper) { + for (const {moduleName: mappedModuleName, regex} of moduleNameMapper) { + if (regex.test(moduleName)) { + // Note: once a moduleNameMapper matches the name, it must result + // in a module, or else an error is thrown. + const matches = moduleName.match(regex); + const mapModuleName = this._getMapModuleName(matches); + const possibleModuleNames = Array.isArray(mappedModuleName) + ? mappedModuleName + : [mappedModuleName]; + let module = null; + for (const possibleModuleName of possibleModuleNames) { + const updatedName = mapModuleName(possibleModuleName); + module = + this.getModule(updatedName) || + Resolver.findNodeModule(updatedName, { + basedir: dirname, + extensions, + moduleDirectory, + paths, + resolver, + rootDir: this._options.rootDir + }); + if (module) { + break; + } + } + if (!module) { + throw createNoMappedModuleFoundError( + moduleName, + mapModuleName, + mappedModuleName, + regex, + resolver + ); + } + return module; + } + } + } + return null; + } + async resolveStubModuleNameAsync(from, moduleName) { + const dirname = path().dirname(from); + const {extensions, moduleDirectory, paths} = this._prepareForResolution( + dirname, + moduleName + ); + const moduleNameMapper = this._options.moduleNameMapper; + const resolver = this._options.resolver; + if (moduleNameMapper) { + for (const {moduleName: mappedModuleName, regex} of moduleNameMapper) { + if (regex.test(moduleName)) { + // Note: once a moduleNameMapper matches the name, it must result + // in a module, or else an error is thrown. + const matches = moduleName.match(regex); + const mapModuleName = this._getMapModuleName(matches); + const possibleModuleNames = Array.isArray(mappedModuleName) + ? mappedModuleName + : [mappedModuleName]; + let module = null; + for (const possibleModuleName of possibleModuleNames) { + const updatedName = mapModuleName(possibleModuleName); + module = + this.getModule(updatedName) || + (await Resolver.findNodeModuleAsync(updatedName, { + basedir: dirname, + extensions, + moduleDirectory, + paths, + resolver, + rootDir: this._options.rootDir + })); + if (module) { + break; + } + } + if (!module) { + throw createNoMappedModuleFoundError( + moduleName, + mapModuleName, + mappedModuleName, + regex, + resolver + ); + } + return module; + } + } + } + return null; + } +} +exports.default = Resolver; +const createNoMappedModuleFoundError = ( + moduleName, + mapModuleName, + mappedModuleName, + regex, + resolver +) => { + const mappedAs = Array.isArray(mappedModuleName) + ? JSON.stringify(mappedModuleName.map(mapModuleName), null, 2) + : mappedModuleName; + const original = Array.isArray(mappedModuleName) + ? `${ + JSON.stringify(mappedModuleName, null, 6) // using 6 because of misalignment when nested below + .slice(0, -1) + ' '.repeat(4) + }]` /// align last bracket correctly as well + : mappedModuleName; + const error = new Error( + _chalk().default.red(`${_chalk().default.bold('Configuration error')}: + +Could not locate module ${_chalk().default.bold(moduleName)} mapped as: +${_chalk().default.bold(mappedAs)}. + +Please check your configuration for these entries: +{ + "moduleNameMapper": { + "${regex.toString()}": "${_chalk().default.bold(original)}" + }, + "resolver": ${_chalk().default.bold(String(resolver))} +}`) + ); + error.name = ''; + return error; +}; +function loadResolver(resolver) { + if (resolver == null) { + return _defaultResolver.default; + } + const loadedResolver = require(resolver); + if (loadedResolver == null) { + throw new Error(`Resolver located at ${resolver} does not export anything`); + } + if (typeof loadedResolver === 'function') { + return loadedResolver; + } + if ( + typeof loadedResolver === 'object' && + (loadedResolver.sync != null || loadedResolver.async != null) + ) { + return loadedResolver; + } + throw new Error( + `Resolver located at ${resolver} does not export a function or an object with "sync" and "async" props` + ); +} diff --git a/node_modules/jest-resolve/build/shouldLoadAsEsm.js b/node_modules/jest-resolve/build/shouldLoadAsEsm.js new file mode 100644 index 00000000..c6b14187 --- /dev/null +++ b/node_modules/jest-resolve/build/shouldLoadAsEsm.js @@ -0,0 +1,90 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.clearCachedLookups = clearCachedLookups; +exports.default = cachedShouldLoadAsEsm; +function _path() { + const data = require('path'); + _path = function () { + return data; + }; + return data; +} +function _vm() { + const data = require('vm'); + _vm = function () { + return data; + }; + return data; +} +var _fileWalkers = require('./fileWalkers'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// @ts-expect-error: experimental, not added to the types + +const runtimeSupportsVmModules = typeof _vm().SyntheticModule === 'function'; +const cachedFileLookups = new Map(); +const cachedDirLookups = new Map(); +const cachedChecks = new Map(); +function clearCachedLookups() { + cachedFileLookups.clear(); + cachedDirLookups.clear(); + cachedChecks.clear(); +} +function cachedShouldLoadAsEsm(path, extensionsToTreatAsEsm) { + if (!runtimeSupportsVmModules) { + return false; + } + let cachedLookup = cachedFileLookups.get(path); + if (cachedLookup === undefined) { + cachedLookup = shouldLoadAsEsm(path, extensionsToTreatAsEsm); + cachedFileLookups.set(path, cachedLookup); + } + return cachedLookup; +} + +// this is a bad version of what https://github.com/nodejs/modules/issues/393 would provide +function shouldLoadAsEsm(path, extensionsToTreatAsEsm) { + const extension = (0, _path().extname)(path); + if (extension === '.mjs') { + return true; + } + if (extension === '.cjs') { + return false; + } + if (extension !== '.js') { + return extensionsToTreatAsEsm.includes(extension); + } + const cwd = (0, _path().dirname)(path); + let cachedLookup = cachedDirLookups.get(cwd); + if (cachedLookup === undefined) { + cachedLookup = cachedPkgCheck(cwd); + cachedFileLookups.set(cwd, cachedLookup); + } + return cachedLookup; +} +function cachedPkgCheck(cwd) { + const pkgPath = (0, _fileWalkers.findClosestPackageJson)(cwd); + if (!pkgPath) { + return false; + } + let hasModuleField = cachedChecks.get(pkgPath); + if (hasModuleField != null) { + return hasModuleField; + } + try { + const pkg = (0, _fileWalkers.readPackageCached)(pkgPath); + hasModuleField = pkg.type === 'module'; + } catch { + hasModuleField = false; + } + cachedChecks.set(pkgPath, hasModuleField); + return hasModuleField; +} diff --git a/node_modules/jest-resolve/build/types.js b/node_modules/jest-resolve/build/types.js new file mode 100644 index 00000000..ad9a93a7 --- /dev/null +++ b/node_modules/jest-resolve/build/types.js @@ -0,0 +1 @@ +'use strict'; diff --git a/node_modules/jest-resolve/build/utils.js b/node_modules/jest-resolve/build/utils.js new file mode 100644 index 00000000..dce4e089 --- /dev/null +++ b/node_modules/jest-resolve/build/utils.js @@ -0,0 +1,233 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.resolveWatchPlugin = + exports.resolveTestEnvironment = + exports.resolveSequencer = + exports.resolveRunner = + void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _jestValidate() { + const data = require('jest-validate'); + _jestValidate = function () { + return data; + }; + return data; +} +var _resolver = _interopRequireDefault(require('./resolver')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const BULLET = _chalk().default.bold('\u25cf '); +const DOCUMENTATION_NOTE = ` ${_chalk().default.bold( + 'Configuration Documentation:' +)} + https://jestjs.io/docs/configuration +`; +const createValidationError = message => + new (_jestValidate().ValidationError)( + `${BULLET}Validation Error`, + message, + DOCUMENTATION_NOTE + ); +const replaceRootDirInPath = (rootDir, filePath) => { + if (!/^/.test(filePath)) { + return filePath; + } + return path().resolve( + rootDir, + path().normalize(`./${filePath.substr(''.length)}`) + ); +}; +const resolveWithPrefix = ( + resolver, + { + filePath, + humanOptionName, + optionName, + prefix, + requireResolveFunction, + rootDir + } +) => { + const fileName = replaceRootDirInPath(rootDir, filePath); + let module = _resolver.default.findNodeModule(`${prefix}${fileName}`, { + basedir: rootDir, + resolver: resolver || undefined + }); + if (module) { + return module; + } + try { + return requireResolveFunction(`${prefix}${fileName}`); + } catch {} + module = _resolver.default.findNodeModule(fileName, { + basedir: rootDir, + resolver: resolver || undefined + }); + if (module) { + return module; + } + try { + return requireResolveFunction(fileName); + } catch {} + throw createValidationError( + ` ${humanOptionName} ${_chalk().default.bold( + fileName + )} cannot be found. Make sure the ${_chalk().default.bold( + optionName + )} configuration option points to an existing node module.` + ); +}; + +/** + * Finds the test environment to use: + * + * 1. looks for jest-environment- relative to project. + * 1. looks for jest-environment- relative to Jest. + * 1. looks for relative to project. + * 1. looks for relative to Jest. + */ +const resolveTestEnvironment = ({ + rootDir, + testEnvironment: filePath, + requireResolveFunction +}) => { + // we don't want to resolve the actual `jsdom` module if `jest-environment-jsdom` is not installed, but `jsdom` package is + if (filePath === 'jsdom') { + filePath = 'jest-environment-jsdom'; + } + try { + return resolveWithPrefix(undefined, { + filePath, + humanOptionName: 'Test environment', + optionName: 'testEnvironment', + prefix: 'jest-environment-', + requireResolveFunction, + rootDir + }); + } catch (error) { + if (filePath === 'jest-environment-jsdom') { + error.message += + '\n\nAs of Jest 28 "jest-environment-jsdom" is no longer shipped by default, make sure to install it separately.'; + } + throw error; + } +}; + +/** + * Finds the watch plugins to use: + * + * 1. looks for jest-watch- relative to project. + * 1. looks for jest-watch- relative to Jest. + * 1. looks for relative to project. + * 1. looks for relative to Jest. + */ +exports.resolveTestEnvironment = resolveTestEnvironment; +const resolveWatchPlugin = ( + resolver, + {filePath, rootDir, requireResolveFunction} +) => + resolveWithPrefix(resolver, { + filePath, + humanOptionName: 'Watch plugin', + optionName: 'watchPlugins', + prefix: 'jest-watch-', + requireResolveFunction, + rootDir + }); + +/** + * Finds the runner to use: + * + * 1. looks for jest-runner- relative to project. + * 1. looks for jest-runner- relative to Jest. + * 1. looks for relative to project. + * 1. looks for relative to Jest. + */ +exports.resolveWatchPlugin = resolveWatchPlugin; +const resolveRunner = (resolver, {filePath, rootDir, requireResolveFunction}) => + resolveWithPrefix(resolver, { + filePath, + humanOptionName: 'Jest Runner', + optionName: 'runner', + prefix: 'jest-runner-', + requireResolveFunction, + rootDir + }); +exports.resolveRunner = resolveRunner; +const resolveSequencer = ( + resolver, + {filePath, rootDir, requireResolveFunction} +) => + resolveWithPrefix(resolver, { + filePath, + humanOptionName: 'Jest Sequencer', + optionName: 'testSequencer', + prefix: 'jest-sequencer-', + requireResolveFunction, + rootDir + }); +exports.resolveSequencer = resolveSequencer; diff --git a/node_modules/jest-resolve/package.json b/node_modules/jest-resolve/package.json new file mode 100644 index 00000000..198c9bef --- /dev/null +++ b/node_modules/jest-resolve/package.json @@ -0,0 +1,44 @@ +{ + "name": "jest-resolve", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-resolve" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "devDependencies": { + "@tsd/typescript": "^5.0.4", + "@types/graceful-fs": "^4.1.3", + "@types/pnpapi": "^0.0.2", + "@types/resolve": "^1.20.2", + "tsd-lite": "^0.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-runner/LICENSE b/node_modules/jest-runner/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-runner/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-runner/build/index.d.ts b/node_modules/jest-runner/build/index.d.ts new file mode 100644 index 00000000..2e46f458 --- /dev/null +++ b/node_modules/jest-runner/build/index.d.ts @@ -0,0 +1,127 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import {Config} from '@jest/types'; +import type {SerializableError} from '@jest/test-result'; +import {Test} from '@jest/test-result'; +import {TestEvents} from '@jest/test-result'; +import type {TestResult} from '@jest/test-result'; +import {TestWatcher} from 'jest-watcher'; + +declare abstract class BaseTestRunner { + protected readonly _globalConfig: Config.GlobalConfig; + protected readonly _context: TestRunnerContext; + readonly isSerial?: boolean; + abstract readonly supportsEventEmitters: boolean; + constructor(_globalConfig: Config.GlobalConfig, _context: TestRunnerContext); +} + +export declare abstract class CallbackTestRunner + extends BaseTestRunner + implements CallbackTestRunnerInterface +{ + readonly supportsEventEmitters = false; + abstract runTests( + tests: Array, + watcher: TestWatcher, + onStart: OnTestStart, + onResult: OnTestSuccess, + onFailure: OnTestFailure, + options: TestRunnerOptions, + ): Promise; +} + +export declare interface CallbackTestRunnerInterface { + readonly isSerial?: boolean; + readonly supportsEventEmitters?: boolean; + runTests( + tests: Array, + watcher: TestWatcher, + onStart: OnTestStart, + onResult: OnTestSuccess, + onFailure: OnTestFailure, + options: TestRunnerOptions, + ): Promise; +} + +export {Config}; + +export declare abstract class EmittingTestRunner + extends BaseTestRunner + implements EmittingTestRunnerInterface +{ + readonly supportsEventEmitters = true; + abstract runTests( + tests: Array, + watcher: TestWatcher, + options: TestRunnerOptions, + ): Promise; + abstract on( + eventName: Name, + listener: (eventData: TestEvents[Name]) => void | Promise, + ): UnsubscribeFn; +} + +export declare interface EmittingTestRunnerInterface { + readonly isSerial?: boolean; + readonly supportsEventEmitters: true; + runTests( + tests: Array, + watcher: TestWatcher, + options: TestRunnerOptions, + ): Promise; + on( + eventName: Name, + listener: (eventData: TestEvents[Name]) => void | Promise, + ): UnsubscribeFn; +} + +export declare type JestTestRunner = CallbackTestRunner | EmittingTestRunner; + +export declare type OnTestFailure = ( + test: Test, + serializableError: SerializableError, +) => Promise; + +export declare type OnTestStart = (test: Test) => Promise; + +export declare type OnTestSuccess = ( + test: Test, + testResult: TestResult, +) => Promise; + +export {Test}; + +export {TestEvents}; + +declare class TestRunner extends EmittingTestRunner { + #private; + runTests( + tests: Array, + watcher: TestWatcher, + options: TestRunnerOptions, + ): Promise; + on( + eventName: Name, + listener: (eventData: TestEvents[Name]) => void | Promise, + ): UnsubscribeFn; +} +export default TestRunner; + +export declare type TestRunnerContext = { + changedFiles?: Set; + sourcesRelatedToTestsInChangedFiles?: Set; +}; + +export declare type TestRunnerOptions = { + serial: boolean; +}; + +export {TestWatcher}; + +export declare type UnsubscribeFn = () => void; + +export {}; diff --git a/node_modules/jest-runner/build/index.js b/node_modules/jest-runner/build/index.js new file mode 100644 index 00000000..65c0ed18 --- /dev/null +++ b/node_modules/jest-runner/build/index.js @@ -0,0 +1,219 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +Object.defineProperty(exports, 'CallbackTestRunner', { + enumerable: true, + get: function () { + return _types.CallbackTestRunner; + } +}); +Object.defineProperty(exports, 'EmittingTestRunner', { + enumerable: true, + get: function () { + return _types.EmittingTestRunner; + } +}); +exports.default = void 0; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _emittery() { + const data = _interopRequireDefault(require('emittery')); + _emittery = function () { + return data; + }; + return data; +} +function _pLimit() { + const data = _interopRequireDefault(require('p-limit')); + _pLimit = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +function _jestWorker() { + const data = require('jest-worker'); + _jestWorker = function () { + return data; + }; + return data; +} +var _runTest = _interopRequireDefault(require('./runTest')); +var _types = require('./types'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class TestRunner extends _types.EmittingTestRunner { + #eventEmitter = new (_emittery().default)(); + async runTests(tests, watcher, options) { + return options.serial + ? this.#createInBandTestRun(tests, watcher) + : this.#createParallelTestRun(tests, watcher); + } + async #createInBandTestRun(tests, watcher) { + process.env.JEST_WORKER_ID = '1'; + const mutex = (0, _pLimit().default)(1); + return tests.reduce( + (promise, test) => + mutex(() => + promise + .then(async () => { + if (watcher.isInterrupted()) { + throw new CancelRun(); + } + + // `deepCyclicCopy` used here to avoid mem-leak + const sendMessageToJest = (eventName, args) => + this.#eventEmitter.emit( + eventName, + (0, _jestUtil().deepCyclicCopy)(args, { + keepPrototype: false + }) + ); + await this.#eventEmitter.emit('test-file-start', [test]); + return (0, _runTest.default)( + test.path, + this._globalConfig, + test.context.config, + test.context.resolver, + this._context, + sendMessageToJest + ); + }) + .then( + result => + this.#eventEmitter.emit('test-file-success', [test, result]), + error => + this.#eventEmitter.emit('test-file-failure', [test, error]) + ) + ), + Promise.resolve() + ); + } + async #createParallelTestRun(tests, watcher) { + const resolvers = new Map(); + for (const test of tests) { + if (!resolvers.has(test.context.config.id)) { + resolvers.set(test.context.config.id, { + config: test.context.config, + serializableModuleMap: test.context.moduleMap.toJSON() + }); + } + } + const worker = new (_jestWorker().Worker)(require.resolve('./testWorker'), { + enableWorkerThreads: this._globalConfig.workerThreads, + exposedMethods: ['worker'], + forkOptions: { + serialization: 'json', + stdio: 'pipe' + }, + // The workerIdleMemoryLimit should've been converted to a number during + // the normalization phase. + idleMemoryLimit: + typeof this._globalConfig.workerIdleMemoryLimit === 'number' + ? this._globalConfig.workerIdleMemoryLimit + : undefined, + maxRetries: 3, + numWorkers: this._globalConfig.maxWorkers, + setupArgs: [ + { + serializableResolvers: Array.from(resolvers.values()) + } + ] + }); + if (worker.getStdout()) worker.getStdout().pipe(process.stdout); + if (worker.getStderr()) worker.getStderr().pipe(process.stderr); + const mutex = (0, _pLimit().default)(this._globalConfig.maxWorkers); + + // Send test suites to workers continuously instead of all at once to track + // the start time of individual tests. + const runTestInWorker = test => + mutex(async () => { + if (watcher.isInterrupted()) { + return Promise.reject(); + } + await this.#eventEmitter.emit('test-file-start', [test]); + const promise = worker.worker({ + config: test.context.config, + context: { + ...this._context, + changedFiles: + this._context.changedFiles && + Array.from(this._context.changedFiles), + sourcesRelatedToTestsInChangedFiles: + this._context.sourcesRelatedToTestsInChangedFiles && + Array.from(this._context.sourcesRelatedToTestsInChangedFiles) + }, + globalConfig: this._globalConfig, + path: test.path + }); + if (promise.UNSTABLE_onCustomMessage) { + // TODO: Get appropriate type for `onCustomMessage` + promise.UNSTABLE_onCustomMessage(([event, payload]) => + this.#eventEmitter.emit(event, payload) + ); + } + return promise; + }); + const onInterrupt = new Promise((_, reject) => { + watcher.on('change', state => { + if (state.interrupted) { + reject(new CancelRun()); + } + }); + }); + const runAllTests = Promise.all( + tests.map(test => + runTestInWorker(test).then( + result => + this.#eventEmitter.emit('test-file-success', [test, result]), + error => this.#eventEmitter.emit('test-file-failure', [test, error]) + ) + ) + ); + const cleanup = async () => { + const {forceExited} = await worker.end(); + if (forceExited) { + console.error( + _chalk().default.yellow( + 'A worker process has failed to exit gracefully and has been force exited. ' + + 'This is likely caused by tests leaking due to improper teardown. ' + + 'Try running with --detectOpenHandles to find leaks. ' + + 'Active timers can also cause this, ensure that .unref() was called on them.' + ) + ); + } + }; + return Promise.race([runAllTests, onInterrupt]).then(cleanup, cleanup); + } + on(eventName, listener) { + return this.#eventEmitter.on(eventName, listener); + } +} +exports.default = TestRunner; +class CancelRun extends Error { + constructor(message) { + super(message); + this.name = 'CancelRun'; + } +} diff --git a/node_modules/jest-runner/build/runTest.js b/node_modules/jest-runner/build/runTest.js new file mode 100644 index 00000000..e3367c85 --- /dev/null +++ b/node_modules/jest-runner/build/runTest.js @@ -0,0 +1,462 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = runTest; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +function _sourceMapSupport() { + const data = _interopRequireDefault(require('source-map-support')); + _sourceMapSupport = function () { + return data; + }; + return data; +} +function _console() { + const data = require('@jest/console'); + _console = function () { + return data; + }; + return data; +} +function _transform() { + const data = require('@jest/transform'); + _transform = function () { + return data; + }; + return data; +} +function docblock() { + const data = _interopRequireWildcard(require('jest-docblock')); + docblock = function () { + return data; + }; + return data; +} +function _jestLeakDetector() { + const data = _interopRequireDefault(require('jest-leak-detector')); + _jestLeakDetector = function () { + return data; + }; + return data; +} +function _jestMessageUtil() { + const data = require('jest-message-util'); + _jestMessageUtil = function () { + return data; + }; + return data; +} +function _jestResolve() { + const data = require('jest-resolve'); + _jestResolve = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +function freezeConsole(testConsole, config) { + // @ts-expect-error: `_log` is `private` - we should figure out some proper API here + testConsole._log = function fakeConsolePush(_type, message) { + const error = new (_jestUtil().ErrorWithStack)( + `${_chalk().default.red( + `${_chalk().default.bold( + 'Cannot log after tests are done.' + )} Did you forget to wait for something async in your test?` + )}\nAttempted to log "${message}".`, + fakeConsolePush + ); + const formattedError = (0, _jestMessageUtil().formatExecError)( + error, + config, + { + noStackTrace: false + }, + undefined, + true + ); + process.stderr.write(`\n${formattedError}\n`); + process.exitCode = 1; + }; +} + +// Keeping the core of "runTest" as a separate function (as "runTestInternal") +// is key to be able to detect memory leaks. Since all variables are local to +// the function, when "runTestInternal" finishes its execution, they can all be +// freed, UNLESS something else is leaking them (and that's why we can detect +// the leak!). +// +// If we had all the code in a single function, we should manually nullify all +// references to verify if there is a leak, which is not maintainable and error +// prone. That's why "runTestInternal" CANNOT be inlined inside "runTest". +async function runTestInternal( + path, + globalConfig, + projectConfig, + resolver, + context, + sendMessageToJest +) { + const testSource = fs().readFileSync(path, 'utf8'); + const docblockPragmas = docblock().parse(docblock().extract(testSource)); + const customEnvironment = docblockPragmas['jest-environment']; + let testEnvironment = projectConfig.testEnvironment; + if (customEnvironment) { + if (Array.isArray(customEnvironment)) { + throw new Error( + `You can only define a single test environment through docblocks, got "${customEnvironment.join( + ', ' + )}"` + ); + } + testEnvironment = (0, _jestResolve().resolveTestEnvironment)({ + ...projectConfig, + requireResolveFunction: require.resolve, + testEnvironment: customEnvironment + }); + } + const cacheFS = new Map([[path, testSource]]); + const transformer = await (0, _transform().createScriptTransformer)( + projectConfig, + cacheFS + ); + const TestEnvironment = await transformer.requireAndTranspileModule( + testEnvironment + ); + const testFramework = await transformer.requireAndTranspileModule( + process.env.JEST_JASMINE === '1' + ? require.resolve('jest-jasmine2') + : projectConfig.testRunner + ); + const Runtime = (0, _jestUtil().interopRequireDefault)( + projectConfig.runtime + ? require(projectConfig.runtime) + : require('jest-runtime') + ).default; + const consoleOut = globalConfig.useStderr ? process.stderr : process.stdout; + const consoleFormatter = (type, message) => + (0, _console().getConsoleOutput)( + // 4 = the console call is buried 4 stack frames deep + _console().BufferedConsole.write([], type, message, 4), + projectConfig, + globalConfig + ); + let testConsole; + if (globalConfig.silent) { + testConsole = new (_console().NullConsole)( + consoleOut, + consoleOut, + consoleFormatter + ); + } else if (globalConfig.verbose) { + testConsole = new (_console().CustomConsole)( + consoleOut, + consoleOut, + consoleFormatter + ); + } else { + testConsole = new (_console().BufferedConsole)(); + } + let extraTestEnvironmentOptions; + const docblockEnvironmentOptions = + docblockPragmas['jest-environment-options']; + if (typeof docblockEnvironmentOptions === 'string') { + extraTestEnvironmentOptions = JSON.parse(docblockEnvironmentOptions); + } + const environment = new TestEnvironment( + { + globalConfig, + projectConfig: extraTestEnvironmentOptions + ? { + ...projectConfig, + testEnvironmentOptions: { + ...projectConfig.testEnvironmentOptions, + ...extraTestEnvironmentOptions + } + } + : projectConfig + }, + { + console: testConsole, + docblockPragmas, + testPath: path + } + ); + if (typeof environment.getVmContext !== 'function') { + console.error( + `Test environment found at "${testEnvironment}" does not export a "getVmContext" method, which is mandatory from Jest 27. This method is a replacement for "runScript".` + ); + process.exit(1); + } + const leakDetector = projectConfig.detectLeaks + ? new (_jestLeakDetector().default)(environment) + : null; + (0, _jestUtil().setGlobal)(environment.global, 'console', testConsole); + const runtime = new Runtime( + projectConfig, + environment, + resolver, + transformer, + cacheFS, + { + changedFiles: context.changedFiles, + collectCoverage: globalConfig.collectCoverage, + collectCoverageFrom: globalConfig.collectCoverageFrom, + coverageProvider: globalConfig.coverageProvider, + sourcesRelatedToTestsInChangedFiles: + context.sourcesRelatedToTestsInChangedFiles + }, + path, + globalConfig + ); + let isTornDown = false; + const tearDownEnv = async () => { + if (!isTornDown) { + runtime.teardown(); + await environment.teardown(); + isTornDown = true; + } + }; + const start = Date.now(); + for (const path of projectConfig.setupFiles) { + const esm = runtime.unstable_shouldLoadAsEsm(path); + if (esm) { + await runtime.unstable_importModule(path); + } else { + const setupFile = runtime.requireModule(path); + if (typeof setupFile === 'function') { + await setupFile(); + } + } + } + const sourcemapOptions = { + environment: 'node', + handleUncaughtExceptions: false, + retrieveSourceMap: source => { + const sourceMapSource = runtime.getSourceMaps()?.get(source); + if (sourceMapSource) { + try { + return { + map: JSON.parse(fs().readFileSync(sourceMapSource, 'utf8')), + url: source + }; + } catch {} + } + return null; + } + }; + + // For tests + runtime + .requireInternalModule(require.resolve('source-map-support')) + .install(sourcemapOptions); + + // For runtime errors + _sourceMapSupport().default.install(sourcemapOptions); + if ( + environment.global && + environment.global.process && + environment.global.process.exit + ) { + const realExit = environment.global.process.exit; + environment.global.process.exit = function exit(...args) { + const error = new (_jestUtil().ErrorWithStack)( + `process.exit called with "${args.join(', ')}"`, + exit + ); + const formattedError = (0, _jestMessageUtil().formatExecError)( + error, + projectConfig, + { + noStackTrace: false + }, + undefined, + true + ); + process.stderr.write(formattedError); + return realExit(...args); + }; + } + + // if we don't have `getVmContext` on the env skip coverage + const collectV8Coverage = + globalConfig.collectCoverage && + globalConfig.coverageProvider === 'v8' && + typeof environment.getVmContext === 'function'; + + // Node's error-message stack size is limited at 10, but it's pretty useful + // to see more than that when a test fails. + Error.stackTraceLimit = 100; + try { + await environment.setup(); + let result; + try { + if (collectV8Coverage) { + await runtime.collectV8Coverage(); + } + result = await testFramework( + globalConfig, + projectConfig, + environment, + runtime, + path, + sendMessageToJest + ); + } catch (err) { + // Access stack before uninstalling sourcemaps + err.stack; + throw err; + } finally { + if (collectV8Coverage) { + await runtime.stopCollectingV8Coverage(); + } + } + freezeConsole(testConsole, projectConfig); + const testCount = + result.numPassingTests + + result.numFailingTests + + result.numPendingTests + + result.numTodoTests; + const end = Date.now(); + const testRuntime = end - start; + result.perfStats = { + end, + runtime: testRuntime, + slow: testRuntime / 1000 > projectConfig.slowTestThreshold, + start + }; + result.testFilePath = path; + result.console = testConsole.getBuffer(); + result.skipped = testCount === result.numPendingTests; + result.displayName = projectConfig.displayName; + const coverage = runtime.getAllCoverageInfoCopy(); + if (coverage) { + const coverageKeys = Object.keys(coverage); + if (coverageKeys.length) { + result.coverage = coverage; + } + } + if (collectV8Coverage) { + const v8Coverage = runtime.getAllV8CoverageInfoCopy(); + if (v8Coverage && v8Coverage.length > 0) { + result.v8Coverage = v8Coverage; + } + } + if (globalConfig.logHeapUsage) { + // @ts-expect-error - doesn't exist on globalThis + globalThis.gc?.(); + result.memoryUsage = process.memoryUsage().heapUsed; + } + await tearDownEnv(); + + // Delay the resolution to allow log messages to be output. + return await new Promise(resolve => { + setImmediate(() => + resolve({ + leakDetector, + result + }) + ); + }); + } finally { + await tearDownEnv(); + _sourceMapSupport().default.resetRetrieveHandlers(); + } +} +async function runTest( + path, + globalConfig, + config, + resolver, + context, + sendMessageToJest +) { + const {leakDetector, result} = await runTestInternal( + path, + globalConfig, + config, + resolver, + context, + sendMessageToJest + ); + if (leakDetector) { + // We wanna allow a tiny but time to pass to allow last-minute cleanup + await new Promise(resolve => setTimeout(resolve, 100)); + + // Resolve leak detector, outside the "runTestInternal" closure. + result.leaks = await leakDetector.isLeaking(); + } else { + result.leaks = false; + } + return result; +} diff --git a/node_modules/jest-runner/build/testWorker.js b/node_modules/jest-runner/build/testWorker.js new file mode 100644 index 00000000..fe0363e9 --- /dev/null +++ b/node_modules/jest-runner/build/testWorker.js @@ -0,0 +1,123 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.setup = setup; +exports.worker = worker; +function _exit() { + const data = _interopRequireDefault(require('exit')); + _exit = function () { + return data; + }; + return data; +} +function _jestHasteMap() { + const data = _interopRequireDefault(require('jest-haste-map')); + _jestHasteMap = function () { + return data; + }; + return data; +} +function _jestMessageUtil() { + const data = require('jest-message-util'); + _jestMessageUtil = function () { + return data; + }; + return data; +} +function _jestRuntime() { + const data = _interopRequireDefault(require('jest-runtime')); + _jestRuntime = function () { + return data; + }; + return data; +} +function _jestWorker() { + const data = require('jest-worker'); + _jestWorker = function () { + return data; + }; + return data; +} +var _runTest = _interopRequireDefault(require('./runTest')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + +// Make sure uncaught errors are logged before we exit. +process.on('uncaughtException', err => { + console.error(err.stack); + (0, _exit().default)(1); +}); +const formatError = error => { + if (typeof error === 'string') { + const {message, stack} = (0, _jestMessageUtil().separateMessageFromStack)( + error + ); + return { + message, + stack, + type: 'Error' + }; + } + return { + code: error.code || undefined, + message: error.message, + stack: error.stack, + type: 'Error' + }; +}; +const resolvers = new Map(); +const getResolver = config => { + const resolver = resolvers.get(config.id); + if (!resolver) { + throw new Error(`Cannot find resolver for: ${config.id}`); + } + return resolver; +}; +function setup(setupData) { + // Module maps that will be needed for the test runs are passed. + for (const { + config, + serializableModuleMap + } of setupData.serializableResolvers) { + const moduleMap = _jestHasteMap() + .default.getStatic(config) + .getModuleMapFromJSON(serializableModuleMap); + resolvers.set( + config.id, + _jestRuntime().default.createResolver(config, moduleMap) + ); + } +} +const sendMessageToJest = (eventName, args) => { + (0, _jestWorker().messageParent)([eventName, args]); +}; +async function worker({config, globalConfig, path, context}) { + try { + return await (0, _runTest.default)( + path, + globalConfig, + config, + getResolver(config), + { + ...context, + changedFiles: context.changedFiles && new Set(context.changedFiles), + sourcesRelatedToTestsInChangedFiles: + context.sourcesRelatedToTestsInChangedFiles && + new Set(context.sourcesRelatedToTestsInChangedFiles) + }, + sendMessageToJest + ); + } catch (error) { + throw formatError(error); + } +} diff --git a/node_modules/jest-runner/build/types.js b/node_modules/jest-runner/build/types.js new file mode 100644 index 00000000..8306d5ab --- /dev/null +++ b/node_modules/jest-runner/build/types.js @@ -0,0 +1,28 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.EmittingTestRunner = exports.CallbackTestRunner = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class BaseTestRunner { + isSerial; + constructor(_globalConfig, _context) { + this._globalConfig = _globalConfig; + this._context = _context; + } +} +class CallbackTestRunner extends BaseTestRunner { + supportsEventEmitters = false; +} +exports.CallbackTestRunner = CallbackTestRunner; +class EmittingTestRunner extends BaseTestRunner { + supportsEventEmitters = true; +} +exports.EmittingTestRunner = EmittingTestRunner; diff --git a/node_modules/jest-runner/package.json b/node_modules/jest-runner/package.json new file mode 100644 index 00000000..6b46ae0f --- /dev/null +++ b/node_modules/jest-runner/package.json @@ -0,0 +1,58 @@ +{ + "name": "jest-runner", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-runner" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" + }, + "devDependencies": { + "@jest/test-utils": "^29.7.0", + "@tsd/typescript": "^5.0.4", + "@types/exit": "^0.1.30", + "@types/graceful-fs": "^4.1.3", + "@types/source-map-support": "^0.5.0", + "jest-jasmine2": "^29.7.0", + "tsd-lite": "^0.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-runtime/LICENSE b/node_modules/jest-runtime/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-runtime/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-runtime/build/helpers.js b/node_modules/jest-runtime/build/helpers.js new file mode 100644 index 00000000..1048868f --- /dev/null +++ b/node_modules/jest-runtime/build/helpers.js @@ -0,0 +1,134 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.findSiblingsWithFileExtension = + exports.decodePossibleOutsideJestVmPath = + exports.createOutsideJestVmPath = + void 0; +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _glob() { + const data = _interopRequireDefault(require('glob')); + _glob = function () { + return data; + }; + return data; +} +function _slash() { + const data = _interopRequireDefault(require('slash')); + _slash = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const OUTSIDE_JEST_VM_PROTOCOL = 'jest-main:'; +// String manipulation is easier here, fileURLToPath is only in newer Nodes, +// plus setting non-standard protocols on URL objects is difficult. +const createOutsideJestVmPath = path => + `${OUTSIDE_JEST_VM_PROTOCOL}//${encodeURIComponent(path)}`; +exports.createOutsideJestVmPath = createOutsideJestVmPath; +const decodePossibleOutsideJestVmPath = outsideJestVmPath => { + if (outsideJestVmPath.startsWith(OUTSIDE_JEST_VM_PROTOCOL)) { + return decodeURIComponent( + outsideJestVmPath.replace( + new RegExp(`^${OUTSIDE_JEST_VM_PROTOCOL}//`), + '' + ) + ); + } + return undefined; +}; +exports.decodePossibleOutsideJestVmPath = decodePossibleOutsideJestVmPath; +const findSiblingsWithFileExtension = ( + moduleFileExtensions, + from, + moduleName +) => { + if (!path().isAbsolute(moduleName) && path().extname(moduleName) === '') { + const dirname = path().dirname(from); + const pathToModule = path().resolve(dirname, moduleName); + try { + const slashedDirname = (0, _slash().default)(dirname); + const matches = _glob() + .default.sync(`${pathToModule}.*`) + .map(match => (0, _slash().default)(match)) + .map(match => { + const relativePath = path().posix.relative(slashedDirname, match); + return path().posix.dirname(match) === slashedDirname + ? `./${relativePath}` + : relativePath; + }) + .map(match => `\t'${match}'`) + .join('\n'); + if (matches) { + const foundMessage = `\n\nHowever, Jest was able to find:\n${matches}`; + const mappedModuleFileExtensions = moduleFileExtensions + .map(ext => `'${ext}'`) + .join(', '); + return ( + `${foundMessage}\n\nYou might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ` + + `[${mappedModuleFileExtensions}].\n\nSee https://jestjs.io/docs/configuration#modulefileextensions-arraystring` + ); + } + } catch {} + } + return ''; +}; +exports.findSiblingsWithFileExtension = findSiblingsWithFileExtension; diff --git a/node_modules/jest-runtime/build/index.d.ts b/node_modules/jest-runtime/build/index.d.ts new file mode 100644 index 00000000..5bdf9fdf --- /dev/null +++ b/node_modules/jest-runtime/build/index.d.ts @@ -0,0 +1,193 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import {CallerTransformOptions} from '@jest/transform'; +import type {Config} from '@jest/types'; +import type {expect} from '@jest/globals'; +import type {Global} from '@jest/types'; +import {IHasteMap} from 'jest-haste-map'; +import {IModuleMap} from 'jest-haste-map'; +import type {JestEnvironment} from '@jest/environment'; +import Resolver from 'jest-resolve'; +import {ScriptTransformer} from '@jest/transform'; +import {shouldInstrument} from '@jest/transform'; +import {ShouldInstrumentOptions} from '@jest/transform'; +import type {SourceMapRegistry} from '@jest/source-map'; +import type {TestContext} from '@jest/test-result'; +import type {V8CoverageResult} from '@jest/test-result'; + +declare type HasteMapOptions = { + console?: Console; + maxWorkers: number; + resetCache: boolean; + watch?: boolean; + watchman: boolean; + workerThreads?: boolean; +}; + +declare interface InternalModuleOptions + extends Required { + isInternalModule: boolean; +} + +declare interface JestGlobals extends Global.TestFrameworkGlobals { + expect: typeof expect; +} + +declare class Runtime { + private readonly _cacheFS; + private readonly _cacheFSBuffer; + private readonly _config; + private readonly _globalConfig?; + private readonly _coverageOptions; + private _currentlyExecutingModulePath; + private readonly _environment; + private readonly _explicitShouldMock; + private readonly _explicitShouldMockModule; + private _fakeTimersImplementation; + private readonly _internalModuleRegistry; + private _isCurrentlyExecutingManualMock; + private _mainModule; + private readonly _mockFactories; + private readonly _mockMetaDataCache; + private _mockRegistry; + private _isolatedMockRegistry; + private readonly _moduleMockRegistry; + private readonly _moduleMockFactories; + private readonly _moduleMocker; + private _isolatedModuleRegistry; + private _moduleRegistry; + private readonly _esmoduleRegistry; + private readonly _cjsNamedExports; + private readonly _esmModuleLinkingMap; + private readonly _testPath; + private readonly _resolver; + private _shouldAutoMock; + private readonly _shouldMockModuleCache; + private readonly _shouldUnmockTransitiveDependenciesCache; + private readonly _sourceMapRegistry; + private readonly _scriptTransformer; + private readonly _fileTransforms; + private readonly _fileTransformsMutex; + private _v8CoverageInstrumenter; + private _v8CoverageResult; + private _v8CoverageSources; + private readonly _transitiveShouldMock; + private _unmockList; + private readonly _virtualMocks; + private readonly _virtualModuleMocks; + private _moduleImplementation?; + private readonly jestObjectCaches; + private jestGlobals?; + private readonly esmConditions; + private readonly cjsConditions; + private isTornDown; + constructor( + config: Config.ProjectConfig, + environment: JestEnvironment, + resolver: Resolver, + transformer: ScriptTransformer, + cacheFS: Map, + coverageOptions: ShouldInstrumentOptions, + testPath: string, + globalConfig?: Config.GlobalConfig, + ); + static shouldInstrument: typeof shouldInstrument; + static createContext( + config: Config.ProjectConfig, + options: { + console?: Console; + maxWorkers: number; + watch?: boolean; + watchman: boolean; + }, + ): Promise; + static createHasteMap( + config: Config.ProjectConfig, + options?: HasteMapOptions, + ): Promise; + static createResolver( + config: Config.ProjectConfig, + moduleMap: IModuleMap, + ): Resolver; + static runCLI(): Promise; + static getCLIOptions(): never; + unstable_shouldLoadAsEsm(modulePath: string): boolean; + private loadEsmModule; + private resolveModule; + private linkAndEvaluateModule; + unstable_importModule( + from: string, + moduleName?: string, + ): Promise; + private loadCjsAsEsm; + private importMock; + private getExportsOfCjs; + requireModule( + from: string, + moduleName?: string, + options?: InternalModuleOptions, + isRequireActual?: boolean, + ): T; + requireInternalModule(from: string, to?: string): T; + requireActual(from: string, moduleName: string): T; + requireMock(from: string, moduleName: string): T; + private _loadModule; + private _getFullTransformationOptions; + requireModuleOrMock(from: string, moduleName: string): T; + isolateModules(fn: () => void): void; + isolateModulesAsync(fn: () => Promise): Promise; + resetModules(): void; + collectV8Coverage(): Promise; + stopCollectingV8Coverage(): Promise; + getAllCoverageInfoCopy(): JestEnvironment['global']['__coverage__']; + getAllV8CoverageInfoCopy(): V8CoverageResult; + getSourceMaps(): SourceMapRegistry; + setMock( + from: string, + moduleName: string, + mockFactory: () => unknown, + options?: { + virtual?: boolean; + }, + ): void; + private setModuleMock; + restoreAllMocks(): void; + resetAllMocks(): void; + clearAllMocks(): void; + teardown(): void; + private _resolveCjsModule; + private _resolveModule; + private _requireResolve; + private _requireResolvePaths; + private _execModule; + private transformFile; + private transformFileAsync; + private createScriptFromCode; + private _requireCoreModule; + private _importCoreModule; + private _importWasmModule; + private _getMockedNativeModule; + private _generateMock; + private _shouldMockCjs; + private _shouldMockModule; + private _createRequireImplementation; + private _createJestObjectFor; + private _logFormattedReferenceError; + private wrapCodeInModuleWrapper; + private constructModuleWrapperStart; + private constructInjectedModuleParameters; + private handleExecutionError; + private getGlobalsForCjs; + private getGlobalsForEsm; + private getGlobalsFromEnvironment; + private readFileBuffer; + private readFile; + setGlobalsForRuntime(globals: JestGlobals): void; +} +export default Runtime; + +export {}; diff --git a/node_modules/jest-runtime/build/index.js b/node_modules/jest-runtime/build/index.js new file mode 100644 index 00000000..01cb4206 --- /dev/null +++ b/node_modules/jest-runtime/build/index.js @@ -0,0 +1,2316 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _module() { + const data = _interopRequireDefault(require('module')); + _module = function () { + return data; + }; + return data; +} +function path() { + const data = _interopRequireWildcard(require('path')); + path = function () { + return data; + }; + return data; +} +function _url() { + const data = require('url'); + _url = function () { + return data; + }; + return data; +} +function _vm() { + const data = require('vm'); + _vm = function () { + return data; + }; + return data; +} +function _cjsModuleLexer() { + const data = require('cjs-module-lexer'); + _cjsModuleLexer = function () { + return data; + }; + return data; +} +function _collectV8Coverage() { + const data = require('collect-v8-coverage'); + _collectV8Coverage = function () { + return data; + }; + return data; +} +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +function _slash() { + const data = _interopRequireDefault(require('slash')); + _slash = function () { + return data; + }; + return data; +} +function _stripBom() { + const data = _interopRequireDefault(require('strip-bom')); + _stripBom = function () { + return data; + }; + return data; +} +function _transform() { + const data = require('@jest/transform'); + _transform = function () { + return data; + }; + return data; +} +function _jestHasteMap() { + const data = _interopRequireDefault(require('jest-haste-map')); + _jestHasteMap = function () { + return data; + }; + return data; +} +function _jestMessageUtil() { + const data = require('jest-message-util'); + _jestMessageUtil = function () { + return data; + }; + return data; +} +function _jestRegexUtil() { + const data = require('jest-regex-util'); + _jestRegexUtil = function () { + return data; + }; + return data; +} +function _jestResolve() { + const data = _interopRequireDefault(require('jest-resolve')); + _jestResolve = function () { + return data; + }; + return data; +} +function _jestSnapshot() { + const data = require('jest-snapshot'); + _jestSnapshot = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +var _helpers = require('./helpers'); +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const esmIsAvailable = typeof _vm().SourceTextModule === 'function'; +const dataURIRegex = + /^data:(?text\/javascript|application\/json|application\/wasm)(?:;(?charset=utf-8|base64))?,(?.*)$/; +const defaultTransformOptions = { + isInternalModule: false, + supportsDynamicImport: esmIsAvailable, + supportsExportNamespaceFrom: false, + supportsStaticESM: false, + supportsTopLevelAwait: false +}; +// These are modules that we know +// * are safe to require from the outside (not stateful, not prone to errors passing in instances from different realms), and +// * take sufficiently long to require to warrant an optimization. +// When required from the outside, they use the worker's require cache and are thus +// only loaded once per worker, not once per test file. +// Use /benchmarks/test-file-overhead to measure the impact. +// Note that this only applies when they are required in an internal context; +// users who require one of these modules in their tests will still get the module from inside the VM. +// Prefer listing a module here only if it is impractical to use the jest-resolve-outside-vm-option where it is required, +// e.g. because there are many require sites spread across the dependency graph. +const INTERNAL_MODULE_REQUIRE_OUTSIDE_OPTIMIZED_MODULES = new Set(['chalk']); +const JEST_RESOLVE_OUTSIDE_VM_OPTION = Symbol.for( + 'jest-resolve-outside-vm-option' +); +const testTimeoutSymbol = Symbol.for('TEST_TIMEOUT_SYMBOL'); +const retryTimesSymbol = Symbol.for('RETRY_TIMES'); +const logErrorsBeforeRetrySymbol = Symbol.for('LOG_ERRORS_BEFORE_RETRY'); +const NODE_MODULES = `${path().sep}node_modules${path().sep}`; +const getModuleNameMapper = config => { + if ( + Array.isArray(config.moduleNameMapper) && + config.moduleNameMapper.length + ) { + return config.moduleNameMapper.map(([regex, moduleName]) => ({ + moduleName, + regex: new RegExp(regex) + })); + } + return null; +}; +const isWasm = modulePath => modulePath.endsWith('.wasm'); +const unmockRegExpCache = new WeakMap(); +const EVAL_RESULT_VARIABLE = 'Object.'; +const runtimeSupportsVmModules = typeof _vm().SyntheticModule === 'function'; +const supportsNodeColonModulePrefixInRequire = (() => { + try { + require('node:fs'); + return true; + } catch { + return false; + } +})(); +class Runtime { + _cacheFS; + _cacheFSBuffer = new Map(); + _config; + _globalConfig; + _coverageOptions; + _currentlyExecutingModulePath; + _environment; + _explicitShouldMock; + _explicitShouldMockModule; + _fakeTimersImplementation; + _internalModuleRegistry; + _isCurrentlyExecutingManualMock; + _mainModule; + _mockFactories; + _mockMetaDataCache; + _mockRegistry; + _isolatedMockRegistry; + _moduleMockRegistry; + _moduleMockFactories; + _moduleMocker; + _isolatedModuleRegistry; + _moduleRegistry; + _esmoduleRegistry; + _cjsNamedExports; + _esmModuleLinkingMap; + _testPath; + _resolver; + _shouldAutoMock; + _shouldMockModuleCache; + _shouldUnmockTransitiveDependenciesCache; + _sourceMapRegistry; + _scriptTransformer; + _fileTransforms; + _fileTransformsMutex; + _v8CoverageInstrumenter; + _v8CoverageResult; + _v8CoverageSources; + _transitiveShouldMock; + _unmockList; + _virtualMocks; + _virtualModuleMocks; + _moduleImplementation; + jestObjectCaches; + jestGlobals; + esmConditions; + cjsConditions; + isTornDown = false; + constructor( + config, + environment, + resolver, + transformer, + cacheFS, + coverageOptions, + testPath, + // TODO: make mandatory in Jest 30 + globalConfig + ) { + this._cacheFS = cacheFS; + this._config = config; + this._coverageOptions = coverageOptions; + this._currentlyExecutingModulePath = ''; + this._environment = environment; + this._globalConfig = globalConfig; + this._explicitShouldMock = new Map(); + this._explicitShouldMockModule = new Map(); + this._internalModuleRegistry = new Map(); + this._isCurrentlyExecutingManualMock = null; + this._mainModule = null; + this._mockFactories = new Map(); + this._mockRegistry = new Map(); + this._moduleMockRegistry = new Map(); + this._moduleMockFactories = new Map(); + (0, _jestUtil().invariant)( + this._environment.moduleMocker, + '`moduleMocker` must be set on an environment when created' + ); + this._moduleMocker = this._environment.moduleMocker; + this._isolatedModuleRegistry = null; + this._isolatedMockRegistry = null; + this._moduleRegistry = new Map(); + this._esmoduleRegistry = new Map(); + this._cjsNamedExports = new Map(); + this._esmModuleLinkingMap = new WeakMap(); + this._testPath = testPath; + this._resolver = resolver; + this._scriptTransformer = transformer; + this._shouldAutoMock = config.automock; + this._sourceMapRegistry = new Map(); + this._fileTransforms = new Map(); + this._fileTransformsMutex = new Map(); + this._virtualMocks = new Map(); + this._virtualModuleMocks = new Map(); + this.jestObjectCaches = new Map(); + this._mockMetaDataCache = new Map(); + this._shouldMockModuleCache = new Map(); + this._shouldUnmockTransitiveDependenciesCache = new Map(); + this._transitiveShouldMock = new Map(); + this._fakeTimersImplementation = config.fakeTimers.legacyFakeTimers + ? this._environment.fakeTimers + : this._environment.fakeTimersModern; + this._unmockList = unmockRegExpCache.get(config); + if (!this._unmockList && config.unmockedModulePathPatterns) { + this._unmockList = new RegExp( + config.unmockedModulePathPatterns.join('|') + ); + unmockRegExpCache.set(config, this._unmockList); + } + const envExportConditions = this._environment.exportConditions?.() ?? []; + this.esmConditions = Array.from( + new Set(['import', 'default', ...envExportConditions]) + ); + this.cjsConditions = Array.from( + new Set(['require', 'default', ...envExportConditions]) + ); + if (config.automock) { + config.setupFiles.forEach(filePath => { + if (filePath.includes(NODE_MODULES)) { + const moduleID = this._resolver.getModuleID( + this._virtualMocks, + filePath, + undefined, + // shouldn't really matter, but in theory this will make sure the caching is correct + { + conditions: this.unstable_shouldLoadAsEsm(filePath) + ? this.esmConditions + : this.cjsConditions + } + ); + this._transitiveShouldMock.set(moduleID, false); + } + }); + } + this.resetModules(); + } + static shouldInstrument = _transform().shouldInstrument; + static async createContext(config, options) { + (0, _jestUtil().createDirectory)(config.cacheDirectory); + const instance = await Runtime.createHasteMap(config, { + console: options.console, + maxWorkers: options.maxWorkers, + resetCache: !config.cache, + watch: options.watch, + watchman: options.watchman + }); + const hasteMap = await instance.build(); + return { + config, + hasteFS: hasteMap.hasteFS, + moduleMap: hasteMap.moduleMap, + resolver: Runtime.createResolver(config, hasteMap.moduleMap) + }; + } + static createHasteMap(config, options) { + const ignorePatternParts = [ + ...config.modulePathIgnorePatterns, + ...(options && options.watch ? config.watchPathIgnorePatterns : []), + config.cacheDirectory.startsWith(config.rootDir + path().sep) && + config.cacheDirectory + ].filter(Boolean); + const ignorePattern = + ignorePatternParts.length > 0 + ? new RegExp(ignorePatternParts.join('|')) + : undefined; + return _jestHasteMap().default.create({ + cacheDirectory: config.cacheDirectory, + computeSha1: config.haste.computeSha1, + console: options?.console, + dependencyExtractor: config.dependencyExtractor, + enableSymlinks: config.haste.enableSymlinks, + extensions: [_jestSnapshot().EXTENSION].concat( + config.moduleFileExtensions + ), + forceNodeFilesystemAPI: config.haste.forceNodeFilesystemAPI, + hasteImplModulePath: config.haste.hasteImplModulePath, + hasteMapModulePath: config.haste.hasteMapModulePath, + id: config.id, + ignorePattern, + maxWorkers: options?.maxWorkers || 1, + mocksPattern: (0, _jestRegexUtil().escapePathForRegex)( + `${path().sep}__mocks__${path().sep}` + ), + platforms: config.haste.platforms || ['ios', 'android'], + resetCache: options?.resetCache, + retainAllFiles: config.haste.retainAllFiles || false, + rootDir: config.rootDir, + roots: config.roots, + throwOnModuleCollision: config.haste.throwOnModuleCollision, + useWatchman: options?.watchman, + watch: options?.watch, + workerThreads: options?.workerThreads + }); + } + static createResolver(config, moduleMap) { + return new (_jestResolve().default)(moduleMap, { + defaultPlatform: config.haste.defaultPlatform, + extensions: config.moduleFileExtensions.map(extension => `.${extension}`), + hasCoreModules: true, + moduleDirectories: config.moduleDirectories, + moduleNameMapper: getModuleNameMapper(config), + modulePaths: config.modulePaths, + platforms: config.haste.platforms, + resolver: config.resolver, + rootDir: config.rootDir + }); + } + static async runCLI() { + throw new Error('The jest-runtime CLI has been moved into jest-repl'); + } + static getCLIOptions() { + throw new Error('The jest-runtime CLI has been moved into jest-repl'); + } + + // unstable as it should be replaced by https://github.com/nodejs/modules/issues/393, and we don't want people to use it + unstable_shouldLoadAsEsm(modulePath) { + return ( + isWasm(modulePath) || + _jestResolve().default.unstable_shouldLoadAsEsm( + modulePath, + this._config.extensionsToTreatAsEsm + ) + ); + } + async loadEsmModule(modulePath, query = '') { + const cacheKey = modulePath + query; + const registry = this._isolatedModuleRegistry + ? this._isolatedModuleRegistry + : this._esmoduleRegistry; + if (this._fileTransformsMutex.has(cacheKey)) { + await this._fileTransformsMutex.get(cacheKey); + } + if (!registry.has(cacheKey)) { + (0, _jestUtil().invariant)( + typeof this._environment.getVmContext === 'function', + 'ES Modules are only supported if your test environment has the `getVmContext` function' + ); + const context = this._environment.getVmContext(); + (0, _jestUtil().invariant)( + context, + 'Test environment has been torn down' + ); + let transformResolve; + let transformReject; + this._fileTransformsMutex.set( + cacheKey, + new Promise((resolve, reject) => { + transformResolve = resolve; + transformReject = reject; + }) + ); + (0, _jestUtil().invariant)( + transformResolve && transformReject, + 'Promise initialization should be sync - please report this bug to Jest!' + ); + if (isWasm(modulePath)) { + const wasm = this._importWasmModule( + this.readFileBuffer(modulePath), + modulePath, + context + ); + registry.set(cacheKey, wasm); + transformResolve(); + return wasm; + } + if (this._resolver.isCoreModule(modulePath)) { + const core = this._importCoreModule(modulePath, context); + registry.set(cacheKey, core); + transformResolve(); + return core; + } + const transformedCode = await this.transformFileAsync(modulePath, { + isInternalModule: false, + supportsDynamicImport: true, + supportsExportNamespaceFrom: true, + supportsStaticESM: true, + supportsTopLevelAwait: true + }); + try { + let module; + if (modulePath.endsWith('.json')) { + module = new (_vm().SyntheticModule)( + ['default'], + function () { + const obj = JSON.parse(transformedCode); + // @ts-expect-error: TS doesn't know what `this` is + this.setExport('default', obj); + }, + { + context, + identifier: modulePath + } + ); + } else { + module = new (_vm().SourceTextModule)(transformedCode, { + context, + identifier: modulePath, + importModuleDynamically: async (specifier, referencingModule) => { + (0, _jestUtil().invariant)( + runtimeSupportsVmModules, + 'You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules' + ); + const module = await this.resolveModule( + specifier, + referencingModule.identifier, + referencingModule.context + ); + return this.linkAndEvaluateModule(module); + }, + initializeImportMeta: meta => { + meta.url = (0, _url().pathToFileURL)(modulePath).href; + let jest = this.jestObjectCaches.get(modulePath); + if (!jest) { + jest = this._createJestObjectFor(modulePath); + this.jestObjectCaches.set(modulePath, jest); + } + meta.jest = jest; + } + }); + } + (0, _jestUtil().invariant)( + !registry.has(cacheKey), + `Module cache already has entry ${cacheKey}. This is a bug in Jest, please report it!` + ); + registry.set(cacheKey, module); + transformResolve(); + } catch (error) { + transformReject(error); + throw error; + } + } + const module = registry.get(cacheKey); + (0, _jestUtil().invariant)( + module, + 'Module cache does not contain module. This is a bug in Jest, please open up an issue' + ); + return module; + } + async resolveModule(specifier, referencingIdentifier, context) { + if (this.isTornDown) { + this._logFormattedReferenceError( + 'You are trying to `import` a file after the Jest environment has been torn down.' + ); + process.exitCode = 1; + // @ts-expect-error - exiting + return; + } + const registry = this._isolatedModuleRegistry + ? this._isolatedModuleRegistry + : this._esmoduleRegistry; + if (specifier === '@jest/globals') { + const fromCache = registry.get('@jest/globals'); + if (fromCache) { + return fromCache; + } + const globals = this.getGlobalsForEsm(referencingIdentifier, context); + registry.set('@jest/globals', globals); + return globals; + } + if (specifier.startsWith('data:')) { + if ( + await this._shouldMockModule( + referencingIdentifier, + specifier, + this._explicitShouldMockModule + ) + ) { + return this.importMock(referencingIdentifier, specifier, context); + } + const fromCache = registry.get(specifier); + if (fromCache) { + return fromCache; + } + const match = specifier.match(dataURIRegex); + if (!match || !match.groups) { + throw new Error('Invalid data URI'); + } + const mime = match.groups.mime; + const encoding = match.groups.encoding; + let module; + if (mime === 'application/wasm') { + if (!encoding) { + throw new Error('Missing data URI encoding'); + } + if (encoding !== 'base64') { + throw new Error(`Invalid data URI encoding: ${encoding}`); + } + module = await this._importWasmModule( + Buffer.from(match.groups.code, 'base64'), + specifier, + context + ); + } else { + let code = match.groups.code; + if (!encoding || encoding === 'charset=utf-8') { + code = decodeURIComponent(code); + } else if (encoding === 'base64') { + code = Buffer.from(code, 'base64').toString(); + } else { + throw new Error(`Invalid data URI encoding: ${encoding}`); + } + if (mime === 'application/json') { + module = new (_vm().SyntheticModule)( + ['default'], + function () { + const obj = JSON.parse(code); + // @ts-expect-error: TS doesn't know what `this` is + this.setExport('default', obj); + }, + { + context, + identifier: specifier + } + ); + } else { + module = new (_vm().SourceTextModule)(code, { + context, + identifier: specifier, + importModuleDynamically: async (specifier, referencingModule) => { + (0, _jestUtil().invariant)( + runtimeSupportsVmModules, + 'You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules' + ); + const module = await this.resolveModule( + specifier, + referencingModule.identifier, + referencingModule.context + ); + return this.linkAndEvaluateModule(module); + }, + initializeImportMeta(meta) { + // no `jest` here as it's not loaded in a file + meta.url = specifier; + } + }); + } + } + registry.set(specifier, module); + return module; + } + if (specifier.startsWith('file://')) { + specifier = (0, _url().fileURLToPath)(specifier); + } + const [path, query] = specifier.split('?'); + if ( + await this._shouldMockModule( + referencingIdentifier, + path, + this._explicitShouldMockModule + ) + ) { + return this.importMock(referencingIdentifier, path, context); + } + const resolved = await this._resolveModule(referencingIdentifier, path); + if ( + // json files are modules when imported in modules + resolved.endsWith('.json') || + this._resolver.isCoreModule(resolved) || + this.unstable_shouldLoadAsEsm(resolved) + ) { + return this.loadEsmModule(resolved, query); + } + return this.loadCjsAsEsm(referencingIdentifier, resolved, context); + } + async linkAndEvaluateModule(module) { + if (this.isTornDown) { + this._logFormattedReferenceError( + 'You are trying to `import` a file after the Jest environment has been torn down.' + ); + process.exitCode = 1; + return; + } + if (module.status === 'unlinked') { + // since we might attempt to link the same module in parallel, stick the promise in a weak map so every call to + // this method can await it + this._esmModuleLinkingMap.set( + module, + module.link((specifier, referencingModule) => + this.resolveModule( + specifier, + referencingModule.identifier, + referencingModule.context + ) + ) + ); + } + await this._esmModuleLinkingMap.get(module); + if (module.status === 'linked') { + await module.evaluate(); + } + return module; + } + async unstable_importModule(from, moduleName) { + (0, _jestUtil().invariant)( + runtimeSupportsVmModules, + 'You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules' + ); + const [path, query] = (moduleName ?? '').split('?'); + const modulePath = await this._resolveModule(from, path); + const module = await this.loadEsmModule(modulePath, query); + return this.linkAndEvaluateModule(module); + } + loadCjsAsEsm(from, modulePath, context) { + // CJS loaded via `import` should share cache with other CJS: https://github.com/nodejs/modules/issues/503 + const cjs = this.requireModuleOrMock(from, modulePath); + const parsedExports = this.getExportsOfCjs(modulePath); + const cjsExports = [...parsedExports].filter(exportName => { + // we don't wanna respect any exports _named_ default as a named export + if (exportName === 'default') { + return false; + } + return Object.hasOwnProperty.call(cjs, exportName); + }); + const module = new (_vm().SyntheticModule)( + [...cjsExports, 'default'], + function () { + cjsExports.forEach(exportName => { + // @ts-expect-error: TS doesn't know what `this` is + this.setExport(exportName, cjs[exportName]); + }); + // @ts-expect-error: TS doesn't know what `this` is + this.setExport('default', cjs); + }, + { + context, + identifier: modulePath + } + ); + return evaluateSyntheticModule(module); + } + async importMock(from, moduleName, context) { + const moduleID = await this._resolver.getModuleIDAsync( + this._virtualModuleMocks, + from, + moduleName, + { + conditions: this.esmConditions + } + ); + if (this._moduleMockRegistry.has(moduleID)) { + return this._moduleMockRegistry.get(moduleID); + } + if (this._moduleMockFactories.has(moduleID)) { + const invokedFactory = await this._moduleMockFactories.get( + moduleID + // has check above makes this ok + )(); + + const module = new (_vm().SyntheticModule)( + Object.keys(invokedFactory), + function () { + Object.entries(invokedFactory).forEach(([key, value]) => { + // @ts-expect-error: TS doesn't know what `this` is + this.setExport(key, value); + }); + }, + { + context, + identifier: moduleName + } + ); + this._moduleMockRegistry.set(moduleID, module); + return evaluateSyntheticModule(module); + } + throw new Error('Attempting to import a mock without a factory'); + } + getExportsOfCjs(modulePath) { + const cachedNamedExports = this._cjsNamedExports.get(modulePath); + if (cachedNamedExports) { + return cachedNamedExports; + } + const transformedCode = + this._fileTransforms.get(modulePath)?.code ?? this.readFile(modulePath); + const {exports, reexports} = (0, _cjsModuleLexer().parse)(transformedCode); + const namedExports = new Set(exports); + reexports.forEach(reexport => { + if (this._resolver.isCoreModule(reexport)) { + const exports = this.requireModule(modulePath, reexport); + if (exports !== null && typeof exports === 'object') { + Object.keys(exports).forEach(namedExports.add, namedExports); + } + } else { + const resolved = this._resolveCjsModule(modulePath, reexport); + const exports = this.getExportsOfCjs(resolved); + exports.forEach(namedExports.add, namedExports); + } + }); + this._cjsNamedExports.set(modulePath, namedExports); + return namedExports; + } + requireModule(from, moduleName, options, isRequireActual = false) { + const isInternal = options?.isInternalModule ?? false; + const moduleID = this._resolver.getModuleID( + this._virtualMocks, + from, + moduleName, + { + conditions: this.cjsConditions + } + ); + let modulePath; + + // Some old tests rely on this mocking behavior. Ideally we'll change this + // to be more explicit. + const moduleResource = moduleName && this._resolver.getModule(moduleName); + const manualMock = + moduleName && this._resolver.getMockModule(from, moduleName); + if ( + !options?.isInternalModule && + !isRequireActual && + !moduleResource && + manualMock && + manualMock !== this._isCurrentlyExecutingManualMock && + this._explicitShouldMock.get(moduleID) !== false + ) { + modulePath = manualMock; + } + if (moduleName && this._resolver.isCoreModule(moduleName)) { + return this._requireCoreModule( + moduleName, + supportsNodeColonModulePrefixInRequire + ); + } + if (!modulePath) { + modulePath = this._resolveCjsModule(from, moduleName); + } + if (this.unstable_shouldLoadAsEsm(modulePath)) { + // Node includes more info in the message + const error = new Error( + `Must use import to load ES Module: ${modulePath}` + ); + error.code = 'ERR_REQUIRE_ESM'; + throw error; + } + let moduleRegistry; + if (isInternal) { + moduleRegistry = this._internalModuleRegistry; + } else if (this._isolatedModuleRegistry) { + moduleRegistry = this._isolatedModuleRegistry; + } else { + moduleRegistry = this._moduleRegistry; + } + const module = moduleRegistry.get(modulePath); + if (module) { + return module.exports; + } + + // We must register the pre-allocated module object first so that any + // circular dependencies that may arise while evaluating the module can + // be satisfied. + const localModule = { + children: [], + exports: {}, + filename: modulePath, + id: modulePath, + loaded: false, + path: path().dirname(modulePath) + }; + moduleRegistry.set(modulePath, localModule); + try { + this._loadModule( + localModule, + from, + moduleName, + modulePath, + options, + moduleRegistry + ); + } catch (error) { + moduleRegistry.delete(modulePath); + throw error; + } + return localModule.exports; + } + requireInternalModule(from, to) { + if (to) { + const require = ( + _module().default.createRequire ?? + _module().default.createRequireFromPath + )(from); + if (INTERNAL_MODULE_REQUIRE_OUTSIDE_OPTIMIZED_MODULES.has(to)) { + return require(to); + } + const outsideJestVmPath = (0, _helpers.decodePossibleOutsideJestVmPath)( + to + ); + if (outsideJestVmPath) { + return require(outsideJestVmPath); + } + } + return this.requireModule(from, to, { + isInternalModule: true, + supportsDynamicImport: esmIsAvailable, + supportsExportNamespaceFrom: false, + supportsStaticESM: false, + supportsTopLevelAwait: false + }); + } + requireActual(from, moduleName) { + return this.requireModule(from, moduleName, undefined, true); + } + requireMock(from, moduleName) { + const moduleID = this._resolver.getModuleID( + this._virtualMocks, + from, + moduleName, + { + conditions: this.cjsConditions + } + ); + if (this._isolatedMockRegistry?.has(moduleID)) { + return this._isolatedMockRegistry.get(moduleID); + } else if (this._mockRegistry.has(moduleID)) { + return this._mockRegistry.get(moduleID); + } + const mockRegistry = this._isolatedMockRegistry || this._mockRegistry; + if (this._mockFactories.has(moduleID)) { + // has check above makes this ok + const module = this._mockFactories.get(moduleID)(); + mockRegistry.set(moduleID, module); + return module; + } + const manualMockOrStub = this._resolver.getMockModule(from, moduleName); + let modulePath = + this._resolver.getMockModule(from, moduleName) || + this._resolveCjsModule(from, moduleName); + let isManualMock = + manualMockOrStub && + !this._resolver.resolveStubModuleName(from, moduleName); + if (!isManualMock) { + // If the actual module file has a __mocks__ dir sitting immediately next + // to it, look to see if there is a manual mock for this file. + // + // subDir1/my_module.js + // subDir1/__mocks__/my_module.js + // subDir2/my_module.js + // subDir2/__mocks__/my_module.js + // + // Where some other module does a relative require into each of the + // respective subDir{1,2} directories and expects a manual mock + // corresponding to that particular my_module.js file. + + const moduleDir = path().dirname(modulePath); + const moduleFileName = path().basename(modulePath); + const potentialManualMock = path().join( + moduleDir, + '__mocks__', + moduleFileName + ); + if (fs().existsSync(potentialManualMock)) { + isManualMock = true; + modulePath = potentialManualMock; + } + } + if (isManualMock) { + const localModule = { + children: [], + exports: {}, + filename: modulePath, + id: modulePath, + loaded: false, + path: path().dirname(modulePath) + }; + this._loadModule( + localModule, + from, + moduleName, + modulePath, + undefined, + mockRegistry + ); + mockRegistry.set(moduleID, localModule.exports); + } else { + // Look for a real module to generate an automock from + mockRegistry.set(moduleID, this._generateMock(from, moduleName)); + } + return mockRegistry.get(moduleID); + } + _loadModule( + localModule, + from, + moduleName, + modulePath, + options, + moduleRegistry + ) { + if (path().extname(modulePath) === '.json') { + const text = (0, _stripBom().default)(this.readFile(modulePath)); + const transformedFile = this._scriptTransformer.transformJson( + modulePath, + this._getFullTransformationOptions(options), + text + ); + localModule.exports = + this._environment.global.JSON.parse(transformedFile); + } else if (path().extname(modulePath) === '.node') { + localModule.exports = require(modulePath); + } else { + // Only include the fromPath if a moduleName is given. Else treat as root. + const fromPath = moduleName ? from : null; + this._execModule( + localModule, + options, + moduleRegistry, + fromPath, + moduleName + ); + } + localModule.loaded = true; + } + _getFullTransformationOptions(options = defaultTransformOptions) { + return { + ...options, + ...this._coverageOptions + }; + } + requireModuleOrMock(from, moduleName) { + // this module is unmockable + if (moduleName === '@jest/globals') { + // @ts-expect-error: we don't care that it's not assignable to T + return this.getGlobalsForCjs(from); + } + try { + if (this._shouldMockCjs(from, moduleName, this._explicitShouldMock)) { + return this.requireMock(from, moduleName); + } else { + return this.requireModule(from, moduleName); + } + } catch (e) { + const moduleNotFound = + _jestResolve().default.tryCastModuleNotFoundError(e); + if (moduleNotFound) { + if ( + moduleNotFound.siblingWithSimilarExtensionFound === null || + moduleNotFound.siblingWithSimilarExtensionFound === undefined + ) { + moduleNotFound.hint = (0, _helpers.findSiblingsWithFileExtension)( + this._config.moduleFileExtensions, + from, + moduleNotFound.moduleName || moduleName + ); + moduleNotFound.siblingWithSimilarExtensionFound = Boolean( + moduleNotFound.hint + ); + } + moduleNotFound.buildMessage(this._config.rootDir); + throw moduleNotFound; + } + throw e; + } + } + isolateModules(fn) { + if (this._isolatedModuleRegistry || this._isolatedMockRegistry) { + throw new Error( + 'isolateModules cannot be nested inside another isolateModules or isolateModulesAsync.' + ); + } + this._isolatedModuleRegistry = new Map(); + this._isolatedMockRegistry = new Map(); + try { + fn(); + } finally { + // might be cleared within the callback + this._isolatedModuleRegistry?.clear(); + this._isolatedMockRegistry?.clear(); + this._isolatedModuleRegistry = null; + this._isolatedMockRegistry = null; + } + } + async isolateModulesAsync(fn) { + if (this._isolatedModuleRegistry || this._isolatedMockRegistry) { + throw new Error( + 'isolateModulesAsync cannot be nested inside another isolateModulesAsync or isolateModules.' + ); + } + this._isolatedModuleRegistry = new Map(); + this._isolatedMockRegistry = new Map(); + try { + await fn(); + } finally { + // might be cleared within the callback + this._isolatedModuleRegistry?.clear(); + this._isolatedMockRegistry?.clear(); + this._isolatedModuleRegistry = null; + this._isolatedMockRegistry = null; + } + } + resetModules() { + this._isolatedModuleRegistry?.clear(); + this._isolatedMockRegistry?.clear(); + this._isolatedModuleRegistry = null; + this._isolatedMockRegistry = null; + this._mockRegistry.clear(); + this._moduleRegistry.clear(); + this._esmoduleRegistry.clear(); + this._fileTransformsMutex.clear(); + this._cjsNamedExports.clear(); + this._moduleMockRegistry.clear(); + this._cacheFS.clear(); + this._cacheFSBuffer.clear(); + if ( + this._coverageOptions.collectCoverage && + this._coverageOptions.coverageProvider === 'v8' && + this._v8CoverageSources + ) { + this._v8CoverageSources = new Map([ + ...this._v8CoverageSources, + ...this._fileTransforms + ]); + } + this._fileTransforms.clear(); + if (this._environment) { + if (this._environment.global) { + const envGlobal = this._environment.global; + Object.keys(envGlobal).forEach(key => { + const globalMock = envGlobal[key]; + if ( + ((typeof globalMock === 'object' && globalMock !== null) || + typeof globalMock === 'function') && + '_isMockFunction' in globalMock && + globalMock._isMockFunction === true + ) { + globalMock.mockClear(); + } + }); + } + if (this._environment.fakeTimers) { + this._environment.fakeTimers.clearAllTimers(); + } + } + } + async collectV8Coverage() { + this._v8CoverageInstrumenter = + new (_collectV8Coverage().CoverageInstrumenter)(); + this._v8CoverageSources = new Map(); + await this._v8CoverageInstrumenter.startInstrumenting(); + } + async stopCollectingV8Coverage() { + if (!this._v8CoverageInstrumenter || !this._v8CoverageSources) { + throw new Error('You need to call `collectV8Coverage` first.'); + } + this._v8CoverageResult = + await this._v8CoverageInstrumenter.stopInstrumenting(); + this._v8CoverageSources = new Map([ + ...this._v8CoverageSources, + ...this._fileTransforms + ]); + } + getAllCoverageInfoCopy() { + return (0, _jestUtil().deepCyclicCopy)( + this._environment.global.__coverage__ + ); + } + getAllV8CoverageInfoCopy() { + if (!this._v8CoverageResult || !this._v8CoverageSources) { + throw new Error('You need to call `stopCollectingV8Coverage` first.'); + } + return this._v8CoverageResult + .filter(res => res.url.startsWith('file://')) + .map(res => ({ + ...res, + url: (0, _url().fileURLToPath)(res.url) + })) + .filter( + res => + // TODO: will this work on windows? It might be better if `shouldInstrument` deals with it anyways + res.url.startsWith(this._config.rootDir) && + (0, _transform().shouldInstrument)( + res.url, + this._coverageOptions, + this._config, + /* loadedFilenames */ Array.from(this._v8CoverageSources.keys()) + ) + ) + .map(result => { + const transformedFile = this._v8CoverageSources.get(result.url); + return { + codeTransformResult: transformedFile, + result + }; + }); + } + getSourceMaps() { + return this._sourceMapRegistry; + } + setMock(from, moduleName, mockFactory, options) { + if (options?.virtual) { + const mockPath = this._resolver.getModulePath(from, moduleName); + this._virtualMocks.set(mockPath, true); + } + const moduleID = this._resolver.getModuleID( + this._virtualMocks, + from, + moduleName, + { + conditions: this.cjsConditions + } + ); + this._explicitShouldMock.set(moduleID, true); + this._mockFactories.set(moduleID, mockFactory); + } + setModuleMock(from, moduleName, mockFactory, options) { + if (options?.virtual) { + const mockPath = this._resolver.getModulePath(from, moduleName); + this._virtualModuleMocks.set(mockPath, true); + } + const moduleID = this._resolver.getModuleID( + this._virtualModuleMocks, + from, + moduleName, + { + conditions: this.esmConditions + } + ); + this._explicitShouldMockModule.set(moduleID, true); + this._moduleMockFactories.set(moduleID, mockFactory); + } + restoreAllMocks() { + this._moduleMocker.restoreAllMocks(); + } + resetAllMocks() { + this._moduleMocker.resetAllMocks(); + } + clearAllMocks() { + this._moduleMocker.clearAllMocks(); + } + teardown() { + this.restoreAllMocks(); + this.resetModules(); + this._internalModuleRegistry.clear(); + this._mainModule = null; + this._mockFactories.clear(); + this._moduleMockFactories.clear(); + this._mockMetaDataCache.clear(); + this._shouldMockModuleCache.clear(); + this._shouldUnmockTransitiveDependenciesCache.clear(); + this._explicitShouldMock.clear(); + this._explicitShouldMockModule.clear(); + this._transitiveShouldMock.clear(); + this._virtualMocks.clear(); + this._virtualModuleMocks.clear(); + this._cacheFS.clear(); + this._unmockList = undefined; + this._sourceMapRegistry.clear(); + this._fileTransforms.clear(); + this.jestObjectCaches.clear(); + this._v8CoverageSources?.clear(); + this._v8CoverageResult = []; + this._v8CoverageInstrumenter = undefined; + this._moduleImplementation = undefined; + this.isTornDown = true; + } + _resolveCjsModule(from, to) { + return to + ? this._resolver.resolveModule(from, to, { + conditions: this.cjsConditions + }) + : from; + } + _resolveModule(from, to) { + return to + ? this._resolver.resolveModuleAsync(from, to, { + conditions: this.esmConditions + }) + : from; + } + _requireResolve(from, moduleName, options = {}) { + if (moduleName == null) { + throw new Error( + 'The first argument to require.resolve must be a string. Received null or undefined.' + ); + } + if (path().isAbsolute(moduleName)) { + const module = this._resolver.resolveModuleFromDirIfExists( + moduleName, + moduleName, + { + conditions: this.cjsConditions, + paths: [] + } + ); + if (module) { + return module; + } + } else { + const {paths} = options; + if (paths) { + for (const p of paths) { + const absolutePath = path().resolve(from, '..', p); + const module = this._resolver.resolveModuleFromDirIfExists( + absolutePath, + moduleName, + // required to also resolve files without leading './' directly in the path + { + conditions: this.cjsConditions, + paths: [absolutePath] + } + ); + if (module) { + return module; + } + } + throw new (_jestResolve().default.ModuleNotFoundError)( + `Cannot resolve module '${moduleName}' from paths ['${paths.join( + "', '" + )}'] from ${from}` + ); + } + } + try { + return this._resolveCjsModule(from, moduleName); + } catch (err) { + const module = this._resolver.getMockModule(from, moduleName); + if (module) { + return module; + } else { + throw err; + } + } + } + _requireResolvePaths(from, moduleName) { + const fromDir = path().resolve(from, '..'); + if (moduleName == null) { + throw new Error( + 'The first argument to require.resolve.paths must be a string. Received null or undefined.' + ); + } + if (!moduleName.length) { + throw new Error( + 'The first argument to require.resolve.paths must not be the empty string.' + ); + } + if (moduleName[0] === '.') { + return [fromDir]; + } + if (this._resolver.isCoreModule(moduleName)) { + return null; + } + const modulePaths = this._resolver.getModulePaths(fromDir); + const globalPaths = this._resolver.getGlobalPaths(moduleName); + return [...modulePaths, ...globalPaths]; + } + _execModule(localModule, options, moduleRegistry, from, moduleName) { + if (this.isTornDown) { + this._logFormattedReferenceError( + 'You are trying to `import` a file after the Jest environment has been torn down.' + ); + process.exitCode = 1; + return; + } + + // If the environment was disposed, prevent this module from being executed. + if (!this._environment.global) { + return; + } + const module = localModule; + const filename = module.filename; + const lastExecutingModulePath = this._currentlyExecutingModulePath; + this._currentlyExecutingModulePath = filename; + const origCurrExecutingManualMock = this._isCurrentlyExecutingManualMock; + this._isCurrentlyExecutingManualMock = filename; + module.children = []; + Object.defineProperty(module, 'parent', { + enumerable: true, + get() { + const key = from || ''; + return moduleRegistry.get(key) || null; + } + }); + const modulePaths = this._resolver.getModulePaths(module.path); + const globalPaths = this._resolver.getGlobalPaths(moduleName); + module.paths = [...modulePaths, ...globalPaths]; + Object.defineProperty(module, 'require', { + value: this._createRequireImplementation(module, options) + }); + const transformedCode = this.transformFile(filename, options); + let compiledFunction = null; + const script = this.createScriptFromCode(transformedCode, filename); + let runScript = null; + const vmContext = this._environment.getVmContext(); + if (vmContext) { + runScript = script.runInContext(vmContext, { + filename + }); + } + if (runScript !== null) { + compiledFunction = runScript[EVAL_RESULT_VARIABLE]; + } + if (compiledFunction === null) { + this._logFormattedReferenceError( + 'You are trying to `import` a file after the Jest environment has been torn down.' + ); + process.exitCode = 1; + return; + } + const jestObject = this._createJestObjectFor(filename); + this.jestObjectCaches.set(filename, jestObject); + const lastArgs = [ + this._config.injectGlobals ? jestObject : undefined, + // jest object + ...this._config.sandboxInjectedGlobals.map(globalVariable => { + if (this._environment.global[globalVariable]) { + return this._environment.global[globalVariable]; + } + throw new Error( + `You have requested '${globalVariable}' as a global variable, but it was not present. Please check your config or your global environment.` + ); + }) + ]; + if (!this._mainModule && filename === this._testPath) { + this._mainModule = module; + } + Object.defineProperty(module, 'main', { + enumerable: true, + value: this._mainModule + }); + try { + compiledFunction.call( + module.exports, + module, + // module object + module.exports, + // module exports + module.require, + // require implementation + module.path, + // __dirname + module.filename, + // __filename + lastArgs[0], + ...lastArgs.slice(1).filter(_jestUtil().isNonNullable) + ); + } catch (error) { + this.handleExecutionError(error, module); + } + this._isCurrentlyExecutingManualMock = origCurrExecutingManualMock; + this._currentlyExecutingModulePath = lastExecutingModulePath; + } + transformFile(filename, options) { + const source = this.readFile(filename); + if (options?.isInternalModule) { + return source; + } + const transformedFile = this._scriptTransformer.transform( + filename, + this._getFullTransformationOptions(options), + source + ); + this._fileTransforms.set(filename, { + ...transformedFile, + wrapperLength: this.constructModuleWrapperStart().length + }); + if (transformedFile.sourceMapPath) { + this._sourceMapRegistry.set(filename, transformedFile.sourceMapPath); + } + return transformedFile.code; + } + async transformFileAsync(filename, options) { + const source = this.readFile(filename); + if (options?.isInternalModule) { + return source; + } + const transformedFile = await this._scriptTransformer.transformAsync( + filename, + this._getFullTransformationOptions(options), + source + ); + if (this._fileTransforms.get(filename)?.code !== transformedFile.code) { + this._fileTransforms.set(filename, { + ...transformedFile, + wrapperLength: 0 + }); + } + if (transformedFile.sourceMapPath) { + this._sourceMapRegistry.set(filename, transformedFile.sourceMapPath); + } + return transformedFile.code; + } + createScriptFromCode(scriptSource, filename) { + try { + const scriptFilename = this._resolver.isCoreModule(filename) + ? `jest-nodejs-core-${filename}` + : filename; + return new (_vm().Script)(this.wrapCodeInModuleWrapper(scriptSource), { + columnOffset: this._fileTransforms.get(filename)?.wrapperLength, + displayErrors: true, + filename: scriptFilename, + // @ts-expect-error: Experimental ESM API + importModuleDynamically: async specifier => { + (0, _jestUtil().invariant)( + runtimeSupportsVmModules, + 'You need to run with a version of node that supports ES Modules in the VM API. See https://jestjs.io/docs/ecmascript-modules' + ); + const context = this._environment.getVmContext?.(); + (0, _jestUtil().invariant)( + context, + 'Test environment has been torn down' + ); + const module = await this.resolveModule( + specifier, + scriptFilename, + context + ); + return this.linkAndEvaluateModule(module); + } + }); + } catch (e) { + throw (0, _transform().handlePotentialSyntaxError)(e); + } + } + _requireCoreModule(moduleName, supportPrefix) { + const moduleWithoutNodePrefix = + supportPrefix && moduleName.startsWith('node:') + ? moduleName.slice('node:'.length) + : moduleName; + if (moduleWithoutNodePrefix === 'process') { + return this._environment.global.process; + } + if (moduleWithoutNodePrefix === 'module') { + return this._getMockedNativeModule(); + } + return require(moduleName); + } + _importCoreModule(moduleName, context) { + const required = this._requireCoreModule(moduleName, true); + const module = new (_vm().SyntheticModule)( + ['default', ...Object.keys(required)], + function () { + // @ts-expect-error: TS doesn't know what `this` is + this.setExport('default', required); + Object.entries(required).forEach(([key, value]) => { + // @ts-expect-error: TS doesn't know what `this` is + this.setExport(key, value); + }); + }, + // should identifier be `node://${moduleName}`? + { + context, + identifier: moduleName + } + ); + return evaluateSyntheticModule(module); + } + async _importWasmModule(source, identifier, context) { + const wasmModule = await WebAssembly.compile(source); + const exports = WebAssembly.Module.exports(wasmModule); + const imports = WebAssembly.Module.imports(wasmModule); + const moduleLookup = {}; + for (const {module} of imports) { + if (moduleLookup[module] === undefined) { + const resolvedModule = await this.resolveModule( + module, + identifier, + context + ); + moduleLookup[module] = await this.linkAndEvaluateModule(resolvedModule); + } + } + const syntheticModule = new (_vm().SyntheticModule)( + exports.map(({name}) => name), + function () { + const importsObject = {}; + for (const {module, name} of imports) { + if (!importsObject[module]) { + importsObject[module] = {}; + } + importsObject[module][name] = moduleLookup[module].namespace[name]; + } + const wasmInstance = new WebAssembly.Instance( + wasmModule, + importsObject + ); + for (const {name} of exports) { + // @ts-expect-error: TS doesn't know what `this` is + this.setExport(name, wasmInstance.exports[name]); + } + }, + { + context, + identifier + } + ); + return syntheticModule; + } + _getMockedNativeModule() { + if (this._moduleImplementation) { + return this._moduleImplementation; + } + const createRequire = modulePath => { + const filename = + typeof modulePath === 'string' + ? modulePath.startsWith('file:///') + ? (0, _url().fileURLToPath)(new (_url().URL)(modulePath)) + : modulePath + : (0, _url().fileURLToPath)(modulePath); + if (!path().isAbsolute(filename)) { + const error = new TypeError( + `The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received '${filename}'` + ); + error.code = 'ERR_INVALID_ARG_TYPE'; + throw error; + } + return this._createRequireImplementation({ + children: [], + exports: {}, + filename, + id: filename, + loaded: false, + path: path().dirname(filename) + }); + }; + + // should we implement the class ourselves? + class Module extends _module().default.Module {} + Object.entries(_module().default.Module).forEach(([key, value]) => { + // @ts-expect-error: no index signature + Module[key] = value; + }); + Module.Module = Module; + if ('createRequire' in _module().default) { + Module.createRequire = createRequire; + } + if ('createRequireFromPath' in _module().default) { + Module.createRequireFromPath = function createRequireFromPath(filename) { + if (typeof filename !== 'string') { + const error = new TypeError( + `The argument 'filename' must be string. Received '${filename}'.${ + filename instanceof _url().URL + ? ' Use createRequire for URL filename.' + : '' + }` + ); + error.code = 'ERR_INVALID_ARG_TYPE'; + throw error; + } + return createRequire(filename); + }; + } + if ('syncBuiltinESMExports' in _module().default) { + // cast since TS seems very confused about whether it exists or not + Module.syncBuiltinESMExports = + // eslint-disable-next-line @typescript-eslint/no-empty-function + function syncBuiltinESMExports() {}; + } + this._moduleImplementation = Module; + return Module; + } + _generateMock(from, moduleName) { + const modulePath = + this._resolver.resolveStubModuleName(from, moduleName) || + this._resolveCjsModule(from, moduleName); + if (!this._mockMetaDataCache.has(modulePath)) { + // This allows us to handle circular dependencies while generating an + // automock + + this._mockMetaDataCache.set( + modulePath, + this._moduleMocker.getMetadata({}) || {} + ); + + // In order to avoid it being possible for automocking to potentially + // cause side-effects within the module environment, we need to execute + // the module in isolation. This could cause issues if the module being + // mocked has calls into side-effectful APIs on another module. + const origMockRegistry = this._mockRegistry; + const origModuleRegistry = this._moduleRegistry; + this._mockRegistry = new Map(); + this._moduleRegistry = new Map(); + const moduleExports = this.requireModule(from, moduleName); + + // Restore the "real" module/mock registries + this._mockRegistry = origMockRegistry; + this._moduleRegistry = origModuleRegistry; + const mockMetadata = this._moduleMocker.getMetadata(moduleExports); + if (mockMetadata == null) { + throw new Error( + `Failed to get mock metadata: ${modulePath}\n\n` + + 'See: https://jestjs.io/docs/manual-mocks#content' + ); + } + this._mockMetaDataCache.set(modulePath, mockMetadata); + } + return this._moduleMocker.generateFromMetadata( + // added above if missing + this._mockMetaDataCache.get(modulePath) + ); + } + _shouldMockCjs(from, moduleName, explicitShouldMock) { + const options = { + conditions: this.cjsConditions + }; + const moduleID = this._resolver.getModuleID( + this._virtualMocks, + from, + moduleName, + options + ); + const key = from + path().delimiter + moduleID; + if (explicitShouldMock.has(moduleID)) { + // guaranteed by `has` above + return explicitShouldMock.get(moduleID); + } + if ( + !this._shouldAutoMock || + this._resolver.isCoreModule(moduleName) || + this._shouldUnmockTransitiveDependenciesCache.get(key) + ) { + return false; + } + if (this._shouldMockModuleCache.has(moduleID)) { + // guaranteed by `has` above + return this._shouldMockModuleCache.get(moduleID); + } + let modulePath; + try { + modulePath = this._resolveCjsModule(from, moduleName); + } catch (e) { + const manualMock = this._resolver.getMockModule(from, moduleName); + if (manualMock) { + this._shouldMockModuleCache.set(moduleID, true); + return true; + } + throw e; + } + if (this._unmockList && this._unmockList.test(modulePath)) { + this._shouldMockModuleCache.set(moduleID, false); + return false; + } + + // transitive unmocking for package managers that store flat packages (npm3) + const currentModuleID = this._resolver.getModuleID( + this._virtualMocks, + from, + undefined, + options + ); + if ( + this._transitiveShouldMock.get(currentModuleID) === false || + (from.includes(NODE_MODULES) && + modulePath.includes(NODE_MODULES) && + ((this._unmockList && this._unmockList.test(from)) || + explicitShouldMock.get(currentModuleID) === false)) + ) { + this._transitiveShouldMock.set(moduleID, false); + this._shouldUnmockTransitiveDependenciesCache.set(key, true); + return false; + } + this._shouldMockModuleCache.set(moduleID, true); + return true; + } + async _shouldMockModule(from, moduleName, explicitShouldMock) { + const options = { + conditions: this.esmConditions + }; + const moduleID = await this._resolver.getModuleIDAsync( + this._virtualMocks, + from, + moduleName, + options + ); + const key = from + path().delimiter + moduleID; + if (explicitShouldMock.has(moduleID)) { + // guaranteed by `has` above + return explicitShouldMock.get(moduleID); + } + if ( + !this._shouldAutoMock || + this._resolver.isCoreModule(moduleName) || + this._shouldUnmockTransitiveDependenciesCache.get(key) + ) { + return false; + } + if (this._shouldMockModuleCache.has(moduleID)) { + // guaranteed by `has` above + return this._shouldMockModuleCache.get(moduleID); + } + let modulePath; + try { + modulePath = await this._resolveModule(from, moduleName); + } catch (e) { + const manualMock = await this._resolver.getMockModuleAsync( + from, + moduleName + ); + if (manualMock) { + this._shouldMockModuleCache.set(moduleID, true); + return true; + } + throw e; + } + if (this._unmockList && this._unmockList.test(modulePath)) { + this._shouldMockModuleCache.set(moduleID, false); + return false; + } + + // transitive unmocking for package managers that store flat packages (npm3) + const currentModuleID = await this._resolver.getModuleIDAsync( + this._virtualMocks, + from, + undefined, + options + ); + if ( + this._transitiveShouldMock.get(currentModuleID) === false || + (from.includes(NODE_MODULES) && + modulePath.includes(NODE_MODULES) && + ((this._unmockList && this._unmockList.test(from)) || + explicitShouldMock.get(currentModuleID) === false)) + ) { + this._transitiveShouldMock.set(moduleID, false); + this._shouldUnmockTransitiveDependenciesCache.set(key, true); + return false; + } + this._shouldMockModuleCache.set(moduleID, true); + return true; + } + _createRequireImplementation(from, options) { + const resolve = (moduleName, resolveOptions) => { + const resolved = this._requireResolve( + from.filename, + moduleName, + resolveOptions + ); + if ( + resolveOptions?.[JEST_RESOLVE_OUTSIDE_VM_OPTION] && + options?.isInternalModule + ) { + return (0, _helpers.createOutsideJestVmPath)(resolved); + } + return resolved; + }; + resolve.paths = moduleName => + this._requireResolvePaths(from.filename, moduleName); + const moduleRequire = options?.isInternalModule + ? moduleName => this.requireInternalModule(from.filename, moduleName) + : this.requireModuleOrMock.bind(this, from.filename); + moduleRequire.extensions = Object.create(null); + moduleRequire.resolve = resolve; + moduleRequire.cache = (() => { + // TODO: consider warning somehow that this does nothing. We should support deletions, anyways + const notPermittedMethod = () => true; + return new Proxy(Object.create(null), { + defineProperty: notPermittedMethod, + deleteProperty: notPermittedMethod, + get: (_target, key) => + typeof key === 'string' ? this._moduleRegistry.get(key) : undefined, + getOwnPropertyDescriptor() { + return { + configurable: true, + enumerable: true + }; + }, + has: (_target, key) => + typeof key === 'string' && this._moduleRegistry.has(key), + ownKeys: () => Array.from(this._moduleRegistry.keys()), + set: notPermittedMethod + }); + })(); + Object.defineProperty(moduleRequire, 'main', { + enumerable: true, + value: this._mainModule + }); + return moduleRequire; + } + _createJestObjectFor(from) { + const disableAutomock = () => { + this._shouldAutoMock = false; + return jestObject; + }; + const enableAutomock = () => { + this._shouldAutoMock = true; + return jestObject; + }; + const unmock = moduleName => { + const moduleID = this._resolver.getModuleID( + this._virtualMocks, + from, + moduleName, + { + conditions: this.cjsConditions + } + ); + this._explicitShouldMock.set(moduleID, false); + return jestObject; + }; + const deepUnmock = moduleName => { + const moduleID = this._resolver.getModuleID( + this._virtualMocks, + from, + moduleName, + { + conditions: this.cjsConditions + } + ); + this._explicitShouldMock.set(moduleID, false); + this._transitiveShouldMock.set(moduleID, false); + return jestObject; + }; + const mock = (moduleName, mockFactory, options) => { + if (mockFactory !== undefined) { + return setMockFactory(moduleName, mockFactory, options); + } + const moduleID = this._resolver.getModuleID( + this._virtualMocks, + from, + moduleName, + { + conditions: this.cjsConditions + } + ); + this._explicitShouldMock.set(moduleID, true); + return jestObject; + }; + const setMockFactory = (moduleName, mockFactory, options) => { + this.setMock(from, moduleName, mockFactory, options); + return jestObject; + }; + const mockModule = (moduleName, mockFactory, options) => { + if (typeof mockFactory !== 'function') { + throw new Error('`unstable_mockModule` must be passed a mock factory'); + } + this.setModuleMock(from, moduleName, mockFactory, options); + return jestObject; + }; + const clearAllMocks = () => { + this.clearAllMocks(); + return jestObject; + }; + const resetAllMocks = () => { + this.resetAllMocks(); + return jestObject; + }; + const restoreAllMocks = () => { + this.restoreAllMocks(); + return jestObject; + }; + const _getFakeTimers = () => { + if ( + this.isTornDown || + !(this._environment.fakeTimers || this._environment.fakeTimersModern) + ) { + this._logFormattedReferenceError( + 'You are trying to access a property or method of the Jest environment after it has been torn down.' + ); + process.exitCode = 1; + } + return this._fakeTimersImplementation; + }; + const useFakeTimers = fakeTimersConfig => { + fakeTimersConfig = { + ...this._config.fakeTimers, + ...fakeTimersConfig + }; + if (fakeTimersConfig?.legacyFakeTimers) { + this._fakeTimersImplementation = this._environment.fakeTimers; + } else { + this._fakeTimersImplementation = this._environment.fakeTimersModern; + } + this._fakeTimersImplementation.useFakeTimers(fakeTimersConfig); + return jestObject; + }; + const useRealTimers = () => { + _getFakeTimers().useRealTimers(); + return jestObject; + }; + const resetModules = () => { + this.resetModules(); + return jestObject; + }; + const isolateModules = fn => { + this.isolateModules(fn); + return jestObject; + }; + const isolateModulesAsync = fn => { + return this.isolateModulesAsync(fn); + }; + const fn = this._moduleMocker.fn.bind(this._moduleMocker); + const spyOn = this._moduleMocker.spyOn.bind(this._moduleMocker); + const mocked = + this._moduleMocker.mocked?.bind(this._moduleMocker) ?? + (() => { + throw new Error( + 'Your test environment does not support `mocked`, please update it.' + ); + }); + const replaceProperty = + typeof this._moduleMocker.replaceProperty === 'function' + ? this._moduleMocker.replaceProperty.bind(this._moduleMocker) + : () => { + throw new Error( + 'Your test environment does not support `jest.replaceProperty` - please ensure its Jest dependencies are updated to version 29.4 or later' + ); + }; + const setTimeout = timeout => { + this._environment.global[testTimeoutSymbol] = timeout; + return jestObject; + }; + const retryTimes = (numTestRetries, options) => { + this._environment.global[retryTimesSymbol] = numTestRetries; + this._environment.global[logErrorsBeforeRetrySymbol] = + options?.logErrorsBeforeRetry; + return jestObject; + }; + const jestObject = { + advanceTimersByTime: msToRun => + _getFakeTimers().advanceTimersByTime(msToRun), + advanceTimersByTimeAsync: async msToRun => { + const fakeTimers = _getFakeTimers(); + if (fakeTimers === this._environment.fakeTimersModern) { + // TODO: remove this check in Jest 30 + if (typeof fakeTimers.advanceTimersByTimeAsync !== 'function') { + throw new TypeError( + 'Your test environment does not support async fake timers - please ensure its Jest dependencies are updated to version 29.5 or later' + ); + } + await fakeTimers.advanceTimersByTimeAsync(msToRun); + } else { + throw new TypeError( + '`jest.advanceTimersByTimeAsync()` is not available when using legacy fake timers.' + ); + } + }, + advanceTimersToNextTimer: steps => + _getFakeTimers().advanceTimersToNextTimer(steps), + advanceTimersToNextTimerAsync: async steps => { + const fakeTimers = _getFakeTimers(); + if (fakeTimers === this._environment.fakeTimersModern) { + // TODO: remove this check in Jest 30 + if (typeof fakeTimers.advanceTimersToNextTimerAsync !== 'function') { + throw new TypeError( + 'Your test environment does not support async fake timers - please ensure its Jest dependencies are updated to version 29.5 or later' + ); + } + await fakeTimers.advanceTimersToNextTimerAsync(steps); + } else { + throw new TypeError( + '`jest.advanceTimersToNextTimerAsync()` is not available when using legacy fake timers.' + ); + } + }, + autoMockOff: disableAutomock, + autoMockOn: enableAutomock, + clearAllMocks, + clearAllTimers: () => _getFakeTimers().clearAllTimers(), + createMockFromModule: moduleName => this._generateMock(from, moduleName), + deepUnmock, + disableAutomock, + doMock: mock, + dontMock: unmock, + enableAutomock, + fn, + genMockFromModule: moduleName => this._generateMock(from, moduleName), + getRealSystemTime: () => { + const fakeTimers = _getFakeTimers(); + if (fakeTimers === this._environment.fakeTimersModern) { + return fakeTimers.getRealSystemTime(); + } else { + throw new TypeError( + '`jest.getRealSystemTime()` is not available when using legacy fake timers.' + ); + } + }, + getSeed: () => { + // TODO: remove this check in Jest 30 + if (this._globalConfig?.seed === undefined) { + throw new Error( + 'The seed value is not available. Likely you are using older versions of the jest dependencies.' + ); + } + return this._globalConfig.seed; + }, + getTimerCount: () => _getFakeTimers().getTimerCount(), + isEnvironmentTornDown: () => this.isTornDown, + isMockFunction: this._moduleMocker.isMockFunction, + isolateModules, + isolateModulesAsync, + mock, + mocked, + now: () => _getFakeTimers().now(), + replaceProperty, + requireActual: moduleName => this.requireActual(from, moduleName), + requireMock: moduleName => this.requireMock(from, moduleName), + resetAllMocks, + resetModules, + restoreAllMocks, + retryTimes, + runAllImmediates: () => { + const fakeTimers = _getFakeTimers(); + if (fakeTimers === this._environment.fakeTimers) { + fakeTimers.runAllImmediates(); + } else { + throw new TypeError( + '`jest.runAllImmediates()` is only available when using legacy fake timers.' + ); + } + }, + runAllTicks: () => _getFakeTimers().runAllTicks(), + runAllTimers: () => _getFakeTimers().runAllTimers(), + runAllTimersAsync: async () => { + const fakeTimers = _getFakeTimers(); + if (fakeTimers === this._environment.fakeTimersModern) { + // TODO: remove this check in Jest 30 + if (typeof fakeTimers.runAllTimersAsync !== 'function') { + throw new TypeError( + 'Your test environment does not support async fake timers - please ensure its Jest dependencies are updated to version 29.5 or later' + ); + } + await fakeTimers.runAllTimersAsync(); + } else { + throw new TypeError( + '`jest.runAllTimersAsync()` is not available when using legacy fake timers.' + ); + } + }, + runOnlyPendingTimers: () => _getFakeTimers().runOnlyPendingTimers(), + runOnlyPendingTimersAsync: async () => { + const fakeTimers = _getFakeTimers(); + if (fakeTimers === this._environment.fakeTimersModern) { + // TODO: remove this check in Jest 30 + if (typeof fakeTimers.runOnlyPendingTimersAsync !== 'function') { + throw new TypeError( + 'Your test environment does not support async fake timers - please ensure its Jest dependencies are updated to version 29.5 or later' + ); + } + await fakeTimers.runOnlyPendingTimersAsync(); + } else { + throw new TypeError( + '`jest.runOnlyPendingTimersAsync()` is not available when using legacy fake timers.' + ); + } + }, + setMock: (moduleName, mock) => setMockFactory(moduleName, () => mock), + setSystemTime: now => { + const fakeTimers = _getFakeTimers(); + if (fakeTimers === this._environment.fakeTimersModern) { + fakeTimers.setSystemTime(now); + } else { + throw new TypeError( + '`jest.setSystemTime()` is not available when using legacy fake timers.' + ); + } + }, + setTimeout, + spyOn, + unmock, + unstable_mockModule: mockModule, + useFakeTimers, + useRealTimers + }; + return jestObject; + } + _logFormattedReferenceError(errorMessage) { + const testPath = this._testPath + ? ` From ${(0, _slash().default)( + path().relative(this._config.rootDir, this._testPath) + )}.` + : ''; + const originalStack = new ReferenceError(`${errorMessage}${testPath}`).stack + .split('\n') + // Remove this file from the stack (jest-message-utils will keep one line) + .filter(line => line.indexOf(__filename) === -1) + .join('\n'); + const {message, stack} = (0, _jestMessageUtil().separateMessageFromStack)( + originalStack + ); + console.error( + `\n${message}\n${(0, _jestMessageUtil().formatStackTrace)( + stack, + this._config, + { + noStackTrace: false + } + )}` + ); + } + wrapCodeInModuleWrapper(content) { + return `${this.constructModuleWrapperStart() + content}\n}});`; + } + constructModuleWrapperStart() { + const args = this.constructInjectedModuleParameters(); + return `({"${EVAL_RESULT_VARIABLE}":function(${args.join(',')}){`; + } + constructInjectedModuleParameters() { + return [ + 'module', + 'exports', + 'require', + '__dirname', + '__filename', + this._config.injectGlobals ? 'jest' : undefined, + ...this._config.sandboxInjectedGlobals + ].filter(_jestUtil().isNonNullable); + } + handleExecutionError(e, module) { + const moduleNotFoundError = + _jestResolve().default.tryCastModuleNotFoundError(e); + if (moduleNotFoundError) { + if (!moduleNotFoundError.requireStack) { + moduleNotFoundError.requireStack = [module.filename || module.id]; + for (let cursor = module.parent; cursor; cursor = cursor.parent) { + moduleNotFoundError.requireStack.push(cursor.filename || cursor.id); + } + moduleNotFoundError.buildMessage(this._config.rootDir); + } + throw moduleNotFoundError; + } + throw e; + } + getGlobalsForCjs(from) { + const jest = this.jestObjectCaches.get(from); + (0, _jestUtil().invariant)( + jest, + 'There should always be a Jest object already' + ); + return { + ...this.getGlobalsFromEnvironment(), + jest + }; + } + getGlobalsForEsm(from, context) { + let jest = this.jestObjectCaches.get(from); + if (!jest) { + jest = this._createJestObjectFor(from); + this.jestObjectCaches.set(from, jest); + } + const globals = { + ...this.getGlobalsFromEnvironment(), + jest + }; + const module = new (_vm().SyntheticModule)( + Object.keys(globals), + function () { + Object.entries(globals).forEach(([key, value]) => { + // @ts-expect-error: TS doesn't know what `this` is + this.setExport(key, value); + }); + }, + { + context, + identifier: '@jest/globals' + } + ); + return evaluateSyntheticModule(module); + } + getGlobalsFromEnvironment() { + if (this.jestGlobals) { + return { + ...this.jestGlobals + }; + } + return { + afterAll: this._environment.global.afterAll, + afterEach: this._environment.global.afterEach, + beforeAll: this._environment.global.beforeAll, + beforeEach: this._environment.global.beforeEach, + describe: this._environment.global.describe, + expect: this._environment.global.expect, + fdescribe: this._environment.global.fdescribe, + fit: this._environment.global.fit, + it: this._environment.global.it, + test: this._environment.global.test, + xdescribe: this._environment.global.xdescribe, + xit: this._environment.global.xit, + xtest: this._environment.global.xtest + }; + } + readFileBuffer(filename) { + let source = this._cacheFSBuffer.get(filename); + if (!source) { + source = fs().readFileSync(filename); + this._cacheFSBuffer.set(filename, source); + } + return source; + } + readFile(filename) { + let source = this._cacheFS.get(filename); + if (!source) { + const buffer = this.readFileBuffer(filename); + source = buffer.toString('utf8'); + this._cacheFS.set(filename, source); + } + return source; + } + setGlobalsForRuntime(globals) { + this.jestGlobals = globals; + } +} +exports.default = Runtime; +async function evaluateSyntheticModule(module) { + await module.link(() => { + throw new Error('This should never happen'); + }); + await module.evaluate(); + return module; +} diff --git a/node_modules/jest-runtime/package.json b/node_modules/jest-runtime/package.json new file mode 100644 index 00000000..096ae19a --- /dev/null +++ b/node_modules/jest-runtime/package.json @@ -0,0 +1,56 @@ +{ + "name": "jest-runtime", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-runtime" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, + "devDependencies": { + "@jest/test-utils": "^29.7.0", + "@types/glob": "^7.1.1", + "@types/graceful-fs": "^4.1.3", + "jest-environment-node": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-snapshot/LICENSE b/node_modules/jest-snapshot/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-snapshot/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-snapshot/build/InlineSnapshots.js b/node_modules/jest-snapshot/build/InlineSnapshots.js new file mode 100644 index 00000000..3481ad99 --- /dev/null +++ b/node_modules/jest-snapshot/build/InlineSnapshots.js @@ -0,0 +1,421 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.saveInlineSnapshots = saveInlineSnapshots; +var path = _interopRequireWildcard(require('path')); +var _util = require('util'); +var fs = _interopRequireWildcard(require('graceful-fs')); +var _semver = _interopRequireDefault(require('semver')); +var _utils = require('./utils'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var jestWriteFile = + globalThis[Symbol.for('jest-native-write-file')] || fs.writeFileSync; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var jestReadFile = + globalThis[Symbol.for('jest-native-read-file')] || fs.readFileSync; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +// prettier-ignore +const generate = // @ts-expect-error requireOutside Babel transform +require(require.resolve('@babel/generator', { + [(globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol).for('jest-resolve-outside-vm-option')]: true +})).default; +const { + isAwaitExpression, + templateElement, + templateLiteral, + traverse, + traverseFast +} = require(require.resolve('@babel/types', { // @ts-expect-error requireOutside Babel transform + [(globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol).for( + 'jest-resolve-outside-vm-option' + )]: true +})); +// @ts-expect-error requireOutside Babel transform +const {parseSync} = require(require.resolve('@babel/core', { + [(globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol).for( + 'jest-resolve-outside-vm-option' + )]: true +})); +function saveInlineSnapshots(snapshots, rootDir, prettierPath) { + let prettier = null; + if (prettierPath) { + try { + // @ts-expect-error requireOutside Babel transform + prettier = require(require.resolve(prettierPath, { + [(globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol).for( + 'jest-resolve-outside-vm-option' + )]: true + })); + if (_semver.default.gte(prettier.version, '3.0.0')) { + throw new Error( + 'Jest: Inline Snapshots are not supported when using Prettier 3.0.0 or above.\nSee https://jestjs.io/docs/configuration/#prettierpath-string for alternatives.' + ); + } + } catch (error) { + if (!_util.types.isNativeError(error)) { + throw error; + } + if (error.code !== 'MODULE_NOT_FOUND') { + throw error; + } + } + } + const snapshotsByFile = groupSnapshotsByFile(snapshots); + for (const sourceFilePath of Object.keys(snapshotsByFile)) { + saveSnapshotsForFile( + snapshotsByFile[sourceFilePath], + sourceFilePath, + rootDir, + prettier && _semver.default.gte(prettier.version, '1.5.0') + ? prettier + : undefined + ); + } +} +const saveSnapshotsForFile = (snapshots, sourceFilePath, rootDir, prettier) => { + const sourceFile = jestReadFile(sourceFilePath, 'utf8'); + + // TypeScript projects may not have a babel config; make sure they can be parsed anyway. + const presets = [require.resolve('babel-preset-current-node-syntax')]; + const plugins = []; + if (/\.([cm]?ts|tsx)$/.test(sourceFilePath)) { + plugins.push([ + require.resolve('@babel/plugin-syntax-typescript'), + { + isTSX: sourceFilePath.endsWith('x') + }, + // unique name to make sure Babel does not complain about a possible duplicate plugin. + 'TypeScript syntax plugin added by Jest snapshot' + ]); + } + + // Record the matcher names seen during traversal and pass them down one + // by one to formatting parser. + const snapshotMatcherNames = []; + let ast = null; + try { + ast = parseSync(sourceFile, { + filename: sourceFilePath, + plugins, + presets, + root: rootDir + }); + } catch (error) { + // attempt to recover from missing jsx plugin + if (error.message.includes('@babel/plugin-syntax-jsx')) { + try { + const jsxSyntaxPlugin = [ + require.resolve('@babel/plugin-syntax-jsx'), + {}, + // unique name to make sure Babel does not complain about a possible duplicate plugin. + 'JSX syntax plugin added by Jest snapshot' + ]; + ast = parseSync(sourceFile, { + filename: sourceFilePath, + plugins: [...plugins, jsxSyntaxPlugin], + presets, + root: rootDir + }); + } catch { + throw error; + } + } else { + throw error; + } + } + if (!ast) { + throw new Error(`jest-snapshot: Failed to parse ${sourceFilePath}`); + } + traverseAst(snapshots, ast, snapshotMatcherNames); + + // substitute in the snapshots in reverse order, so slice calculations aren't thrown off. + const sourceFileWithSnapshots = snapshots.reduceRight( + (sourceSoFar, nextSnapshot) => { + const {node} = nextSnapshot; + if ( + !node || + typeof node.start !== 'number' || + typeof node.end !== 'number' + ) { + throw new Error('Jest: no snapshot insert location found'); + } + + // A hack to prevent unexpected line breaks in the generated code + node.loc.end.line = node.loc.start.line; + return ( + sourceSoFar.slice(0, node.start) + + generate(node, { + retainLines: true + }).code.trim() + + sourceSoFar.slice(node.end) + ); + }, + sourceFile + ); + const newSourceFile = prettier + ? runPrettier( + prettier, + sourceFilePath, + sourceFileWithSnapshots, + snapshotMatcherNames + ) + : sourceFileWithSnapshots; + if (newSourceFile !== sourceFile) { + jestWriteFile(sourceFilePath, newSourceFile); + } +}; +const groupSnapshotsBy = createKey => snapshots => + snapshots.reduce((object, inlineSnapshot) => { + const key = createKey(inlineSnapshot); + return { + ...object, + [key]: (object[key] || []).concat(inlineSnapshot) + }; + }, {}); +const groupSnapshotsByFrame = groupSnapshotsBy(({frame: {line, column}}) => + typeof line === 'number' && typeof column === 'number' + ? `${line}:${column - 1}` + : '' +); +const groupSnapshotsByFile = groupSnapshotsBy(({frame: {file}}) => file); +const indent = (snapshot, numIndents, indentation) => { + const lines = snapshot.split('\n'); + // Prevent re-indentation of inline snapshots. + if ( + lines.length >= 2 && + lines[1].startsWith(indentation.repeat(numIndents + 1)) + ) { + return snapshot; + } + return lines + .map((line, index) => { + if (index === 0) { + // First line is either a 1-line snapshot or a blank line. + return line; + } else if (index !== lines.length - 1) { + // Do not indent empty lines. + if (line === '') { + return line; + } + + // Not last line, indent one level deeper than expect call. + return indentation.repeat(numIndents + 1) + line; + } else { + // The last line should be placed on the same level as the expect call. + return indentation.repeat(numIndents) + line; + } + }) + .join('\n'); +}; +const traverseAst = (snapshots, ast, snapshotMatcherNames) => { + const groupedSnapshots = groupSnapshotsByFrame(snapshots); + const remainingSnapshots = new Set(snapshots.map(({snapshot}) => snapshot)); + traverseFast(ast, node => { + if (node.type !== 'CallExpression') return; + const {arguments: args, callee} = node; + if ( + callee.type !== 'MemberExpression' || + callee.property.type !== 'Identifier' || + callee.property.loc == null + ) { + return; + } + const {line, column} = callee.property.loc.start; + const snapshotsForFrame = groupedSnapshots[`${line}:${column}`]; + if (!snapshotsForFrame) { + return; + } + if (snapshotsForFrame.length > 1) { + throw new Error( + 'Jest: Multiple inline snapshots for the same call are not supported.' + ); + } + const inlineSnapshot = snapshotsForFrame[0]; + inlineSnapshot.node = node; + snapshotMatcherNames.push(callee.property.name); + const snapshotIndex = args.findIndex( + ({type}) => type === 'TemplateLiteral' || type === 'StringLiteral' + ); + const {snapshot} = inlineSnapshot; + remainingSnapshots.delete(snapshot); + const replacementNode = templateLiteral( + [ + templateElement({ + raw: (0, _utils.escapeBacktickString)(snapshot) + }) + ], + [] + ); + if (snapshotIndex > -1) { + args[snapshotIndex] = replacementNode; + } else { + args.push(replacementNode); + } + }); + if (remainingSnapshots.size) { + throw new Error("Jest: Couldn't locate all inline snapshots."); + } +}; +const runPrettier = ( + prettier, + sourceFilePath, + sourceFileWithSnapshots, + snapshotMatcherNames +) => { + // Resolve project configuration. + // For older versions of Prettier, do not load configuration. + const config = prettier.resolveConfig + ? prettier.resolveConfig.sync(sourceFilePath, { + editorconfig: true + }) + : null; + + // Prioritize parser found in the project config. + // If not found detect the parser for the test file. + // For older versions of Prettier, fallback to a simple parser detection. + // @ts-expect-error - `inferredParser` is `string` + const inferredParser = + (config && typeof config.parser === 'string' && config.parser) || + (prettier.getFileInfo + ? prettier.getFileInfo.sync(sourceFilePath).inferredParser + : simpleDetectParser(sourceFilePath)); + if (!inferredParser) { + throw new Error( + `Could not infer Prettier parser for file ${sourceFilePath}` + ); + } + + // Snapshots have now been inserted. Run prettier to make sure that the code is + // formatted, except snapshot indentation. Snapshots cannot be formatted until + // after the initial format because we don't know where the call expression + // will be placed (specifically its indentation), so we have to do two + // prettier.format calls back-to-back. + return prettier.format( + prettier.format(sourceFileWithSnapshots, { + ...config, + filepath: sourceFilePath + }), + { + ...config, + filepath: sourceFilePath, + parser: createFormattingParser(snapshotMatcherNames, inferredParser) + } + ); +}; + +// This parser formats snapshots to the correct indentation. +const createFormattingParser = + (snapshotMatcherNames, inferredParser) => (text, parsers, options) => { + // Workaround for https://github.com/prettier/prettier/issues/3150 + options.parser = inferredParser; + const ast = parsers[inferredParser](text, options); + traverse(ast, (node, ancestors) => { + if (node.type !== 'CallExpression') return; + const {arguments: args, callee} = node; + if ( + callee.type !== 'MemberExpression' || + callee.property.type !== 'Identifier' || + !snapshotMatcherNames.includes(callee.property.name) || + !callee.loc || + callee.computed + ) { + return; + } + let snapshotIndex; + let snapshot; + for (let i = 0; i < args.length; i++) { + const node = args[i]; + if (node.type === 'TemplateLiteral') { + snapshotIndex = i; + snapshot = node.quasis[0].value.raw; + } + } + if (snapshot === undefined) { + return; + } + const parent = ancestors[ancestors.length - 1].node; + const startColumn = + isAwaitExpression(parent) && parent.loc + ? parent.loc.start.column + : callee.loc.start.column; + const useSpaces = !options.useTabs; + snapshot = indent( + snapshot, + Math.ceil( + useSpaces + ? startColumn / (options.tabWidth ?? 1) + : // Each tab is 2 characters. + startColumn / 2 + ), + useSpaces ? ' '.repeat(options.tabWidth ?? 1) : '\t' + ); + const replacementNode = templateLiteral( + [ + templateElement({ + raw: snapshot + }) + ], + [] + ); + args[snapshotIndex] = replacementNode; + }); + return ast; + }; +const simpleDetectParser = filePath => { + const extname = path.extname(filePath); + if (/\.tsx?$/.test(extname)) { + return 'typescript'; + } + return 'babel'; +}; diff --git a/node_modules/jest-snapshot/build/SnapshotResolver.js b/node_modules/jest-snapshot/build/SnapshotResolver.js new file mode 100644 index 00000000..351f7eab --- /dev/null +++ b/node_modules/jest-snapshot/build/SnapshotResolver.js @@ -0,0 +1,153 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.isSnapshotPath = + exports.buildSnapshotResolver = + exports.EXTENSION = + exports.DOT_EXTENSION = + void 0; +var path = _interopRequireWildcard(require('path')); +var _chalk = _interopRequireDefault(require('chalk')); +var _transform = require('@jest/transform'); +var _jestUtil = require('jest-util'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const EXTENSION = 'snap'; +exports.EXTENSION = EXTENSION; +const DOT_EXTENSION = `.${EXTENSION}`; +exports.DOT_EXTENSION = DOT_EXTENSION; +const isSnapshotPath = path => path.endsWith(DOT_EXTENSION); +exports.isSnapshotPath = isSnapshotPath; +const cache = new Map(); +const buildSnapshotResolver = async ( + config, + localRequire = (0, _transform.createTranspilingRequire)(config) +) => { + const key = config.rootDir; + const resolver = + cache.get(key) ?? + (await createSnapshotResolver(await localRequire, config.snapshotResolver)); + cache.set(key, resolver); + return resolver; +}; +exports.buildSnapshotResolver = buildSnapshotResolver; +async function createSnapshotResolver(localRequire, snapshotResolverPath) { + return typeof snapshotResolverPath === 'string' + ? createCustomSnapshotResolver(snapshotResolverPath, localRequire) + : createDefaultSnapshotResolver(); +} +function createDefaultSnapshotResolver() { + return { + resolveSnapshotPath: testPath => + path.join( + path.join(path.dirname(testPath), '__snapshots__'), + path.basename(testPath) + DOT_EXTENSION + ), + resolveTestPath: snapshotPath => + path.resolve( + path.dirname(snapshotPath), + '..', + path.basename(snapshotPath, DOT_EXTENSION) + ), + testPathForConsistencyCheck: path.posix.join( + 'consistency_check', + '__tests__', + 'example.test.js' + ) + }; +} +async function createCustomSnapshotResolver( + snapshotResolverPath, + localRequire +) { + const custom = (0, _jestUtil.interopRequireDefault)( + await localRequire(snapshotResolverPath) + ).default; + const keys = [ + ['resolveSnapshotPath', 'function'], + ['resolveTestPath', 'function'], + ['testPathForConsistencyCheck', 'string'] + ]; + keys.forEach(([propName, requiredType]) => { + if (typeof custom[propName] !== requiredType) { + throw new TypeError(mustImplement(propName, requiredType)); + } + }); + const customResolver = { + resolveSnapshotPath: testPath => + custom.resolveSnapshotPath(testPath, DOT_EXTENSION), + resolveTestPath: snapshotPath => + custom.resolveTestPath(snapshotPath, DOT_EXTENSION), + testPathForConsistencyCheck: custom.testPathForConsistencyCheck + }; + verifyConsistentTransformations(customResolver); + return customResolver; +} +function mustImplement(propName, requiredType) { + return `${_chalk.default.bold( + `Custom snapshot resolver must implement a \`${propName}\` as a ${requiredType}.` + )}\nDocumentation: https://jestjs.io/docs/configuration#snapshotresolver-string`; +} +function verifyConsistentTransformations(custom) { + const resolvedSnapshotPath = custom.resolveSnapshotPath( + custom.testPathForConsistencyCheck + ); + const resolvedTestPath = custom.resolveTestPath(resolvedSnapshotPath); + if (resolvedTestPath !== custom.testPathForConsistencyCheck) { + throw new Error( + _chalk.default.bold( + `Custom snapshot resolver functions must transform paths consistently, i.e. expects resolveTestPath(resolveSnapshotPath('${custom.testPathForConsistencyCheck}')) === ${resolvedTestPath}` + ) + ); + } +} diff --git a/node_modules/jest-snapshot/build/State.js b/node_modules/jest-snapshot/build/State.js new file mode 100644 index 00000000..262e3675 --- /dev/null +++ b/node_modules/jest-snapshot/build/State.js @@ -0,0 +1,288 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var fs = _interopRequireWildcard(require('graceful-fs')); +var _jestMessageUtil = require('jest-message-util'); +var _InlineSnapshots = require('./InlineSnapshots'); +var _utils = require('./utils'); +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var jestExistsFile = + globalThis[Symbol.for('jest-native-exists-file')] || fs.existsSync; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +class SnapshotState { + _counters; + _dirty; + // @ts-expect-error - seemingly unused? + _index; + _updateSnapshot; + _snapshotData; + _initialData; + _snapshotPath; + _inlineSnapshots; + _uncheckedKeys; + _prettierPath; + _rootDir; + snapshotFormat; + added; + expand; + matched; + unmatched; + updated; + constructor(snapshotPath, options) { + this._snapshotPath = snapshotPath; + const {data, dirty} = (0, _utils.getSnapshotData)( + this._snapshotPath, + options.updateSnapshot + ); + this._initialData = data; + this._snapshotData = data; + this._dirty = dirty; + this._prettierPath = options.prettierPath ?? null; + this._inlineSnapshots = []; + this._uncheckedKeys = new Set(Object.keys(this._snapshotData)); + this._counters = new Map(); + this._index = 0; + this.expand = options.expand || false; + this.added = 0; + this.matched = 0; + this.unmatched = 0; + this._updateSnapshot = options.updateSnapshot; + this.updated = 0; + this.snapshotFormat = options.snapshotFormat; + this._rootDir = options.rootDir; + } + markSnapshotsAsCheckedForTest(testName) { + this._uncheckedKeys.forEach(uncheckedKey => { + if ((0, _utils.keyToTestName)(uncheckedKey) === testName) { + this._uncheckedKeys.delete(uncheckedKey); + } + }); + } + _addSnapshot(key, receivedSerialized, options) { + this._dirty = true; + if (options.isInline) { + const error = options.error || new Error(); + const lines = (0, _jestMessageUtil.getStackTraceLines)( + (0, _utils.removeLinesBeforeExternalMatcherTrap)(error.stack || '') + ); + const frame = (0, _jestMessageUtil.getTopFrame)(lines); + if (!frame) { + throw new Error( + "Jest: Couldn't infer stack frame for inline snapshot." + ); + } + this._inlineSnapshots.push({ + frame, + snapshot: receivedSerialized + }); + } else { + this._snapshotData[key] = receivedSerialized; + } + } + clear() { + this._snapshotData = this._initialData; + this._inlineSnapshots = []; + this._counters = new Map(); + this._index = 0; + this.added = 0; + this.matched = 0; + this.unmatched = 0; + this.updated = 0; + } + save() { + const hasExternalSnapshots = Object.keys(this._snapshotData).length; + const hasInlineSnapshots = this._inlineSnapshots.length; + const isEmpty = !hasExternalSnapshots && !hasInlineSnapshots; + const status = { + deleted: false, + saved: false + }; + if ((this._dirty || this._uncheckedKeys.size) && !isEmpty) { + if (hasExternalSnapshots) { + (0, _utils.saveSnapshotFile)(this._snapshotData, this._snapshotPath); + } + if (hasInlineSnapshots) { + (0, _InlineSnapshots.saveInlineSnapshots)( + this._inlineSnapshots, + this._rootDir, + this._prettierPath + ); + } + status.saved = true; + } else if (!hasExternalSnapshots && jestExistsFile(this._snapshotPath)) { + if (this._updateSnapshot === 'all') { + fs.unlinkSync(this._snapshotPath); + } + status.deleted = true; + } + return status; + } + getUncheckedCount() { + return this._uncheckedKeys.size || 0; + } + getUncheckedKeys() { + return Array.from(this._uncheckedKeys); + } + removeUncheckedKeys() { + if (this._updateSnapshot === 'all' && this._uncheckedKeys.size) { + this._dirty = true; + this._uncheckedKeys.forEach(key => delete this._snapshotData[key]); + this._uncheckedKeys.clear(); + } + } + match({testName, received, key, inlineSnapshot, isInline, error}) { + this._counters.set(testName, (this._counters.get(testName) || 0) + 1); + const count = Number(this._counters.get(testName)); + if (!key) { + key = (0, _utils.testNameToKey)(testName, count); + } + + // Do not mark the snapshot as "checked" if the snapshot is inline and + // there's an external snapshot. This way the external snapshot can be + // removed with `--updateSnapshot`. + if (!(isInline && this._snapshotData[key] !== undefined)) { + this._uncheckedKeys.delete(key); + } + const receivedSerialized = (0, _utils.addExtraLineBreaks)( + (0, _utils.serialize)(received, undefined, this.snapshotFormat) + ); + const expected = isInline ? inlineSnapshot : this._snapshotData[key]; + const pass = expected === receivedSerialized; + const hasSnapshot = expected !== undefined; + const snapshotIsPersisted = isInline || fs.existsSync(this._snapshotPath); + if (pass && !isInline) { + // Executing a snapshot file as JavaScript and writing the strings back + // when other snapshots have changed loses the proper escaping for some + // characters. Since we check every snapshot in every test, use the newly + // generated formatted string. + // Note that this is only relevant when a snapshot is added and the dirty + // flag is set. + this._snapshotData[key] = receivedSerialized; + } + + // These are the conditions on when to write snapshots: + // * There's no snapshot file in a non-CI environment. + // * There is a snapshot file and we decided to update the snapshot. + // * There is a snapshot file, but it doesn't have this snaphsot. + // These are the conditions on when not to write snapshots: + // * The update flag is set to 'none'. + // * There's no snapshot file or a file without this snapshot on a CI environment. + if ( + (hasSnapshot && this._updateSnapshot === 'all') || + ((!hasSnapshot || !snapshotIsPersisted) && + (this._updateSnapshot === 'new' || this._updateSnapshot === 'all')) + ) { + if (this._updateSnapshot === 'all') { + if (!pass) { + if (hasSnapshot) { + this.updated++; + } else { + this.added++; + } + this._addSnapshot(key, receivedSerialized, { + error, + isInline + }); + } else { + this.matched++; + } + } else { + this._addSnapshot(key, receivedSerialized, { + error, + isInline + }); + this.added++; + } + return { + actual: '', + count, + expected: '', + key, + pass: true + }; + } else { + if (!pass) { + this.unmatched++; + return { + actual: (0, _utils.removeExtraLineBreaks)(receivedSerialized), + count, + expected: + expected !== undefined + ? (0, _utils.removeExtraLineBreaks)(expected) + : undefined, + key, + pass: false + }; + } else { + this.matched++; + return { + actual: '', + count, + expected: '', + key, + pass: true + }; + } + } + } + fail(testName, _received, key) { + this._counters.set(testName, (this._counters.get(testName) || 0) + 1); + const count = Number(this._counters.get(testName)); + if (!key) { + key = (0, _utils.testNameToKey)(testName, count); + } + this._uncheckedKeys.delete(key); + this.unmatched++; + return key; + } +} +exports.default = SnapshotState; diff --git a/node_modules/jest-snapshot/build/colors.js b/node_modules/jest-snapshot/build/colors.js new file mode 100644 index 00000000..e729c37e --- /dev/null +++ b/node_modules/jest-snapshot/build/colors.js @@ -0,0 +1,39 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.bForeground3 = + exports.bForeground2 = + exports.bBackground3 = + exports.bBackground2 = + exports.aForeground3 = + exports.aForeground2 = + exports.aBackground3 = + exports.aBackground2 = + void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// https://jonasjacek.github.io/colors/ + +const aForeground2 = 90; +exports.aForeground2 = aForeground2; +const aBackground2 = 225; +exports.aBackground2 = aBackground2; +const bForeground2 = 23; +exports.bForeground2 = bForeground2; +const bBackground2 = 195; +exports.bBackground2 = bBackground2; +const aForeground3 = [0x80, 0, 0x80]; +exports.aForeground3 = aForeground3; +const aBackground3 = [0xff, 0xd7, 0xff]; +exports.aBackground3 = aBackground3; +const bForeground3 = [0, 0x5f, 0x5f]; +exports.bForeground3 = bForeground3; +const bBackground3 = [0xd7, 0xff, 0xff]; +exports.bBackground3 = bBackground3; diff --git a/node_modules/jest-snapshot/build/dedentLines.js b/node_modules/jest-snapshot/build/dedentLines.js new file mode 100644 index 00000000..81854381 --- /dev/null +++ b/node_modules/jest-snapshot/build/dedentLines.js @@ -0,0 +1,132 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.dedentLines = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const getIndentationLength = line => { + const result = /^( {2})+/.exec(line); + return result === null ? 0 : result[0].length; +}; +const dedentLine = line => line.slice(getIndentationLength(line)); + +// Return true if: +// "key": "value has multiple lines\n… +// "key has multiple lines\n… +const hasUnmatchedDoubleQuoteMarks = string => { + let n = 0; + let i = string.indexOf('"', 0); + while (i !== -1) { + if (i === 0 || string[i - 1] !== '\\') { + n += 1; + } + i = string.indexOf('"', i + 1); + } + return n % 2 !== 0; +}; +const isFirstLineOfTag = line => /^( {2})* { + let line = input[output.length]; + output.push(dedentLine(line)); + if (line.includes('>')) { + return true; + } + while (output.length < input.length) { + line = input[output.length]; + if (hasUnmatchedDoubleQuoteMarks(line)) { + return false; // because props include a multiline string + } else if (isFirstLineOfTag(line)) { + // Recursion only if props have markup. + if (!dedentMarkup(input, output)) { + return false; + } + } else { + output.push(dedentLine(line)); + if (line.includes('>')) { + return true; + } + } + } + return false; +}; + +// Push dedented lines of markup onto output and return true; +// otherwise return false because: +// * props include a multiline string +// * text has more than one adjacent line +// * markup does not close +const dedentMarkup = (input, output) => { + let line = input[output.length]; + if (!dedentStartTag(input, output)) { + return false; + } + if (input[output.length - 1].includes('/>')) { + return true; + } + let isText = false; + const stack = []; + stack.push(getIndentationLength(line)); + while (stack.length > 0 && output.length < input.length) { + line = input[output.length]; + if (isFirstLineOfTag(line)) { + if (line.includes('')) { + stack.push(getIndentationLength(line)); + } + } + isText = false; + } else { + if (isText) { + return false; // because text has more than one adjacent line + } + + const indentationLengthOfTag = stack[stack.length - 1]; + output.push(line.slice(indentationLengthOfTag + 2)); + isText = true; + } + } + return stack.length === 0; +}; + +// Return lines unindented by heuristic; +// otherwise return null because: +// * props include a multiline string +// * text has more than one adjacent line +// * markup does not close +const dedentLines = input => { + const output = []; + while (output.length < input.length) { + const line = input[output.length]; + if (hasUnmatchedDoubleQuoteMarks(line)) { + return null; + } else if (isFirstLineOfTag(line)) { + if (!dedentMarkup(input, output)) { + return null; + } + } else { + output.push(dedentLine(line)); + } + } + return output; +}; +exports.dedentLines = dedentLines; diff --git a/node_modules/jest-snapshot/build/index.d.ts b/node_modules/jest-snapshot/build/index.d.ts new file mode 100644 index 00000000..6a5cbcd5 --- /dev/null +++ b/node_modules/jest-snapshot/build/index.d.ts @@ -0,0 +1,186 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {Config} from '@jest/types'; +import type {MatcherContext} from 'expect'; +import type {MatcherFunctionWithContext} from 'expect'; +import {Plugin as Plugin_2} from 'pretty-format'; +import {Plugins} from 'pretty-format'; +import type {PrettyFormatOptions} from 'pretty-format'; + +export declare const addSerializer: (plugin: Plugin_2) => void; + +export declare const buildSnapshotResolver: ( + config: Config.ProjectConfig, + localRequire?: Promise | LocalRequire, +) => Promise; + +export declare const cleanup: ( + fileSystem: FileSystem_2, + update: Config.SnapshotUpdateState, + snapshotResolver: SnapshotResolver, + testPathIgnorePatterns?: Config.ProjectConfig['testPathIgnorePatterns'], +) => { + filesRemoved: number; + filesRemovedList: Array; +}; + +export declare interface Context extends MatcherContext { + snapshotState: SnapshotState; +} + +export declare const EXTENSION = 'snap'; + +declare interface FileSystem_2 { + exists(path: string): boolean; + matchFiles(pattern: RegExp | string): Array; +} + +export declare const getSerializers: () => Plugins; + +export declare const isSnapshotPath: (path: string) => boolean; + +declare type LocalRequire = (module: string) => unknown; + +declare type SaveStatus = { + deleted: boolean; + saved: boolean; +}; + +declare type SnapshotFormat = Omit; + +export declare interface SnapshotMatchers, T> { + /** + * This ensures that a value matches the most recent snapshot with property matchers. + * Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information. + */ + toMatchSnapshot(hint?: string): R; + /** + * This ensures that a value matches the most recent snapshot. + * Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information. + */ + toMatchSnapshot>( + propertyMatchers: Partial, + hint?: string, + ): R; + /** + * This ensures that a value matches the most recent snapshot with property matchers. + * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically. + * Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information. + */ + toMatchInlineSnapshot(snapshot?: string): R; + /** + * This ensures that a value matches the most recent snapshot with property matchers. + * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically. + * Check out [the Snapshot Testing guide](https://jestjs.io/docs/snapshot-testing) for more information. + */ + toMatchInlineSnapshot>( + propertyMatchers: Partial, + snapshot?: string, + ): R; + /** + * Used to test that a function throws a error matching the most recent snapshot when it is called. + */ + toThrowErrorMatchingSnapshot(hint?: string): R; + /** + * Used to test that a function throws a error matching the most recent snapshot when it is called. + * Instead of writing the snapshot value to a .snap file, it will be written into the source code automatically. + */ + toThrowErrorMatchingInlineSnapshot(snapshot?: string): R; +} + +declare type SnapshotMatchOptions = { + readonly testName: string; + readonly received: unknown; + readonly key?: string; + readonly inlineSnapshot?: string; + readonly isInline: boolean; + readonly error?: Error; +}; + +export declare type SnapshotResolver = { + /** Resolves from `testPath` to snapshot path. */ + resolveSnapshotPath(testPath: string, snapshotExtension?: string): string; + /** Resolves from `snapshotPath` to test path. */ + resolveTestPath(snapshotPath: string, snapshotExtension?: string): string; + /** Example test path, used for preflight consistency check of the implementation above. */ + testPathForConsistencyCheck: string; +}; + +declare type SnapshotReturnOptions = { + readonly actual: string; + readonly count: number; + readonly expected?: string; + readonly key: string; + readonly pass: boolean; +}; + +export declare class SnapshotState { + private _counters; + private _dirty; + private _index; + private readonly _updateSnapshot; + private _snapshotData; + private readonly _initialData; + private readonly _snapshotPath; + private _inlineSnapshots; + private readonly _uncheckedKeys; + private readonly _prettierPath; + private readonly _rootDir; + readonly snapshotFormat: SnapshotFormat; + added: number; + expand: boolean; + matched: number; + unmatched: number; + updated: number; + constructor(snapshotPath: string, options: SnapshotStateOptions); + markSnapshotsAsCheckedForTest(testName: string): void; + private _addSnapshot; + clear(): void; + save(): SaveStatus; + getUncheckedCount(): number; + getUncheckedKeys(): Array; + removeUncheckedKeys(): void; + match({ + testName, + received, + key, + inlineSnapshot, + isInline, + error, + }: SnapshotMatchOptions): SnapshotReturnOptions; + fail(testName: string, _received: unknown, key?: string): string; +} + +declare type SnapshotStateOptions = { + readonly updateSnapshot: Config.SnapshotUpdateState; + readonly prettierPath?: string | null; + readonly expand?: boolean; + readonly snapshotFormat: SnapshotFormat; + readonly rootDir: string; +}; + +export declare const toMatchInlineSnapshot: MatcherFunctionWithContext< + Context, + [propertiesOrSnapshot?: object | string, inlineSnapshot?: string] +>; + +export declare const toMatchSnapshot: MatcherFunctionWithContext< + Context, + [propertiesOrHint?: object | string, hint?: string] +>; + +export declare const toThrowErrorMatchingInlineSnapshot: MatcherFunctionWithContext< + Context, + [inlineSnapshot?: string, fromPromise?: boolean] +>; + +export declare const toThrowErrorMatchingSnapshot: MatcherFunctionWithContext< + Context, + [hint?: string, fromPromise?: boolean] +>; + +export {}; diff --git a/node_modules/jest-snapshot/build/index.js b/node_modules/jest-snapshot/build/index.js new file mode 100644 index 00000000..df9f897b --- /dev/null +++ b/node_modules/jest-snapshot/build/index.js @@ -0,0 +1,591 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +Object.defineProperty(exports, 'EXTENSION', { + enumerable: true, + get: function () { + return _SnapshotResolver.EXTENSION; + } +}); +Object.defineProperty(exports, 'SnapshotState', { + enumerable: true, + get: function () { + return _State.default; + } +}); +Object.defineProperty(exports, 'addSerializer', { + enumerable: true, + get: function () { + return _plugins.addSerializer; + } +}); +Object.defineProperty(exports, 'buildSnapshotResolver', { + enumerable: true, + get: function () { + return _SnapshotResolver.buildSnapshotResolver; + } +}); +exports.cleanup = void 0; +Object.defineProperty(exports, 'getSerializers', { + enumerable: true, + get: function () { + return _plugins.getSerializers; + } +}); +Object.defineProperty(exports, 'isSnapshotPath', { + enumerable: true, + get: function () { + return _SnapshotResolver.isSnapshotPath; + } +}); +exports.toThrowErrorMatchingSnapshot = + exports.toThrowErrorMatchingInlineSnapshot = + exports.toMatchSnapshot = + exports.toMatchInlineSnapshot = + void 0; +var fs = _interopRequireWildcard(require('graceful-fs')); +var _jestMatcherUtils = require('jest-matcher-utils'); +var _SnapshotResolver = require('./SnapshotResolver'); +var _printSnapshot = require('./printSnapshot'); +var _utils = require('./utils'); +var _plugins = require('./plugins'); +var _State = _interopRequireDefault(require('./State')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var jestExistsFile = + globalThis[Symbol.for('jest-native-exists-file')] || fs.existsSync; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +const DID_NOT_THROW = 'Received function did not throw'; // same as toThrow +const NOT_SNAPSHOT_MATCHERS = `Snapshot matchers cannot be used with ${(0, +_jestMatcherUtils.BOLD_WEIGHT)('not')}`; +const INDENTATION_REGEX = /^([^\S\n]*)\S/m; + +// Display name in report when matcher fails same as in snapshot file, +// but with optional hint argument in bold weight. +const printSnapshotName = (concatenatedBlockNames = '', hint = '', count) => { + const hasNames = concatenatedBlockNames.length !== 0; + const hasHint = hint.length !== 0; + return `Snapshot name: \`${ + hasNames ? (0, _utils.escapeBacktickString)(concatenatedBlockNames) : '' + }${hasNames && hasHint ? ': ' : ''}${ + hasHint + ? (0, _jestMatcherUtils.BOLD_WEIGHT)( + (0, _utils.escapeBacktickString)(hint) + ) + : '' + } ${count}\``; +}; +function stripAddedIndentation(inlineSnapshot) { + // Find indentation if exists. + const match = inlineSnapshot.match(INDENTATION_REGEX); + if (!match || !match[1]) { + // No indentation. + return inlineSnapshot; + } + const indentation = match[1]; + const lines = inlineSnapshot.split('\n'); + if (lines.length <= 2) { + // Must be at least 3 lines. + return inlineSnapshot; + } + if (lines[0].trim() !== '' || lines[lines.length - 1].trim() !== '') { + // If not blank first and last lines, abort. + return inlineSnapshot; + } + for (let i = 1; i < lines.length - 1; i++) { + if (lines[i] !== '') { + if (lines[i].indexOf(indentation) !== 0) { + // All lines except first and last should either be blank or have the same + // indent as the first line (or more). If this isn't the case we don't + // want to touch the snapshot at all. + return inlineSnapshot; + } + lines[i] = lines[i].substring(indentation.length); + } + } + + // Last line is a special case because it won't have the same indent as others + // but may still have been given some indent to line up. + lines[lines.length - 1] = ''; + + // Return inline snapshot, now at indent 0. + inlineSnapshot = lines.join('\n'); + return inlineSnapshot; +} +const fileExists = (filePath, fileSystem) => + fileSystem.exists(filePath) || jestExistsFile(filePath); +const cleanup = ( + fileSystem, + update, + snapshotResolver, + testPathIgnorePatterns +) => { + const pattern = `\\.${_SnapshotResolver.EXTENSION}$`; + const files = fileSystem.matchFiles(pattern); + let testIgnorePatternsRegex = null; + if (testPathIgnorePatterns && testPathIgnorePatterns.length > 0) { + testIgnorePatternsRegex = new RegExp(testPathIgnorePatterns.join('|')); + } + const list = files.filter(snapshotFile => { + const testPath = snapshotResolver.resolveTestPath(snapshotFile); + + // ignore snapshots of ignored tests + if (testIgnorePatternsRegex && testIgnorePatternsRegex.test(testPath)) { + return false; + } + if (!fileExists(testPath, fileSystem)) { + if (update === 'all') { + fs.unlinkSync(snapshotFile); + } + return true; + } + return false; + }); + return { + filesRemoved: list.length, + filesRemovedList: list + }; +}; +exports.cleanup = cleanup; +const toMatchSnapshot = function (received, propertiesOrHint, hint) { + const matcherName = 'toMatchSnapshot'; + let properties; + const length = arguments.length; + if (length === 2 && typeof propertiesOrHint === 'string') { + hint = propertiesOrHint; + } else if (length >= 2) { + if (typeof propertiesOrHint !== 'object' || propertiesOrHint === null) { + const options = { + isNot: this.isNot, + promise: this.promise + }; + let printedWithType = (0, _jestMatcherUtils.printWithType)( + 'Expected properties', + propertiesOrHint, + _printSnapshot.printExpected + ); + if (length === 3) { + options.secondArgument = 'hint'; + options.secondArgumentColor = _jestMatcherUtils.BOLD_WEIGHT; + if (propertiesOrHint == null) { + printedWithType += + "\n\nTo provide a hint without properties: toMatchSnapshot('hint')"; + } + } + throw new Error( + (0, _jestMatcherUtils.matcherErrorMessage)( + (0, _jestMatcherUtils.matcherHint)( + matcherName, + undefined, + _printSnapshot.PROPERTIES_ARG, + options + ), + `Expected ${(0, _jestMatcherUtils.EXPECTED_COLOR)( + 'properties' + )} must be an object`, + printedWithType + ) + ); + } + + // Future breaking change: Snapshot hint must be a string + // if (arguments.length === 3 && typeof hint !== 'string') {} + + properties = propertiesOrHint; + } + return _toMatchSnapshot({ + context: this, + hint, + isInline: false, + matcherName, + properties, + received + }); +}; +exports.toMatchSnapshot = toMatchSnapshot; +const toMatchInlineSnapshot = function ( + received, + propertiesOrSnapshot, + inlineSnapshot +) { + const matcherName = 'toMatchInlineSnapshot'; + let properties; + const length = arguments.length; + if (length === 2 && typeof propertiesOrSnapshot === 'string') { + inlineSnapshot = propertiesOrSnapshot; + } else if (length >= 2) { + const options = { + isNot: this.isNot, + promise: this.promise + }; + if (length === 3) { + options.secondArgument = _printSnapshot.SNAPSHOT_ARG; + options.secondArgumentColor = _printSnapshot.noColor; + } + if ( + typeof propertiesOrSnapshot !== 'object' || + propertiesOrSnapshot === null + ) { + throw new Error( + (0, _jestMatcherUtils.matcherErrorMessage)( + (0, _jestMatcherUtils.matcherHint)( + matcherName, + undefined, + _printSnapshot.PROPERTIES_ARG, + options + ), + `Expected ${(0, _jestMatcherUtils.EXPECTED_COLOR)( + 'properties' + )} must be an object`, + (0, _jestMatcherUtils.printWithType)( + 'Expected properties', + propertiesOrSnapshot, + _printSnapshot.printExpected + ) + ) + ); + } + if (length === 3 && typeof inlineSnapshot !== 'string') { + throw new Error( + (0, _jestMatcherUtils.matcherErrorMessage)( + (0, _jestMatcherUtils.matcherHint)( + matcherName, + undefined, + _printSnapshot.PROPERTIES_ARG, + options + ), + 'Inline snapshot must be a string', + (0, _jestMatcherUtils.printWithType)( + 'Inline snapshot', + inlineSnapshot, + _utils.serialize + ) + ) + ); + } + properties = propertiesOrSnapshot; + } + return _toMatchSnapshot({ + context: this, + inlineSnapshot: + inlineSnapshot !== undefined + ? stripAddedIndentation(inlineSnapshot) + : undefined, + isInline: true, + matcherName, + properties, + received + }); +}; +exports.toMatchInlineSnapshot = toMatchInlineSnapshot; +const _toMatchSnapshot = config => { + const {context, hint, inlineSnapshot, isInline, matcherName, properties} = + config; + let {received} = config; + context.dontThrow && context.dontThrow(); + const {currentConcurrentTestName, isNot, snapshotState} = context; + const currentTestName = + currentConcurrentTestName?.() ?? context.currentTestName; + if (isNot) { + throw new Error( + (0, _jestMatcherUtils.matcherErrorMessage)( + (0, _printSnapshot.matcherHintFromConfig)(config, false), + NOT_SNAPSHOT_MATCHERS + ) + ); + } + if (snapshotState == null) { + // Because the state is the problem, this is not a matcher error. + // Call generic stringify from jest-matcher-utils package + // because uninitialized snapshot state does not need snapshot serializers. + throw new Error( + `${(0, _printSnapshot.matcherHintFromConfig)(config, false)}\n\n` + + 'Snapshot state must be initialized' + + `\n\n${(0, _jestMatcherUtils.printWithType)( + 'Snapshot state', + snapshotState, + _jestMatcherUtils.stringify + )}` + ); + } + const fullTestName = + currentTestName && hint + ? `${currentTestName}: ${hint}` + : currentTestName || ''; // future BREAKING change: || hint + + if (typeof properties === 'object') { + if (typeof received !== 'object' || received === null) { + throw new Error( + (0, _jestMatcherUtils.matcherErrorMessage)( + (0, _printSnapshot.matcherHintFromConfig)(config, false), + `${(0, _jestMatcherUtils.RECEIVED_COLOR)( + 'received' + )} value must be an object when the matcher has ${(0, + _jestMatcherUtils.EXPECTED_COLOR)('properties')}`, + (0, _jestMatcherUtils.printWithType)( + 'Received', + received, + _printSnapshot.printReceived + ) + ) + ); + } + const propertyPass = context.equals(received, properties, [ + context.utils.iterableEquality, + context.utils.subsetEquality + ]); + if (!propertyPass) { + const key = snapshotState.fail(fullTestName, received); + const matched = /(\d+)$/.exec(key); + const count = matched === null ? 1 : Number(matched[1]); + const message = () => + `${(0, _printSnapshot.matcherHintFromConfig)( + config, + false + )}\n\n${printSnapshotName(currentTestName, hint, count)}\n\n${(0, + _printSnapshot.printPropertiesAndReceived)( + properties, + received, + snapshotState.expand + )}`; + return { + message, + name: matcherName, + pass: false + }; + } else { + received = (0, _utils.deepMerge)(received, properties); + } + } + const result = snapshotState.match({ + error: context.error, + inlineSnapshot, + isInline, + received, + testName: fullTestName + }); + const {actual, count, expected, pass} = result; + if (pass) { + return { + message: () => '', + pass: true + }; + } + const message = + expected === undefined + ? () => + `${(0, _printSnapshot.matcherHintFromConfig)( + config, + true + )}\n\n${printSnapshotName(currentTestName, hint, count)}\n\n` + + `New snapshot was ${(0, _jestMatcherUtils.BOLD_WEIGHT)( + 'not written' + )}. The update flag ` + + 'must be explicitly passed to write a new snapshot.\n\n' + + 'This is likely because this test is run in a continuous integration ' + + '(CI) environment in which snapshots are not written by default.\n\n' + + `Received:${actual.includes('\n') ? '\n' : ' '}${(0, + _printSnapshot.bReceivedColor)(actual)}` + : () => + `${(0, _printSnapshot.matcherHintFromConfig)( + config, + true + )}\n\n${printSnapshotName(currentTestName, hint, count)}\n\n${(0, + _printSnapshot.printSnapshotAndReceived)( + expected, + actual, + received, + snapshotState.expand, + snapshotState.snapshotFormat + )}`; + + // Passing the actual and expected objects so that a custom reporter + // could access them, for example in order to display a custom visual diff, + // or create a different error message + return { + actual, + expected, + message, + name: matcherName, + pass: false + }; +}; +const toThrowErrorMatchingSnapshot = function (received, hint, fromPromise) { + const matcherName = 'toThrowErrorMatchingSnapshot'; + + // Future breaking change: Snapshot hint must be a string + // if (hint !== undefined && typeof hint !== string) {} + + return _toThrowErrorMatchingSnapshot( + { + context: this, + hint, + isInline: false, + matcherName, + received + }, + fromPromise + ); +}; +exports.toThrowErrorMatchingSnapshot = toThrowErrorMatchingSnapshot; +const toThrowErrorMatchingInlineSnapshot = function ( + received, + inlineSnapshot, + fromPromise +) { + const matcherName = 'toThrowErrorMatchingInlineSnapshot'; + if (inlineSnapshot !== undefined && typeof inlineSnapshot !== 'string') { + const options = { + expectedColor: _printSnapshot.noColor, + isNot: this.isNot, + promise: this.promise + }; + throw new Error( + (0, _jestMatcherUtils.matcherErrorMessage)( + (0, _jestMatcherUtils.matcherHint)( + matcherName, + undefined, + _printSnapshot.SNAPSHOT_ARG, + options + ), + 'Inline snapshot must be a string', + (0, _jestMatcherUtils.printWithType)( + 'Inline snapshot', + inlineSnapshot, + _utils.serialize + ) + ) + ); + } + return _toThrowErrorMatchingSnapshot( + { + context: this, + inlineSnapshot: + inlineSnapshot !== undefined + ? stripAddedIndentation(inlineSnapshot) + : undefined, + isInline: true, + matcherName, + received + }, + fromPromise + ); +}; +exports.toThrowErrorMatchingInlineSnapshot = toThrowErrorMatchingInlineSnapshot; +const _toThrowErrorMatchingSnapshot = (config, fromPromise) => { + const {context, hint, inlineSnapshot, isInline, matcherName, received} = + config; + context.dontThrow && context.dontThrow(); + const {isNot, promise} = context; + if (!fromPromise) { + if (typeof received !== 'function') { + const options = { + isNot, + promise + }; + throw new Error( + (0, _jestMatcherUtils.matcherErrorMessage)( + (0, _jestMatcherUtils.matcherHint)( + matcherName, + undefined, + '', + options + ), + `${(0, _jestMatcherUtils.RECEIVED_COLOR)( + 'received' + )} value must be a function`, + (0, _jestMatcherUtils.printWithType)( + 'Received', + received, + _printSnapshot.printReceived + ) + ) + ); + } + } + if (isNot) { + throw new Error( + (0, _jestMatcherUtils.matcherErrorMessage)( + (0, _printSnapshot.matcherHintFromConfig)(config, false), + NOT_SNAPSHOT_MATCHERS + ) + ); + } + let error; + if (fromPromise) { + error = received; + } else { + try { + received(); + } catch (e) { + error = e; + } + } + if (error === undefined) { + // Because the received value is a function, this is not a matcher error. + throw new Error( + `${(0, _printSnapshot.matcherHintFromConfig)( + config, + false + )}\n\n${DID_NOT_THROW}` + ); + } + return _toMatchSnapshot({ + context, + hint, + inlineSnapshot, + isInline, + matcherName, + received: error.message + }); +}; diff --git a/node_modules/jest-snapshot/build/mockSerializer.js b/node_modules/jest-snapshot/build/mockSerializer.js new file mode 100644 index 00000000..dd10f778 --- /dev/null +++ b/node_modules/jest-snapshot/build/mockSerializer.js @@ -0,0 +1,47 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.test = exports.serialize = exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const serialize = (val, config, indentation, depth, refs, printer) => { + // Serialize a non-default name, even if config.printFunctionName is false. + const name = val.getMockName(); + const nameString = name === 'jest.fn()' ? '' : ` ${name}`; + let callsString = ''; + if (val.mock.calls.length !== 0) { + const indentationNext = indentation + config.indent; + callsString = ` {${config.spacingOuter}${indentationNext}"calls": ${printer( + val.mock.calls, + config, + indentationNext, + depth, + refs + )}${config.min ? ', ' : ','}${ + config.spacingOuter + }${indentationNext}"results": ${printer( + val.mock.results, + config, + indentationNext, + depth, + refs + )}${config.min ? '' : ','}${config.spacingOuter}${indentation}}`; + } + return `[MockFunction${nameString}]${callsString}`; +}; +exports.serialize = serialize; +const test = val => val && !!val._isMockFunction; +exports.test = test; +const plugin = { + serialize, + test +}; +var _default = plugin; +exports.default = _default; diff --git a/node_modules/jest-snapshot/build/plugins.js b/node_modules/jest-snapshot/build/plugins.js new file mode 100644 index 00000000..3d4484d1 --- /dev/null +++ b/node_modules/jest-snapshot/build/plugins.js @@ -0,0 +1,43 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.getSerializers = exports.addSerializer = void 0; +var _prettyFormat = require('pretty-format'); +var _mockSerializer = _interopRequireDefault(require('./mockSerializer')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const { + DOMCollection, + DOMElement, + Immutable, + ReactElement, + ReactTestComponent, + AsymmetricMatcher +} = _prettyFormat.plugins; +let PLUGINS = [ + ReactTestComponent, + ReactElement, + DOMElement, + DOMCollection, + Immutable, + _mockSerializer.default, + AsymmetricMatcher +]; + +// Prepend to list so the last added is the first tested. +const addSerializer = plugin => { + PLUGINS = [plugin].concat(PLUGINS); +}; +exports.addSerializer = addSerializer; +const getSerializers = () => PLUGINS; +exports.getSerializers = getSerializers; diff --git a/node_modules/jest-snapshot/build/printSnapshot.js b/node_modules/jest-snapshot/build/printSnapshot.js new file mode 100644 index 00000000..13f28f42 --- /dev/null +++ b/node_modules/jest-snapshot/build/printSnapshot.js @@ -0,0 +1,340 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.printSnapshotAndReceived = + exports.printReceived = + exports.printPropertiesAndReceived = + exports.printExpected = + exports.noColor = + exports.matcherHintFromConfig = + exports.getSnapshotColorForChalkInstance = + exports.getReceivedColorForChalkInstance = + exports.bReceivedColor = + exports.aSnapshotColor = + exports.SNAPSHOT_ARG = + exports.PROPERTIES_ARG = + exports.HINT_ARG = + void 0; +var _chalk = _interopRequireDefault(require('chalk')); +var _expectUtils = require('@jest/expect-utils'); +var _jestDiff = require('jest-diff'); +var _jestGetType = require('jest-get-type'); +var _jestMatcherUtils = require('jest-matcher-utils'); +var _prettyFormat = require('pretty-format'); +var _colors = require('./colors'); +var _dedentLines = require('./dedentLines'); +var _utils = require('./utils'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const getSnapshotColorForChalkInstance = chalkInstance => { + const level = chalkInstance.level; + if (level === 3) { + return chalkInstance + .rgb( + _colors.aForeground3[0], + _colors.aForeground3[1], + _colors.aForeground3[2] + ) + .bgRgb( + _colors.aBackground3[0], + _colors.aBackground3[1], + _colors.aBackground3[2] + ); + } + if (level === 2) { + return chalkInstance + .ansi256(_colors.aForeground2) + .bgAnsi256(_colors.aBackground2); + } + return chalkInstance.magenta.bgYellowBright; +}; +exports.getSnapshotColorForChalkInstance = getSnapshotColorForChalkInstance; +const getReceivedColorForChalkInstance = chalkInstance => { + const level = chalkInstance.level; + if (level === 3) { + return chalkInstance + .rgb( + _colors.bForeground3[0], + _colors.bForeground3[1], + _colors.bForeground3[2] + ) + .bgRgb( + _colors.bBackground3[0], + _colors.bBackground3[1], + _colors.bBackground3[2] + ); + } + if (level === 2) { + return chalkInstance + .ansi256(_colors.bForeground2) + .bgAnsi256(_colors.bBackground2); + } + return chalkInstance.cyan.bgWhiteBright; // also known as teal +}; +exports.getReceivedColorForChalkInstance = getReceivedColorForChalkInstance; +const aSnapshotColor = getSnapshotColorForChalkInstance(_chalk.default); +exports.aSnapshotColor = aSnapshotColor; +const bReceivedColor = getReceivedColorForChalkInstance(_chalk.default); +exports.bReceivedColor = bReceivedColor; +const noColor = string => string; +exports.noColor = noColor; +const HINT_ARG = 'hint'; +exports.HINT_ARG = HINT_ARG; +const SNAPSHOT_ARG = 'snapshot'; +exports.SNAPSHOT_ARG = SNAPSHOT_ARG; +const PROPERTIES_ARG = 'properties'; +exports.PROPERTIES_ARG = PROPERTIES_ARG; +const matcherHintFromConfig = ( + {context: {isNot, promise}, hint, inlineSnapshot, matcherName, properties}, + isUpdatable +) => { + const options = { + isNot, + promise + }; + if (isUpdatable) { + options.receivedColor = bReceivedColor; + } + let expectedArgument = ''; + if (typeof properties === 'object') { + expectedArgument = PROPERTIES_ARG; + if (isUpdatable) { + options.expectedColor = noColor; + } + if (typeof hint === 'string' && hint.length !== 0) { + options.secondArgument = HINT_ARG; + options.secondArgumentColor = _jestMatcherUtils.BOLD_WEIGHT; + } else if (typeof inlineSnapshot === 'string') { + options.secondArgument = SNAPSHOT_ARG; + if (isUpdatable) { + options.secondArgumentColor = aSnapshotColor; + } else { + options.secondArgumentColor = noColor; + } + } + } else { + if (typeof hint === 'string' && hint.length !== 0) { + expectedArgument = HINT_ARG; + options.expectedColor = _jestMatcherUtils.BOLD_WEIGHT; + } else if (typeof inlineSnapshot === 'string') { + expectedArgument = SNAPSHOT_ARG; + if (isUpdatable) { + options.expectedColor = aSnapshotColor; + } + } + } + return (0, _jestMatcherUtils.matcherHint)( + matcherName, + undefined, + expectedArgument, + options + ); +}; + +// Given array of diffs, return string: +// * include common substrings +// * exclude change substrings which have opposite op +// * include change substrings which have argument op +// with change color only if there is a common substring +exports.matcherHintFromConfig = matcherHintFromConfig; +const joinDiffs = (diffs, op, hasCommon) => + diffs.reduce( + (reduced, diff) => + reduced + + (diff[0] === _jestDiff.DIFF_EQUAL + ? diff[1] + : diff[0] !== op + ? '' + : hasCommon + ? (0, _jestMatcherUtils.INVERTED_COLOR)(diff[1]) + : diff[1]), + '' + ); +const isLineDiffable = received => { + const receivedType = (0, _jestGetType.getType)(received); + if ((0, _jestGetType.isPrimitive)(received)) { + return typeof received === 'string'; + } + if ( + receivedType === 'date' || + receivedType === 'function' || + receivedType === 'regexp' + ) { + return false; + } + if (received instanceof Error) { + return false; + } + if ( + receivedType === 'object' && + typeof received.asymmetricMatch === 'function' + ) { + return false; + } + return true; +}; +const printExpected = val => + (0, _jestMatcherUtils.EXPECTED_COLOR)((0, _utils.minify)(val)); +exports.printExpected = printExpected; +const printReceived = val => + (0, _jestMatcherUtils.RECEIVED_COLOR)((0, _utils.minify)(val)); +exports.printReceived = printReceived; +const printPropertiesAndReceived = ( + properties, + received, + expand // CLI options: true if `--expand` or false if `--no-expand` +) => { + const aAnnotation = 'Expected properties'; + const bAnnotation = 'Received value'; + if (isLineDiffable(properties) && isLineDiffable(received)) { + const {replacedExpected, replacedReceived} = (0, + _jestMatcherUtils.replaceMatchedToAsymmetricMatcher)( + properties, + received, + [], + [] + ); + return (0, _jestDiff.diffLinesUnified)( + (0, _utils.serialize)(replacedExpected).split('\n'), + (0, _utils.serialize)( + (0, _expectUtils.getObjectSubset)(replacedReceived, replacedExpected) + ).split('\n'), + { + aAnnotation, + aColor: _jestMatcherUtils.EXPECTED_COLOR, + bAnnotation, + bColor: _jestMatcherUtils.RECEIVED_COLOR, + changeLineTrailingSpaceColor: _chalk.default.bgYellow, + commonLineTrailingSpaceColor: _chalk.default.bgYellow, + emptyFirstOrLastLinePlaceholder: '↵', + // U+21B5 + expand, + includeChangeCounts: true + } + ); + } + const printLabel = (0, _jestMatcherUtils.getLabelPrinter)( + aAnnotation, + bAnnotation + ); + return `${printLabel(aAnnotation) + printExpected(properties)}\n${printLabel( + bAnnotation + )}${printReceived(received)}`; +}; +exports.printPropertiesAndReceived = printPropertiesAndReceived; +const MAX_DIFF_STRING_LENGTH = 20000; +const printSnapshotAndReceived = (a, b, received, expand, snapshotFormat) => { + const aAnnotation = 'Snapshot'; + const bAnnotation = 'Received'; + const aColor = aSnapshotColor; + const bColor = bReceivedColor; + const options = { + aAnnotation, + aColor, + bAnnotation, + bColor, + changeLineTrailingSpaceColor: noColor, + commonLineTrailingSpaceColor: _chalk.default.bgYellow, + emptyFirstOrLastLinePlaceholder: '↵', + // U+21B5 + expand, + includeChangeCounts: true + }; + if (typeof received === 'string') { + if ( + a.length >= 2 && + a.startsWith('"') && + a.endsWith('"') && + b === (0, _prettyFormat.format)(received) + ) { + // If snapshot looks like default serialization of a string + // and received is string which has default serialization. + + if (!a.includes('\n') && !b.includes('\n')) { + // If neither string is multiline, + // display as labels and quoted strings. + let aQuoted = a; + let bQuoted = b; + if ( + a.length - 2 <= MAX_DIFF_STRING_LENGTH && + b.length - 2 <= MAX_DIFF_STRING_LENGTH + ) { + const diffs = (0, _jestDiff.diffStringsRaw)( + a.slice(1, -1), + b.slice(1, -1), + true + ); + const hasCommon = diffs.some( + diff => diff[0] === _jestDiff.DIFF_EQUAL + ); + aQuoted = `"${joinDiffs(diffs, _jestDiff.DIFF_DELETE, hasCommon)}"`; + bQuoted = `"${joinDiffs(diffs, _jestDiff.DIFF_INSERT, hasCommon)}"`; + } + const printLabel = (0, _jestMatcherUtils.getLabelPrinter)( + aAnnotation, + bAnnotation + ); + return `${printLabel(aAnnotation) + aColor(aQuoted)}\n${printLabel( + bAnnotation + )}${bColor(bQuoted)}`; + } + + // Else either string is multiline, so display as unquoted strings. + a = (0, _utils.deserializeString)(a); // hypothetical expected string + b = received; // not serialized + } + // Else expected had custom serialization or was not a string + // or received has custom serialization. + + return a.length <= MAX_DIFF_STRING_LENGTH && + b.length <= MAX_DIFF_STRING_LENGTH + ? (0, _jestDiff.diffStringsUnified)(a, b, options) + : (0, _jestDiff.diffLinesUnified)(a.split('\n'), b.split('\n'), options); + } + if (isLineDiffable(received)) { + const aLines2 = a.split('\n'); + const bLines2 = b.split('\n'); + + // Fall through to fix a regression for custom serializers + // like jest-snapshot-serializer-raw that ignore the indent option. + const b0 = (0, _utils.serialize)(received, 0, snapshotFormat); + if (b0 !== b) { + const aLines0 = (0, _dedentLines.dedentLines)(aLines2); + if (aLines0 !== null) { + // Compare lines without indentation. + const bLines0 = b0.split('\n'); + return (0, _jestDiff.diffLinesUnified2)( + aLines2, + bLines2, + aLines0, + bLines0, + options + ); + } + } + + // Fall back because: + // * props include a multiline string + // * text has more than one adjacent line + // * markup does not close + return (0, _jestDiff.diffLinesUnified)(aLines2, bLines2, options); + } + const printLabel = (0, _jestMatcherUtils.getLabelPrinter)( + aAnnotation, + bAnnotation + ); + return `${printLabel(aAnnotation) + aColor(a)}\n${printLabel( + bAnnotation + )}${bColor(b)}`; +}; +exports.printSnapshotAndReceived = printSnapshotAndReceived; diff --git a/node_modules/jest-snapshot/build/types.js b/node_modules/jest-snapshot/build/types.js new file mode 100644 index 00000000..ad9a93a7 --- /dev/null +++ b/node_modules/jest-snapshot/build/types.js @@ -0,0 +1 @@ +'use strict'; diff --git a/node_modules/jest-snapshot/build/utils.js b/node_modules/jest-snapshot/build/utils.js new file mode 100644 index 00000000..7c494706 --- /dev/null +++ b/node_modules/jest-snapshot/build/utils.js @@ -0,0 +1,320 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.testNameToKey = + exports.serialize = + exports.saveSnapshotFile = + exports.removeLinesBeforeExternalMatcherTrap = + exports.removeExtraLineBreaks = + exports.minify = + exports.keyToTestName = + exports.getSnapshotData = + exports.escapeBacktickString = + exports.ensureDirectoryExists = + exports.deserializeString = + exports.deepMerge = + exports.addExtraLineBreaks = + exports.SNAPSHOT_VERSION_WARNING = + exports.SNAPSHOT_VERSION = + exports.SNAPSHOT_GUIDE_LINK = + void 0; +var path = _interopRequireWildcard(require('path')); +var _chalk = _interopRequireDefault(require('chalk')); +var fs = _interopRequireWildcard(require('graceful-fs')); +var _naturalCompare = _interopRequireDefault(require('natural-compare')); +var _prettyFormat = require('pretty-format'); +var _plugins = require('./plugins'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var jestWriteFile = + globalThis[Symbol.for('jest-native-write-file')] || fs.writeFileSync; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var jestReadFile = + globalThis[Symbol.for('jest-native-read-file')] || fs.readFileSync; +var Symbol = globalThis['jest-symbol-do-not-touch'] || globalThis.Symbol; +var jestExistsFile = + globalThis[Symbol.for('jest-native-exists-file')] || fs.existsSync; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +const SNAPSHOT_VERSION = '1'; +exports.SNAPSHOT_VERSION = SNAPSHOT_VERSION; +const SNAPSHOT_VERSION_REGEXP = /^\/\/ Jest Snapshot v(.+),/; +const SNAPSHOT_GUIDE_LINK = 'https://goo.gl/fbAQLP'; +exports.SNAPSHOT_GUIDE_LINK = SNAPSHOT_GUIDE_LINK; +const SNAPSHOT_VERSION_WARNING = _chalk.default.yellow( + `${_chalk.default.bold('Warning')}: Before you upgrade snapshots, ` + + 'we recommend that you revert any local changes to tests or other code, ' + + 'to ensure that you do not store invalid state.' +); +exports.SNAPSHOT_VERSION_WARNING = SNAPSHOT_VERSION_WARNING; +const writeSnapshotVersion = () => + `// Jest Snapshot v${SNAPSHOT_VERSION}, ${SNAPSHOT_GUIDE_LINK}`; +const validateSnapshotVersion = snapshotContents => { + const versionTest = SNAPSHOT_VERSION_REGEXP.exec(snapshotContents); + const version = versionTest && versionTest[1]; + if (!version) { + return new Error( + _chalk.default.red( + `${_chalk.default.bold( + 'Outdated snapshot' + )}: No snapshot header found. ` + + 'Jest 19 introduced versioned snapshots to ensure all developers ' + + 'on a project are using the same version of Jest. ' + + 'Please update all snapshots during this upgrade of Jest.\n\n' + ) + SNAPSHOT_VERSION_WARNING + ); + } + if (version < SNAPSHOT_VERSION) { + return new Error( + // eslint-disable-next-line prefer-template + _chalk.default.red( + `${_chalk.default.red.bold( + 'Outdated snapshot' + )}: The version of the snapshot ` + + 'file associated with this test is outdated. The snapshot file ' + + 'version ensures that all developers on a project are using ' + + 'the same version of Jest. ' + + 'Please update all snapshots during this upgrade of Jest.' + ) + + '\n\n' + + `Expected: v${SNAPSHOT_VERSION}\n` + + `Received: v${version}\n\n` + + SNAPSHOT_VERSION_WARNING + ); + } + if (version > SNAPSHOT_VERSION) { + return new Error( + // eslint-disable-next-line prefer-template + _chalk.default.red( + `${_chalk.default.red.bold( + 'Outdated Jest version' + )}: The version of this ` + + 'snapshot file indicates that this project is meant to be used ' + + 'with a newer version of Jest. The snapshot file version ensures ' + + 'that all developers on a project are using the same version of ' + + 'Jest. Please update your version of Jest and re-run the tests.' + ) + + '\n\n' + + `Expected: v${SNAPSHOT_VERSION}\n` + + `Received: v${version}` + ); + } + return null; +}; +function isObject(item) { + return item != null && typeof item === 'object' && !Array.isArray(item); +} +const testNameToKey = (testName, count) => `${testName} ${count}`; +exports.testNameToKey = testNameToKey; +const keyToTestName = key => { + if (!/ \d+$/.test(key)) { + throw new Error('Snapshot keys must end with a number.'); + } + return key.replace(/ \d+$/, ''); +}; +exports.keyToTestName = keyToTestName; +const getSnapshotData = (snapshotPath, update) => { + const data = Object.create(null); + let snapshotContents = ''; + let dirty = false; + if (jestExistsFile(snapshotPath)) { + try { + snapshotContents = jestReadFile(snapshotPath, 'utf8'); + // eslint-disable-next-line no-new-func + const populate = new Function('exports', snapshotContents); + populate(data); + } catch {} + } + const validationResult = validateSnapshotVersion(snapshotContents); + const isInvalid = snapshotContents && validationResult; + if (update === 'none' && isInvalid) { + throw validationResult; + } + if ((update === 'all' || update === 'new') && isInvalid) { + dirty = true; + } + return { + data, + dirty + }; +}; + +// Add extra line breaks at beginning and end of multiline snapshot +// to make the content easier to read. +exports.getSnapshotData = getSnapshotData; +const addExtraLineBreaks = string => + string.includes('\n') ? `\n${string}\n` : string; + +// Remove extra line breaks at beginning and end of multiline snapshot. +// Instead of trim, which can remove additional newlines or spaces +// at beginning or end of the content from a custom serializer. +exports.addExtraLineBreaks = addExtraLineBreaks; +const removeExtraLineBreaks = string => + string.length > 2 && string.startsWith('\n') && string.endsWith('\n') + ? string.slice(1, -1) + : string; +exports.removeExtraLineBreaks = removeExtraLineBreaks; +const removeLinesBeforeExternalMatcherTrap = stack => { + const lines = stack.split('\n'); + for (let i = 0; i < lines.length; i += 1) { + // It's a function name specified in `packages/expect/src/index.ts` + // for external custom matchers. + if (lines[i].includes('__EXTERNAL_MATCHER_TRAP__')) { + return lines.slice(i + 1).join('\n'); + } + } + return stack; +}; +exports.removeLinesBeforeExternalMatcherTrap = + removeLinesBeforeExternalMatcherTrap; +const escapeRegex = true; +const printFunctionName = false; +const serialize = (val, indent = 2, formatOverrides = {}) => + normalizeNewlines( + (0, _prettyFormat.format)(val, { + escapeRegex, + indent, + plugins: (0, _plugins.getSerializers)(), + printFunctionName, + ...formatOverrides + }) + ); +exports.serialize = serialize; +const minify = val => + (0, _prettyFormat.format)(val, { + escapeRegex, + min: true, + plugins: (0, _plugins.getSerializers)(), + printFunctionName + }); + +// Remove double quote marks and unescape double quotes and backslashes. +exports.minify = minify; +const deserializeString = stringified => + stringified.slice(1, -1).replace(/\\("|\\)/g, '$1'); +exports.deserializeString = deserializeString; +const escapeBacktickString = str => str.replace(/`|\\|\${/g, '\\$&'); +exports.escapeBacktickString = escapeBacktickString; +const printBacktickString = str => `\`${escapeBacktickString(str)}\``; +const ensureDirectoryExists = filePath => { + try { + fs.mkdirSync(path.dirname(filePath), { + recursive: true + }); + } catch {} +}; +exports.ensureDirectoryExists = ensureDirectoryExists; +const normalizeNewlines = string => string.replace(/\r\n|\r/g, '\n'); +const saveSnapshotFile = (snapshotData, snapshotPath) => { + const snapshots = Object.keys(snapshotData) + .sort(_naturalCompare.default) + .map( + key => + `exports[${printBacktickString(key)}] = ${printBacktickString( + normalizeNewlines(snapshotData[key]) + )};` + ); + ensureDirectoryExists(snapshotPath); + jestWriteFile( + snapshotPath, + `${writeSnapshotVersion()}\n\n${snapshots.join('\n\n')}\n` + ); +}; +exports.saveSnapshotFile = saveSnapshotFile; +const isAnyOrAnything = input => + '$$typeof' in input && + input.$$typeof === Symbol.for('jest.asymmetricMatcher') && + ['Any', 'Anything'].includes(input.constructor.name); +const deepMergeArray = (target, source) => { + const mergedOutput = Array.from(target); + source.forEach((sourceElement, index) => { + const targetElement = mergedOutput[index]; + if (Array.isArray(target[index]) && Array.isArray(sourceElement)) { + mergedOutput[index] = deepMergeArray(target[index], sourceElement); + } else if (isObject(targetElement) && !isAnyOrAnything(sourceElement)) { + mergedOutput[index] = deepMerge(target[index], sourceElement); + } else { + // Source does not exist in target or target is primitive and cannot be deep merged + mergedOutput[index] = sourceElement; + } + }); + return mergedOutput; +}; + +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +const deepMerge = (target, source) => { + if (isObject(target) && isObject(source)) { + const mergedOutput = { + ...target + }; + Object.keys(source).forEach(key => { + if (isObject(source[key]) && !source[key].$$typeof) { + if (!(key in target)) + Object.assign(mergedOutput, { + [key]: source[key] + }); + else mergedOutput[key] = deepMerge(target[key], source[key]); + } else if (Array.isArray(source[key])) { + mergedOutput[key] = deepMergeArray(target[key], source[key]); + } else { + Object.assign(mergedOutput, { + [key]: source[key] + }); + } + }); + return mergedOutput; + } else if (Array.isArray(target) && Array.isArray(source)) { + return deepMergeArray(target, source); + } + return target; +}; +exports.deepMerge = deepMerge; diff --git a/node_modules/jest-snapshot/node_modules/.bin/semver b/node_modules/jest-snapshot/node_modules/.bin/semver new file mode 100644 index 00000000..77443e78 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/.bin/semver @@ -0,0 +1,12 @@ +#!/bin/sh +basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") + +case `uname` in + *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;; +esac + +if [ -x "$basedir/node" ]; then + exec "$basedir/node" "$basedir/../semver/bin/semver.js" "$@" +else + exec node "$basedir/../semver/bin/semver.js" "$@" +fi diff --git a/node_modules/jest-snapshot/node_modules/.bin/semver.cmd b/node_modules/jest-snapshot/node_modules/.bin/semver.cmd new file mode 100644 index 00000000..9913fa9d --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/.bin/semver.cmd @@ -0,0 +1,17 @@ +@ECHO off +GOTO start +:find_dp0 +SET dp0=%~dp0 +EXIT /b +:start +SETLOCAL +CALL :find_dp0 + +IF EXIST "%dp0%\node.exe" ( + SET "_prog=%dp0%\node.exe" +) ELSE ( + SET "_prog=node" + SET PATHEXT=%PATHEXT:;.JS;=;% +) + +endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\semver\bin\semver.js" %* diff --git a/node_modules/jest-snapshot/node_modules/.bin/semver.ps1 b/node_modules/jest-snapshot/node_modules/.bin/semver.ps1 new file mode 100644 index 00000000..314717ad --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/.bin/semver.ps1 @@ -0,0 +1,28 @@ +#!/usr/bin/env pwsh +$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent + +$exe="" +if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { + # Fix case when both the Windows and Linux builds of Node + # are installed in the same directory + $exe=".exe" +} +$ret=0 +if (Test-Path "$basedir/node$exe") { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} else { + # Support pipeline input + if ($MyInvocation.ExpectingInput) { + $input | & "node$exe" "$basedir/../semver/bin/semver.js" $args + } else { + & "node$exe" "$basedir/../semver/bin/semver.js" $args + } + $ret=$LASTEXITCODE +} +exit $ret diff --git a/node_modules/jest-snapshot/node_modules/lru-cache/LICENSE b/node_modules/jest-snapshot/node_modules/lru-cache/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/lru-cache/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/jest-snapshot/node_modules/lru-cache/README.md b/node_modules/jest-snapshot/node_modules/lru-cache/README.md new file mode 100644 index 00000000..435dfebb --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/lru-cache/README.md @@ -0,0 +1,166 @@ +# lru cache + +A cache object that deletes the least-recently-used items. + +[![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache) + +## Installation: + +```javascript +npm install lru-cache --save +``` + +## Usage: + +```javascript +var LRU = require("lru-cache") + , options = { max: 500 + , length: function (n, key) { return n * 2 + key.length } + , dispose: function (key, n) { n.close() } + , maxAge: 1000 * 60 * 60 } + , cache = new LRU(options) + , otherCache = new LRU(50) // sets just the max size + +cache.set("key", "value") +cache.get("key") // "value" + +// non-string keys ARE fully supported +// but note that it must be THE SAME object, not +// just a JSON-equivalent object. +var someObject = { a: 1 } +cache.set(someObject, 'a value') +// Object keys are not toString()-ed +cache.set('[object Object]', 'a different value') +assert.equal(cache.get(someObject), 'a value') +// A similar object with same keys/values won't work, +// because it's a different object identity +assert.equal(cache.get({ a: 1 }), undefined) + +cache.reset() // empty the cache +``` + +If you put more stuff in it, then items will fall out. + +If you try to put an oversized thing in it, then it'll fall out right +away. + +## Options + +* `max` The maximum size of the cache, checked by applying the length + function to all values in the cache. Not setting this is kind of + silly, since that's the whole purpose of this lib, but it defaults + to `Infinity`. Setting it to a non-number or negative number will + throw a `TypeError`. Setting it to 0 makes it be `Infinity`. +* `maxAge` Maximum age in ms. Items are not pro-actively pruned out + as they age, but if you try to get an item that is too old, it'll + drop it and return undefined instead of giving it to you. + Setting this to a negative value will make everything seem old! + Setting it to a non-number will throw a `TypeError`. +* `length` Function that is used to calculate the length of stored + items. If you're storing strings or buffers, then you probably want + to do something like `function(n, key){return n.length}`. The default is + `function(){return 1}`, which is fine if you want to store `max` + like-sized things. The item is passed as the first argument, and + the key is passed as the second argumnet. +* `dispose` Function that is called on items when they are dropped + from the cache. This can be handy if you want to close file + descriptors or do other cleanup tasks when items are no longer + accessible. Called with `key, value`. It's called *before* + actually removing the item from the internal cache, so if you want + to immediately put it back in, you'll have to do that in a + `nextTick` or `setTimeout` callback or it won't do anything. +* `stale` By default, if you set a `maxAge`, it'll only actually pull + stale items out of the cache when you `get(key)`. (That is, it's + not pre-emptively doing a `setTimeout` or anything.) If you set + `stale:true`, it'll return the stale value before deleting it. If + you don't set this, then it'll return `undefined` when you try to + get a stale entry, as if it had already been deleted. +* `noDisposeOnSet` By default, if you set a `dispose()` method, then + it'll be called whenever a `set()` operation overwrites an existing + key. If you set this option, `dispose()` will only be called when a + key falls out of the cache, not when it is overwritten. +* `updateAgeOnGet` When using time-expiring entries with `maxAge`, + setting this to `true` will make each item's effective time update + to the current time whenever it is retrieved from cache, causing it + to not expire. (It can still fall out of cache based on recency of + use, of course.) + +## API + +* `set(key, value, maxAge)` +* `get(key) => value` + + Both of these will update the "recently used"-ness of the key. + They do what you think. `maxAge` is optional and overrides the + cache `maxAge` option if provided. + + If the key is not found, `get()` will return `undefined`. + + The key and val can be any value. + +* `peek(key)` + + Returns the key value (or `undefined` if not found) without + updating the "recently used"-ness of the key. + + (If you find yourself using this a lot, you *might* be using the + wrong sort of data structure, but there are some use cases where + it's handy.) + +* `del(key)` + + Deletes a key out of the cache. + +* `reset()` + + Clear the cache entirely, throwing away all values. + +* `has(key)` + + Check if a key is in the cache, without updating the recent-ness + or deleting it for being stale. + +* `forEach(function(value,key,cache), [thisp])` + + Just like `Array.prototype.forEach`. Iterates over all the keys + in the cache, in order of recent-ness. (Ie, more recently used + items are iterated over first.) + +* `rforEach(function(value,key,cache), [thisp])` + + The same as `cache.forEach(...)` but items are iterated over in + reverse order. (ie, less recently used items are iterated over + first.) + +* `keys()` + + Return an array of the keys in the cache. + +* `values()` + + Return an array of the values in the cache. + +* `length` + + Return total length of objects in cache taking into account + `length` options function. + +* `itemCount` + + Return total quantity of objects currently in cache. Note, that + `stale` (see options) items are returned as part of this item + count. + +* `dump()` + + Return an array of the cache entries ready for serialization and usage + with 'destinationCache.load(arr)`. + +* `load(cacheEntriesArray)` + + Loads another cache entries array, obtained with `sourceCache.dump()`, + into the cache. The destination cache is reset before loading new entries + +* `prune()` + + Manually iterates over the entire cache proactively pruning old entries diff --git a/node_modules/jest-snapshot/node_modules/lru-cache/index.js b/node_modules/jest-snapshot/node_modules/lru-cache/index.js new file mode 100644 index 00000000..573b6b85 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/lru-cache/index.js @@ -0,0 +1,334 @@ +'use strict' + +// A linked list to keep track of recently-used-ness +const Yallist = require('yallist') + +const MAX = Symbol('max') +const LENGTH = Symbol('length') +const LENGTH_CALCULATOR = Symbol('lengthCalculator') +const ALLOW_STALE = Symbol('allowStale') +const MAX_AGE = Symbol('maxAge') +const DISPOSE = Symbol('dispose') +const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet') +const LRU_LIST = Symbol('lruList') +const CACHE = Symbol('cache') +const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet') + +const naiveLength = () => 1 + +// lruList is a yallist where the head is the youngest +// item, and the tail is the oldest. the list contains the Hit +// objects as the entries. +// Each Hit object has a reference to its Yallist.Node. This +// never changes. +// +// cache is a Map (or PseudoMap) that matches the keys to +// the Yallist.Node object. +class LRUCache { + constructor (options) { + if (typeof options === 'number') + options = { max: options } + + if (!options) + options = {} + + if (options.max && (typeof options.max !== 'number' || options.max < 0)) + throw new TypeError('max must be a non-negative number') + // Kind of weird to have a default max of Infinity, but oh well. + const max = this[MAX] = options.max || Infinity + + const lc = options.length || naiveLength + this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc + this[ALLOW_STALE] = options.stale || false + if (options.maxAge && typeof options.maxAge !== 'number') + throw new TypeError('maxAge must be a number') + this[MAX_AGE] = options.maxAge || 0 + this[DISPOSE] = options.dispose + this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false + this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false + this.reset() + } + + // resize the cache when the max changes. + set max (mL) { + if (typeof mL !== 'number' || mL < 0) + throw new TypeError('max must be a non-negative number') + + this[MAX] = mL || Infinity + trim(this) + } + get max () { + return this[MAX] + } + + set allowStale (allowStale) { + this[ALLOW_STALE] = !!allowStale + } + get allowStale () { + return this[ALLOW_STALE] + } + + set maxAge (mA) { + if (typeof mA !== 'number') + throw new TypeError('maxAge must be a non-negative number') + + this[MAX_AGE] = mA + trim(this) + } + get maxAge () { + return this[MAX_AGE] + } + + // resize the cache when the lengthCalculator changes. + set lengthCalculator (lC) { + if (typeof lC !== 'function') + lC = naiveLength + + if (lC !== this[LENGTH_CALCULATOR]) { + this[LENGTH_CALCULATOR] = lC + this[LENGTH] = 0 + this[LRU_LIST].forEach(hit => { + hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key) + this[LENGTH] += hit.length + }) + } + trim(this) + } + get lengthCalculator () { return this[LENGTH_CALCULATOR] } + + get length () { return this[LENGTH] } + get itemCount () { return this[LRU_LIST].length } + + rforEach (fn, thisp) { + thisp = thisp || this + for (let walker = this[LRU_LIST].tail; walker !== null;) { + const prev = walker.prev + forEachStep(this, fn, walker, thisp) + walker = prev + } + } + + forEach (fn, thisp) { + thisp = thisp || this + for (let walker = this[LRU_LIST].head; walker !== null;) { + const next = walker.next + forEachStep(this, fn, walker, thisp) + walker = next + } + } + + keys () { + return this[LRU_LIST].toArray().map(k => k.key) + } + + values () { + return this[LRU_LIST].toArray().map(k => k.value) + } + + reset () { + if (this[DISPOSE] && + this[LRU_LIST] && + this[LRU_LIST].length) { + this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value)) + } + + this[CACHE] = new Map() // hash of items by key + this[LRU_LIST] = new Yallist() // list of items in order of use recency + this[LENGTH] = 0 // length of items in the list + } + + dump () { + return this[LRU_LIST].map(hit => + isStale(this, hit) ? false : { + k: hit.key, + v: hit.value, + e: hit.now + (hit.maxAge || 0) + }).toArray().filter(h => h) + } + + dumpLru () { + return this[LRU_LIST] + } + + set (key, value, maxAge) { + maxAge = maxAge || this[MAX_AGE] + + if (maxAge && typeof maxAge !== 'number') + throw new TypeError('maxAge must be a number') + + const now = maxAge ? Date.now() : 0 + const len = this[LENGTH_CALCULATOR](value, key) + + if (this[CACHE].has(key)) { + if (len > this[MAX]) { + del(this, this[CACHE].get(key)) + return false + } + + const node = this[CACHE].get(key) + const item = node.value + + // dispose of the old one before overwriting + // split out into 2 ifs for better coverage tracking + if (this[DISPOSE]) { + if (!this[NO_DISPOSE_ON_SET]) + this[DISPOSE](key, item.value) + } + + item.now = now + item.maxAge = maxAge + item.value = value + this[LENGTH] += len - item.length + item.length = len + this.get(key) + trim(this) + return true + } + + const hit = new Entry(key, value, len, now, maxAge) + + // oversized objects fall out of cache automatically. + if (hit.length > this[MAX]) { + if (this[DISPOSE]) + this[DISPOSE](key, value) + + return false + } + + this[LENGTH] += hit.length + this[LRU_LIST].unshift(hit) + this[CACHE].set(key, this[LRU_LIST].head) + trim(this) + return true + } + + has (key) { + if (!this[CACHE].has(key)) return false + const hit = this[CACHE].get(key).value + return !isStale(this, hit) + } + + get (key) { + return get(this, key, true) + } + + peek (key) { + return get(this, key, false) + } + + pop () { + const node = this[LRU_LIST].tail + if (!node) + return null + + del(this, node) + return node.value + } + + del (key) { + del(this, this[CACHE].get(key)) + } + + load (arr) { + // reset the cache + this.reset() + + const now = Date.now() + // A previous serialized cache has the most recent items first + for (let l = arr.length - 1; l >= 0; l--) { + const hit = arr[l] + const expiresAt = hit.e || 0 + if (expiresAt === 0) + // the item was created without expiration in a non aged cache + this.set(hit.k, hit.v) + else { + const maxAge = expiresAt - now + // dont add already expired items + if (maxAge > 0) { + this.set(hit.k, hit.v, maxAge) + } + } + } + } + + prune () { + this[CACHE].forEach((value, key) => get(this, key, false)) + } +} + +const get = (self, key, doUse) => { + const node = self[CACHE].get(key) + if (node) { + const hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!self[ALLOW_STALE]) + return undefined + } else { + if (doUse) { + if (self[UPDATE_AGE_ON_GET]) + node.value.now = Date.now() + self[LRU_LIST].unshiftNode(node) + } + } + return hit.value + } +} + +const isStale = (self, hit) => { + if (!hit || (!hit.maxAge && !self[MAX_AGE])) + return false + + const diff = Date.now() - hit.now + return hit.maxAge ? diff > hit.maxAge + : self[MAX_AGE] && (diff > self[MAX_AGE]) +} + +const trim = self => { + if (self[LENGTH] > self[MAX]) { + for (let walker = self[LRU_LIST].tail; + self[LENGTH] > self[MAX] && walker !== null;) { + // We know that we're about to delete this one, and also + // what the next least recently used key will be, so just + // go ahead and set it now. + const prev = walker.prev + del(self, walker) + walker = prev + } + } +} + +const del = (self, node) => { + if (node) { + const hit = node.value + if (self[DISPOSE]) + self[DISPOSE](hit.key, hit.value) + + self[LENGTH] -= hit.length + self[CACHE].delete(hit.key) + self[LRU_LIST].removeNode(node) + } +} + +class Entry { + constructor (key, value, length, now, maxAge) { + this.key = key + this.value = value + this.length = length + this.now = now + this.maxAge = maxAge || 0 + } +} + +const forEachStep = (self, fn, node, thisp) => { + let hit = node.value + if (isStale(self, hit)) { + del(self, node) + if (!self[ALLOW_STALE]) + hit = undefined + } + if (hit) + fn.call(thisp, hit.value, hit.key, self) +} + +module.exports = LRUCache diff --git a/node_modules/jest-snapshot/node_modules/lru-cache/package.json b/node_modules/jest-snapshot/node_modules/lru-cache/package.json new file mode 100644 index 00000000..43b7502c --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/lru-cache/package.json @@ -0,0 +1,34 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "6.0.0", + "author": "Isaac Z. Schlueter ", + "keywords": [ + "mru", + "lru", + "cache" + ], + "scripts": { + "test": "tap", + "snap": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublishOnly": "git push origin --follow-tags" + }, + "main": "index.js", + "repository": "git://github.com/isaacs/node-lru-cache.git", + "devDependencies": { + "benchmark": "^2.1.4", + "tap": "^14.10.7" + }, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "files": [ + "index.js" + ], + "engines": { + "node": ">=10" + } +} diff --git a/node_modules/jest-snapshot/node_modules/semver/LICENSE b/node_modules/jest-snapshot/node_modules/semver/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/jest-snapshot/node_modules/semver/README.md b/node_modules/jest-snapshot/node_modules/semver/README.md new file mode 100644 index 00000000..53ea9b52 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/README.md @@ -0,0 +1,637 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +You can also just load the module for the function that you care about, if +you'd like to minimize your footprint. + +```js +// load the whole API at once in a single object +const semver = require('semver') + +// or just load the bits you need +// all of them listed here, just pick and choose what you want + +// classes +const SemVer = require('semver/classes/semver') +const Comparator = require('semver/classes/comparator') +const Range = require('semver/classes/range') + +// functions for working with versions +const semverParse = require('semver/functions/parse') +const semverValid = require('semver/functions/valid') +const semverClean = require('semver/functions/clean') +const semverInc = require('semver/functions/inc') +const semverDiff = require('semver/functions/diff') +const semverMajor = require('semver/functions/major') +const semverMinor = require('semver/functions/minor') +const semverPatch = require('semver/functions/patch') +const semverPrerelease = require('semver/functions/prerelease') +const semverCompare = require('semver/functions/compare') +const semverRcompare = require('semver/functions/rcompare') +const semverCompareLoose = require('semver/functions/compare-loose') +const semverCompareBuild = require('semver/functions/compare-build') +const semverSort = require('semver/functions/sort') +const semverRsort = require('semver/functions/rsort') + +// low-level comparators between versions +const semverGt = require('semver/functions/gt') +const semverLt = require('semver/functions/lt') +const semverEq = require('semver/functions/eq') +const semverNeq = require('semver/functions/neq') +const semverGte = require('semver/functions/gte') +const semverLte = require('semver/functions/lte') +const semverCmp = require('semver/functions/cmp') +const semverCoerce = require('semver/functions/coerce') + +// working with ranges +const semverSatisfies = require('semver/functions/satisfies') +const semverMaxSatisfying = require('semver/ranges/max-satisfying') +const semverMinSatisfying = require('semver/ranges/min-satisfying') +const semverToComparators = require('semver/ranges/to-comparators') +const semverMinVersion = require('semver/ranges/min-version') +const semverValidRange = require('semver/ranges/valid') +const semverOutside = require('semver/ranges/outside') +const semverGtr = require('semver/ranges/gtr') +const semverLtr = require('semver/ranges/ltr') +const semverIntersects = require('semver/ranges/intersects') +const simplifyRange = require('semver/ranges/simplify') +const rangeSubset = require('semver/ranges/subset') +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-n <0|1> + This is the base to be used for the prerelease identifier. + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and +would match the versions `2.0.0` and `3.1.0`, but not the versions +`1.0.1` or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +#### Prerelease Identifier Base + +The method `.inc` takes an optional parameter 'identifierBase' string +that will let you let your prerelease number as zero-based or one-based. +Set to `false` to omit the prerelease number altogether. +If you do not specify this parameter, it will default to zero-based. + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta', '1') +// '1.2.4-beta.1' +``` + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta', false) +// '1.2.4-beta' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta -n 1 +1.2.4-beta.1 +``` + +```bash +$ semver 1.2.3 -i prerelease --preid beta -n false +1.2.4-beta +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless + `includePrerelease` is specified, in which case any version at all + satisfies) +* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero element in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0-0` +* `^0.2.3` := `>=0.2.3 <0.3.0-0` +* `^0.0.3` := `>=0.0.3 <0.0.4-0` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0-0` +* `^0.0.x` := `>=0.0.0 <0.1.0-0` +* `^0.0` := `>=0.0.0 <0.1.0-0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0-0` +* `^0.x` := `>=0.0.0 <1.0.0-0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect +* `simplifyRange(versions, range)`: Return a "simplified" range that + matches the same items in `versions` list as the range specified. Note + that it does *not* guarantee that it would match the same versions in all + cases, only for the set of versions provided. This is useful when + generating ranges by joining together multiple versions with `||` + programmatically, to provide the user with something a bit more + ergonomic. If the provided range is shorter in string-length than the + generated range, then that is returned. +* `subset(subRange, superRange)`: Return `true` if the `subRange` range is + entirely contained by the `superRange` range. + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version, options)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided +version is not valid a null will be returned. This does not work for +ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `2.1.5` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` + +## Constants + +As a convenience, helper constants are exported to provide information about what `node-semver` supports: + +### `RELEASE_TYPES` + +- major +- premajor +- minor +- preminor +- patch +- prepatch +- prerelease + +``` +const semver = require('semver'); + +if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) { + console.log('This is a valid release type!'); +} else { + console.warn('This is NOT a valid release type!'); +} +``` + +### `SEMVER_SPEC_VERSION` + +2.0.0 + +``` +const semver = require('semver'); + +console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION); +``` + +## Exported Modules + + + +You may pull in just the part of this semver utility that you need, if you +are sensitive to packing and tree-shaking concerns. The main +`require('semver')` export uses getter functions to lazily load the parts +of the API that are used. + +The following modules are available: + +* `require('semver')` +* `require('semver/classes')` +* `require('semver/classes/comparator')` +* `require('semver/classes/range')` +* `require('semver/classes/semver')` +* `require('semver/functions/clean')` +* `require('semver/functions/cmp')` +* `require('semver/functions/coerce')` +* `require('semver/functions/compare')` +* `require('semver/functions/compare-build')` +* `require('semver/functions/compare-loose')` +* `require('semver/functions/diff')` +* `require('semver/functions/eq')` +* `require('semver/functions/gt')` +* `require('semver/functions/gte')` +* `require('semver/functions/inc')` +* `require('semver/functions/lt')` +* `require('semver/functions/lte')` +* `require('semver/functions/major')` +* `require('semver/functions/minor')` +* `require('semver/functions/neq')` +* `require('semver/functions/parse')` +* `require('semver/functions/patch')` +* `require('semver/functions/prerelease')` +* `require('semver/functions/rcompare')` +* `require('semver/functions/rsort')` +* `require('semver/functions/satisfies')` +* `require('semver/functions/sort')` +* `require('semver/functions/valid')` +* `require('semver/ranges/gtr')` +* `require('semver/ranges/intersects')` +* `require('semver/ranges/ltr')` +* `require('semver/ranges/max-satisfying')` +* `require('semver/ranges/min-satisfying')` +* `require('semver/ranges/min-version')` +* `require('semver/ranges/outside')` +* `require('semver/ranges/to-comparators')` +* `require('semver/ranges/valid')` + diff --git a/node_modules/jest-snapshot/node_modules/semver/bin/semver.js b/node_modules/jest-snapshot/node_modules/semver/bin/semver.js new file mode 100644 index 00000000..242b7ade --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/bin/semver.js @@ -0,0 +1,197 @@ +#!/usr/bin/env node +// Standalone semver comparison program. +// Exits successfully and prints matching version(s) if +// any supplied version is valid and passes all tests. + +const argv = process.argv.slice(2) + +let versions = [] + +const range = [] + +let inc = null + +const version = require('../package.json').version + +let loose = false + +let includePrerelease = false + +let coerce = false + +let rtl = false + +let identifier + +let identifierBase + +const semver = require('../') +const parseOptions = require('../internal/parse-options') + +let reverse = false + +let options = {} + +const main = () => { + if (!argv.length) { + return help() + } + while (argv.length) { + let a = argv.shift() + const indexOfEqualSign = a.indexOf('=') + if (indexOfEqualSign !== -1) { + const value = a.slice(indexOfEqualSign + 1) + a = a.slice(0, indexOfEqualSign) + argv.unshift(value) + } + switch (a) { + case '-rv': case '-rev': case '--rev': case '--reverse': + reverse = true + break + case '-l': case '--loose': + loose = true + break + case '-p': case '--include-prerelease': + includePrerelease = true + break + case '-v': case '--version': + versions.push(argv.shift()) + break + case '-i': case '--inc': case '--increment': + switch (argv[0]) { + case 'major': case 'minor': case 'patch': case 'prerelease': + case 'premajor': case 'preminor': case 'prepatch': + inc = argv.shift() + break + default: + inc = 'patch' + break + } + break + case '--preid': + identifier = argv.shift() + break + case '-r': case '--range': + range.push(argv.shift()) + break + case '-n': + identifierBase = argv.shift() + if (identifierBase === 'false') { + identifierBase = false + } + break + case '-c': case '--coerce': + coerce = true + break + case '--rtl': + rtl = true + break + case '--ltr': + rtl = false + break + case '-h': case '--help': case '-?': + return help() + default: + versions.push(a) + break + } + } + + options = parseOptions({ loose, includePrerelease, rtl }) + + versions = versions.map((v) => { + return coerce ? (semver.coerce(v, options) || { version: v }).version : v + }).filter((v) => { + return semver.valid(v) + }) + if (!versions.length) { + return fail() + } + if (inc && (versions.length !== 1 || range.length)) { + return failInc() + } + + for (let i = 0, l = range.length; i < l; i++) { + versions = versions.filter((v) => { + return semver.satisfies(v, range[i], options) + }) + if (!versions.length) { + return fail() + } + } + return success(versions) +} + +const failInc = () => { + console.error('--inc can only be used on a single version with no range') + fail() +} + +const fail = () => process.exit(1) + +const success = () => { + const compare = reverse ? 'rcompare' : 'compare' + versions.sort((a, b) => { + return semver[compare](a, b, options) + }).map((v) => { + return semver.clean(v, options) + }).map((v) => { + return inc ? semver.inc(v, inc, options, identifier, identifierBase) : v + }).forEach((v, i, _) => { + console.log(v) + }) +} + +const help = () => console.log( +`SemVer ${version} + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +-n + Base number to be used for the prerelease identifier. + Can be either 0 or 1, or false to omit the number altogether. + Defaults to 0. + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them.`) + +main() diff --git a/node_modules/jest-snapshot/node_modules/semver/classes/comparator.js b/node_modules/jest-snapshot/node_modules/semver/classes/comparator.js new file mode 100644 index 00000000..3d39c0ee --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/classes/comparator.js @@ -0,0 +1,141 @@ +const ANY = Symbol('SemVer ANY') +// hoisted class for cyclic dependency +class Comparator { + static get ANY () { + return ANY + } + + constructor (comp, options) { + options = parseOptions(options) + + if (comp instanceof Comparator) { + if (comp.loose === !!options.loose) { + return comp + } else { + comp = comp.value + } + } + + comp = comp.trim().split(/\s+/).join(' ') + debug('comparator', comp, options) + this.options = options + this.loose = !!options.loose + this.parse(comp) + + if (this.semver === ANY) { + this.value = '' + } else { + this.value = this.operator + this.semver.version + } + + debug('comp', this) + } + + parse (comp) { + const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR] + const m = comp.match(r) + + if (!m) { + throw new TypeError(`Invalid comparator: ${comp}`) + } + + this.operator = m[1] !== undefined ? m[1] : '' + if (this.operator === '=') { + this.operator = '' + } + + // if it literally is just '>' or '' then allow anything. + if (!m[2]) { + this.semver = ANY + } else { + this.semver = new SemVer(m[2], this.options.loose) + } + } + + toString () { + return this.value + } + + test (version) { + debug('Comparator.test', version, this.options.loose) + + if (this.semver === ANY || version === ANY) { + return true + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + return cmp(version, this.operator, this.semver, this.options) + } + + intersects (comp, options) { + if (!(comp instanceof Comparator)) { + throw new TypeError('a Comparator is required') + } + + if (this.operator === '') { + if (this.value === '') { + return true + } + return new Range(comp.value, options).test(this.value) + } else if (comp.operator === '') { + if (comp.value === '') { + return true + } + return new Range(this.value, options).test(comp.semver) + } + + options = parseOptions(options) + + // Special cases where nothing can possibly be lower + if (options.includePrerelease && + (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) { + return false + } + if (!options.includePrerelease && + (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) { + return false + } + + // Same direction increasing (> or >=) + if (this.operator.startsWith('>') && comp.operator.startsWith('>')) { + return true + } + // Same direction decreasing (< or <=) + if (this.operator.startsWith('<') && comp.operator.startsWith('<')) { + return true + } + // same SemVer and both sides are inclusive (<= or >=) + if ( + (this.semver.version === comp.semver.version) && + this.operator.includes('=') && comp.operator.includes('=')) { + return true + } + // opposite directions less than + if (cmp(this.semver, '<', comp.semver, options) && + this.operator.startsWith('>') && comp.operator.startsWith('<')) { + return true + } + // opposite directions greater than + if (cmp(this.semver, '>', comp.semver, options) && + this.operator.startsWith('<') && comp.operator.startsWith('>')) { + return true + } + return false + } +} + +module.exports = Comparator + +const parseOptions = require('../internal/parse-options') +const { safeRe: re, t } = require('../internal/re') +const cmp = require('../functions/cmp') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const Range = require('./range') diff --git a/node_modules/jest-snapshot/node_modules/semver/classes/index.js b/node_modules/jest-snapshot/node_modules/semver/classes/index.js new file mode 100644 index 00000000..5e3f5c9b --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/classes/index.js @@ -0,0 +1,5 @@ +module.exports = { + SemVer: require('./semver.js'), + Range: require('./range.js'), + Comparator: require('./comparator.js'), +} diff --git a/node_modules/jest-snapshot/node_modules/semver/classes/range.js b/node_modules/jest-snapshot/node_modules/semver/classes/range.js new file mode 100644 index 00000000..7e7c4141 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/classes/range.js @@ -0,0 +1,539 @@ +// hoisted class for cyclic dependency +class Range { + constructor (range, options) { + options = parseOptions(options) + + if (range instanceof Range) { + if ( + range.loose === !!options.loose && + range.includePrerelease === !!options.includePrerelease + ) { + return range + } else { + return new Range(range.raw, options) + } + } + + if (range instanceof Comparator) { + // just put it in the set and return + this.raw = range.value + this.set = [[range]] + this.format() + return this + } + + this.options = options + this.loose = !!options.loose + this.includePrerelease = !!options.includePrerelease + + // First reduce all whitespace as much as possible so we do not have to rely + // on potentially slow regexes like \s*. This is then stored and used for + // future error messages as well. + this.raw = range + .trim() + .split(/\s+/) + .join(' ') + + // First, split on || + this.set = this.raw + .split('||') + // map the range to a 2d array of comparators + .map(r => this.parseRange(r.trim())) + // throw out any comparator lists that are empty + // this generally means that it was not a valid range, which is allowed + // in loose mode, but will still throw if the WHOLE range is invalid. + .filter(c => c.length) + + if (!this.set.length) { + throw new TypeError(`Invalid SemVer Range: ${this.raw}`) + } + + // if we have any that are not the null set, throw out null sets. + if (this.set.length > 1) { + // keep the first one, in case they're all null sets + const first = this.set[0] + this.set = this.set.filter(c => !isNullSet(c[0])) + if (this.set.length === 0) { + this.set = [first] + } else if (this.set.length > 1) { + // if we have any that are *, then the range is just * + for (const c of this.set) { + if (c.length === 1 && isAny(c[0])) { + this.set = [c] + break + } + } + } + } + + this.format() + } + + format () { + this.range = this.set + .map((comps) => comps.join(' ').trim()) + .join('||') + .trim() + return this.range + } + + toString () { + return this.range + } + + parseRange (range) { + // memoize range parsing for performance. + // this is a very hot path, and fully deterministic. + const memoOpts = + (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | + (this.options.loose && FLAG_LOOSE) + const memoKey = memoOpts + ':' + range + const cached = cache.get(memoKey) + if (cached) { + return cached + } + + const loose = this.options.loose + // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4` + const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE] + range = range.replace(hr, hyphenReplace(this.options.includePrerelease)) + debug('hyphen replace', range) + + // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5` + range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace) + debug('comparator trim', range) + + // `~ 1.2.3` => `~1.2.3` + range = range.replace(re[t.TILDETRIM], tildeTrimReplace) + debug('tilde trim', range) + + // `^ 1.2.3` => `^1.2.3` + range = range.replace(re[t.CARETTRIM], caretTrimReplace) + debug('caret trim', range) + + // At this point, the range is completely trimmed and + // ready to be split into comparators. + + let rangeList = range + .split(' ') + .map(comp => parseComparator(comp, this.options)) + .join(' ') + .split(/\s+/) + // >=0.0.0 is equivalent to * + .map(comp => replaceGTE0(comp, this.options)) + + if (loose) { + // in loose mode, throw out any that are not valid comparators + rangeList = rangeList.filter(comp => { + debug('loose invalid filter', comp, this.options) + return !!comp.match(re[t.COMPARATORLOOSE]) + }) + } + debug('range list', rangeList) + + // if any comparators are the null set, then replace with JUST null set + // if more than one comparator, remove any * comparators + // also, don't include the same comparator more than once + const rangeMap = new Map() + const comparators = rangeList.map(comp => new Comparator(comp, this.options)) + for (const comp of comparators) { + if (isNullSet(comp)) { + return [comp] + } + rangeMap.set(comp.value, comp) + } + if (rangeMap.size > 1 && rangeMap.has('')) { + rangeMap.delete('') + } + + const result = [...rangeMap.values()] + cache.set(memoKey, result) + return result + } + + intersects (range, options) { + if (!(range instanceof Range)) { + throw new TypeError('a Range is required') + } + + return this.set.some((thisComparators) => { + return ( + isSatisfiable(thisComparators, options) && + range.set.some((rangeComparators) => { + return ( + isSatisfiable(rangeComparators, options) && + thisComparators.every((thisComparator) => { + return rangeComparators.every((rangeComparator) => { + return thisComparator.intersects(rangeComparator, options) + }) + }) + ) + }) + ) + }) + } + + // if ANY of the sets match ALL of its comparators, then pass + test (version) { + if (!version) { + return false + } + + if (typeof version === 'string') { + try { + version = new SemVer(version, this.options) + } catch (er) { + return false + } + } + + for (let i = 0; i < this.set.length; i++) { + if (testSet(this.set[i], version, this.options)) { + return true + } + } + return false + } +} + +module.exports = Range + +const LRU = require('lru-cache') +const cache = new LRU({ max: 1000 }) + +const parseOptions = require('../internal/parse-options') +const Comparator = require('./comparator') +const debug = require('../internal/debug') +const SemVer = require('./semver') +const { + safeRe: re, + t, + comparatorTrimReplace, + tildeTrimReplace, + caretTrimReplace, +} = require('../internal/re') +const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants') + +const isNullSet = c => c.value === '<0.0.0-0' +const isAny = c => c.value === '' + +// take a set of comparators and determine whether there +// exists a version which can satisfy it +const isSatisfiable = (comparators, options) => { + let result = true + const remainingComparators = comparators.slice() + let testComparator = remainingComparators.pop() + + while (result && remainingComparators.length) { + result = remainingComparators.every((otherComparator) => { + return testComparator.intersects(otherComparator, options) + }) + + testComparator = remainingComparators.pop() + } + + return result +} + +// comprised of xranges, tildes, stars, and gtlt's at this point. +// already replaced the hyphen ranges +// turn into a set of JUST comparators. +const parseComparator = (comp, options) => { + debug('comp', comp, options) + comp = replaceCarets(comp, options) + debug('caret', comp) + comp = replaceTildes(comp, options) + debug('tildes', comp) + comp = replaceXRanges(comp, options) + debug('xrange', comp) + comp = replaceStars(comp, options) + debug('stars', comp) + return comp +} + +const isX = id => !id || id.toLowerCase() === 'x' || id === '*' + +// ~, ~> --> * (any, kinda silly) +// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0 +// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0 +// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0 +// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0 +// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0 +// ~0.0.1 --> >=0.0.1 <0.1.0-0 +const replaceTildes = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceTilde(c, options)) + .join(' ') +} + +const replaceTilde = (comp, options) => { + const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE] + return comp.replace(r, (_, M, m, p, pr) => { + debug('tilde', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0 <${+M + 1}.0.0-0` + } else if (isX(p)) { + // ~1.2 == >=1.2.0 <1.3.0-0 + ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` + } else if (pr) { + debug('replaceTilde pr', pr) + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } else { + // ~1.2.3 == >=1.2.3 <1.3.0-0 + ret = `>=${M}.${m}.${p + } <${M}.${+m + 1}.0-0` + } + + debug('tilde return', ret) + return ret + }) +} + +// ^ --> * (any, kinda silly) +// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0 +// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0 +// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0 +// ^1.2.3 --> >=1.2.3 <2.0.0-0 +// ^1.2.0 --> >=1.2.0 <2.0.0-0 +// ^0.0.1 --> >=0.0.1 <0.0.2-0 +// ^0.1.0 --> >=0.1.0 <0.2.0-0 +const replaceCarets = (comp, options) => { + return comp + .trim() + .split(/\s+/) + .map((c) => replaceCaret(c, options)) + .join(' ') +} + +const replaceCaret = (comp, options) => { + debug('caret', comp, options) + const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET] + const z = options.includePrerelease ? '-0' : '' + return comp.replace(r, (_, M, m, p, pr) => { + debug('caret', comp, _, M, m, p, pr) + let ret + + if (isX(M)) { + ret = '' + } else if (isX(m)) { + ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` + } else if (isX(p)) { + if (M === '0') { + ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` + } else { + ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` + } + } else if (pr) { + debug('replaceCaret pr', pr) + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p}-${pr + } <${+M + 1}.0.0-0` + } + } else { + debug('no pr') + if (M === '0') { + if (m === '0') { + ret = `>=${M}.${m}.${p + }${z} <${M}.${m}.${+p + 1}-0` + } else { + ret = `>=${M}.${m}.${p + }${z} <${M}.${+m + 1}.0-0` + } + } else { + ret = `>=${M}.${m}.${p + } <${+M + 1}.0.0-0` + } + } + + debug('caret return', ret) + return ret + }) +} + +const replaceXRanges = (comp, options) => { + debug('replaceXRanges', comp, options) + return comp + .split(/\s+/) + .map((c) => replaceXRange(c, options)) + .join(' ') +} + +const replaceXRange = (comp, options) => { + comp = comp.trim() + const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE] + return comp.replace(r, (ret, gtlt, M, m, p, pr) => { + debug('xRange', comp, ret, gtlt, M, m, p, pr) + const xM = isX(M) + const xm = xM || isX(m) + const xp = xm || isX(p) + const anyX = xp + + if (gtlt === '=' && anyX) { + gtlt = '' + } + + // if we're including prereleases in the match, then we need + // to fix this to -0, the lowest possible prerelease value + pr = options.includePrerelease ? '-0' : '' + + if (xM) { + if (gtlt === '>' || gtlt === '<') { + // nothing is allowed + ret = '<0.0.0-0' + } else { + // nothing is forbidden + ret = '*' + } + } else if (gtlt && anyX) { + // we know patch is an x, because we have any x at all. + // replace X with 0 + if (xm) { + m = 0 + } + p = 0 + + if (gtlt === '>') { + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + gtlt = '>=' + if (xm) { + M = +M + 1 + m = 0 + p = 0 + } else { + m = +m + 1 + p = 0 + } + } else if (gtlt === '<=') { + // <=0.7.x is actually <0.8.0, since any 0.7.x should + // pass. Similarly, <=7.x is actually <8.0.0, etc. + gtlt = '<' + if (xm) { + M = +M + 1 + } else { + m = +m + 1 + } + } + + if (gtlt === '<') { + pr = '-0' + } + + ret = `${gtlt + M}.${m}.${p}${pr}` + } else if (xm) { + ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` + } else if (xp) { + ret = `>=${M}.${m}.0${pr + } <${M}.${+m + 1}.0-0` + } + + debug('xRange return', ret) + + return ret + }) +} + +// Because * is AND-ed with everything else in the comparator, +// and '' means "any version", just remove the *s entirely. +const replaceStars = (comp, options) => { + debug('replaceStars', comp, options) + // Looseness is ignored here. star is always as loose as it gets! + return comp + .trim() + .replace(re[t.STAR], '') +} + +const replaceGTE0 = (comp, options) => { + debug('replaceGTE0', comp, options) + return comp + .trim() + .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '') +} + +// This function is passed to string.replace(re[t.HYPHENRANGE]) +// M, m, patch, prerelease, build +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0-0 +const hyphenReplace = incPr => ($0, + from, fM, fm, fp, fpr, fb, + to, tM, tm, tp, tpr, tb) => { + if (isX(fM)) { + from = '' + } else if (isX(fm)) { + from = `>=${fM}.0.0${incPr ? '-0' : ''}` + } else if (isX(fp)) { + from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}` + } else if (fpr) { + from = `>=${from}` + } else { + from = `>=${from}${incPr ? '-0' : ''}` + } + + if (isX(tM)) { + to = '' + } else if (isX(tm)) { + to = `<${+tM + 1}.0.0-0` + } else if (isX(tp)) { + to = `<${tM}.${+tm + 1}.0-0` + } else if (tpr) { + to = `<=${tM}.${tm}.${tp}-${tpr}` + } else if (incPr) { + to = `<${tM}.${tm}.${+tp + 1}-0` + } else { + to = `<=${to}` + } + + return `${from} ${to}`.trim() +} + +const testSet = (set, version, options) => { + for (let i = 0; i < set.length; i++) { + if (!set[i].test(version)) { + return false + } + } + + if (version.prerelease.length && !options.includePrerelease) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (let i = 0; i < set.length; i++) { + debug(set[i].semver) + if (set[i].semver === Comparator.ANY) { + continue + } + + if (set[i].semver.prerelease.length > 0) { + const allowed = set[i].semver + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) { + return true + } + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false + } + + return true +} diff --git a/node_modules/jest-snapshot/node_modules/semver/classes/semver.js b/node_modules/jest-snapshot/node_modules/semver/classes/semver.js new file mode 100644 index 00000000..84e84590 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/classes/semver.js @@ -0,0 +1,302 @@ +const debug = require('../internal/debug') +const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants') +const { safeRe: re, t } = require('../internal/re') + +const parseOptions = require('../internal/parse-options') +const { compareIdentifiers } = require('../internal/identifiers') +class SemVer { + constructor (version, options) { + options = parseOptions(options) + + if (version instanceof SemVer) { + if (version.loose === !!options.loose && + version.includePrerelease === !!options.includePrerelease) { + return version + } else { + version = version.version + } + } else if (typeof version !== 'string') { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`) + } + + if (version.length > MAX_LENGTH) { + throw new TypeError( + `version is longer than ${MAX_LENGTH} characters` + ) + } + + debug('SemVer', version, options) + this.options = options + this.loose = !!options.loose + // this isn't actually relevant for versions, but keep it so that we + // don't run into trouble passing this.options around. + this.includePrerelease = !!options.includePrerelease + + const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]) + + if (!m) { + throw new TypeError(`Invalid Version: ${version}`) + } + + this.raw = version + + // these are actually numbers + this.major = +m[1] + this.minor = +m[2] + this.patch = +m[3] + + if (this.major > MAX_SAFE_INTEGER || this.major < 0) { + throw new TypeError('Invalid major version') + } + + if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) { + throw new TypeError('Invalid minor version') + } + + if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) { + throw new TypeError('Invalid patch version') + } + + // numberify any prerelease numeric ids + if (!m[4]) { + this.prerelease = [] + } else { + this.prerelease = m[4].split('.').map((id) => { + if (/^[0-9]+$/.test(id)) { + const num = +id + if (num >= 0 && num < MAX_SAFE_INTEGER) { + return num + } + } + return id + }) + } + + this.build = m[5] ? m[5].split('.') : [] + this.format() + } + + format () { + this.version = `${this.major}.${this.minor}.${this.patch}` + if (this.prerelease.length) { + this.version += `-${this.prerelease.join('.')}` + } + return this.version + } + + toString () { + return this.version + } + + compare (other) { + debug('SemVer.compare', this.version, this.options, other) + if (!(other instanceof SemVer)) { + if (typeof other === 'string' && other === this.version) { + return 0 + } + other = new SemVer(other, this.options) + } + + if (other.version === this.version) { + return 0 + } + + return this.compareMain(other) || this.comparePre(other) + } + + compareMain (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + return ( + compareIdentifiers(this.major, other.major) || + compareIdentifiers(this.minor, other.minor) || + compareIdentifiers(this.patch, other.patch) + ) + } + + comparePre (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + // NOT having a prerelease is > having one + if (this.prerelease.length && !other.prerelease.length) { + return -1 + } else if (!this.prerelease.length && other.prerelease.length) { + return 1 + } else if (!this.prerelease.length && !other.prerelease.length) { + return 0 + } + + let i = 0 + do { + const a = this.prerelease[i] + const b = other.prerelease[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + compareBuild (other) { + if (!(other instanceof SemVer)) { + other = new SemVer(other, this.options) + } + + let i = 0 + do { + const a = this.build[i] + const b = other.build[i] + debug('prerelease compare', i, a, b) + if (a === undefined && b === undefined) { + return 0 + } else if (b === undefined) { + return 1 + } else if (a === undefined) { + return -1 + } else if (a === b) { + continue + } else { + return compareIdentifiers(a, b) + } + } while (++i) + } + + // preminor will bump the version up to the next minor release, and immediately + // down to pre-release. premajor and prepatch work the same way. + inc (release, identifier, identifierBase) { + switch (release) { + case 'premajor': + this.prerelease.length = 0 + this.patch = 0 + this.minor = 0 + this.major++ + this.inc('pre', identifier, identifierBase) + break + case 'preminor': + this.prerelease.length = 0 + this.patch = 0 + this.minor++ + this.inc('pre', identifier, identifierBase) + break + case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0 + this.inc('patch', identifier, identifierBase) + this.inc('pre', identifier, identifierBase) + break + // If the input is a non-prerelease version, this acts the same as + // prepatch. + case 'prerelease': + if (this.prerelease.length === 0) { + this.inc('patch', identifier, identifierBase) + } + this.inc('pre', identifier, identifierBase) + break + + case 'major': + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if ( + this.minor !== 0 || + this.patch !== 0 || + this.prerelease.length === 0 + ) { + this.major++ + } + this.minor = 0 + this.patch = 0 + this.prerelease = [] + break + case 'minor': + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) { + this.minor++ + } + this.patch = 0 + this.prerelease = [] + break + case 'patch': + // If this is not a pre-release version, it will increment the patch. + // If it is a pre-release it will bump up to the same patch version. + // 1.2.0-5 patches to 1.2.0 + // 1.2.0 patches to 1.2.1 + if (this.prerelease.length === 0) { + this.patch++ + } + this.prerelease = [] + break + // This probably shouldn't be used publicly. + // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. + case 'pre': { + const base = Number(identifierBase) ? 1 : 0 + + if (!identifier && identifierBase === false) { + throw new Error('invalid increment argument: identifier is empty') + } + + if (this.prerelease.length === 0) { + this.prerelease = [base] + } else { + let i = this.prerelease.length + while (--i >= 0) { + if (typeof this.prerelease[i] === 'number') { + this.prerelease[i]++ + i = -2 + } + } + if (i === -1) { + // didn't increment anything + if (identifier === this.prerelease.join('.') && identifierBase === false) { + throw new Error('invalid increment argument: identifier already exists') + } + this.prerelease.push(base) + } + } + if (identifier) { + // 1.2.0-beta.1 bumps to 1.2.0-beta.2, + // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 + let prerelease = [identifier, base] + if (identifierBase === false) { + prerelease = [identifier] + } + if (compareIdentifiers(this.prerelease[0], identifier) === 0) { + if (isNaN(this.prerelease[1])) { + this.prerelease = prerelease + } + } else { + this.prerelease = prerelease + } + } + break + } + default: + throw new Error(`invalid increment argument: ${release}`) + } + this.raw = this.format() + if (this.build.length) { + this.raw += `+${this.build.join('.')}` + } + return this + } +} + +module.exports = SemVer diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/clean.js b/node_modules/jest-snapshot/node_modules/semver/functions/clean.js new file mode 100644 index 00000000..811fe6b8 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/clean.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const clean = (version, options) => { + const s = parse(version.trim().replace(/^[=v]+/, ''), options) + return s ? s.version : null +} +module.exports = clean diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/cmp.js b/node_modules/jest-snapshot/node_modules/semver/functions/cmp.js new file mode 100644 index 00000000..40119094 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/cmp.js @@ -0,0 +1,52 @@ +const eq = require('./eq') +const neq = require('./neq') +const gt = require('./gt') +const gte = require('./gte') +const lt = require('./lt') +const lte = require('./lte') + +const cmp = (a, op, b, loose) => { + switch (op) { + case '===': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a === b + + case '!==': + if (typeof a === 'object') { + a = a.version + } + if (typeof b === 'object') { + b = b.version + } + return a !== b + + case '': + case '=': + case '==': + return eq(a, b, loose) + + case '!=': + return neq(a, b, loose) + + case '>': + return gt(a, b, loose) + + case '>=': + return gte(a, b, loose) + + case '<': + return lt(a, b, loose) + + case '<=': + return lte(a, b, loose) + + default: + throw new TypeError(`Invalid operator: ${op}`) + } +} +module.exports = cmp diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/coerce.js b/node_modules/jest-snapshot/node_modules/semver/functions/coerce.js new file mode 100644 index 00000000..febbff9c --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/coerce.js @@ -0,0 +1,52 @@ +const SemVer = require('../classes/semver') +const parse = require('./parse') +const { safeRe: re, t } = require('../internal/re') + +const coerce = (version, options) => { + if (version instanceof SemVer) { + return version + } + + if (typeof version === 'number') { + version = String(version) + } + + if (typeof version !== 'string') { + return null + } + + options = options || {} + + let match = null + if (!options.rtl) { + match = version.match(re[t.COERCE]) + } else { + // Find the right-most coercible string that does not share + // a terminus with a more left-ward coercible string. + // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4' + // + // Walk through the string checking with a /g regexp + // Manually set the index so as to pick up overlapping matches. + // Stop when we get a match that ends at the string end, since no + // coercible string can be more right-ward without the same terminus. + let next + while ((next = re[t.COERCERTL].exec(version)) && + (!match || match.index + match[0].length !== version.length) + ) { + if (!match || + next.index + next[0].length !== match.index + match[0].length) { + match = next + } + re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length + } + // leave it in a clean state + re[t.COERCERTL].lastIndex = -1 + } + + if (match === null) { + return null + } + + return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options) +} +module.exports = coerce diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/compare-build.js b/node_modules/jest-snapshot/node_modules/semver/functions/compare-build.js new file mode 100644 index 00000000..9eb881be --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/compare-build.js @@ -0,0 +1,7 @@ +const SemVer = require('../classes/semver') +const compareBuild = (a, b, loose) => { + const versionA = new SemVer(a, loose) + const versionB = new SemVer(b, loose) + return versionA.compare(versionB) || versionA.compareBuild(versionB) +} +module.exports = compareBuild diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/compare-loose.js b/node_modules/jest-snapshot/node_modules/semver/functions/compare-loose.js new file mode 100644 index 00000000..4881fbe0 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/compare-loose.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const compareLoose = (a, b) => compare(a, b, true) +module.exports = compareLoose diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/compare.js b/node_modules/jest-snapshot/node_modules/semver/functions/compare.js new file mode 100644 index 00000000..748b7afa --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/compare.js @@ -0,0 +1,5 @@ +const SemVer = require('../classes/semver') +const compare = (a, b, loose) => + new SemVer(a, loose).compare(new SemVer(b, loose)) + +module.exports = compare diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/diff.js b/node_modules/jest-snapshot/node_modules/semver/functions/diff.js new file mode 100644 index 00000000..fc224e30 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/diff.js @@ -0,0 +1,65 @@ +const parse = require('./parse.js') + +const diff = (version1, version2) => { + const v1 = parse(version1, null, true) + const v2 = parse(version2, null, true) + const comparison = v1.compare(v2) + + if (comparison === 0) { + return null + } + + const v1Higher = comparison > 0 + const highVersion = v1Higher ? v1 : v2 + const lowVersion = v1Higher ? v2 : v1 + const highHasPre = !!highVersion.prerelease.length + const lowHasPre = !!lowVersion.prerelease.length + + if (lowHasPre && !highHasPre) { + // Going from prerelease -> no prerelease requires some special casing + + // If the low version has only a major, then it will always be a major + // Some examples: + // 1.0.0-1 -> 1.0.0 + // 1.0.0-1 -> 1.1.1 + // 1.0.0-1 -> 2.0.0 + if (!lowVersion.patch && !lowVersion.minor) { + return 'major' + } + + // Otherwise it can be determined by checking the high version + + if (highVersion.patch) { + // anything higher than a patch bump would result in the wrong version + return 'patch' + } + + if (highVersion.minor) { + // anything higher than a minor bump would result in the wrong version + return 'minor' + } + + // bumping major/minor/patch all have same result + return 'major' + } + + // add the `pre` prefix if we are going to a prerelease version + const prefix = highHasPre ? 'pre' : '' + + if (v1.major !== v2.major) { + return prefix + 'major' + } + + if (v1.minor !== v2.minor) { + return prefix + 'minor' + } + + if (v1.patch !== v2.patch) { + return prefix + 'patch' + } + + // high and low are preleases + return 'prerelease' +} + +module.exports = diff diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/eq.js b/node_modules/jest-snapshot/node_modules/semver/functions/eq.js new file mode 100644 index 00000000..271fed97 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/eq.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const eq = (a, b, loose) => compare(a, b, loose) === 0 +module.exports = eq diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/gt.js b/node_modules/jest-snapshot/node_modules/semver/functions/gt.js new file mode 100644 index 00000000..d9b2156d --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/gt.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const gt = (a, b, loose) => compare(a, b, loose) > 0 +module.exports = gt diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/gte.js b/node_modules/jest-snapshot/node_modules/semver/functions/gte.js new file mode 100644 index 00000000..5aeaa634 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/gte.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const gte = (a, b, loose) => compare(a, b, loose) >= 0 +module.exports = gte diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/inc.js b/node_modules/jest-snapshot/node_modules/semver/functions/inc.js new file mode 100644 index 00000000..7670b1be --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/inc.js @@ -0,0 +1,19 @@ +const SemVer = require('../classes/semver') + +const inc = (version, release, options, identifier, identifierBase) => { + if (typeof (options) === 'string') { + identifierBase = identifier + identifier = options + options = undefined + } + + try { + return new SemVer( + version instanceof SemVer ? version.version : version, + options + ).inc(release, identifier, identifierBase).version + } catch (er) { + return null + } +} +module.exports = inc diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/lt.js b/node_modules/jest-snapshot/node_modules/semver/functions/lt.js new file mode 100644 index 00000000..b440ab7d --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/lt.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const lt = (a, b, loose) => compare(a, b, loose) < 0 +module.exports = lt diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/lte.js b/node_modules/jest-snapshot/node_modules/semver/functions/lte.js new file mode 100644 index 00000000..6dcc9565 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/lte.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const lte = (a, b, loose) => compare(a, b, loose) <= 0 +module.exports = lte diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/major.js b/node_modules/jest-snapshot/node_modules/semver/functions/major.js new file mode 100644 index 00000000..4283165e --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/major.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const major = (a, loose) => new SemVer(a, loose).major +module.exports = major diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/minor.js b/node_modules/jest-snapshot/node_modules/semver/functions/minor.js new file mode 100644 index 00000000..57b3455f --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/minor.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const minor = (a, loose) => new SemVer(a, loose).minor +module.exports = minor diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/neq.js b/node_modules/jest-snapshot/node_modules/semver/functions/neq.js new file mode 100644 index 00000000..f944c015 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/neq.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const neq = (a, b, loose) => compare(a, b, loose) !== 0 +module.exports = neq diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/parse.js b/node_modules/jest-snapshot/node_modules/semver/functions/parse.js new file mode 100644 index 00000000..459b3b17 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/parse.js @@ -0,0 +1,16 @@ +const SemVer = require('../classes/semver') +const parse = (version, options, throwErrors = false) => { + if (version instanceof SemVer) { + return version + } + try { + return new SemVer(version, options) + } catch (er) { + if (!throwErrors) { + return null + } + throw er + } +} + +module.exports = parse diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/patch.js b/node_modules/jest-snapshot/node_modules/semver/functions/patch.js new file mode 100644 index 00000000..63afca25 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/patch.js @@ -0,0 +1,3 @@ +const SemVer = require('../classes/semver') +const patch = (a, loose) => new SemVer(a, loose).patch +module.exports = patch diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/prerelease.js b/node_modules/jest-snapshot/node_modules/semver/functions/prerelease.js new file mode 100644 index 00000000..06aa1324 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/prerelease.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const prerelease = (version, options) => { + const parsed = parse(version, options) + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null +} +module.exports = prerelease diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/rcompare.js b/node_modules/jest-snapshot/node_modules/semver/functions/rcompare.js new file mode 100644 index 00000000..0ac509e7 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/rcompare.js @@ -0,0 +1,3 @@ +const compare = require('./compare') +const rcompare = (a, b, loose) => compare(b, a, loose) +module.exports = rcompare diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/rsort.js b/node_modules/jest-snapshot/node_modules/semver/functions/rsort.js new file mode 100644 index 00000000..82404c5c --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/rsort.js @@ -0,0 +1,3 @@ +const compareBuild = require('./compare-build') +const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose)) +module.exports = rsort diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/satisfies.js b/node_modules/jest-snapshot/node_modules/semver/functions/satisfies.js new file mode 100644 index 00000000..50af1c19 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/satisfies.js @@ -0,0 +1,10 @@ +const Range = require('../classes/range') +const satisfies = (version, range, options) => { + try { + range = new Range(range, options) + } catch (er) { + return false + } + return range.test(version) +} +module.exports = satisfies diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/sort.js b/node_modules/jest-snapshot/node_modules/semver/functions/sort.js new file mode 100644 index 00000000..4d10917a --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/sort.js @@ -0,0 +1,3 @@ +const compareBuild = require('./compare-build') +const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose)) +module.exports = sort diff --git a/node_modules/jest-snapshot/node_modules/semver/functions/valid.js b/node_modules/jest-snapshot/node_modules/semver/functions/valid.js new file mode 100644 index 00000000..f27bae10 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/functions/valid.js @@ -0,0 +1,6 @@ +const parse = require('./parse') +const valid = (version, options) => { + const v = parse(version, options) + return v ? v.version : null +} +module.exports = valid diff --git a/node_modules/jest-snapshot/node_modules/semver/index.js b/node_modules/jest-snapshot/node_modules/semver/index.js new file mode 100644 index 00000000..86d42ac1 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/index.js @@ -0,0 +1,89 @@ +// just pre-load all the stuff that index.js lazily exports +const internalRe = require('./internal/re') +const constants = require('./internal/constants') +const SemVer = require('./classes/semver') +const identifiers = require('./internal/identifiers') +const parse = require('./functions/parse') +const valid = require('./functions/valid') +const clean = require('./functions/clean') +const inc = require('./functions/inc') +const diff = require('./functions/diff') +const major = require('./functions/major') +const minor = require('./functions/minor') +const patch = require('./functions/patch') +const prerelease = require('./functions/prerelease') +const compare = require('./functions/compare') +const rcompare = require('./functions/rcompare') +const compareLoose = require('./functions/compare-loose') +const compareBuild = require('./functions/compare-build') +const sort = require('./functions/sort') +const rsort = require('./functions/rsort') +const gt = require('./functions/gt') +const lt = require('./functions/lt') +const eq = require('./functions/eq') +const neq = require('./functions/neq') +const gte = require('./functions/gte') +const lte = require('./functions/lte') +const cmp = require('./functions/cmp') +const coerce = require('./functions/coerce') +const Comparator = require('./classes/comparator') +const Range = require('./classes/range') +const satisfies = require('./functions/satisfies') +const toComparators = require('./ranges/to-comparators') +const maxSatisfying = require('./ranges/max-satisfying') +const minSatisfying = require('./ranges/min-satisfying') +const minVersion = require('./ranges/min-version') +const validRange = require('./ranges/valid') +const outside = require('./ranges/outside') +const gtr = require('./ranges/gtr') +const ltr = require('./ranges/ltr') +const intersects = require('./ranges/intersects') +const simplifyRange = require('./ranges/simplify') +const subset = require('./ranges/subset') +module.exports = { + parse, + valid, + clean, + inc, + diff, + major, + minor, + patch, + prerelease, + compare, + rcompare, + compareLoose, + compareBuild, + sort, + rsort, + gt, + lt, + eq, + neq, + gte, + lte, + cmp, + coerce, + Comparator, + Range, + satisfies, + toComparators, + maxSatisfying, + minSatisfying, + minVersion, + validRange, + outside, + gtr, + ltr, + intersects, + simplifyRange, + subset, + SemVer, + re: internalRe.re, + src: internalRe.src, + tokens: internalRe.t, + SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION, + RELEASE_TYPES: constants.RELEASE_TYPES, + compareIdentifiers: identifiers.compareIdentifiers, + rcompareIdentifiers: identifiers.rcompareIdentifiers, +} diff --git a/node_modules/jest-snapshot/node_modules/semver/internal/constants.js b/node_modules/jest-snapshot/node_modules/semver/internal/constants.js new file mode 100644 index 00000000..94be1c57 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/internal/constants.js @@ -0,0 +1,35 @@ +// Note: this is the semver.org version of the spec that it implements +// Not necessarily the package version of this code. +const SEMVER_SPEC_VERSION = '2.0.0' + +const MAX_LENGTH = 256 +const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || +/* istanbul ignore next */ 9007199254740991 + +// Max safe segment length for coercion. +const MAX_SAFE_COMPONENT_LENGTH = 16 + +// Max safe length for a build identifier. The max length minus 6 characters for +// the shortest version with a build 0.0.0+BUILD. +const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6 + +const RELEASE_TYPES = [ + 'major', + 'premajor', + 'minor', + 'preminor', + 'patch', + 'prepatch', + 'prerelease', +] + +module.exports = { + MAX_LENGTH, + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_SAFE_INTEGER, + RELEASE_TYPES, + SEMVER_SPEC_VERSION, + FLAG_INCLUDE_PRERELEASE: 0b001, + FLAG_LOOSE: 0b010, +} diff --git a/node_modules/jest-snapshot/node_modules/semver/internal/debug.js b/node_modules/jest-snapshot/node_modules/semver/internal/debug.js new file mode 100644 index 00000000..1c00e136 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/internal/debug.js @@ -0,0 +1,9 @@ +const debug = ( + typeof process === 'object' && + process.env && + process.env.NODE_DEBUG && + /\bsemver\b/i.test(process.env.NODE_DEBUG) +) ? (...args) => console.error('SEMVER', ...args) + : () => {} + +module.exports = debug diff --git a/node_modules/jest-snapshot/node_modules/semver/internal/identifiers.js b/node_modules/jest-snapshot/node_modules/semver/internal/identifiers.js new file mode 100644 index 00000000..e612d0a3 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/internal/identifiers.js @@ -0,0 +1,23 @@ +const numeric = /^[0-9]+$/ +const compareIdentifiers = (a, b) => { + const anum = numeric.test(a) + const bnum = numeric.test(b) + + if (anum && bnum) { + a = +a + b = +b + } + + return a === b ? 0 + : (anum && !bnum) ? -1 + : (bnum && !anum) ? 1 + : a < b ? -1 + : 1 +} + +const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a) + +module.exports = { + compareIdentifiers, + rcompareIdentifiers, +} diff --git a/node_modules/jest-snapshot/node_modules/semver/internal/parse-options.js b/node_modules/jest-snapshot/node_modules/semver/internal/parse-options.js new file mode 100644 index 00000000..10d64ce0 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/internal/parse-options.js @@ -0,0 +1,15 @@ +// parse out just the options we care about +const looseOption = Object.freeze({ loose: true }) +const emptyOpts = Object.freeze({ }) +const parseOptions = options => { + if (!options) { + return emptyOpts + } + + if (typeof options !== 'object') { + return looseOption + } + + return options +} +module.exports = parseOptions diff --git a/node_modules/jest-snapshot/node_modules/semver/internal/re.js b/node_modules/jest-snapshot/node_modules/semver/internal/re.js new file mode 100644 index 00000000..21150b3e --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/internal/re.js @@ -0,0 +1,212 @@ +const { + MAX_SAFE_COMPONENT_LENGTH, + MAX_SAFE_BUILD_LENGTH, + MAX_LENGTH, +} = require('./constants') +const debug = require('./debug') +exports = module.exports = {} + +// The actual regexps go on exports.re +const re = exports.re = [] +const safeRe = exports.safeRe = [] +const src = exports.src = [] +const t = exports.t = {} +let R = 0 + +const LETTERDASHNUMBER = '[a-zA-Z0-9-]' + +// Replace some greedy regex tokens to prevent regex dos issues. These regex are +// used internally via the safeRe object since all inputs in this library get +// normalized first to trim and collapse all extra whitespace. The original +// regexes are exported for userland consumption and lower level usage. A +// future breaking change could export the safer regex only with a note that +// all input should have extra whitespace removed. +const safeRegexReplacements = [ + ['\\s', 1], + ['\\d', MAX_LENGTH], + [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH], +] + +const makeSafeRegex = (value) => { + for (const [token, max] of safeRegexReplacements) { + value = value + .split(`${token}*`).join(`${token}{0,${max}}`) + .split(`${token}+`).join(`${token}{1,${max}}`) + } + return value +} + +const createToken = (name, value, isGlobal) => { + const safe = makeSafeRegex(value) + const index = R++ + debug(name, index, value) + t[name] = index + src[index] = value + re[index] = new RegExp(value, isGlobal ? 'g' : undefined) + safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined) +} + +// The following Regular Expressions can be used for tokenizing, +// validating, and parsing SemVer version strings. + +// ## Numeric Identifier +// A single `0`, or a non-zero digit followed by zero or more digits. + +createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') +createToken('NUMERICIDENTIFIERLOOSE', '\\d+') + +// ## Non-numeric Identifier +// Zero or more digits, followed by a letter or hyphen, and then zero or +// more letters, digits, or hyphens. + +createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`) + +// ## Main Version +// Three dot-separated numeric identifiers. + +createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})\\.` + + `(${src[t.NUMERICIDENTIFIER]})`) + +createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` + + `(${src[t.NUMERICIDENTIFIERLOOSE]})`) + +// ## Pre-release Version Identifier +// A numeric identifier, or a non-numeric identifier. + +createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE] +}|${src[t.NONNUMERICIDENTIFIER]})`) + +// ## Pre-release Version +// Hyphen, followed by one or more dot-separated pre-release version +// identifiers. + +createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER] +}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`) + +createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE] +}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`) + +// ## Build Metadata Identifier +// Any combination of digits, letters, or hyphens. + +createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`) + +// ## Build Metadata +// Plus sign, followed by one or more period-separated build metadata +// identifiers. + +createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER] +}(?:\\.${src[t.BUILDIDENTIFIER]})*))`) + +// ## Full Version String +// A main version, followed optionally by a pre-release version and +// build metadata. + +// Note that the only major, minor, patch, and pre-release sections of +// the version string are capturing groups. The build metadata is not a +// capturing group, because it should not ever be used in version +// comparison. + +createToken('FULLPLAIN', `v?${src[t.MAINVERSION] +}${src[t.PRERELEASE]}?${ + src[t.BUILD]}?`) + +createToken('FULL', `^${src[t.FULLPLAIN]}$`) + +// like full, but allows v1.2.3 and =1.2.3, which people do sometimes. +// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty +// common in the npm registry. +createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE] +}${src[t.PRERELEASELOOSE]}?${ + src[t.BUILD]}?`) + +createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`) + +createToken('GTLT', '((?:<|>)?=?)') + +// Something like "2.*" or "1.2.x". +// Note that "x.x" is a valid xRange identifer, meaning "any version" +// Only the first item is strictly required. +createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`) +createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`) + +createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIER]})` + + `(?:${src[t.PRERELEASE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` + + `(?:${src[t.PRERELEASELOOSE]})?${ + src[t.BUILD]}?` + + `)?)?`) + +createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`) +createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`) + +// Coercion. +// Extract anything that could conceivably be a part of a valid semver +createToken('COERCE', `${'(^|[^\\d])' + + '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` + + `(?:$|[^\\d])`) +createToken('COERCERTL', src[t.COERCE], true) + +// Tilde ranges. +// Meaning is "reasonably at or greater than" +createToken('LONETILDE', '(?:~>?)') + +createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true) +exports.tildeTrimReplace = '$1~' + +createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`) +createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`) + +// Caret ranges. +// Meaning is "at least and backwards compatible with" +createToken('LONECARET', '(?:\\^)') + +createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true) +exports.caretTrimReplace = '$1^' + +createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`) +createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`) + +// A simple gt/lt/eq thing, or just "" to indicate "any version" +createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`) +createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`) + +// An expression to strip any whitespace between the gtlt and the thing +// it modifies, so that `> 1.2.3` ==> `>1.2.3` +createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT] +}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true) +exports.comparatorTrimReplace = '$1$2$3' + +// Something like `1.2.3 - 1.2.4` +// Note that these all use the loose form, because they'll be +// checked against either the strict or loose comparator form +// later. +createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAIN]})` + + `\\s*$`) + +createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` + + `\\s+-\\s+` + + `(${src[t.XRANGEPLAINLOOSE]})` + + `\\s*$`) + +// Star ranges basically just allow anything at all. +createToken('STAR', '(<|>)?=?\\s*\\*') +// >=0.0.0 is like a star +createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$') +createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$') diff --git a/node_modules/jest-snapshot/node_modules/semver/package.json b/node_modules/jest-snapshot/node_modules/semver/package.json new file mode 100644 index 00000000..c145eca2 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/package.json @@ -0,0 +1,87 @@ +{ + "name": "semver", + "version": "7.5.4", + "description": "The semantic version parser used by npm.", + "main": "index.js", + "scripts": { + "test": "tap", + "snap": "tap", + "lint": "eslint \"**/*.js\"", + "postlint": "template-oss-check", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint", + "template-oss-apply": "template-oss-apply --force" + }, + "devDependencies": { + "@npmcli/eslint-config": "^4.0.0", + "@npmcli/template-oss": "4.17.0", + "tap": "^16.0.0" + }, + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/npm/node-semver.git" + }, + "bin": { + "semver": "bin/semver.js" + }, + "files": [ + "bin/", + "lib/", + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ], + "tap": { + "timeout": 30, + "coverage-map": "map.js", + "nyc-arg": [ + "--exclude", + "tap-snapshots/**" + ] + }, + "engines": { + "node": ">=10" + }, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "author": "GitHub Inc.", + "templateOSS": { + "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", + "version": "4.17.0", + "engines": ">=10", + "ciVersions": [ + "10.0.0", + "10.x", + "12.x", + "14.x", + "16.x", + "18.x" + ], + "npmSpec": "8", + "distPaths": [ + "classes/", + "functions/", + "internal/", + "ranges/", + "index.js", + "preload.js", + "range.bnf" + ], + "allowPaths": [ + "/classes/", + "/functions/", + "/internal/", + "/ranges/", + "/index.js", + "/preload.js", + "/range.bnf" + ], + "publish": "true" + } +} diff --git a/node_modules/jest-snapshot/node_modules/semver/preload.js b/node_modules/jest-snapshot/node_modules/semver/preload.js new file mode 100644 index 00000000..947cd4f7 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/preload.js @@ -0,0 +1,2 @@ +// XXX remove in v8 or beyond +module.exports = require('./index.js') diff --git a/node_modules/jest-snapshot/node_modules/semver/range.bnf b/node_modules/jest-snapshot/node_modules/semver/range.bnf new file mode 100644 index 00000000..d4c6ae0d --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/range.bnf @@ -0,0 +1,16 @@ +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | [1-9] ( [0-9] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/gtr.js b/node_modules/jest-snapshot/node_modules/semver/ranges/gtr.js new file mode 100644 index 00000000..db7e3559 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/gtr.js @@ -0,0 +1,4 @@ +// Determine if version is greater than all the versions possible in the range. +const outside = require('./outside') +const gtr = (version, range, options) => outside(version, range, '>', options) +module.exports = gtr diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/intersects.js b/node_modules/jest-snapshot/node_modules/semver/ranges/intersects.js new file mode 100644 index 00000000..e0e9b7ce --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/intersects.js @@ -0,0 +1,7 @@ +const Range = require('../classes/range') +const intersects = (r1, r2, options) => { + r1 = new Range(r1, options) + r2 = new Range(r2, options) + return r1.intersects(r2, options) +} +module.exports = intersects diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/ltr.js b/node_modules/jest-snapshot/node_modules/semver/ranges/ltr.js new file mode 100644 index 00000000..528a885e --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/ltr.js @@ -0,0 +1,4 @@ +const outside = require('./outside') +// Determine if version is less than all the versions possible in the range +const ltr = (version, range, options) => outside(version, range, '<', options) +module.exports = ltr diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/max-satisfying.js b/node_modules/jest-snapshot/node_modules/semver/ranges/max-satisfying.js new file mode 100644 index 00000000..6e3d993c --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/max-satisfying.js @@ -0,0 +1,25 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') + +const maxSatisfying = (versions, range, options) => { + let max = null + let maxSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!max || maxSV.compare(v) === -1) { + // compare(max, v, true) + max = v + maxSV = new SemVer(max, options) + } + } + }) + return max +} +module.exports = maxSatisfying diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/min-satisfying.js b/node_modules/jest-snapshot/node_modules/semver/ranges/min-satisfying.js new file mode 100644 index 00000000..9b60974e --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/min-satisfying.js @@ -0,0 +1,24 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const minSatisfying = (versions, range, options) => { + let min = null + let minSV = null + let rangeObj = null + try { + rangeObj = new Range(range, options) + } catch (er) { + return null + } + versions.forEach((v) => { + if (rangeObj.test(v)) { + // satisfies(v, range, options) + if (!min || minSV.compare(v) === 1) { + // compare(min, v, true) + min = v + minSV = new SemVer(min, options) + } + } + }) + return min +} +module.exports = minSatisfying diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/min-version.js b/node_modules/jest-snapshot/node_modules/semver/ranges/min-version.js new file mode 100644 index 00000000..350e1f78 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/min-version.js @@ -0,0 +1,61 @@ +const SemVer = require('../classes/semver') +const Range = require('../classes/range') +const gt = require('../functions/gt') + +const minVersion = (range, loose) => { + range = new Range(range, loose) + + let minver = new SemVer('0.0.0') + if (range.test(minver)) { + return minver + } + + minver = new SemVer('0.0.0-0') + if (range.test(minver)) { + return minver + } + + minver = null + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let setMin = null + comparators.forEach((comparator) => { + // Clone to avoid manipulating the comparator's semver object. + const compver = new SemVer(comparator.semver.version) + switch (comparator.operator) { + case '>': + if (compver.prerelease.length === 0) { + compver.patch++ + } else { + compver.prerelease.push(0) + } + compver.raw = compver.format() + /* fallthrough */ + case '': + case '>=': + if (!setMin || gt(compver, setMin)) { + setMin = compver + } + break + case '<': + case '<=': + /* Ignore maximum versions */ + break + /* istanbul ignore next */ + default: + throw new Error(`Unexpected operation: ${comparator.operator}`) + } + }) + if (setMin && (!minver || gt(minver, setMin))) { + minver = setMin + } + } + + if (minver && range.test(minver)) { + return minver + } + + return null +} +module.exports = minVersion diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/outside.js b/node_modules/jest-snapshot/node_modules/semver/ranges/outside.js new file mode 100644 index 00000000..ae99b10a --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/outside.js @@ -0,0 +1,80 @@ +const SemVer = require('../classes/semver') +const Comparator = require('../classes/comparator') +const { ANY } = Comparator +const Range = require('../classes/range') +const satisfies = require('../functions/satisfies') +const gt = require('../functions/gt') +const lt = require('../functions/lt') +const lte = require('../functions/lte') +const gte = require('../functions/gte') + +const outside = (version, range, hilo, options) => { + version = new SemVer(version, options) + range = new Range(range, options) + + let gtfn, ltefn, ltfn, comp, ecomp + switch (hilo) { + case '>': + gtfn = gt + ltefn = lte + ltfn = lt + comp = '>' + ecomp = '>=' + break + case '<': + gtfn = lt + ltefn = gte + ltfn = gt + comp = '<' + ecomp = '<=' + break + default: + throw new TypeError('Must provide a hilo val of "<" or ">"') + } + + // If it satisfies the range it is not outside + if (satisfies(version, range, options)) { + return false + } + + // From now on, variable terms are as if we're in "gtr" mode. + // but note that everything is flipped for the "ltr" function. + + for (let i = 0; i < range.set.length; ++i) { + const comparators = range.set[i] + + let high = null + let low = null + + comparators.forEach((comparator) => { + if (comparator.semver === ANY) { + comparator = new Comparator('>=0.0.0') + } + high = high || comparator + low = low || comparator + if (gtfn(comparator.semver, high.semver, options)) { + high = comparator + } else if (ltfn(comparator.semver, low.semver, options)) { + low = comparator + } + }) + + // If the edge version comparator has a operator then our version + // isn't outside it + if (high.operator === comp || high.operator === ecomp) { + return false + } + + // If the lowest version comparator has an operator and our version + // is less than it then it isn't higher than the range + if ((!low.operator || low.operator === comp) && + ltefn(version, low.semver)) { + return false + } else if (low.operator === ecomp && ltfn(version, low.semver)) { + return false + } + } + return true +} + +module.exports = outside diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/simplify.js b/node_modules/jest-snapshot/node_modules/semver/ranges/simplify.js new file mode 100644 index 00000000..618d5b62 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/simplify.js @@ -0,0 +1,47 @@ +// given a set of versions and a range, create a "simplified" range +// that includes the same versions that the original range does +// If the original range is shorter than the simplified one, return that. +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') +module.exports = (versions, range, options) => { + const set = [] + let first = null + let prev = null + const v = versions.sort((a, b) => compare(a, b, options)) + for (const version of v) { + const included = satisfies(version, range, options) + if (included) { + prev = version + if (!first) { + first = version + } + } else { + if (prev) { + set.push([first, prev]) + } + prev = null + first = null + } + } + if (first) { + set.push([first, null]) + } + + const ranges = [] + for (const [min, max] of set) { + if (min === max) { + ranges.push(min) + } else if (!max && min === v[0]) { + ranges.push('*') + } else if (!max) { + ranges.push(`>=${min}`) + } else if (min === v[0]) { + ranges.push(`<=${max}`) + } else { + ranges.push(`${min} - ${max}`) + } + } + const simplified = ranges.join(' || ') + const original = typeof range.raw === 'string' ? range.raw : String(range) + return simplified.length < original.length ? simplified : range +} diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/subset.js b/node_modules/jest-snapshot/node_modules/semver/ranges/subset.js new file mode 100644 index 00000000..1e5c2683 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/subset.js @@ -0,0 +1,247 @@ +const Range = require('../classes/range.js') +const Comparator = require('../classes/comparator.js') +const { ANY } = Comparator +const satisfies = require('../functions/satisfies.js') +const compare = require('../functions/compare.js') + +// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff: +// - Every simple range `r1, r2, ...` is a null set, OR +// - Every simple range `r1, r2, ...` which is not a null set is a subset of +// some `R1, R2, ...` +// +// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff: +// - If c is only the ANY comparator +// - If C is only the ANY comparator, return true +// - Else if in prerelease mode, return false +// - else replace c with `[>=0.0.0]` +// - If C is only the ANY comparator +// - if in prerelease mode, return true +// - else replace C with `[>=0.0.0]` +// - Let EQ be the set of = comparators in c +// - If EQ is more than one, return true (null set) +// - Let GT be the highest > or >= comparator in c +// - Let LT be the lowest < or <= comparator in c +// - If GT and LT, and GT.semver > LT.semver, return true (null set) +// - If any C is a = range, and GT or LT are set, return false +// - If EQ +// - If GT, and EQ does not satisfy GT, return true (null set) +// - If LT, and EQ does not satisfy LT, return true (null set) +// - If EQ satisfies every C, return true +// - Else return false +// - If GT +// - If GT.semver is lower than any > or >= comp in C, return false +// - If GT is >=, and GT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the GT.semver tuple, return false +// - If LT +// - If LT.semver is greater than any < or <= comp in C, return false +// - If LT is <=, and LT.semver does not satisfy every C, return false +// - If GT.semver has a prerelease, and not in prerelease mode +// - If no C has a prerelease and the LT.semver tuple, return false +// - Else return true + +const subset = (sub, dom, options = {}) => { + if (sub === dom) { + return true + } + + sub = new Range(sub, options) + dom = new Range(dom, options) + let sawNonNull = false + + OUTER: for (const simpleSub of sub.set) { + for (const simpleDom of dom.set) { + const isSub = simpleSubset(simpleSub, simpleDom, options) + sawNonNull = sawNonNull || isSub !== null + if (isSub) { + continue OUTER + } + } + // the null set is a subset of everything, but null simple ranges in + // a complex range should be ignored. so if we saw a non-null range, + // then we know this isn't a subset, but if EVERY simple range was null, + // then it is a subset. + if (sawNonNull) { + return false + } + } + return true +} + +const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')] +const minimumVersion = [new Comparator('>=0.0.0')] + +const simpleSubset = (sub, dom, options) => { + if (sub === dom) { + return true + } + + if (sub.length === 1 && sub[0].semver === ANY) { + if (dom.length === 1 && dom[0].semver === ANY) { + return true + } else if (options.includePrerelease) { + sub = minimumVersionWithPreRelease + } else { + sub = minimumVersion + } + } + + if (dom.length === 1 && dom[0].semver === ANY) { + if (options.includePrerelease) { + return true + } else { + dom = minimumVersion + } + } + + const eqSet = new Set() + let gt, lt + for (const c of sub) { + if (c.operator === '>' || c.operator === '>=') { + gt = higherGT(gt, c, options) + } else if (c.operator === '<' || c.operator === '<=') { + lt = lowerLT(lt, c, options) + } else { + eqSet.add(c.semver) + } + } + + if (eqSet.size > 1) { + return null + } + + let gtltComp + if (gt && lt) { + gtltComp = compare(gt.semver, lt.semver, options) + if (gtltComp > 0) { + return null + } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) { + return null + } + } + + // will iterate one or zero times + for (const eq of eqSet) { + if (gt && !satisfies(eq, String(gt), options)) { + return null + } + + if (lt && !satisfies(eq, String(lt), options)) { + return null + } + + for (const c of dom) { + if (!satisfies(eq, String(c), options)) { + return false + } + } + + return true + } + + let higher, lower + let hasDomLT, hasDomGT + // if the subset has a prerelease, we need a comparator in the superset + // with the same tuple and a prerelease, or it's not a subset + let needDomLTPre = lt && + !options.includePrerelease && + lt.semver.prerelease.length ? lt.semver : false + let needDomGTPre = gt && + !options.includePrerelease && + gt.semver.prerelease.length ? gt.semver : false + // exception: <1.2.3-0 is the same as <1.2.3 + if (needDomLTPre && needDomLTPre.prerelease.length === 1 && + lt.operator === '<' && needDomLTPre.prerelease[0] === 0) { + needDomLTPre = false + } + + for (const c of dom) { + hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>=' + hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<=' + if (gt) { + if (needDomGTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomGTPre.major && + c.semver.minor === needDomGTPre.minor && + c.semver.patch === needDomGTPre.patch) { + needDomGTPre = false + } + } + if (c.operator === '>' || c.operator === '>=') { + higher = higherGT(gt, c, options) + if (higher === c && higher !== gt) { + return false + } + } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) { + return false + } + } + if (lt) { + if (needDomLTPre) { + if (c.semver.prerelease && c.semver.prerelease.length && + c.semver.major === needDomLTPre.major && + c.semver.minor === needDomLTPre.minor && + c.semver.patch === needDomLTPre.patch) { + needDomLTPre = false + } + } + if (c.operator === '<' || c.operator === '<=') { + lower = lowerLT(lt, c, options) + if (lower === c && lower !== lt) { + return false + } + } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) { + return false + } + } + if (!c.operator && (lt || gt) && gtltComp !== 0) { + return false + } + } + + // if there was a < or >, and nothing in the dom, then must be false + // UNLESS it was limited by another range in the other direction. + // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0 + if (gt && hasDomLT && !lt && gtltComp !== 0) { + return false + } + + if (lt && hasDomGT && !gt && gtltComp !== 0) { + return false + } + + // we needed a prerelease range in a specific tuple, but didn't get one + // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0, + // because it includes prereleases in the 1.2.3 tuple + if (needDomGTPre || needDomLTPre) { + return false + } + + return true +} + +// >=1.2.3 is lower than >1.2.3 +const higherGT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp > 0 ? a + : comp < 0 ? b + : b.operator === '>' && a.operator === '>=' ? b + : a +} + +// <=1.2.3 is higher than <1.2.3 +const lowerLT = (a, b, options) => { + if (!a) { + return b + } + const comp = compare(a.semver, b.semver, options) + return comp < 0 ? a + : comp > 0 ? b + : b.operator === '<' && a.operator === '<=' ? b + : a +} + +module.exports = subset diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/to-comparators.js b/node_modules/jest-snapshot/node_modules/semver/ranges/to-comparators.js new file mode 100644 index 00000000..6c8bc7e6 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/to-comparators.js @@ -0,0 +1,8 @@ +const Range = require('../classes/range') + +// Mostly just for testing and legacy API reasons +const toComparators = (range, options) => + new Range(range, options).set + .map(comp => comp.map(c => c.value).join(' ').trim().split(' ')) + +module.exports = toComparators diff --git a/node_modules/jest-snapshot/node_modules/semver/ranges/valid.js b/node_modules/jest-snapshot/node_modules/semver/ranges/valid.js new file mode 100644 index 00000000..365f3568 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/semver/ranges/valid.js @@ -0,0 +1,11 @@ +const Range = require('../classes/range') +const validRange = (range, options) => { + try { + // Return '*' instead of '' so that truthiness works. + // This will throw if it's invalid anyway + return new Range(range, options).range || '*' + } catch (er) { + return null + } +} +module.exports = validRange diff --git a/node_modules/jest-snapshot/node_modules/yallist/LICENSE b/node_modules/jest-snapshot/node_modules/yallist/LICENSE new file mode 100644 index 00000000..19129e31 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/yallist/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/node_modules/jest-snapshot/node_modules/yallist/README.md b/node_modules/jest-snapshot/node_modules/yallist/README.md new file mode 100644 index 00000000..f5861018 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/yallist/README.md @@ -0,0 +1,204 @@ +# yallist + +Yet Another Linked List + +There are many doubly-linked list implementations like it, but this +one is mine. + +For when an array would be too big, and a Map can't be iterated in +reverse order. + + +[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) + +## basic usage + +```javascript +var yallist = require('yallist') +var myList = yallist.create([1, 2, 3]) +myList.push('foo') +myList.unshift('bar') +// of course pop() and shift() are there, too +console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] +myList.forEach(function (k) { + // walk the list head to tail +}) +myList.forEachReverse(function (k, index, list) { + // walk the list tail to head +}) +var myDoubledList = myList.map(function (k) { + return k + k +}) +// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] +// mapReverse is also a thing +var myDoubledListReverse = myList.mapReverse(function (k) { + return k + k +}) // ['foofoo', 6, 4, 2, 'barbar'] + +var reduced = myList.reduce(function (set, entry) { + set += entry + return set +}, 'start') +console.log(reduced) // 'startfoo123bar' +``` + +## api + +The whole API is considered "public". + +Functions with the same name as an Array method work more or less the +same way. + +There's reverse versions of most things because that's the point. + +### Yallist + +Default export, the class that holds and manages a list. + +Call it with either a forEach-able (like an array) or a set of +arguments, to initialize the list. + +The Array-ish methods all act like you'd expect. No magic length, +though, so if you change that it won't automatically prune or add +empty spots. + +### Yallist.create(..) + +Alias for Yallist function. Some people like factories. + +#### yallist.head + +The first node in the list + +#### yallist.tail + +The last node in the list + +#### yallist.length + +The number of nodes in the list. (Change this at your peril. It is +not magic like Array length.) + +#### yallist.toArray() + +Convert the list to an array. + +#### yallist.forEach(fn, [thisp]) + +Call a function on each item in the list. + +#### yallist.forEachReverse(fn, [thisp]) + +Call a function on each item in the list, in reverse order. + +#### yallist.get(n) + +Get the data at position `n` in the list. If you use this a lot, +probably better off just using an Array. + +#### yallist.getReverse(n) + +Get the data at position `n`, counting from the tail. + +#### yallist.map(fn, thisp) + +Create a new Yallist with the result of calling the function on each +item. + +#### yallist.mapReverse(fn, thisp) + +Same as `map`, but in reverse. + +#### yallist.pop() + +Get the data from the list tail, and remove the tail from the list. + +#### yallist.push(item, ...) + +Insert one or more items to the tail of the list. + +#### yallist.reduce(fn, initialValue) + +Like Array.reduce. + +#### yallist.reduceReverse + +Like Array.reduce, but in reverse. + +#### yallist.reverse + +Reverse the list in place. + +#### yallist.shift() + +Get the data from the list head, and remove the head from the list. + +#### yallist.slice([from], [to]) + +Just like Array.slice, but returns a new Yallist. + +#### yallist.sliceReverse([from], [to]) + +Just like yallist.slice, but the result is returned in reverse. + +#### yallist.toArray() + +Create an array representation of the list. + +#### yallist.toArrayReverse() + +Create a reversed array representation of the list. + +#### yallist.unshift(item, ...) + +Insert one or more items to the head of the list. + +#### yallist.unshiftNode(node) + +Move a Node object to the front of the list. (That is, pull it out of +wherever it lives, and make it the new head.) + +If the node belongs to a different list, then that list will remove it +first. + +#### yallist.pushNode(node) + +Move a Node object to the end of the list. (That is, pull it out of +wherever it lives, and make it the new tail.) + +If the node belongs to a list already, then that list will remove it +first. + +#### yallist.removeNode(node) + +Remove a node from the list, preserving referential integrity of head +and tail and other nodes. + +Will throw an error if you try to have a list remove a node that +doesn't belong to it. + +### Yallist.Node + +The class that holds the data and is actually the list. + +Call with `var n = new Node(value, previousNode, nextNode)` + +Note that if you do direct operations on Nodes themselves, it's very +easy to get into weird states where the list is broken. Be careful :) + +#### node.next + +The next node in the list. + +#### node.prev + +The previous node in the list. + +#### node.value + +The data the node contains. + +#### node.list + +The list to which this node belongs. (Null if it does not belong to +any list.) diff --git a/node_modules/jest-snapshot/node_modules/yallist/iterator.js b/node_modules/jest-snapshot/node_modules/yallist/iterator.js new file mode 100644 index 00000000..d41c97a1 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/yallist/iterator.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = function (Yallist) { + Yallist.prototype[Symbol.iterator] = function* () { + for (let walker = this.head; walker; walker = walker.next) { + yield walker.value + } + } +} diff --git a/node_modules/jest-snapshot/node_modules/yallist/package.json b/node_modules/jest-snapshot/node_modules/yallist/package.json new file mode 100644 index 00000000..8a083867 --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/yallist/package.json @@ -0,0 +1,29 @@ +{ + "name": "yallist", + "version": "4.0.0", + "description": "Yet Another Linked List", + "main": "yallist.js", + "directories": { + "test": "test" + }, + "files": [ + "yallist.js", + "iterator.js" + ], + "dependencies": {}, + "devDependencies": { + "tap": "^12.1.0" + }, + "scripts": { + "test": "tap test/*.js --100", + "preversion": "npm test", + "postversion": "npm publish", + "postpublish": "git push origin --all; git push origin --tags" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/isaacs/yallist.git" + }, + "author": "Isaac Z. Schlueter (http://blog.izs.me/)", + "license": "ISC" +} diff --git a/node_modules/jest-snapshot/node_modules/yallist/yallist.js b/node_modules/jest-snapshot/node_modules/yallist/yallist.js new file mode 100644 index 00000000..4e83ab1c --- /dev/null +++ b/node_modules/jest-snapshot/node_modules/yallist/yallist.js @@ -0,0 +1,426 @@ +'use strict' +module.exports = Yallist + +Yallist.Node = Node +Yallist.create = Yallist + +function Yallist (list) { + var self = this + if (!(self instanceof Yallist)) { + self = new Yallist() + } + + self.tail = null + self.head = null + self.length = 0 + + if (list && typeof list.forEach === 'function') { + list.forEach(function (item) { + self.push(item) + }) + } else if (arguments.length > 0) { + for (var i = 0, l = arguments.length; i < l; i++) { + self.push(arguments[i]) + } + } + + return self +} + +Yallist.prototype.removeNode = function (node) { + if (node.list !== this) { + throw new Error('removing node which does not belong to this list') + } + + var next = node.next + var prev = node.prev + + if (next) { + next.prev = prev + } + + if (prev) { + prev.next = next + } + + if (node === this.head) { + this.head = next + } + if (node === this.tail) { + this.tail = prev + } + + node.list.length-- + node.next = null + node.prev = null + node.list = null + + return next +} + +Yallist.prototype.unshiftNode = function (node) { + if (node === this.head) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var head = this.head + node.list = this + node.next = head + if (head) { + head.prev = node + } + + this.head = node + if (!this.tail) { + this.tail = node + } + this.length++ +} + +Yallist.prototype.pushNode = function (node) { + if (node === this.tail) { + return + } + + if (node.list) { + node.list.removeNode(node) + } + + var tail = this.tail + node.list = this + node.prev = tail + if (tail) { + tail.next = node + } + + this.tail = node + if (!this.head) { + this.head = node + } + this.length++ +} + +Yallist.prototype.push = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + push(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.unshift = function () { + for (var i = 0, l = arguments.length; i < l; i++) { + unshift(this, arguments[i]) + } + return this.length +} + +Yallist.prototype.pop = function () { + if (!this.tail) { + return undefined + } + + var res = this.tail.value + this.tail = this.tail.prev + if (this.tail) { + this.tail.next = null + } else { + this.head = null + } + this.length-- + return res +} + +Yallist.prototype.shift = function () { + if (!this.head) { + return undefined + } + + var res = this.head.value + this.head = this.head.next + if (this.head) { + this.head.prev = null + } else { + this.tail = null + } + this.length-- + return res +} + +Yallist.prototype.forEach = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.head, i = 0; walker !== null; i++) { + fn.call(thisp, walker.value, i, this) + walker = walker.next + } +} + +Yallist.prototype.forEachReverse = function (fn, thisp) { + thisp = thisp || this + for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { + fn.call(thisp, walker.value, i, this) + walker = walker.prev + } +} + +Yallist.prototype.get = function (n) { + for (var i = 0, walker = this.head; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.next + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.getReverse = function (n) { + for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { + // abort out of the list early if we hit a cycle + walker = walker.prev + } + if (i === n && walker !== null) { + return walker.value + } +} + +Yallist.prototype.map = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.head; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.next + } + return res +} + +Yallist.prototype.mapReverse = function (fn, thisp) { + thisp = thisp || this + var res = new Yallist() + for (var walker = this.tail; walker !== null;) { + res.push(fn.call(thisp, walker.value, this)) + walker = walker.prev + } + return res +} + +Yallist.prototype.reduce = function (fn, initial) { + var acc + var walker = this.head + if (arguments.length > 1) { + acc = initial + } else if (this.head) { + walker = this.head.next + acc = this.head.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = 0; walker !== null; i++) { + acc = fn(acc, walker.value, i) + walker = walker.next + } + + return acc +} + +Yallist.prototype.reduceReverse = function (fn, initial) { + var acc + var walker = this.tail + if (arguments.length > 1) { + acc = initial + } else if (this.tail) { + walker = this.tail.prev + acc = this.tail.value + } else { + throw new TypeError('Reduce of empty list with no initial value') + } + + for (var i = this.length - 1; walker !== null; i--) { + acc = fn(acc, walker.value, i) + walker = walker.prev + } + + return acc +} + +Yallist.prototype.toArray = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.head; walker !== null; i++) { + arr[i] = walker.value + walker = walker.next + } + return arr +} + +Yallist.prototype.toArrayReverse = function () { + var arr = new Array(this.length) + for (var i = 0, walker = this.tail; walker !== null; i++) { + arr[i] = walker.value + walker = walker.prev + } + return arr +} + +Yallist.prototype.slice = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = 0, walker = this.head; walker !== null && i < from; i++) { + walker = walker.next + } + for (; walker !== null && i < to; i++, walker = walker.next) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.sliceReverse = function (from, to) { + to = to || this.length + if (to < 0) { + to += this.length + } + from = from || 0 + if (from < 0) { + from += this.length + } + var ret = new Yallist() + if (to < from || to < 0) { + return ret + } + if (from < 0) { + from = 0 + } + if (to > this.length) { + to = this.length + } + for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { + walker = walker.prev + } + for (; walker !== null && i > from; i--, walker = walker.prev) { + ret.push(walker.value) + } + return ret +} + +Yallist.prototype.splice = function (start, deleteCount, ...nodes) { + if (start > this.length) { + start = this.length - 1 + } + if (start < 0) { + start = this.length + start; + } + + for (var i = 0, walker = this.head; walker !== null && i < start; i++) { + walker = walker.next + } + + var ret = [] + for (var i = 0; walker && i < deleteCount; i++) { + ret.push(walker.value) + walker = this.removeNode(walker) + } + if (walker === null) { + walker = this.tail + } + + if (walker !== this.head && walker !== this.tail) { + walker = walker.prev + } + + for (var i = 0; i < nodes.length; i++) { + walker = insert(this, walker, nodes[i]) + } + return ret; +} + +Yallist.prototype.reverse = function () { + var head = this.head + var tail = this.tail + for (var walker = head; walker !== null; walker = walker.prev) { + var p = walker.prev + walker.prev = walker.next + walker.next = p + } + this.head = tail + this.tail = head + return this +} + +function insert (self, node, value) { + var inserted = node === self.head ? + new Node(value, null, node, self) : + new Node(value, node, node.next, self) + + if (inserted.next === null) { + self.tail = inserted + } + if (inserted.prev === null) { + self.head = inserted + } + + self.length++ + + return inserted +} + +function push (self, item) { + self.tail = new Node(item, self.tail, null, self) + if (!self.head) { + self.head = self.tail + } + self.length++ +} + +function unshift (self, item) { + self.head = new Node(item, null, self.head, self) + if (!self.tail) { + self.tail = self.head + } + self.length++ +} + +function Node (value, prev, next, list) { + if (!(this instanceof Node)) { + return new Node(value, prev, next, list) + } + + this.list = list + this.value = value + + if (prev) { + prev.next = this + this.prev = prev + } else { + this.prev = null + } + + if (next) { + next.prev = this + this.next = next + } else { + this.next = null + } +} + +try { + // add if support for Symbol.iterator is present + require('./iterator.js')(Yallist) +} catch (er) {} diff --git a/node_modules/jest-snapshot/package.json b/node_modules/jest-snapshot/package.json new file mode 100644 index 00000000..167dd938 --- /dev/null +++ b/node_modules/jest-snapshot/package.json @@ -0,0 +1,63 @@ +{ + "name": "jest-snapshot", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-snapshot" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" + }, + "devDependencies": { + "@babel/preset-flow": "^7.7.2", + "@babel/preset-react": "^7.12.1", + "@jest/test-utils": "^29.7.0", + "@tsd/typescript": "^5.0.4", + "@types/babel__core": "^7.1.14", + "@types/graceful-fs": "^4.1.3", + "@types/natural-compare": "^1.4.0", + "@types/prettier": "^2.1.5", + "@types/semver": "^7.1.0", + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "prettier": "^2.1.1", + "tsd-lite": "^0.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-util/LICENSE b/node_modules/jest-util/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-util/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-util/Readme.md b/node_modules/jest-util/Readme.md new file mode 100644 index 00000000..15f6daa4 --- /dev/null +++ b/node_modules/jest-util/Readme.md @@ -0,0 +1,87 @@ +# `@jest/utils` + +This packages is a collection of utilities and helper functions + +## `ErrorWithStack` + +This custom error class can be useful when you need to capture the stack trace of an error and provide additional context to the error message. By default, JavaScript errors only capture the stack trace when they are thrown, but this class allows you to capture the stack trace at any point in your code by calling its constructor. + +## `clearLine` + +It ensures that the clearing operation is only performed when running in a terminal environment, and not when the output is redirected to a file or another non-terminal destination. + +## `convertDescriptorToString` + +It defines a function named `convertDescriptorToString` that takes a descriptor as input and converts it to a string based on its type. It handles various types such as functions, numbers, strings, and undefined values. If the input doesn't match any of these types, it throws an error with a descriptive message. + +## `createDirectory` + +It creates new directory and also allows creation of nested directories. + +## `deepCyclicCopy` + +The `deepCyclicCopy` function provides deep copying of JavaScript objects and arrays, including handling circular references. It offers optional customization through a `DeepCyclicCopyOptions` parameter, allowing users to blacklist properties and preserve object prototypes. The function returns a completely independent deep copy of the input data structure. + +## `formatTime` + +This function is useful for formatting time values with appropriate SI unit prefixes for readability. It expresses time in various units (e.g., milliseconds, microseconds, nanoseconds) while ensuring the formatting is consistent and human-readable. + +## `globsToMatcher` + +The code efficiently converts a list of glob patterns into a reusable function for matching paths against those patterns, considering negated patterns and optimizing for performance. + +## `installCommonGlobals` + +Sets up various global variables and functions needed by the Jest testing framework. It ensures that these globals are properly set up for testing scenarios while maintaining compatibility with the environment's global object. + +## `interopRequireDefault` + +Provides a way to ensure compatibility between ES modules and CommonJS modules by handling the default export behavior appropriately. + +## `invariant` + +It is a utility used for asserting that a given condition is true. It's often used as a debugging aid during development to catch situations where an expected condition is not met. + +## `isInteractive` + +Checks whether the current environment is suitable for interactive terminal interactions. + +## `isNonNullable` + +Used to narrow down the type of a variable within a TypeScript code block, ensuring that it is safe to assume that the value is non-nullable. This can help avoid runtime errors related to null or undefined values. + +## `isPromise` + +It helps in order to determine whether a given value conforms to the structure of a Promise-like object, which typically has a `then` method. This can be useful when working with asynchronous code to ensure dealing with promises correctly. + +## `pluralize` + +This function is used to easily generate grammatically correct phrases in text output that depend on the count of items. It ensures that the word is correctly pluralized when needed. + +## `preRunMessage` + +These functions are intended for use in interactive command-line tools or scripts which provide informative messages to the user while ensuring a clean and responsive interface. + +## `replacePathSepForGlob` + +The function takes a string `path` as input and replaces backslashes ('\\') with forward slashes ('/') in the path. Used to normalize file paths to be compatible with glob patterns, ensuring consistency in path representation for different operating systems. + +## `requireOrImportModule` + +This function provides a unified way to load modules regardless of whether they use CommonJS or ESM syntax. It ensures that the default export is applied consistently when needed, allowing users to work with modules that might use different module systems. + +## `setGlobal` + +Used to set properties with specified values within a global object. It is designed to work in both browser-like and Node.js environments by accepting different types of global objects as input. + +## `specialChars` + +It defines constants and conditional values for handling platform-specific behaviors in a terminal environment. It determines if the current platform is Windows ('win32') and sets up constants for various symbols and terminal screen clearing escape sequences accordingly, ensuring proper display and behavior on both Windows and non-Windows operating systems. + +## `testPathPatternToRegExp` + +This function is used for consistency when serializing/deserializing global configurations and ensures that consistent regular expressions are produced for matching test paths. + +## `tryRealpath` + +Used to resolve the real path of a given path, but if the path doesn't exist or is a directory, it doesn't throw an error and returns the original path string. This can be useful for gracefully handling path resolution in scenarios where some paths might not exist or might be directories. diff --git a/node_modules/jest-util/build/ErrorWithStack.js b/node_modules/jest-util/build/ErrorWithStack.js new file mode 100644 index 00000000..43aa026b --- /dev/null +++ b/node_modules/jest-util/build/ErrorWithStack.js @@ -0,0 +1,28 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class ErrorWithStack extends Error { + constructor(message, callsite, stackLimit) { + // Ensure we have a large stack length so we get full details. + const originalStackLimit = Error.stackTraceLimit; + if (stackLimit) { + Error.stackTraceLimit = Math.max(stackLimit, originalStackLimit || 10); + } + super(message); + if (Error.captureStackTrace) { + Error.captureStackTrace(this, callsite); + } + Error.stackTraceLimit = originalStackLimit; + } +} +exports.default = ErrorWithStack; diff --git a/node_modules/jest-util/build/clearLine.js b/node_modules/jest-util/build/clearLine.js new file mode 100644 index 00000000..3db59014 --- /dev/null +++ b/node_modules/jest-util/build/clearLine.js @@ -0,0 +1,18 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = clearLine; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function clearLine(stream) { + if (stream.isTTY) { + stream.write('\x1b[999D\x1b[K'); + } +} diff --git a/node_modules/jest-util/build/convertDescriptorToString.js b/node_modules/jest-util/build/convertDescriptorToString.js new file mode 100644 index 00000000..e4b8e58b --- /dev/null +++ b/node_modules/jest-util/build/convertDescriptorToString.js @@ -0,0 +1,30 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = convertDescriptorToString; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function convertDescriptorToString(descriptor) { + switch (typeof descriptor) { + case 'function': + if (descriptor.name) { + return descriptor.name; + } + break; + case 'number': + case 'undefined': + return `${descriptor}`; + case 'string': + return descriptor; + } + throw new Error( + `Invalid first argument, ${descriptor}. It must be a named class, named function, number, or string.` + ); +} diff --git a/node_modules/jest-util/build/createDirectory.js b/node_modules/jest-util/build/createDirectory.js new file mode 100644 index 00000000..693b93b6 --- /dev/null +++ b/node_modules/jest-util/build/createDirectory.js @@ -0,0 +1,71 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = createDirectory; +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function createDirectory(path) { + try { + fs().mkdirSync(path, { + recursive: true + }); + } catch (e) { + if (e.code !== 'EEXIST') { + throw e; + } + } +} diff --git a/node_modules/jest-util/build/createProcessObject.js b/node_modules/jest-util/build/createProcessObject.js new file mode 100644 index 00000000..3111418a --- /dev/null +++ b/node_modules/jest-util/build/createProcessObject.js @@ -0,0 +1,109 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = createProcessObject; +var _deepCyclicCopy = _interopRequireDefault(require('./deepCyclicCopy')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const BLACKLIST = new Set(['env', 'mainModule', '_events']); +const isWin32 = process.platform === 'win32'; +const proto = Object.getPrototypeOf(process.env); + +// The "process.env" object has a bunch of particularities: first, it does not +// directly extend from Object; second, it converts any assigned value to a +// string; and third, it is case-insensitive in Windows. We use a proxy here to +// mimic it (see https://nodejs.org/api/process.html#process_process_env). + +function createProcessEnv() { + const real = Object.create(proto); + const lookup = {}; + function deletePropertyWin32(_target, key) { + for (const name in real) { + if (Object.prototype.hasOwnProperty.call(real, name)) { + if (typeof key === 'string') { + if (name.toLowerCase() === key.toLowerCase()) { + delete real[name]; + delete lookup[name.toLowerCase()]; + } + } else { + if (key === name) { + delete real[name]; + delete lookup[name]; + } + } + } + } + return true; + } + function deleteProperty(_target, key) { + delete real[key]; + delete lookup[key]; + return true; + } + function getProperty(_target, key) { + return real[key]; + } + function getPropertyWin32(_target, key) { + if (typeof key === 'string') { + return lookup[key in proto ? key : key.toLowerCase()]; + } else { + return real[key]; + } + } + const proxy = new Proxy(real, { + deleteProperty: isWin32 ? deletePropertyWin32 : deleteProperty, + get: isWin32 ? getPropertyWin32 : getProperty, + set(_target, key, value) { + const strValue = `${value}`; + if (typeof key === 'string') { + lookup[key.toLowerCase()] = strValue; + } + real[key] = strValue; + return true; + } + }); + return Object.assign(proxy, process.env); +} +function createProcessObject() { + const process = require('process'); + const newProcess = (0, _deepCyclicCopy.default)(process, { + blacklist: BLACKLIST, + keepPrototype: true + }); + try { + // This fails on Node 12, but it's already set to 'process' + newProcess[Symbol.toStringTag] = 'process'; + } catch (e) { + // Make sure it's actually set instead of potentially ignoring errors + if (newProcess[Symbol.toStringTag] !== 'process') { + e.message = `Unable to set toStringTag on process. Please open up an issue at https://github.com/jestjs/jest\n\n${e.message}`; + throw e; + } + } + + // Sequentially execute all constructors over the object. + let proto = process; + while ((proto = Object.getPrototypeOf(proto))) { + if (typeof proto.constructor === 'function') { + proto.constructor.call(newProcess); + } + } + newProcess.env = createProcessEnv(); + newProcess.send = () => true; + Object.defineProperty(newProcess, 'domain', { + get() { + return process.domain; + } + }); + return newProcess; +} diff --git a/node_modules/jest-util/build/deepCyclicCopy.js b/node_modules/jest-util/build/deepCyclicCopy.js new file mode 100644 index 00000000..e847a785 --- /dev/null +++ b/node_modules/jest-util/build/deepCyclicCopy.js @@ -0,0 +1,76 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = deepCyclicCopy; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const EMPTY = new Set(); +function deepCyclicCopy( + value, + options = { + blacklist: EMPTY, + keepPrototype: false + }, + cycles = new WeakMap() +) { + if (typeof value !== 'object' || value === null || Buffer.isBuffer(value)) { + return value; + } else if (cycles.has(value)) { + return cycles.get(value); + } else if (Array.isArray(value)) { + return deepCyclicCopyArray(value, options, cycles); + } else { + return deepCyclicCopyObject(value, options, cycles); + } +} +function deepCyclicCopyObject(object, options, cycles) { + const newObject = options.keepPrototype + ? Object.create(Object.getPrototypeOf(object)) + : {}; + const descriptors = Object.getOwnPropertyDescriptors(object); + cycles.set(object, newObject); + Object.keys(descriptors).forEach(key => { + if (options.blacklist && options.blacklist.has(key)) { + delete descriptors[key]; + return; + } + const descriptor = descriptors[key]; + if (typeof descriptor.value !== 'undefined') { + descriptor.value = deepCyclicCopy( + descriptor.value, + { + blacklist: EMPTY, + keepPrototype: options.keepPrototype + }, + cycles + ); + } + descriptor.configurable = true; + }); + return Object.defineProperties(newObject, descriptors); +} +function deepCyclicCopyArray(array, options, cycles) { + const newArray = options.keepPrototype + ? new (Object.getPrototypeOf(array).constructor)(array.length) + : []; + const length = array.length; + cycles.set(array, newArray); + for (let i = 0; i < length; i++) { + newArray[i] = deepCyclicCopy( + array[i], + { + blacklist: EMPTY, + keepPrototype: options.keepPrototype + }, + cycles + ); + } + return newArray; +} diff --git a/node_modules/jest-util/build/formatTime.js b/node_modules/jest-util/build/formatTime.js new file mode 100644 index 00000000..deac8d27 --- /dev/null +++ b/node_modules/jest-util/build/formatTime.js @@ -0,0 +1,24 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = formatTime; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function formatTime(time, prefixPower = -3, padLeftLength = 0) { + const prefixes = ['n', 'μ', 'm', '']; + const prefixIndex = Math.max( + 0, + Math.min( + Math.trunc(prefixPower / 3) + prefixes.length - 1, + prefixes.length - 1 + ) + ); + return `${String(time).padStart(padLeftLength)} ${prefixes[prefixIndex]}s`; +} diff --git a/node_modules/jest-util/build/globsToMatcher.js b/node_modules/jest-util/build/globsToMatcher.js new file mode 100644 index 00000000..7a609119 --- /dev/null +++ b/node_modules/jest-util/build/globsToMatcher.js @@ -0,0 +1,98 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = globsToMatcher; +function _picomatch() { + const data = _interopRequireDefault(require('picomatch')); + _picomatch = function () { + return data; + }; + return data; +} +var _replacePathSepForGlob = _interopRequireDefault( + require('./replacePathSepForGlob') +); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const globsToMatchersMap = new Map(); +const picomatchOptions = { + dot: true +}; + +/** + * Converts a list of globs into a function that matches a path against the + * globs. + * + * Every time picomatch is called, it will parse the glob strings and turn + * them into regexp instances. Instead of calling picomatch repeatedly with + * the same globs, we can use this function which will build the picomatch + * matchers ahead of time and then have an optimized path for determining + * whether an individual path matches. + * + * This function is intended to match the behavior of `micromatch()`. + * + * @example + * const isMatch = globsToMatcher(['*.js', '!*.test.js']); + * isMatch('pizza.js'); // true + * isMatch('pizza.test.js'); // false + */ +function globsToMatcher(globs) { + if (globs.length === 0) { + // Since there were no globs given, we can simply have a fast path here and + // return with a very simple function. + return () => false; + } + const matchers = globs.map(glob => { + if (!globsToMatchersMap.has(glob)) { + const isMatch = (0, _picomatch().default)(glob, picomatchOptions, true); + const matcher = { + isMatch, + // Matchers that are negated have different behavior than matchers that + // are not negated, so we need to store this information ahead of time. + negated: isMatch.state.negated || !!isMatch.state.negatedExtglob + }; + globsToMatchersMap.set(glob, matcher); + } + return globsToMatchersMap.get(glob); + }); + return path => { + const replacedPath = (0, _replacePathSepForGlob.default)(path); + let kept = undefined; + let negatives = 0; + for (let i = 0; i < matchers.length; i++) { + const {isMatch, negated} = matchers[i]; + if (negated) { + negatives++; + } + const matched = isMatch(replacedPath); + if (!matched && negated) { + // The path was not matched, and the matcher is a negated matcher, so we + // want to omit the path. This means that the negative matcher is + // filtering the path out. + kept = false; + } else if (matched && !negated) { + // The path was matched, and the matcher is not a negated matcher, so we + // want to keep the path. + kept = true; + } + } + + // If all of the globs were negative globs, then we want to include the path + // as long as it was not explicitly not kept. Otherwise only include + // the path if it was kept. This allows sets of globs that are all negated + // to allow some paths to be matched, while sets of globs that are mixed + // negated and non-negated to cause the negated matchers to only omit paths + // and not keep them. + return negatives === matchers.length ? kept !== false : !!kept; + }; +} diff --git a/node_modules/jest-util/build/index.d.ts b/node_modules/jest-util/build/index.d.ts new file mode 100644 index 00000000..50e92211 --- /dev/null +++ b/node_modules/jest-util/build/index.d.ts @@ -0,0 +1,136 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// + +import type {Config} from '@jest/types'; +import type {Global} from '@jest/types'; + +declare const ARROW = ' \u203A '; + +declare const CLEAR: string; + +export declare function clearLine(stream: NodeJS.WriteStream): void; + +export declare function convertDescriptorToString( + descriptor: Global.BlockNameLike | undefined, +): string; + +export declare function createDirectory(path: string): void; + +export declare function deepCyclicCopy( + value: T, + options?: DeepCyclicCopyOptions, + cycles?: WeakMap, +): T; + +declare type DeepCyclicCopyOptions = { + blacklist?: Set; + keepPrototype?: boolean; +}; + +export declare class ErrorWithStack extends Error { + constructor( + message: string | undefined, + callsite: (...args: Array) => unknown, + stackLimit?: number, + ); +} + +export declare function formatTime( + time: number, + prefixPower?: number, + padLeftLength?: number, +): string; + +/** + * Converts a list of globs into a function that matches a path against the + * globs. + * + * Every time picomatch is called, it will parse the glob strings and turn + * them into regexp instances. Instead of calling picomatch repeatedly with + * the same globs, we can use this function which will build the picomatch + * matchers ahead of time and then have an optimized path for determining + * whether an individual path matches. + * + * This function is intended to match the behavior of `micromatch()`. + * + * @example + * const isMatch = globsToMatcher(['*.js', '!*.test.js']); + * isMatch('pizza.js'); // true + * isMatch('pizza.test.js'); // false + */ +export declare function globsToMatcher(globs: Array): Matcher; + +declare const ICONS: { + failed: string; + pending: string; + success: string; + todo: string; +}; + +export declare function installCommonGlobals( + globalObject: typeof globalThis, + globals: Config.ConfigGlobals, +): typeof globalThis & Config.ConfigGlobals; + +export declare function interopRequireDefault(obj: any): any; + +export declare function invariant( + condition: unknown, + message?: string, +): asserts condition; + +export declare const isInteractive: boolean; + +export declare function isNonNullable(value: T): value is NonNullable; + +export declare function isPromise( + candidate: unknown, +): candidate is PromiseLike; + +declare type Matcher = (str: string) => boolean; + +export declare function pluralize( + word: string, + count: number, + ending?: string, +): string; + +declare namespace preRunMessage { + export {print_2 as print, remove}; +} +export {preRunMessage}; + +declare function print_2(stream: NodeJS.WriteStream): void; + +declare function remove(stream: NodeJS.WriteStream): void; + +export declare function replacePathSepForGlob(path: string): string; + +export declare function requireOrImportModule( + filePath: string, + applyInteropRequireDefault?: boolean, +): Promise; + +export declare function setGlobal( + globalToMutate: typeof globalThis | Global.Global, + key: string, + value: unknown, +): void; + +declare namespace specialChars { + export {ARROW, ICONS, CLEAR}; +} +export {specialChars}; + +export declare function testPathPatternToRegExp( + testPathPattern: Config.GlobalConfig['testPathPattern'], +): RegExp; + +export declare function tryRealpath(path: string): string; + +export {}; diff --git a/node_modules/jest-util/build/index.js b/node_modules/jest-util/build/index.js new file mode 100644 index 00000000..c235000b --- /dev/null +++ b/node_modules/jest-util/build/index.js @@ -0,0 +1,199 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +Object.defineProperty(exports, 'ErrorWithStack', { + enumerable: true, + get: function () { + return _ErrorWithStack.default; + } +}); +Object.defineProperty(exports, 'clearLine', { + enumerable: true, + get: function () { + return _clearLine.default; + } +}); +Object.defineProperty(exports, 'convertDescriptorToString', { + enumerable: true, + get: function () { + return _convertDescriptorToString.default; + } +}); +Object.defineProperty(exports, 'createDirectory', { + enumerable: true, + get: function () { + return _createDirectory.default; + } +}); +Object.defineProperty(exports, 'deepCyclicCopy', { + enumerable: true, + get: function () { + return _deepCyclicCopy.default; + } +}); +Object.defineProperty(exports, 'formatTime', { + enumerable: true, + get: function () { + return _formatTime.default; + } +}); +Object.defineProperty(exports, 'globsToMatcher', { + enumerable: true, + get: function () { + return _globsToMatcher.default; + } +}); +Object.defineProperty(exports, 'installCommonGlobals', { + enumerable: true, + get: function () { + return _installCommonGlobals.default; + } +}); +Object.defineProperty(exports, 'interopRequireDefault', { + enumerable: true, + get: function () { + return _interopRequireDefault.default; + } +}); +Object.defineProperty(exports, 'invariant', { + enumerable: true, + get: function () { + return _invariant.default; + } +}); +Object.defineProperty(exports, 'isInteractive', { + enumerable: true, + get: function () { + return _isInteractive.default; + } +}); +Object.defineProperty(exports, 'isNonNullable', { + enumerable: true, + get: function () { + return _isNonNullable.default; + } +}); +Object.defineProperty(exports, 'isPromise', { + enumerable: true, + get: function () { + return _isPromise.default; + } +}); +Object.defineProperty(exports, 'pluralize', { + enumerable: true, + get: function () { + return _pluralize.default; + } +}); +exports.preRunMessage = void 0; +Object.defineProperty(exports, 'replacePathSepForGlob', { + enumerable: true, + get: function () { + return _replacePathSepForGlob.default; + } +}); +Object.defineProperty(exports, 'requireOrImportModule', { + enumerable: true, + get: function () { + return _requireOrImportModule.default; + } +}); +Object.defineProperty(exports, 'setGlobal', { + enumerable: true, + get: function () { + return _setGlobal.default; + } +}); +exports.specialChars = void 0; +Object.defineProperty(exports, 'testPathPatternToRegExp', { + enumerable: true, + get: function () { + return _testPathPatternToRegExp.default; + } +}); +Object.defineProperty(exports, 'tryRealpath', { + enumerable: true, + get: function () { + return _tryRealpath.default; + } +}); +var preRunMessage = _interopRequireWildcard(require('./preRunMessage')); +exports.preRunMessage = preRunMessage; +var specialChars = _interopRequireWildcard(require('./specialChars')); +exports.specialChars = specialChars; +var _clearLine = _interopRequireDefault2(require('./clearLine')); +var _createDirectory = _interopRequireDefault2(require('./createDirectory')); +var _ErrorWithStack = _interopRequireDefault2(require('./ErrorWithStack')); +var _installCommonGlobals = _interopRequireDefault2( + require('./installCommonGlobals') +); +var _interopRequireDefault = _interopRequireDefault2( + require('./interopRequireDefault') +); +var _isInteractive = _interopRequireDefault2(require('./isInteractive')); +var _isPromise = _interopRequireDefault2(require('./isPromise')); +var _setGlobal = _interopRequireDefault2(require('./setGlobal')); +var _deepCyclicCopy = _interopRequireDefault2(require('./deepCyclicCopy')); +var _convertDescriptorToString = _interopRequireDefault2( + require('./convertDescriptorToString') +); +var _replacePathSepForGlob = _interopRequireDefault2( + require('./replacePathSepForGlob') +); +var _testPathPatternToRegExp = _interopRequireDefault2( + require('./testPathPatternToRegExp') +); +var _globsToMatcher = _interopRequireDefault2(require('./globsToMatcher')); +var _pluralize = _interopRequireDefault2(require('./pluralize')); +var _formatTime = _interopRequireDefault2(require('./formatTime')); +var _tryRealpath = _interopRequireDefault2(require('./tryRealpath')); +var _requireOrImportModule = _interopRequireDefault2( + require('./requireOrImportModule') +); +var _invariant = _interopRequireDefault2(require('./invariant')); +var _isNonNullable = _interopRequireDefault2(require('./isNonNullable')); +function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} diff --git a/node_modules/jest-util/build/installCommonGlobals.js b/node_modules/jest-util/build/installCommonGlobals.js new file mode 100644 index 00000000..9c72bc5f --- /dev/null +++ b/node_modules/jest-util/build/installCommonGlobals.js @@ -0,0 +1,115 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = installCommonGlobals; +function fs() { + const data = _interopRequireWildcard(require('graceful-fs')); + fs = function () { + return data; + }; + return data; +} +var _createProcessObject = _interopRequireDefault( + require('./createProcessObject') +); +var _deepCyclicCopy = _interopRequireDefault(require('./deepCyclicCopy')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== 'function') return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function (nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + if (obj === null || (typeof obj !== 'object' && typeof obj !== 'function')) { + return {default: obj}; + } + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) { + return cache.get(obj); + } + var newObj = {}; + var hasPropertyDescriptor = + Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var key in obj) { + if (key !== 'default' && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor + ? Object.getOwnPropertyDescriptor(obj, key) + : null; + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + newObj.default = obj; + if (cache) { + cache.set(obj, newObj); + } + return newObj; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const DTRACE = Object.keys(globalThis).filter(key => key.startsWith('DTRACE')); +function installCommonGlobals(globalObject, globals) { + globalObject.process = (0, _createProcessObject.default)(); + const symbol = globalObject.Symbol; + // Keep a reference to some globals that Jest needs + Object.defineProperties(globalObject, { + [symbol.for('jest-native-promise')]: { + enumerable: false, + value: Promise, + writable: false + }, + [symbol.for('jest-native-now')]: { + enumerable: false, + value: globalObject.Date.now.bind(globalObject.Date), + writable: false + }, + [symbol.for('jest-native-read-file')]: { + enumerable: false, + value: fs().readFileSync.bind(fs()), + writable: false + }, + [symbol.for('jest-native-write-file')]: { + enumerable: false, + value: fs().writeFileSync.bind(fs()), + writable: false + }, + [symbol.for('jest-native-exists-file')]: { + enumerable: false, + value: fs().existsSync.bind(fs()), + writable: false + }, + 'jest-symbol-do-not-touch': { + enumerable: false, + value: symbol, + writable: false + } + }); + + // Forward some APIs. + DTRACE.forEach(dtrace => { + // @ts-expect-error: no index + globalObject[dtrace] = function (...args) { + // @ts-expect-error: no index + return globalThis[dtrace].apply(this, args); + }; + }); + return Object.assign(globalObject, (0, _deepCyclicCopy.default)(globals)); +} diff --git a/node_modules/jest-util/build/interopRequireDefault.js b/node_modules/jest-util/build/interopRequireDefault.js new file mode 100644 index 00000000..851074af --- /dev/null +++ b/node_modules/jest-util/build/interopRequireDefault.js @@ -0,0 +1,22 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = interopRequireDefault; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// copied from https://github.com/babel/babel/blob/56044c7851d583d498f919e9546caddf8f80a72f/packages/babel-helpers/src/helpers.js#L558-L562 +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +function interopRequireDefault(obj) { + return obj && obj.__esModule + ? obj + : { + default: obj + }; +} diff --git a/node_modules/jest-util/build/invariant.js b/node_modules/jest-util/build/invariant.js new file mode 100644 index 00000000..62fe5d9b --- /dev/null +++ b/node_modules/jest-util/build/invariant.js @@ -0,0 +1,18 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = invariant; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function invariant(condition, message = '') { + if (!condition) { + throw new Error(message); + } +} diff --git a/node_modules/jest-util/build/isInteractive.js b/node_modules/jest-util/build/isInteractive.js new file mode 100644 index 00000000..b4588ba0 --- /dev/null +++ b/node_modules/jest-util/build/isInteractive.js @@ -0,0 +1,22 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _ciInfo() { + const data = require('ci-info'); + _ciInfo = function () { + return data; + }; + return data; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +var _default = + !!process.stdout.isTTY && process.env.TERM !== 'dumb' && !_ciInfo().isCI; +exports.default = _default; diff --git a/node_modules/jest-util/build/isNonNullable.js b/node_modules/jest-util/build/isNonNullable.js new file mode 100644 index 00000000..d7602b01 --- /dev/null +++ b/node_modules/jest-util/build/isNonNullable.js @@ -0,0 +1,16 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = isNonNullable; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function isNonNullable(value) { + return value != null; +} diff --git a/node_modules/jest-util/build/isPromise.js b/node_modules/jest-util/build/isPromise.js new file mode 100644 index 00000000..53dd5df4 --- /dev/null +++ b/node_modules/jest-util/build/isPromise.js @@ -0,0 +1,20 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = isPromise; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function isPromise(candidate) { + return ( + candidate != null && + (typeof candidate === 'object' || typeof candidate === 'function') && + typeof candidate.then === 'function' + ); +} diff --git a/node_modules/jest-util/build/pluralize.js b/node_modules/jest-util/build/pluralize.js new file mode 100644 index 00000000..b2889ed1 --- /dev/null +++ b/node_modules/jest-util/build/pluralize.js @@ -0,0 +1,16 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = pluralize; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function pluralize(word, count, ending = 's') { + return `${count} ${word}${count === 1 ? '' : ending}`; +} diff --git a/node_modules/jest-util/build/preRunMessage.js b/node_modules/jest-util/build/preRunMessage.js new file mode 100644 index 00000000..3f614b40 --- /dev/null +++ b/node_modules/jest-util/build/preRunMessage.js @@ -0,0 +1,38 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.print = print; +exports.remove = remove; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +var _clearLine = _interopRequireDefault(require('./clearLine')); +var _isInteractive = _interopRequireDefault(require('./isInteractive')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function print(stream) { + if (_isInteractive.default) { + stream.write( + _chalk().default.bold.dim('Determining test suites to run...') + ); + } +} +function remove(stream) { + if (_isInteractive.default) { + (0, _clearLine.default)(stream); + } +} diff --git a/node_modules/jest-util/build/replacePathSepForGlob.js b/node_modules/jest-util/build/replacePathSepForGlob.js new file mode 100644 index 00000000..ff806639 --- /dev/null +++ b/node_modules/jest-util/build/replacePathSepForGlob.js @@ -0,0 +1,16 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = replacePathSepForGlob; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function replacePathSepForGlob(path) { + return path.replace(/\\(?![{}()+?.^$])/g, '/'); +} diff --git a/node_modules/jest-util/build/requireOrImportModule.js b/node_modules/jest-util/build/requireOrImportModule.js new file mode 100644 index 00000000..10c6e1ad --- /dev/null +++ b/node_modules/jest-util/build/requireOrImportModule.js @@ -0,0 +1,77 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = requireOrImportModule; +function _path() { + const data = require('path'); + _path = function () { + return data; + }; + return data; +} +function _url() { + const data = require('url'); + _url = function () { + return data; + }; + return data; +} +var _interopRequireDefault = _interopRequireDefault2( + require('./interopRequireDefault') +); +function _interopRequireDefault2(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +async function requireOrImportModule( + filePath, + applyInteropRequireDefault = true +) { + if (!(0, _path().isAbsolute)(filePath) && filePath[0] === '.') { + throw new Error( + `Jest: requireOrImportModule path must be absolute, was "${filePath}"` + ); + } + try { + const requiredModule = require(filePath); + if (!applyInteropRequireDefault) { + return requiredModule; + } + return (0, _interopRequireDefault.default)(requiredModule).default; + } catch (error) { + if (error.code === 'ERR_REQUIRE_ESM') { + try { + const moduleUrl = (0, _url().pathToFileURL)(filePath); + + // node `import()` supports URL, but TypeScript doesn't know that + const importedModule = await import(moduleUrl.href); + if (!applyInteropRequireDefault) { + return importedModule; + } + if (!importedModule.default) { + throw new Error( + `Jest: Failed to load ESM at ${filePath} - did you use a default export?` + ); + } + return importedModule.default; + } catch (innerError) { + if (innerError.message === 'Not supported') { + throw new Error( + `Jest: Your version of Node does not support dynamic import - please enable it or use a .cjs file extension for file ${filePath}` + ); + } + throw innerError; + } + } else { + throw error; + } + } +} diff --git a/node_modules/jest-util/build/setGlobal.js b/node_modules/jest-util/build/setGlobal.js new file mode 100644 index 00000000..d4b2eb04 --- /dev/null +++ b/node_modules/jest-util/build/setGlobal.js @@ -0,0 +1,17 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = setGlobal; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function setGlobal(globalToMutate, key, value) { + // @ts-expect-error: no index + globalToMutate[key] = value; +} diff --git a/node_modules/jest-util/build/specialChars.js b/node_modules/jest-util/build/specialChars.js new file mode 100644 index 00000000..ce5de433 --- /dev/null +++ b/node_modules/jest-util/build/specialChars.js @@ -0,0 +1,25 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.ICONS = exports.CLEAR = exports.ARROW = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const isWindows = process.platform === 'win32'; +const ARROW = ' \u203A '; +exports.ARROW = ARROW; +const ICONS = { + failed: isWindows ? '\u00D7' : '\u2715', + pending: '\u25CB', + success: isWindows ? '\u221A' : '\u2713', + todo: '\u270E' +}; +exports.ICONS = ICONS; +const CLEAR = isWindows ? '\x1B[2J\x1B[0f' : '\x1B[2J\x1B[3J\x1B[H'; +exports.CLEAR = CLEAR; diff --git a/node_modules/jest-util/build/testPathPatternToRegExp.js b/node_modules/jest-util/build/testPathPatternToRegExp.js new file mode 100644 index 00000000..3db3b616 --- /dev/null +++ b/node_modules/jest-util/build/testPathPatternToRegExp.js @@ -0,0 +1,19 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = testPathPatternToRegExp; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Because we serialize/deserialize globalConfig when we spawn workers, +// we can't pass regular expression. Using this shared function on both sides +// will ensure that we produce consistent regexp for testPathPattern. +function testPathPatternToRegExp(testPathPattern) { + return new RegExp(testPathPattern, 'i'); +} diff --git a/node_modules/jest-util/build/tryRealpath.js b/node_modules/jest-util/build/tryRealpath.js new file mode 100644 index 00000000..cdd47e05 --- /dev/null +++ b/node_modules/jest-util/build/tryRealpath.js @@ -0,0 +1,30 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = tryRealpath; +function _gracefulFs() { + const data = require('graceful-fs'); + _gracefulFs = function () { + return data; + }; + return data; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function tryRealpath(path) { + try { + path = _gracefulFs().realpathSync.native(path); + } catch (error) { + if (error.code !== 'ENOENT' && error.code !== 'EISDIR') { + throw error; + } + } + return path; +} diff --git a/node_modules/jest-util/package.json b/node_modules/jest-util/package.json new file mode 100644 index 00000000..33b7b931 --- /dev/null +++ b/node_modules/jest-util/package.json @@ -0,0 +1,38 @@ +{ + "name": "jest-util", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-util" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "devDependencies": { + "@types/graceful-fs": "^4.1.3", + "@types/picomatch": "^2.2.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-validate/LICENSE b/node_modules/jest-validate/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-validate/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-validate/README.md b/node_modules/jest-validate/README.md new file mode 100644 index 00000000..41b275ce --- /dev/null +++ b/node_modules/jest-validate/README.md @@ -0,0 +1,216 @@ +# jest-validate + +Generic configuration validation tool that helps you with warnings, errors and deprecation messages as well as showing users examples of correct configuration. + +```bash +npm install --save jest-validate +``` + +## Usage + +```js +import {validate} from 'jest-validate'; + +validate(config, validationOptions); // => {hasDeprecationWarnings: boolean, isValid: boolean} +``` + +Where `ValidationOptions` are: + +```ts +type ValidationOptions = { + comment?: string; + condition?: (option: unknown, validOption: unknown) => boolean; + deprecate?: ( + config: Record, + option: string, + deprecatedOptions: DeprecatedOptions, + options: ValidationOptions, + ) => boolean; + deprecatedConfig?: DeprecatedOptions; + error?: ( + option: string, + received: unknown, + defaultValue: unknown, + options: ValidationOptions, + path?: Array, + ) => void; + exampleConfig: Record; + recursive?: boolean; + recursiveBlacklist?: Array; + recursiveDenylist?: Array; + title?: Title; + unknown?: ( + config: Record, + exampleConfig: Record, + option: string, + options: ValidationOptions, + path?: Array, + ) => void; +}; + +type Title = { + deprecation?: string; + error?: string; + warning?: string; +}; +``` + +`exampleConfig` is the only option required. + +## API + +By default `jest-validate` will print generic warning and error messages. You can however customize this behavior by providing `options: ValidationOptions` object as a second argument: + +Almost anything can be overwritten to suite your needs. + +### Options + +- `recursiveDenylist` – optional array of string keyPaths that should be excluded from deep (recursive) validation. +- `comment` – optional string to be rendered below error/warning message. +- `condition` – an optional function with validation condition. +- `deprecate`, `error`, `unknown` – optional functions responsible for displaying warning and error messages. +- `deprecatedConfig` – optional object with deprecated config keys. +- `exampleConfig` – the only **required** option with configuration against which you'd like to test. +- `recursive` - optional boolean determining whether recursively compare `exampleConfig` to `config` (default: `true`). +- `title` – optional object of titles for errors and messages. + +You will find examples of `condition`, `deprecate`, `error`, `unknown`, and `deprecatedConfig` inside source of this repository, named respectively. + +## exampleConfig syntax + +`exampleConfig` should be an object with key/value pairs that contain an example of a valid value for each key. A configuration value is considered valid when: + +- it matches the JavaScript type of the example value, e.g. `string`, `number`, `array`, `boolean`, `function`, or `object` +- it is `null` or `undefined` +- it matches the Javascript type of any of arguments passed to `MultipleValidOptions(...)` + +The last condition is a special syntax that allows validating where more than one type is permissible; see example below. It's acceptable to have multiple values of the same type in the example, so you can also use this syntax to provide more than one example. When a validation failure occurs, the error message will show all other values in the array as examples. + +## Examples + +Minimal example: + +```js +validate(config, {exampleConfig}); +``` + +Example with slight modifications: + +```js +validate(config, { + comment: ' Documentation: http://custom-docs.com', + deprecatedConfig, + exampleConfig, + title: { + deprecation: 'Custom Deprecation', + // leaving 'error' and 'warning' as default + }, +}); +``` + +This will output: + +#### Warning: + +```bash +● Validation Warning: + + Unknown option transformx with value "/node_modules/babel-jest" was found. + This is either a typing error or a user mistake. Fixing it will remove this message. + + Documentation: http://custom-docs.com +``` + +#### Error: + +```bash +● Validation Error: + + Option transform must be of type: + object + but instead received: + string + + Example: + { + "transform": { + "\\.js$": "/preprocessor.js" + } + } + + Documentation: http://custom-docs.com +``` + +## Example validating multiple types + +```js +import {multipleValidOptions} from 'jest-validate'; + +validate(config, { + // `bar` will accept either a string or a number + bar: multipleValidOptions('string is ok', 2), +}); +``` + +#### Error: + +```bash +● Validation Error: + + Option foo must be of type: + string or number + but instead received: + array + + Example: + { + "bar": "string is ok" + } + + or + + { + "bar": 2 + } + + Documentation: http://custom-docs.com +``` + +#### Deprecation + +Based on `deprecatedConfig` object with proper deprecation messages. Note custom title: + +```bash +Custom Deprecation: + + Option scriptPreprocessor was replaced by transform, which support multiple preprocessors. + + Jest now treats your current configuration as: + { + "transform": {".*": "xxx"} + } + + Please update your configuration. + + Documentation: http://custom-docs.com +``` + +## Example validating CLI arguments + +```js +import {validate} from 'jest-validate'; + +validateCLIOptions(argv, {...allowedOptions, deprecatedOptions}); +``` + +If `argv` contains a deprecated option that is not specifid in `allowedOptions`, `validateCLIOptions` will throw an error with the message specified in the `deprecatedOptions` config: + +```bash +● collectCoverageOnlyFrom: + + Option "collectCoverageOnlyFrom" was replaced by "collectCoverageFrom" + + CLI Options Documentation: https://jestjs.io/docs/en/cli.html +``` + +If the deprecation option is still listed in the `allowedOptions` config, then `validateCLIOptions` will print the warning wihout throwing an error. diff --git a/node_modules/jest-validate/build/condition.js b/node_modules/jest-validate/build/condition.js new file mode 100644 index 00000000..4b19031d --- /dev/null +++ b/node_modules/jest-validate/build/condition.js @@ -0,0 +1,44 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.getValues = getValues; +exports.multipleValidOptions = multipleValidOptions; +exports.validationCondition = validationCondition; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const toString = Object.prototype.toString; +const MULTIPLE_VALID_OPTIONS_SYMBOL = Symbol('JEST_MULTIPLE_VALID_OPTIONS'); +function validationConditionSingle(option, validOption) { + return ( + option === null || + option === undefined || + (typeof option === 'function' && typeof validOption === 'function') || + toString.call(option) === toString.call(validOption) + ); +} +function getValues(validOption) { + if ( + Array.isArray(validOption) && + // @ts-expect-error: no index signature + validOption[MULTIPLE_VALID_OPTIONS_SYMBOL] + ) { + return validOption; + } + return [validOption]; +} +function validationCondition(option, validOption) { + return getValues(validOption).some(e => validationConditionSingle(option, e)); +} +function multipleValidOptions(...args) { + const options = [...args]; + // @ts-expect-error: no index signature + options[MULTIPLE_VALID_OPTIONS_SYMBOL] = true; + return options; +} diff --git a/node_modules/jest-validate/build/defaultConfig.js b/node_modules/jest-validate/build/defaultConfig.js new file mode 100644 index 00000000..c43f2c03 --- /dev/null +++ b/node_modules/jest-validate/build/defaultConfig.js @@ -0,0 +1,37 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _condition = require('./condition'); +var _deprecated = require('./deprecated'); +var _errors = require('./errors'); +var _utils = require('./utils'); +var _warnings = require('./warnings'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const validationOptions = { + comment: '', + condition: _condition.validationCondition, + deprecate: _deprecated.deprecationWarning, + deprecatedConfig: {}, + error: _errors.errorMessage, + exampleConfig: {}, + recursive: true, + // Allow NPM-sanctioned comments in package.json. Use a "//" key. + recursiveDenylist: ['//'], + title: { + deprecation: _utils.DEPRECATION, + error: _utils.ERROR, + warning: _utils.WARNING + }, + unknown: _warnings.unknownOptionWarning +}; +var _default = validationOptions; +exports.default = _default; diff --git a/node_modules/jest-validate/build/deprecated.js b/node_modules/jest-validate/build/deprecated.js new file mode 100644 index 00000000..e5e80707 --- /dev/null +++ b/node_modules/jest-validate/build/deprecated.js @@ -0,0 +1,28 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.deprecationWarning = void 0; +var _utils = require('./utils'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const deprecationMessage = (message, options) => { + const comment = options.comment; + const name = + (options.title && options.title.deprecation) || _utils.DEPRECATION; + (0, _utils.logValidationWarning)(name, message, comment); +}; +const deprecationWarning = (config, option, deprecatedOptions, options) => { + if (option in deprecatedOptions) { + deprecationMessage(deprecatedOptions[option](config), options); + return true; + } + return false; +}; +exports.deprecationWarning = deprecationWarning; diff --git a/node_modules/jest-validate/build/errors.js b/node_modules/jest-validate/build/errors.js new file mode 100644 index 00000000..4a288027 --- /dev/null +++ b/node_modules/jest-validate/build/errors.js @@ -0,0 +1,64 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.errorMessage = void 0; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _jestGetType() { + const data = require('jest-get-type'); + _jestGetType = function () { + return data; + }; + return data; +} +var _condition = require('./condition'); +var _utils = require('./utils'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const errorMessage = (option, received, defaultValue, options, path) => { + const conditions = (0, _condition.getValues)(defaultValue); + const validTypes = Array.from( + new Set(conditions.map(_jestGetType().getType)) + ); + const message = ` Option ${_chalk().default.bold( + `"${path && path.length > 0 ? `${path.join('.')}.` : ''}${option}"` + )} must be of type: + ${validTypes.map(e => _chalk().default.bold.green(e)).join(' or ')} + but instead received: + ${_chalk().default.bold.red((0, _jestGetType().getType)(received))} + + Example: +${formatExamples(option, conditions)}`; + const comment = options.comment; + const name = (options.title && options.title.error) || _utils.ERROR; + throw new _utils.ValidationError(name, message, comment); +}; +exports.errorMessage = errorMessage; +function formatExamples(option, examples) { + return examples.map( + e => ` { + ${_chalk().default.bold(`"${option}"`)}: ${_chalk().default.bold( + (0, _utils.formatPrettyObject)(e) + )} + }` + ).join(` + + or + +`); +} diff --git a/node_modules/jest-validate/build/exampleConfig.js b/node_modules/jest-validate/build/exampleConfig.js new file mode 100644 index 00000000..92f2d6cc --- /dev/null +++ b/node_modules/jest-validate/build/exampleConfig.js @@ -0,0 +1,38 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const config = { + comment: ' A comment', + condition: () => true, + deprecate: () => false, + deprecatedConfig: { + key: () => 'Deprecation message' + }, + // eslint-disable-next-line @typescript-eslint/no-empty-function + error: () => {}, + exampleConfig: { + key: 'value', + test: 'case' + }, + recursive: true, + recursiveDenylist: [], + title: { + deprecation: 'Deprecation Warning', + error: 'Validation Error', + warning: 'Validation Warning' + }, + // eslint-disable-next-line @typescript-eslint/no-empty-function + unknown: () => {} +}; +var _default = config; +exports.default = _default; diff --git a/node_modules/jest-validate/build/index.d.ts b/node_modules/jest-validate/build/index.d.ts new file mode 100644 index 00000000..64bd1de0 --- /dev/null +++ b/node_modules/jest-validate/build/index.d.ts @@ -0,0 +1,89 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {Config} from '@jest/types'; +import type {Options} from 'yargs'; + +export declare const createDidYouMeanMessage: ( + unrecognized: string, + allowedOptions: Array, +) => string; + +declare type DeprecatedOptionFunc = (arg: Record) => string; + +export declare type DeprecatedOptions = Record; + +export declare const format: (value: unknown) => string; + +export declare const logValidationWarning: ( + name: string, + message: string, + comment?: string | null, +) => void; + +export declare function multipleValidOptions>( + ...args: T +): T[number]; + +declare type Title = { + deprecation?: string; + error?: string; + warning?: string; +}; + +export declare const validate: ( + config: Record, + options: ValidationOptions, +) => { + hasDeprecationWarnings: boolean; + isValid: boolean; +}; + +export declare function validateCLIOptions( + argv: Config.Argv, + options?: Record & { + deprecationEntries?: DeprecatedOptions; + }, + rawArgv?: Array, +): boolean; + +export declare class ValidationError extends Error { + name: string; + message: string; + constructor(name: string, message: string, comment?: string | null); +} + +declare type ValidationOptions = { + comment?: string; + condition?: (option: unknown, validOption: unknown) => boolean; + deprecate?: ( + config: Record, + option: string, + deprecatedOptions: DeprecatedOptions, + options: ValidationOptions, + ) => boolean; + deprecatedConfig?: DeprecatedOptions; + error?: ( + option: string, + received: unknown, + defaultValue: unknown, + options: ValidationOptions, + path?: Array, + ) => void; + exampleConfig: Record; + recursive?: boolean; + recursiveDenylist?: Array; + title?: Title; + unknown?: ( + config: Record, + exampleConfig: Record, + option: string, + options: ValidationOptions, + path?: Array, + ) => void; +}; + +export {}; diff --git a/node_modules/jest-validate/build/index.js b/node_modules/jest-validate/build/index.js new file mode 100644 index 00000000..d0e6b1d7 --- /dev/null +++ b/node_modules/jest-validate/build/index.js @@ -0,0 +1,56 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +Object.defineProperty(exports, 'ValidationError', { + enumerable: true, + get: function () { + return _utils.ValidationError; + } +}); +Object.defineProperty(exports, 'createDidYouMeanMessage', { + enumerable: true, + get: function () { + return _utils.createDidYouMeanMessage; + } +}); +Object.defineProperty(exports, 'format', { + enumerable: true, + get: function () { + return _utils.format; + } +}); +Object.defineProperty(exports, 'logValidationWarning', { + enumerable: true, + get: function () { + return _utils.logValidationWarning; + } +}); +Object.defineProperty(exports, 'multipleValidOptions', { + enumerable: true, + get: function () { + return _condition.multipleValidOptions; + } +}); +Object.defineProperty(exports, 'validate', { + enumerable: true, + get: function () { + return _validate.default; + } +}); +Object.defineProperty(exports, 'validateCLIOptions', { + enumerable: true, + get: function () { + return _validateCLIOptions.default; + } +}); +var _utils = require('./utils'); +var _validate = _interopRequireDefault(require('./validate')); +var _validateCLIOptions = _interopRequireDefault( + require('./validateCLIOptions') +); +var _condition = require('./condition'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} diff --git a/node_modules/jest-validate/build/types.js b/node_modules/jest-validate/build/types.js new file mode 100644 index 00000000..ad9a93a7 --- /dev/null +++ b/node_modules/jest-validate/build/types.js @@ -0,0 +1 @@ +'use strict'; diff --git a/node_modules/jest-validate/build/utils.js b/node_modules/jest-validate/build/utils.js new file mode 100644 index 00000000..d1034968 --- /dev/null +++ b/node_modules/jest-validate/build/utils.js @@ -0,0 +1,100 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.logValidationWarning = + exports.formatPrettyObject = + exports.format = + exports.createDidYouMeanMessage = + exports.WARNING = + exports.ValidationError = + exports.ERROR = + exports.DEPRECATION = + void 0; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _leven() { + const data = _interopRequireDefault(require('leven')); + _leven = function () { + return data; + }; + return data; +} +function _prettyFormat() { + const data = require('pretty-format'); + _prettyFormat = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const BULLET = _chalk().default.bold('\u25cf'); +const DEPRECATION = `${BULLET} Deprecation Warning`; +exports.DEPRECATION = DEPRECATION; +const ERROR = `${BULLET} Validation Error`; +exports.ERROR = ERROR; +const WARNING = `${BULLET} Validation Warning`; +exports.WARNING = WARNING; +const format = value => + typeof value === 'function' + ? value.toString() + : (0, _prettyFormat().format)(value, { + min: true + }); +exports.format = format; +const formatPrettyObject = value => + typeof value === 'function' + ? value.toString() + : typeof value === 'undefined' + ? 'undefined' + : JSON.stringify(value, null, 2).split('\n').join('\n '); +exports.formatPrettyObject = formatPrettyObject; +class ValidationError extends Error { + name; + message; + constructor(name, message, comment) { + super(); + comment = comment ? `\n\n${comment}` : '\n'; + this.name = ''; + this.message = _chalk().default.red( + `${_chalk().default.bold(name)}:\n\n${message}${comment}` + ); + // eslint-disable-next-line @typescript-eslint/no-empty-function + Error.captureStackTrace(this, () => {}); + } +} +exports.ValidationError = ValidationError; +const logValidationWarning = (name, message, comment) => { + comment = comment ? `\n\n${comment}` : '\n'; + console.warn( + _chalk().default.yellow( + `${_chalk().default.bold(name)}:\n\n${message}${comment}` + ) + ); +}; +exports.logValidationWarning = logValidationWarning; +const createDidYouMeanMessage = (unrecognized, allowedOptions) => { + const suggestion = allowedOptions.find(option => { + const steps = (0, _leven().default)(option, unrecognized); + return steps < 3; + }); + return suggestion + ? `Did you mean ${_chalk().default.bold(format(suggestion))}?` + : ''; +}; +exports.createDidYouMeanMessage = createDidYouMeanMessage; diff --git a/node_modules/jest-validate/build/validate.js b/node_modules/jest-validate/build/validate.js new file mode 100644 index 00000000..f40ffdf7 --- /dev/null +++ b/node_modules/jest-validate/build/validate.js @@ -0,0 +1,117 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _defaultConfig = _interopRequireDefault(require('./defaultConfig')); +var _utils = require('./utils'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +let hasDeprecationWarnings = false; +const shouldSkipValidationForPath = (path, key, denylist) => + denylist ? denylist.includes([...path, key].join('.')) : false; +const _validate = (config, exampleConfig, options, path = []) => { + if ( + typeof config !== 'object' || + config == null || + typeof exampleConfig !== 'object' || + exampleConfig == null + ) { + return { + hasDeprecationWarnings + }; + } + for (const key in config) { + if ( + options.deprecatedConfig && + key in options.deprecatedConfig && + typeof options.deprecate === 'function' + ) { + const isDeprecatedKey = options.deprecate( + config, + key, + options.deprecatedConfig, + options + ); + hasDeprecationWarnings = hasDeprecationWarnings || isDeprecatedKey; + } else if (allowsMultipleTypes(key)) { + const value = config[key]; + if ( + typeof options.condition === 'function' && + typeof options.error === 'function' + ) { + if (key === 'maxWorkers' && !isOfTypeStringOrNumber(value)) { + throw new _utils.ValidationError( + 'Validation Error', + `${key} has to be of type string or number`, + 'maxWorkers=50% or\nmaxWorkers=3' + ); + } + } + } else if (Object.hasOwnProperty.call(exampleConfig, key)) { + if ( + typeof options.condition === 'function' && + typeof options.error === 'function' && + !options.condition(config[key], exampleConfig[key]) + ) { + options.error(key, config[key], exampleConfig[key], options, path); + } + } else if ( + shouldSkipValidationForPath(path, key, options.recursiveDenylist) + ) { + // skip validating unknown options inside blacklisted paths + } else { + options.unknown && + options.unknown(config, exampleConfig, key, options, path); + } + if ( + options.recursive && + !Array.isArray(exampleConfig[key]) && + options.recursiveDenylist && + !shouldSkipValidationForPath(path, key, options.recursiveDenylist) + ) { + _validate(config[key], exampleConfig[key], options, [...path, key]); + } + } + return { + hasDeprecationWarnings + }; +}; +const allowsMultipleTypes = key => key === 'maxWorkers'; +const isOfTypeStringOrNumber = value => + typeof value === 'number' || typeof value === 'string'; +const validate = (config, options) => { + hasDeprecationWarnings = false; + + // Preserve default denylist entries even with user-supplied denylist + const combinedDenylist = [ + ...(_defaultConfig.default.recursiveDenylist || []), + ...(options.recursiveDenylist || []) + ]; + const defaultedOptions = Object.assign({ + ..._defaultConfig.default, + ...options, + recursiveDenylist: combinedDenylist, + title: options.title || _defaultConfig.default.title + }); + const {hasDeprecationWarnings: hdw} = _validate( + config, + options.exampleConfig, + defaultedOptions + ); + return { + hasDeprecationWarnings: hdw, + isValid: true + }; +}; +var _default = validate; +exports.default = _default; diff --git a/node_modules/jest-validate/build/validateCLIOptions.js b/node_modules/jest-validate/build/validateCLIOptions.js new file mode 100644 index 00000000..909d0562 --- /dev/null +++ b/node_modules/jest-validate/build/validateCLIOptions.js @@ -0,0 +1,127 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.DOCUMENTATION_NOTE = void 0; +exports.default = validateCLIOptions; +function _camelcase() { + const data = _interopRequireDefault(require('camelcase')); + _camelcase = function () { + return data; + }; + return data; +} +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +var _utils = require('./utils'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const BULLET = _chalk().default.bold('\u25cf'); +const DOCUMENTATION_NOTE = ` ${_chalk().default.bold( + 'CLI Options Documentation:' +)} + https://jestjs.io/docs/cli +`; +exports.DOCUMENTATION_NOTE = DOCUMENTATION_NOTE; +const createCLIValidationError = (unrecognizedOptions, allowedOptions) => { + let title = `${BULLET} Unrecognized CLI Parameter`; + let message; + const comment = + ` ${_chalk().default.bold('CLI Options Documentation')}:\n` + + ' https://jestjs.io/docs/cli\n'; + if (unrecognizedOptions.length === 1) { + const unrecognized = unrecognizedOptions[0]; + const didYouMeanMessage = + unrecognized.length > 1 + ? (0, _utils.createDidYouMeanMessage)( + unrecognized, + Array.from(allowedOptions) + ) + : ''; + message = ` Unrecognized option ${_chalk().default.bold( + (0, _utils.format)(unrecognized) + )}.${didYouMeanMessage ? ` ${didYouMeanMessage}` : ''}`; + } else { + title += 's'; + message = + ' Following options were not recognized:\n' + + ` ${_chalk().default.bold((0, _utils.format)(unrecognizedOptions))}`; + } + return new _utils.ValidationError(title, message, comment); +}; +const validateDeprecatedOptions = ( + deprecatedOptions, + deprecationEntries, + argv +) => { + deprecatedOptions.forEach(opt => { + const name = opt.name; + const message = deprecationEntries[name](argv); + const comment = DOCUMENTATION_NOTE; + if (opt.fatal) { + throw new _utils.ValidationError(name, message, comment); + } else { + (0, _utils.logValidationWarning)(name, message, comment); + } + }); +}; +function validateCLIOptions(argv, options = {}, rawArgv = []) { + const yargsSpecialOptions = ['$0', '_', 'help', 'h']; + const allowedOptions = Object.keys(options).reduce( + (acc, option) => acc.add(option).add(options[option].alias || option), + new Set(yargsSpecialOptions) + ); + const deprecationEntries = options.deprecationEntries ?? {}; + const CLIDeprecations = Object.keys(deprecationEntries).reduce( + (acc, entry) => { + acc[entry] = deprecationEntries[entry]; + if (options[entry]) { + const alias = options[entry].alias; + if (alias) { + acc[alias] = deprecationEntries[entry]; + } + } + return acc; + }, + {} + ); + const deprecations = new Set(Object.keys(CLIDeprecations)); + const deprecatedOptions = Object.keys(argv) + .filter(arg => deprecations.has(arg) && argv[arg] != null) + .map(arg => ({ + fatal: !allowedOptions.has(arg), + name: arg + })); + if (deprecatedOptions.length) { + validateDeprecatedOptions(deprecatedOptions, CLIDeprecations, argv); + } + const unrecognizedOptions = Object.keys(argv).filter( + arg => + !allowedOptions.has( + (0, _camelcase().default)(arg, { + locale: 'en-US' + }) + ) && + !allowedOptions.has(arg) && + (!rawArgv.length || rawArgv.includes(arg)), + [] + ); + if (unrecognizedOptions.length) { + throw createCLIValidationError(unrecognizedOptions, allowedOptions); + } + return true; +} diff --git a/node_modules/jest-validate/build/warnings.js b/node_modules/jest-validate/build/warnings.js new file mode 100644 index 00000000..1860d5ae --- /dev/null +++ b/node_modules/jest-validate/build/warnings.js @@ -0,0 +1,41 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.unknownOptionWarning = void 0; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +var _utils = require('./utils'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const unknownOptionWarning = (config, exampleConfig, option, options, path) => { + const didYouMean = (0, _utils.createDidYouMeanMessage)( + option, + Object.keys(exampleConfig) + ); + const message = ` Unknown option ${_chalk().default.bold( + `"${path && path.length > 0 ? `${path.join('.')}.` : ''}${option}"` + )} with value ${_chalk().default.bold( + (0, _utils.format)(config[option]) + )} was found.${ + didYouMean && ` ${didYouMean}` + }\n This is probably a typing mistake. Fixing it will remove this message.`; + const comment = options.comment; + const name = (options.title && options.title.warning) || _utils.WARNING; + (0, _utils.logValidationWarning)(name, message, comment); +}; +exports.unknownOptionWarning = unknownOptionWarning; diff --git a/node_modules/jest-validate/node_modules/camelcase/index.d.ts b/node_modules/jest-validate/node_modules/camelcase/index.d.ts new file mode 100644 index 00000000..9db94e53 --- /dev/null +++ b/node_modules/jest-validate/node_modules/camelcase/index.d.ts @@ -0,0 +1,103 @@ +declare namespace camelcase { + interface Options { + /** + Uppercase the first character: `foo-bar` → `FooBar`. + + @default false + */ + readonly pascalCase?: boolean; + + /** + Preserve the consecutive uppercase characters: `foo-BAR` → `FooBAR`. + + @default false + */ + readonly preserveConsecutiveUppercase?: boolean; + + /** + The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used. + + Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm. + + Default: The host environment’s current locale. + + @example + ``` + import camelCase = require('camelcase'); + + camelCase('lorem-ipsum', {locale: 'en-US'}); + //=> 'loremIpsum' + camelCase('lorem-ipsum', {locale: 'tr-TR'}); + //=> 'loremİpsum' + camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']}); + //=> 'loremIpsum' + camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']}); + //=> 'loremİpsum' + ``` + */ + readonly locale?: false | string | readonly string[]; + } +} + +/** +Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`. + +Correctly handles Unicode strings. + +@param input - String to convert to camel case. + +@example +``` +import camelCase = require('camelcase'); + +camelCase('foo-bar'); +//=> 'fooBar' + +camelCase('foo_bar'); +//=> 'fooBar' + +camelCase('Foo-Bar'); +//=> 'fooBar' + +camelCase('розовый_пушистый_единорог'); +//=> 'розовыйПушистыйЕдинорог' + +camelCase('Foo-Bar', {pascalCase: true}); +//=> 'FooBar' + +camelCase('--foo.bar', {pascalCase: false}); +//=> 'fooBar' + +camelCase('Foo-BAR', {preserveConsecutiveUppercase: true}); +//=> 'fooBAR' + +camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true})); +//=> 'FooBAR' + +camelCase('foo bar'); +//=> 'fooBar' + +console.log(process.argv[3]); +//=> '--foo-bar' +camelCase(process.argv[3]); +//=> 'fooBar' + +camelCase(['foo', 'bar']); +//=> 'fooBar' + +camelCase(['__foo__', '--bar'], {pascalCase: true}); +//=> 'FooBar' + +camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true}) +//=> 'FooBAR' + +camelCase('lorem-ipsum', {locale: 'en-US'}); +//=> 'loremIpsum' +``` +*/ +declare function camelcase( + input: string | readonly string[], + options?: camelcase.Options +): string; + +export = camelcase; diff --git a/node_modules/jest-validate/node_modules/camelcase/index.js b/node_modules/jest-validate/node_modules/camelcase/index.js new file mode 100644 index 00000000..6ff4ee85 --- /dev/null +++ b/node_modules/jest-validate/node_modules/camelcase/index.js @@ -0,0 +1,113 @@ +'use strict'; + +const UPPERCASE = /[\p{Lu}]/u; +const LOWERCASE = /[\p{Ll}]/u; +const LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu; +const IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u; +const SEPARATORS = /[_.\- ]+/; + +const LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source); +const SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu'); +const NUMBERS_AND_IDENTIFIER = new RegExp('\\d+' + IDENTIFIER.source, 'gu'); + +const preserveCamelCase = (string, toLowerCase, toUpperCase) => { + let isLastCharLower = false; + let isLastCharUpper = false; + let isLastLastCharUpper = false; + + for (let i = 0; i < string.length; i++) { + const character = string[i]; + + if (isLastCharLower && UPPERCASE.test(character)) { + string = string.slice(0, i) + '-' + string.slice(i); + isLastCharLower = false; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = true; + i++; + } else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character)) { + string = string.slice(0, i - 1) + '-' + string.slice(i - 1); + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = false; + isLastCharLower = true; + } else { + isLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character; + isLastLastCharUpper = isLastCharUpper; + isLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character; + } + } + + return string; +}; + +const preserveConsecutiveUppercase = (input, toLowerCase) => { + LEADING_CAPITAL.lastIndex = 0; + + return input.replace(LEADING_CAPITAL, m1 => toLowerCase(m1)); +}; + +const postProcess = (input, toUpperCase) => { + SEPARATORS_AND_IDENTIFIER.lastIndex = 0; + NUMBERS_AND_IDENTIFIER.lastIndex = 0; + + return input.replace(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier)) + .replace(NUMBERS_AND_IDENTIFIER, m => toUpperCase(m)); +}; + +const camelCase = (input, options) => { + if (!(typeof input === 'string' || Array.isArray(input))) { + throw new TypeError('Expected the input to be `string | string[]`'); + } + + options = { + pascalCase: false, + preserveConsecutiveUppercase: false, + ...options + }; + + if (Array.isArray(input)) { + input = input.map(x => x.trim()) + .filter(x => x.length) + .join('-'); + } else { + input = input.trim(); + } + + if (input.length === 0) { + return ''; + } + + const toLowerCase = options.locale === false ? + string => string.toLowerCase() : + string => string.toLocaleLowerCase(options.locale); + const toUpperCase = options.locale === false ? + string => string.toUpperCase() : + string => string.toLocaleUpperCase(options.locale); + + if (input.length === 1) { + return options.pascalCase ? toUpperCase(input) : toLowerCase(input); + } + + const hasUpperCase = input !== toLowerCase(input); + + if (hasUpperCase) { + input = preserveCamelCase(input, toLowerCase, toUpperCase); + } + + input = input.replace(LEADING_SEPARATORS, ''); + + if (options.preserveConsecutiveUppercase) { + input = preserveConsecutiveUppercase(input, toLowerCase); + } else { + input = toLowerCase(input); + } + + if (options.pascalCase) { + input = toUpperCase(input.charAt(0)) + input.slice(1); + } + + return postProcess(input, toUpperCase); +}; + +module.exports = camelCase; +// TODO: Remove this for the next major release +module.exports.default = camelCase; diff --git a/node_modules/jest-validate/node_modules/camelcase/license b/node_modules/jest-validate/node_modules/camelcase/license new file mode 100644 index 00000000..fa7ceba3 --- /dev/null +++ b/node_modules/jest-validate/node_modules/camelcase/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jest-validate/node_modules/camelcase/package.json b/node_modules/jest-validate/node_modules/camelcase/package.json new file mode 100644 index 00000000..c4335792 --- /dev/null +++ b/node_modules/jest-validate/node_modules/camelcase/package.json @@ -0,0 +1,44 @@ +{ + "name": "camelcase", + "version": "6.3.0", + "description": "Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`", + "license": "MIT", + "repository": "sindresorhus/camelcase", + "funding": "https://github.com/sponsors/sindresorhus", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "camelcase", + "camel-case", + "camel", + "case", + "dash", + "hyphen", + "dot", + "underscore", + "separator", + "string", + "text", + "convert", + "pascalcase", + "pascal-case" + ], + "devDependencies": { + "ava": "^1.4.1", + "tsd": "^0.11.0", + "xo": "^0.28.3" + } +} diff --git a/node_modules/jest-validate/node_modules/camelcase/readme.md b/node_modules/jest-validate/node_modules/camelcase/readme.md new file mode 100644 index 00000000..0ff8f9e1 --- /dev/null +++ b/node_modules/jest-validate/node_modules/camelcase/readme.md @@ -0,0 +1,144 @@ +# camelcase + +> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar` + +Correctly handles Unicode strings. + +If you use this on untrusted user input, don't forget to limit the length to something reasonable. + +## Install + +``` +$ npm install camelcase +``` + +*If you need to support Firefox < 78, stay on version 5 as version 6 uses regex features not available in Firefox < 78.* + +## Usage + +```js +const camelCase = require('camelcase'); + +camelCase('foo-bar'); +//=> 'fooBar' + +camelCase('foo_bar'); +//=> 'fooBar' + +camelCase('Foo-Bar'); +//=> 'fooBar' + +camelCase('розовый_пушистый_единорог'); +//=> 'розовыйПушистыйЕдинорог' + +camelCase('Foo-Bar', {pascalCase: true}); +//=> 'FooBar' + +camelCase('--foo.bar', {pascalCase: false}); +//=> 'fooBar' + +camelCase('Foo-BAR', {preserveConsecutiveUppercase: true}); +//=> 'fooBAR' + +camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true})); +//=> 'FooBAR' + +camelCase('foo bar'); +//=> 'fooBar' + +console.log(process.argv[3]); +//=> '--foo-bar' +camelCase(process.argv[3]); +//=> 'fooBar' + +camelCase(['foo', 'bar']); +//=> 'fooBar' + +camelCase(['__foo__', '--bar'], {pascalCase: true}); +//=> 'FooBar' + +camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true}) +//=> 'FooBAR' + +camelCase('lorem-ipsum', {locale: 'en-US'}); +//=> 'loremIpsum' +``` + +## API + +### camelCase(input, options?) + +#### input + +Type: `string | string[]` + +String to convert to camel case. + +#### options + +Type: `object` + +##### pascalCase + +Type: `boolean`\ +Default: `false` + +Uppercase the first character: `foo-bar` → `FooBar` + +##### preserveConsecutiveUppercase + +Type: `boolean`\ +Default: `false` + +Preserve the consecutive uppercase characters: `foo-BAR` → `FooBAR`. + +##### locale + +Type: `false | string | string[]`\ +Default: The host environment’s current locale. + +The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used. + +```js +const camelCase = require('camelcase'); + +camelCase('lorem-ipsum', {locale: 'en-US'}); +//=> 'loremIpsum' + +camelCase('lorem-ipsum', {locale: 'tr-TR'}); +//=> 'loremİpsum' + +camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']}); +//=> 'loremIpsum' + +camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']}); +//=> 'loremİpsum' +``` + +Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm: + +```js +const camelCase = require('camelcase'); + +// On a platform with 'tr-TR' + +camelCase('lorem-ipsum'); +//=> 'loremİpsum' + +camelCase('lorem-ipsum', {locale: false}); +//=> 'loremIpsum' +``` + +## camelcase for enterprise + +Available as part of the Tidelift Subscription. + +The maintainers of camelcase 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-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) + +## Related + +- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module +- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase +- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string +- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one +- [camelcase-keys](https://github.com/sindresorhus/camelcase-keys) - Convert object keys to camel case diff --git a/node_modules/jest-validate/package.json b/node_modules/jest-validate/package.json new file mode 100644 index 00000000..bfe79fc7 --- /dev/null +++ b/node_modules/jest-validate/package.json @@ -0,0 +1,37 @@ +{ + "name": "jest-validate", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-validate" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" + }, + "devDependencies": { + "@types/yargs": "^17.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-watcher/LICENSE b/node_modules/jest-watcher/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-watcher/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-watcher/build/BaseWatchPlugin.js b/node_modules/jest-watcher/build/BaseWatchPlugin.js new file mode 100644 index 00000000..90ea785a --- /dev/null +++ b/node_modules/jest-watcher/build/BaseWatchPlugin.js @@ -0,0 +1,35 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class BaseWatchPlugin { + _stdin; + _stdout; + constructor({stdin, stdout}) { + this._stdin = stdin; + this._stdout = stdout; + } + + // eslint-disable-next-line @typescript-eslint/no-empty-function + apply(_hooks) {} + getUsageInfo(_globalConfig) { + return null; + } + + // eslint-disable-next-line @typescript-eslint/no-empty-function + onKey(_key) {} + run(_globalConfig, _updateConfigAndRun) { + return Promise.resolve(); + } +} +var _default = BaseWatchPlugin; +exports.default = _default; diff --git a/node_modules/jest-watcher/build/JestHooks.js b/node_modules/jest-watcher/build/JestHooks.js new file mode 100644 index 00000000..ddc2731a --- /dev/null +++ b/node_modules/jest-watcher/build/JestHooks.js @@ -0,0 +1,63 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class JestHooks { + _listeners; + _subscriber; + _emitter; + constructor() { + this._listeners = { + onFileChange: [], + onTestRunComplete: [], + shouldRunTestSuite: [] + }; + this._subscriber = { + onFileChange: fn => { + this._listeners.onFileChange.push(fn); + }, + onTestRunComplete: fn => { + this._listeners.onTestRunComplete.push(fn); + }, + shouldRunTestSuite: fn => { + this._listeners.shouldRunTestSuite.push(fn); + } + }; + this._emitter = { + onFileChange: fs => + this._listeners.onFileChange.forEach(listener => listener(fs)), + onTestRunComplete: results => + this._listeners.onTestRunComplete.forEach(listener => + listener(results) + ), + shouldRunTestSuite: async testSuiteInfo => { + const result = await Promise.all( + this._listeners.shouldRunTestSuite.map(listener => + listener(testSuiteInfo) + ) + ); + return result.every(Boolean); + } + }; + } + isUsed(hook) { + return this._listeners[hook]?.length > 0; + } + getSubscriber() { + return this._subscriber; + } + getEmitter() { + return this._emitter; + } +} +var _default = JestHooks; +exports.default = _default; diff --git a/node_modules/jest-watcher/build/PatternPrompt.js b/node_modules/jest-watcher/build/PatternPrompt.js new file mode 100644 index 00000000..55878863 --- /dev/null +++ b/node_modules/jest-watcher/build/PatternPrompt.js @@ -0,0 +1,74 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _ansiEscapes() { + const data = _interopRequireDefault(require('ansi-escapes')); + _ansiEscapes = function () { + return data; + }; + return data; +} +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const {CLEAR} = _jestUtil().specialChars; +const usage = entity => + `\n${_chalk().default.bold('Pattern Mode Usage')}\n` + + ` ${_chalk().default.dim('\u203A Press')} Esc ${_chalk().default.dim( + 'to exit pattern mode.' + )}\n` + + ` ${_chalk().default.dim('\u203A Press')} Enter ` + + `${_chalk().default.dim(`to filter by a ${entity} regex pattern.`)}\n` + + '\n'; +const usageRows = usage('').split('\n').length; +class PatternPrompt { + _currentUsageRows; + constructor(_pipe, _prompt, _entityName = '') { + this._pipe = _pipe; + this._prompt = _prompt; + this._entityName = _entityName; + this._currentUsageRows = usageRows; + } + run(onSuccess, onCancel, options) { + this._pipe.write(_ansiEscapes().default.cursorHide); + this._pipe.write(CLEAR); + if (options && options.header) { + this._pipe.write(`${options.header}\n`); + this._currentUsageRows = usageRows + options.header.split('\n').length; + } else { + this._currentUsageRows = usageRows; + } + this._pipe.write(usage(this._entityName)); + this._pipe.write(_ansiEscapes().default.cursorShow); + this._prompt.enter(this._onChange.bind(this), onSuccess, onCancel); + } + _onChange(_pattern, _options) { + this._pipe.write(_ansiEscapes().default.eraseLine); + this._pipe.write(_ansiEscapes().default.cursorLeft); + } +} +exports.default = PatternPrompt; diff --git a/node_modules/jest-watcher/build/TestWatcher.js b/node_modules/jest-watcher/build/TestWatcher.js new file mode 100644 index 00000000..75578dbb --- /dev/null +++ b/node_modules/jest-watcher/build/TestWatcher.js @@ -0,0 +1,45 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _emittery() { + const data = _interopRequireDefault(require('emittery')); + _emittery = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class TestWatcher extends _emittery().default { + state; + _isWatchMode; + constructor({isWatchMode}) { + super(); + this.state = { + interrupted: false + }; + this._isWatchMode = isWatchMode; + } + async setState(state) { + Object.assign(this.state, state); + await this.emit('change', this.state); + } + isInterrupted() { + return this.state.interrupted; + } + isWatchMode() { + return this._isWatchMode; + } +} +exports.default = TestWatcher; diff --git a/node_modules/jest-watcher/build/constants.js b/node_modules/jest-watcher/build/constants.js new file mode 100644 index 00000000..54706dec --- /dev/null +++ b/node_modules/jest-watcher/build/constants.js @@ -0,0 +1,27 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.KEYS = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const isWindows = process.platform === 'win32'; +const KEYS = { + ARROW_DOWN: '\u001b[B', + ARROW_LEFT: '\u001b[D', + ARROW_RIGHT: '\u001b[C', + ARROW_UP: '\u001b[A', + BACKSPACE: Buffer.from(isWindows ? '08' : '7f', 'hex').toString(), + CONTROL_C: '\u0003', + CONTROL_D: '\u0004', + CONTROL_U: '\u0015', + ENTER: '\r', + ESCAPE: '\u001b' +}; +exports.KEYS = KEYS; diff --git a/node_modules/jest-watcher/build/index.d.ts b/node_modules/jest-watcher/build/index.d.ts new file mode 100644 index 00000000..7d2c1a10 --- /dev/null +++ b/node_modules/jest-watcher/build/index.d.ts @@ -0,0 +1,222 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// + +import type {AggregatedResult} from '@jest/test-result'; +import type {Config} from '@jest/types'; +import Emittery = require('emittery'); + +export declare type AllowedConfigOptions = Partial< + Pick< + Config.GlobalConfig, + | 'bail' + | 'changedSince' + | 'collectCoverage' + | 'collectCoverageFrom' + | 'coverageDirectory' + | 'coverageReporters' + | 'findRelatedTests' + | 'nonFlagArgs' + | 'notify' + | 'notifyMode' + | 'onlyFailures' + | 'reporters' + | 'testNamePattern' + | 'testPathPattern' + | 'updateSnapshot' + | 'verbose' + > & { + mode: 'watch' | 'watchAll'; + } +>; + +declare type AvailableHooks = + | 'onFileChange' + | 'onTestRunComplete' + | 'shouldRunTestSuite'; + +export declare abstract class BaseWatchPlugin implements WatchPlugin { + protected _stdin: NodeJS.ReadStream; + protected _stdout: NodeJS.WriteStream; + constructor({ + stdin, + stdout, + }: { + stdin: NodeJS.ReadStream; + stdout: NodeJS.WriteStream; + }); + apply(_hooks: JestHookSubscriber): void; + getUsageInfo(_globalConfig: Config.GlobalConfig): UsageData | null; + onKey(_key: string): void; + run( + _globalConfig: Config.GlobalConfig, + _updateConfigAndRun: UpdateConfigCallback, + ): Promise; +} + +declare type FileChange = (fs: JestHookExposedFS) => void; + +export declare class JestHook { + private readonly _listeners; + private readonly _subscriber; + private readonly _emitter; + constructor(); + isUsed(hook: AvailableHooks): boolean; + getSubscriber(): Readonly; + getEmitter(): Readonly; +} + +export declare type JestHookEmitter = { + onFileChange: (fs: JestHookExposedFS) => void; + onTestRunComplete: (results: AggregatedResult) => void; + shouldRunTestSuite: ( + testSuiteInfo: TestSuiteInfo, + ) => Promise | boolean; +}; + +declare type JestHookExposedFS = { + projects: Array<{ + config: Config.ProjectConfig; + testPaths: Array; + }>; +}; + +export declare type JestHookSubscriber = { + onFileChange: (fn: FileChange) => void; + onTestRunComplete: (fn: TestRunComplete) => void; + shouldRunTestSuite: (fn: ShouldRunTestSuite) => void; +}; + +export declare const KEYS: { + ARROW_DOWN: string; + ARROW_LEFT: string; + ARROW_RIGHT: string; + ARROW_UP: string; + BACKSPACE: string; + CONTROL_C: string; + CONTROL_D: string; + CONTROL_U: string; + ENTER: string; + ESCAPE: string; +}; + +export declare abstract class PatternPrompt { + protected _pipe: NodeJS.WritableStream; + protected _prompt: Prompt; + protected _entityName: string; + protected _currentUsageRows: number; + constructor( + _pipe: NodeJS.WritableStream, + _prompt: Prompt, + _entityName?: string, + ); + run( + onSuccess: (value: string) => void, + onCancel: () => void, + options?: { + header: string; + }, + ): void; + protected _onChange(_pattern: string, _options: ScrollOptions_2): void; +} + +export declare function printPatternCaret( + pattern: string, + pipe: NodeJS.WritableStream, +): void; + +export declare function printRestoredPatternCaret( + pattern: string, + currentUsageRows: number, + pipe: NodeJS.WritableStream, +): void; + +export declare class Prompt { + private _entering; + private _value; + private _onChange; + private _onSuccess; + private _onCancel; + private _offset; + private _promptLength; + private _selection; + constructor(); + private readonly _onResize; + enter( + onChange: (pattern: string, options: ScrollOptions_2) => void, + onSuccess: (pattern: string) => void, + onCancel: () => void, + ): void; + setPromptLength(length: number): void; + setPromptSelection(selected: string): void; + put(key: string): void; + abort(): void; + isEntering(): boolean; +} + +declare type ScrollOptions_2 = { + offset: number; + max: number; +}; +export {ScrollOptions_2 as ScrollOptions}; + +declare type ShouldRunTestSuite = ( + testSuiteInfo: TestSuiteInfo, +) => Promise; + +declare type State = { + interrupted: boolean; +}; + +declare type TestRunComplete = (results: AggregatedResult) => void; + +declare type TestSuiteInfo = { + config: Config.ProjectConfig; + duration?: number; + testPath: string; +}; + +export declare class TestWatcher extends Emittery<{ + change: State; +}> { + state: State; + private readonly _isWatchMode; + constructor({isWatchMode}: {isWatchMode: boolean}); + setState(state: State): Promise; + isInterrupted(): boolean; + isWatchMode(): boolean; +} + +export declare type UpdateConfigCallback = ( + config?: AllowedConfigOptions, +) => void; + +export declare type UsageData = { + key: string; + prompt: string; +}; + +export declare interface WatchPlugin { + isInternal?: boolean; + apply?: (hooks: JestHookSubscriber) => void; + getUsageInfo?: (globalConfig: Config.GlobalConfig) => UsageData | null; + onKey?: (value: string) => void; + run?: ( + globalConfig: Config.GlobalConfig, + updateConfigAndRun: UpdateConfigCallback, + ) => Promise; +} + +export declare interface WatchPluginClass { + new (options: { + config: Record; + stdin: NodeJS.ReadStream; + stdout: NodeJS.WriteStream; + }): WatchPlugin; +} + +export {}; diff --git a/node_modules/jest-watcher/build/index.js b/node_modules/jest-watcher/build/index.js new file mode 100644 index 00000000..a1015f4c --- /dev/null +++ b/node_modules/jest-watcher/build/index.js @@ -0,0 +1,74 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +var _exportNames = { + BaseWatchPlugin: true, + JestHook: true, + PatternPrompt: true, + TestWatcher: true, + Prompt: true +}; +Object.defineProperty(exports, 'BaseWatchPlugin', { + enumerable: true, + get: function () { + return _BaseWatchPlugin.default; + } +}); +Object.defineProperty(exports, 'JestHook', { + enumerable: true, + get: function () { + return _JestHooks.default; + } +}); +Object.defineProperty(exports, 'PatternPrompt', { + enumerable: true, + get: function () { + return _PatternPrompt.default; + } +}); +Object.defineProperty(exports, 'Prompt', { + enumerable: true, + get: function () { + return _Prompt.default; + } +}); +Object.defineProperty(exports, 'TestWatcher', { + enumerable: true, + get: function () { + return _TestWatcher.default; + } +}); +var _BaseWatchPlugin = _interopRequireDefault(require('./BaseWatchPlugin')); +var _JestHooks = _interopRequireDefault(require('./JestHooks')); +var _PatternPrompt = _interopRequireDefault(require('./PatternPrompt')); +var _TestWatcher = _interopRequireDefault(require('./TestWatcher')); +var _constants = require('./constants'); +Object.keys(_constants).forEach(function (key) { + if (key === 'default' || key === '__esModule') return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _constants[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _constants[key]; + } + }); +}); +var _Prompt = _interopRequireDefault(require('./lib/Prompt')); +var _patternModeHelpers = require('./lib/patternModeHelpers'); +Object.keys(_patternModeHelpers).forEach(function (key) { + if (key === 'default' || key === '__esModule') return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _patternModeHelpers[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function () { + return _patternModeHelpers[key]; + } + }); +}); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} diff --git a/node_modules/jest-watcher/build/lib/Prompt.js b/node_modules/jest-watcher/build/lib/Prompt.js new file mode 100644 index 00000000..c6c5f5f0 --- /dev/null +++ b/node_modules/jest-watcher/build/lib/Prompt.js @@ -0,0 +1,113 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _constants = require('../constants'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class Prompt { + _entering; + _value; + _onChange; + _onSuccess; + _onCancel; + _offset; + _promptLength; + _selection; + constructor() { + // Copied from `enter` to satisfy TS + this._entering = true; + this._value = ''; + this._selection = null; + this._offset = -1; + this._promptLength = 0; + + /* eslint-disable @typescript-eslint/no-empty-function */ + this._onChange = () => {}; + this._onSuccess = () => {}; + this._onCancel = () => {}; + /* eslint-enable */ + } + + _onResize = () => { + this._onChange(); + }; + enter(onChange, onSuccess, onCancel) { + this._entering = true; + this._value = ''; + this._onSuccess = onSuccess; + this._onCancel = onCancel; + this._selection = null; + this._offset = -1; + this._promptLength = 0; + this._onChange = () => + onChange(this._value, { + max: 10, + offset: this._offset + }); + this._onChange(); + process.stdout.on('resize', this._onResize); + } + setPromptLength(length) { + this._promptLength = length; + } + setPromptSelection(selected) { + this._selection = selected; + } + put(key) { + switch (key) { + case _constants.KEYS.ENTER: + this._entering = false; + this._onSuccess(this._selection ?? this._value); + this.abort(); + break; + case _constants.KEYS.ESCAPE: + this._entering = false; + this._onCancel(this._value); + this.abort(); + break; + case _constants.KEYS.ARROW_DOWN: + this._offset = Math.min(this._offset + 1, this._promptLength - 1); + this._onChange(); + break; + case _constants.KEYS.ARROW_UP: + this._offset = Math.max(this._offset - 1, -1); + this._onChange(); + break; + case _constants.KEYS.ARROW_LEFT: + case _constants.KEYS.ARROW_RIGHT: + break; + case _constants.KEYS.CONTROL_U: + this._value = ''; + this._offset = -1; + this._selection = null; + this._onChange(); + break; + default: + this._value = + key === _constants.KEYS.BACKSPACE + ? this._value.slice(0, -1) + : this._value + key; + this._offset = -1; + this._selection = null; + this._onChange(); + break; + } + } + abort() { + this._entering = false; + this._value = ''; + process.stdout.removeListener('resize', this._onResize); + } + isEntering() { + return this._entering; + } +} +exports.default = Prompt; diff --git a/node_modules/jest-watcher/build/lib/colorize.js b/node_modules/jest-watcher/build/lib/colorize.js new file mode 100644 index 00000000..b339cc5c --- /dev/null +++ b/node_modules/jest-watcher/build/lib/colorize.js @@ -0,0 +1,30 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = colorize; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function colorize(str, start, end) { + return ( + _chalk().default.dim(str.slice(0, start)) + + _chalk().default.reset(str.slice(start, end)) + + _chalk().default.dim(str.slice(end)) + ); +} diff --git a/node_modules/jest-watcher/build/lib/formatTestNameByPattern.js b/node_modules/jest-watcher/build/lib/formatTestNameByPattern.js new file mode 100644 index 00000000..9fdc3a4e --- /dev/null +++ b/node_modules/jest-watcher/build/lib/formatTestNameByPattern.js @@ -0,0 +1,67 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = formatTestNameByPattern; +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +var _colorize = _interopRequireDefault(require('./colorize')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const DOTS = '...'; +const ENTER = '⏎'; +function formatTestNameByPattern(testName, pattern, width) { + const inlineTestName = testName.replace(/(\r\n|\n|\r)/gm, ENTER); + let regexp; + try { + regexp = new RegExp(pattern, 'i'); + } catch { + return _chalk().default.dim(inlineTestName); + } + const match = inlineTestName.match(regexp); + if (!match) { + return _chalk().default.dim(inlineTestName); + } + const startPatternIndex = Math.max(match.index ?? 0, 0); + const endPatternIndex = startPatternIndex + match[0].length; + if (inlineTestName.length <= width) { + return (0, _colorize.default)( + inlineTestName, + startPatternIndex, + endPatternIndex + ); + } + const slicedTestName = inlineTestName.slice(0, width - DOTS.length); + if (startPatternIndex < slicedTestName.length) { + if (endPatternIndex > slicedTestName.length) { + return (0, _colorize.default)( + slicedTestName + DOTS, + startPatternIndex, + slicedTestName.length + DOTS.length + ); + } else { + return (0, _colorize.default)( + slicedTestName + DOTS, + Math.min(startPatternIndex, slicedTestName.length), + endPatternIndex + ); + } + } + return `${_chalk().default.dim(slicedTestName)}${_chalk().default.reset( + DOTS + )}`; +} diff --git a/node_modules/jest-watcher/build/lib/patternModeHelpers.js b/node_modules/jest-watcher/build/lib/patternModeHelpers.js new file mode 100644 index 00000000..873a6e2e --- /dev/null +++ b/node_modules/jest-watcher/build/lib/patternModeHelpers.js @@ -0,0 +1,54 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.printPatternCaret = printPatternCaret; +exports.printRestoredPatternCaret = printRestoredPatternCaret; +function _ansiEscapes() { + const data = _interopRequireDefault(require('ansi-escapes')); + _ansiEscapes = function () { + return data; + }; + return data; +} +function _chalk() { + const data = _interopRequireDefault(require('chalk')); + _chalk = function () { + return data; + }; + return data; +} +function _stringLength() { + const data = _interopRequireDefault(require('string-length')); + _stringLength = function () { + return data; + }; + return data; +} +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function printPatternCaret(pattern, pipe) { + const inputText = `${_chalk().default.dim(' pattern \u203A')} ${pattern}`; + pipe.write(_ansiEscapes().default.eraseDown); + pipe.write(inputText); + pipe.write(_ansiEscapes().default.cursorSavePosition); +} +function printRestoredPatternCaret(pattern, currentUsageRows, pipe) { + const inputText = `${_chalk().default.dim(' pattern \u203A')} ${pattern}`; + pipe.write( + _ansiEscapes().default.cursorTo( + (0, _stringLength().default)(inputText), + currentUsageRows - 1 + ) + ); + pipe.write(_ansiEscapes().default.cursorRestorePosition); +} diff --git a/node_modules/jest-watcher/build/lib/scroll.js b/node_modules/jest-watcher/build/lib/scroll.js new file mode 100644 index 00000000..b9e45939 --- /dev/null +++ b/node_modules/jest-watcher/build/lib/scroll.js @@ -0,0 +1,31 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = scroll; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function scroll(size, {offset, max}) { + let start = 0; + let index = Math.min(offset, size); + const halfScreen = max / 2; + if (index <= halfScreen) { + start = 0; + } else { + if (size >= max) { + start = Math.min(index - halfScreen - 1, size - max); + } + index = Math.min(index - start, size); + } + return { + end: Math.min(size, start + max), + index, + start + }; +} diff --git a/node_modules/jest-watcher/build/types.js b/node_modules/jest-watcher/build/types.js new file mode 100644 index 00000000..ad9a93a7 --- /dev/null +++ b/node_modules/jest-watcher/build/types.js @@ -0,0 +1 @@ +'use strict'; diff --git a/node_modules/jest-watcher/package.json b/node_modules/jest-watcher/package.json new file mode 100644 index 00000000..9c18a292 --- /dev/null +++ b/node_modules/jest-watcher/package.json @@ -0,0 +1,41 @@ +{ + "name": "jest-watcher", + "description": "Delightful JavaScript Testing.", + "version": "29.7.0", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-watcher" + }, + "bugs": { + "url": "https://github.com/jestjs/jest/issues" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "homepage": "https://jestjs.io/", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest-worker/LICENSE b/node_modules/jest-worker/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest-worker/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest-worker/README.md b/node_modules/jest-worker/README.md new file mode 100644 index 00000000..f9e1131c --- /dev/null +++ b/node_modules/jest-worker/README.md @@ -0,0 +1,272 @@ +# jest-worker + +Module for executing heavy tasks under forked processes in parallel, by providing a `Promise` based interface, minimum overhead, and bound workers. + +The module works by providing an absolute path of the module to be loaded in all forked processes. All methods are exposed on the parent process as promises, so they can be `await`'ed. Child (worker) methods can either be synchronous or asynchronous. + +The module also implements support for bound workers. Binding a worker means that, based on certain parameters, the same task will always be executed by the same worker. The way bound workers work is by using the returned string of the `computeWorkerKey` method. If the string was used before for a task, the call will be queued to the related worker that processed the task earlier; if not, it will be executed by the first available worker, then sticked to the worker that executed it; so the next time it will be processed by the same worker. If you have no preference on the worker executing the task, but you have defined a `computeWorkerKey` method because you want _some_ of the tasks to be sticked, you can return `null` from it. + +The list of exposed methods can be explicitly provided via the `exposedMethods` option. If it is not provided, it will be obtained by requiring the child module into the main process, and analyzed via reflection. Check the "minimal example" section for a valid one. + +## Install + +```sh +yarn add jest-worker +``` + +## Example + +This example covers the minimal usage: + +### File `parent.js` + +```js +import {Worker as JestWorker} from 'jest-worker'; + +async function main() { + const worker = new JestWorker(require.resolve('./worker')); + const result = await worker.hello('Alice'); // "Hello, Alice" +} + +main(); +``` + +### File `worker.js` + +```js +export function hello(param) { + return `Hello, ${param}`; +} +``` + +## Experimental worker + +Node shipped with [`worker_threads`](https://nodejs.org/api/worker_threads.html), a "threading API" that uses `SharedArrayBuffers` to communicate between the main process and its child threads. This feature can significantly improve the communication time between parent and child processes in `jest-worker`. + +To use `worker_threads` instead of default `child_process` you have to pass `enableWorkerThreads: true` when instantiating the worker. + +## API + +The `Worker` export is a constructor that is initialized by passing the worker path, plus an options object. + +### `workerPath: string | URL` (required) + +Node module name or absolute path or file URL of the file to be loaded in the child processes. You can use `require.resolve` to transform a relative path into an absolute one. + +### `options: Object` (optional) + +#### `computeWorkerKey: (method: string, ...args: Array) => string | null` (optional) + +Every time a method exposed via the API is called, `computeWorkerKey` is also called in order to bound the call to a worker. This is useful for workers that are able to cache the result or part of it. You bound calls to a worker by making `computeWorkerKey` return the same identifier for all different calls. If you do not want to bind the call to any worker, return `null`. + +The callback you provide is called with the method name, plus all the rest of the arguments of the call. Thus, you have full control to decide what to return. Check a practical example on bound workers under the "bound worker usage" section. + +By default, no process is bound to any worker. + +#### `enableWorkerThreads: boolean` (optional) + +By default, `jest-worker` will use `child_process` threads to spawn new Node.js processes. If you prefer [`worker_threads`](https://nodejs.org/api/worker_threads.html) instead, pass `enableWorkerThreads: true`. + +#### `exposedMethods: ReadonlyArray` (optional) + +List of method names that can be called on the child processes from the parent process. You cannot expose any method named like a public `Worker` method, or starting with `_`. If you use method auto-discovery, then these methods will not be exposed, even if they exist. + +#### `forkOptions: ForkOptions` (optional) + +Allow customizing all options passed to `child_process.fork`. By default, some values are set (`cwd`, `env`, `execArgv` and `serialization`), but you can override them and customize the rest. For a list of valid values, check [the Node documentation](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options). + +#### `idleMemoryLimit: number` (optional) + +Specifies the memory limit for workers before they are recycled and is primarily a work-around for [this issue](https://github.com/jestjs/jest/issues/11956); + +After the worker has executed a task the memory usage of it is checked. If it exceeds the value specified the worker is killed and restarted. If no limit is set this process does not occur. The limit can be specified in 2 ways: + +- `<= 1` - The value is assumed to be a percentage of system memory. So 0.5 sets the memory limit of the worker to half of the total system memory +- `\> 1` - Assumed to be a fixed byte value. Because of the previous rule if you wanted a value of 1 byte (I don't know why) you could use `1.1`. + +#### `maxRetries: number` (optional) + +Maximum amount of times that a dead child can be re-spawned, per call. Defaults to `3`, pass `Infinity` to allow endless retries. + +#### `numWorkers: number` (optional) + +Amount of workers to spawn. Defaults to the number of CPUs minus 1. + +#### `resourceLimits: ResourceLimits` (optional) + +The `resourceLimits` option which will be passed to `worker_threads` workers. + +#### `silent: Boolean` (optional) + +Set to false for `stdout` and `stderr` to be logged to console. + +By default this is true. + +#### `setupArgs: Array` (optional) + +The arguments that will be passed to the `setup` method during initialization. + +#### `taskQueue: TaskQueue` (optional) + +The task queue defines in which order tasks (method calls) are processed by the workers. `jest-worker` ships with a `FifoQueue` and `PriorityQueue`: + +- `FifoQueue` (default): Processes the method calls (tasks) in the call order. +- `PriorityQueue`: Processes the method calls by a computed priority in natural ordering (lower priorities first). Tasks with the same priority are processed in any order (FIFO not guaranteed). The constructor accepts a single argument, the function that is passed the name of the called function and the arguments and returns a numerical value for the priority: `new require('jest-worker').PriorityQueue((method, filename) => filename.length)`. + +#### `WorkerPool: new (workerPath: string, options?: WorkerPoolOptions) => WorkerPoolInterface` (optional) + +Provide a custom WorkerPool class to be used for spawning child processes. + +#### `workerSchedulingPolicy: 'round-robin' | 'in-order'` (optional) + +Specifies the policy how tasks are assigned to workers if multiple workers are _idle_: + +- `round-robin` (default): The task will be sequentially distributed onto the workers. The first task is assigned to the worker 1, the second to the worker 2, to ensure that the work is distributed across workers. +- `in-order`: The task will be assigned to the first free worker starting with worker 1 and only assign the work to worker 2 if the worker 1 is busy. + +Tasks are always assigned to the first free worker as soon as tasks start to queue up. The scheduling policy does not define the task scheduling which is always first-in, first-out. + +## JestWorker + +### Methods + +The returned `JestWorker` instance has all the exposed methods, plus some additional ones to interact with the workers itself: + +#### `getStdout(): Readable` + +Returns a `ReadableStream` where the standard output of all workers is piped. Note that the `silent` option of the child workers must be set to `true` to make it work. This is the default set by `jest-worker`, but keep it in mind when overriding options through `forkOptions`. + +#### `getStderr(): Readable` + +Returns a `ReadableStream` where the standard error of all workers is piped. Note that the `silent` option of the child workers must be set to `true` to make it work. This is the default set by `jest-worker`, but keep it in mind when overriding options through `forkOptions`. + +#### `start()` + +Starts up every worker and calls their `setup` function, if it exists. Returns a `Promise` which resolves when all workers are running and have completed their `setup`. + +This is useful if you want to start up all your workers eagerly before they are used to call any other functions. + +#### `end()` + +Finishes the workers by killing all workers. No further calls can be done to the `Worker` instance. + +Returns a `Promise` that resolves with `{ forceExited: boolean }` once all workers are dead. If `forceExited` is `true`, at least one of the workers did not exit gracefully, which likely happened because it executed a leaky task that left handles open. This should be avoided, force exiting workers is a last resort to prevent creating lots of orphans. + +**Note:** + +`await`ing the `end()` Promise immediately after the workers are no longer needed before proceeding to do other useful things in your program may not be a good idea. If workers have to be force exited, `jest-worker` may go through multiple stages of force exiting (e.g. SIGTERM, later SIGKILL) and give the worker overall around 1 second time to exit on its own. During this time, your program will wait, even though it may not be necessary that all workers are dead before continuing execution. + +Consider deliberately leaving this Promise floating (unhandled resolution). After your program has done the rest of its work and is about to exit, the Node process will wait for the Promise to resolve after all workers are dead as the last event loop task. That way you parallelized computation time of your program and waiting time and you didn't delay the outputs of your program unnecessarily. + +### Worker IDs + +Each worker has a unique id (index that starts with `'1'`), which is available inside the worker as `process.env.JEST_WORKER_ID`. + +## Setting up and tearing down the child process + +The child process can define two special methods (both of them can be asynchronous): + +- `setup()`: If defined, it's executed before the first call to any method in the child. +- `teardown()`: If defined, it's executed when the farm ends. + +# More examples + +## Standard usage + +This example covers the standard usage: + +### File `parent.js` + +```js +import {Worker as JestWorker} from 'jest-worker'; + +async function main() { + const myWorker = new JestWorker(require.resolve('./worker'), { + exposedMethods: ['foo', 'bar', 'getWorkerId'], + numWorkers: 4, + }); + + console.log(await myWorker.foo('Alice')); // "Hello from foo: Alice" + console.log(await myWorker.bar('Bob')); // "Hello from bar: Bob" + console.log(await myWorker.getWorkerId()); // "3" -> this message has sent from the 3rd worker + + const {forceExited} = await myWorker.end(); + if (forceExited) { + console.error('Workers failed to exit gracefully'); + } +} + +main(); +``` + +### File `worker.js` + +```js +export function foo(param) { + return `Hello from foo: ${param}`; +} + +export function bar(param) { + return `Hello from bar: ${param}`; +} + +export function getWorkerId() { + return process.env.JEST_WORKER_ID; +} +``` + +## Bound worker usage: + +This example covers the usage with a `computeWorkerKey` method: + +### File `parent.js` + +```js +import {Worker as JestWorker} from 'jest-worker'; + +async function main() { + const myWorker = new JestWorker(require.resolve('./worker'), { + computeWorkerKey: (method, filename) => filename, + }); + + // Transform the given file, within the first available worker. + console.log(await myWorker.transform('/tmp/foo.js')); + + // Wait a bit. + await sleep(10000); + + // Transform the same file again. Will immediately return because the + // transformed file is cached in the worker, and `computeWorkerKey` ensures + // the same worker that processed the file the first time will process it now. + console.log(await myWorker.transform('/tmp/foo.js')); + + const {forceExited} = await myWorker.end(); + if (forceExited) { + console.error('Workers failed to exit gracefully'); + } +} + +main(); +``` + +### File `worker.js` + +```js +import babel from '@babel/core'; + +const cache = Object.create(null); + +export function transform(filename) { + if (cache[filename]) { + return cache[filename]; + } + + // jest-worker can handle both immediate results and thenables. If a + // thenable is returned, it will be await'ed until it resolves. + return babel.transformFileAsync(filename).then(result => { + cache[filename] = result; + + return result; + }); +} +``` diff --git a/node_modules/jest-worker/build/Farm.js b/node_modules/jest-worker/build/Farm.js new file mode 100644 index 00000000..bb9accf6 --- /dev/null +++ b/node_modules/jest-worker/build/Farm.js @@ -0,0 +1,152 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _FifoQueue = _interopRequireDefault(require('./FifoQueue')); +var _types = require('./types'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class Farm { + _computeWorkerKey; + _workerSchedulingPolicy; + _cacheKeys = Object.create(null); + _locks = []; + _offset = 0; + _taskQueue; + constructor(_numOfWorkers, _callback, options = {}) { + this._numOfWorkers = _numOfWorkers; + this._callback = _callback; + this._computeWorkerKey = options.computeWorkerKey; + this._workerSchedulingPolicy = + options.workerSchedulingPolicy ?? 'round-robin'; + this._taskQueue = options.taskQueue ?? new _FifoQueue.default(); + } + doWork(method, ...args) { + const customMessageListeners = new Set(); + const addCustomMessageListener = listener => { + customMessageListeners.add(listener); + return () => { + customMessageListeners.delete(listener); + }; + }; + const onCustomMessage = message => { + customMessageListeners.forEach(listener => listener(message)); + }; + const promise = new Promise( + // Bind args to this function so it won't reference to the parent scope. + // This prevents a memory leak in v8, because otherwise the function will + // retain args for the closure. + ((args, resolve, reject) => { + const computeWorkerKey = this._computeWorkerKey; + const request = [_types.CHILD_MESSAGE_CALL, false, method, args]; + let worker = null; + let hash = null; + if (computeWorkerKey) { + hash = computeWorkerKey.call(this, method, ...args); + worker = hash == null ? null : this._cacheKeys[hash]; + } + const onStart = worker => { + if (hash != null) { + this._cacheKeys[hash] = worker; + } + }; + const onEnd = (error, result) => { + customMessageListeners.clear(); + if (error) { + reject(error); + } else { + resolve(result); + } + }; + const task = { + onCustomMessage, + onEnd, + onStart, + request + }; + if (worker) { + this._taskQueue.enqueue(task, worker.getWorkerId()); + this._process(worker.getWorkerId()); + } else { + this._push(task); + } + }).bind(null, args) + ); + promise.UNSTABLE_onCustomMessage = addCustomMessageListener; + return promise; + } + _process(workerId) { + if (this._isLocked(workerId)) { + return this; + } + const task = this._taskQueue.dequeue(workerId); + if (!task) { + return this; + } + if (task.request[1]) { + throw new Error('Queue implementation returned processed task'); + } + + // Reference the task object outside so it won't be retained by onEnd, + // and other properties of the task object, such as task.request can be + // garbage collected. + let taskOnEnd = task.onEnd; + const onEnd = (error, result) => { + if (taskOnEnd) { + taskOnEnd(error, result); + } + taskOnEnd = null; + this._unlock(workerId); + this._process(workerId); + }; + task.request[1] = true; + this._lock(workerId); + this._callback( + workerId, + task.request, + task.onStart, + onEnd, + task.onCustomMessage + ); + return this; + } + _push(task) { + this._taskQueue.enqueue(task); + const offset = this._getNextWorkerOffset(); + for (let i = 0; i < this._numOfWorkers; i++) { + this._process((offset + i) % this._numOfWorkers); + if (task.request[1]) { + break; + } + } + return this; + } + _getNextWorkerOffset() { + switch (this._workerSchedulingPolicy) { + case 'in-order': + return 0; + case 'round-robin': + return this._offset++; + } + } + _lock(workerId) { + this._locks[workerId] = true; + } + _unlock(workerId) { + this._locks[workerId] = false; + } + _isLocked(workerId) { + return this._locks[workerId]; + } +} +exports.default = Farm; diff --git a/node_modules/jest-worker/build/FifoQueue.js b/node_modules/jest-worker/build/FifoQueue.js new file mode 100644 index 00000000..1831e024 --- /dev/null +++ b/node_modules/jest-worker/build/FifoQueue.js @@ -0,0 +1,89 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * First-in, First-out task queue that manages a dedicated pool + * for each worker as well as a shared queue. The FIFO ordering is guaranteed + * across the worker specific and shared queue. + */ +class FifoQueue { + _workerQueues = []; + _sharedQueue = new InternalQueue(); + enqueue(task, workerId) { + if (workerId == null) { + this._sharedQueue.enqueue(task); + return; + } + let workerQueue = this._workerQueues[workerId]; + if (workerQueue == null) { + workerQueue = this._workerQueues[workerId] = new InternalQueue(); + } + const sharedTop = this._sharedQueue.peekLast(); + const item = { + previousSharedTask: sharedTop, + task + }; + workerQueue.enqueue(item); + } + dequeue(workerId) { + const workerTop = this._workerQueues[workerId]?.peek(); + const sharedTaskIsProcessed = + workerTop?.previousSharedTask?.request[1] ?? true; + + // Process the top task from the shared queue if + // - there's no task in the worker specific queue or + // - if the non-worker-specific task after which this worker specific task + // has been queued wasn't processed yet + if (workerTop != null && sharedTaskIsProcessed) { + return this._workerQueues[workerId]?.dequeue()?.task ?? null; + } + return this._sharedQueue.dequeue(); + } +} +exports.default = FifoQueue; +/** + * FIFO queue for a single worker / shared queue. + */ +class InternalQueue { + _head = null; + _last = null; + enqueue(value) { + const item = { + next: null, + value + }; + if (this._last == null) { + this._head = item; + } else { + this._last.next = item; + } + this._last = item; + } + dequeue() { + if (this._head == null) { + return null; + } + const item = this._head; + this._head = item.next; + if (this._head == null) { + this._last = null; + } + return item.value; + } + peek() { + return this._head?.value ?? null; + } + peekLast() { + return this._last?.value ?? null; + } +} diff --git a/node_modules/jest-worker/build/PriorityQueue.js b/node_modules/jest-worker/build/PriorityQueue.js new file mode 100644 index 00000000..6218a8ea --- /dev/null +++ b/node_modules/jest-worker/build/PriorityQueue.js @@ -0,0 +1,137 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * Priority queue that processes tasks in natural ordering (lower priority first) + * according to the priority computed by the function passed in the constructor. + * + * FIFO ordering isn't guaranteed for tasks with the same priority. + * + * Worker specific tasks with the same priority as a non-worker specific task + * are always processed first. + */ +class PriorityQueue { + _queue = []; + _sharedQueue = new MinHeap(); + constructor(_computePriority) { + this._computePriority = _computePriority; + } + enqueue(task, workerId) { + if (workerId == null) { + this._enqueue(task, this._sharedQueue); + } else { + const queue = this._getWorkerQueue(workerId); + this._enqueue(task, queue); + } + } + _enqueue(task, queue) { + const item = { + priority: this._computePriority(task.request[2], ...task.request[3]), + task + }; + queue.add(item); + } + dequeue(workerId) { + const workerQueue = this._getWorkerQueue(workerId); + const workerTop = workerQueue.peek(); + const sharedTop = this._sharedQueue.peek(); + + // use the task from the worker queue if there's no task in the shared queue + // or if the priority of the worker queue is smaller or equal to the + // priority of the top task in the shared queue. The tasks of the + // worker specific queue are preferred because no other worker can pick this + // specific task up. + if ( + sharedTop == null || + (workerTop != null && workerTop.priority <= sharedTop.priority) + ) { + return workerQueue.poll()?.task ?? null; + } + return this._sharedQueue.poll().task; + } + _getWorkerQueue(workerId) { + let queue = this._queue[workerId]; + if (queue == null) { + queue = this._queue[workerId] = new MinHeap(); + } + return queue; + } +} +exports.default = PriorityQueue; +class MinHeap { + _heap = []; + peek() { + return this._heap[0] ?? null; + } + add(item) { + const nodes = this._heap; + nodes.push(item); + if (nodes.length === 1) { + return; + } + let currentIndex = nodes.length - 1; + + // Bubble up the added node as long as the parent is bigger + while (currentIndex > 0) { + const parentIndex = Math.floor((currentIndex + 1) / 2) - 1; + const parent = nodes[parentIndex]; + if (parent.priority <= item.priority) { + break; + } + nodes[currentIndex] = parent; + nodes[parentIndex] = item; + currentIndex = parentIndex; + } + } + poll() { + const nodes = this._heap; + const result = nodes[0]; + const lastElement = nodes.pop(); + + // heap was empty or removed the last element + if (result == null || nodes.length === 0) { + return result ?? null; + } + let index = 0; + nodes[0] = lastElement ?? null; + const element = nodes[0]; + while (true) { + let swapIndex = null; + const rightChildIndex = (index + 1) * 2; + const leftChildIndex = rightChildIndex - 1; + const rightChild = nodes[rightChildIndex]; + const leftChild = nodes[leftChildIndex]; + + // if the left child is smaller, swap with the left + if (leftChild != null && leftChild.priority < element.priority) { + swapIndex = leftChildIndex; + } + + // If the right child is smaller or the right child is smaller than the left + // then swap with the right child + if ( + rightChild != null && + rightChild.priority < (swapIndex == null ? element : leftChild).priority + ) { + swapIndex = rightChildIndex; + } + if (swapIndex == null) { + break; + } + nodes[index] = nodes[swapIndex]; + nodes[swapIndex] = element; + index = swapIndex; + } + return result; + } +} diff --git a/node_modules/jest-worker/build/WorkerPool.js b/node_modules/jest-worker/build/WorkerPool.js new file mode 100644 index 00000000..b1e439d2 --- /dev/null +++ b/node_modules/jest-worker/build/WorkerPool.js @@ -0,0 +1,34 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +var _BaseWorkerPool = _interopRequireDefault(require('./base/BaseWorkerPool')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class WorkerPool extends _BaseWorkerPool.default { + send(workerId, request, onStart, onEnd, onCustomMessage) { + this.restartWorkerIfShutDown(workerId); + this.getWorkerById(workerId).send(request, onStart, onEnd, onCustomMessage); + } + createWorker(workerOptions) { + let Worker; + if (this._options.enableWorkerThreads) { + Worker = require('./workers/NodeThreadsWorker').default; + } else { + Worker = require('./workers/ChildProcessWorker').default; + } + return new Worker(workerOptions); + } +} +var _default = WorkerPool; +exports.default = _default; diff --git a/node_modules/jest-worker/build/base/BaseWorkerPool.js b/node_modules/jest-worker/build/base/BaseWorkerPool.js new file mode 100644 index 00000000..b49d061d --- /dev/null +++ b/node_modules/jest-worker/build/base/BaseWorkerPool.js @@ -0,0 +1,156 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _mergeStream() { + const data = _interopRequireDefault(require('merge-stream')); + _mergeStream = function () { + return data; + }; + return data; +} +var _types = require('../types'); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// How long to wait for the child process to terminate +// after CHILD_MESSAGE_END before sending force exiting. +const FORCE_EXIT_DELAY = 500; + +/* istanbul ignore next */ +// eslint-disable-next-line @typescript-eslint/no-empty-function +const emptyMethod = () => {}; +class BaseWorkerPool { + _stderr; + _stdout; + _options; + _workers; + _workerPath; + constructor(workerPath, options) { + this._options = options; + this._workerPath = workerPath; + this._workers = new Array(options.numWorkers); + const stdout = (0, _mergeStream().default)(); + const stderr = (0, _mergeStream().default)(); + const {forkOptions, maxRetries, resourceLimits, setupArgs} = options; + for (let i = 0; i < options.numWorkers; i++) { + const workerOptions = { + forkOptions, + idleMemoryLimit: this._options.idleMemoryLimit, + maxRetries, + resourceLimits, + setupArgs, + workerId: i, + workerPath + }; + const worker = this.createWorker(workerOptions); + const workerStdout = worker.getStdout(); + const workerStderr = worker.getStderr(); + if (workerStdout) { + stdout.add(workerStdout); + } + if (workerStderr) { + stderr.add(workerStderr); + } + this._workers[i] = worker; + } + this._stdout = stdout; + this._stderr = stderr; + } + getStderr() { + return this._stderr; + } + getStdout() { + return this._stdout; + } + getWorkers() { + return this._workers; + } + getWorkerById(workerId) { + return this._workers[workerId]; + } + restartWorkerIfShutDown(workerId) { + if (this._workers[workerId].state === _types.WorkerStates.SHUT_DOWN) { + const {forkOptions, maxRetries, resourceLimits, setupArgs} = + this._options; + const workerOptions = { + forkOptions, + idleMemoryLimit: this._options.idleMemoryLimit, + maxRetries, + resourceLimits, + setupArgs, + workerId, + workerPath: this._workerPath + }; + const worker = this.createWorker(workerOptions); + this._workers[workerId] = worker; + } + } + createWorker(_workerOptions) { + throw Error('Missing method createWorker in WorkerPool'); + } + async start() { + await Promise.all( + this._workers.map(async worker => { + await worker.waitForWorkerReady(); + await new Promise((resolve, reject) => { + worker.send( + [_types.CHILD_MESSAGE_CALL_SETUP], + emptyMethod, + error => { + if (error) { + reject(error); + } else { + resolve(); + } + }, + emptyMethod + ); + }); + }) + ); + } + async end() { + // We do not cache the request object here. If so, it would only be only + // processed by one of the workers, and we want them all to close. + const workerExitPromises = this._workers.map(async worker => { + worker.send( + [_types.CHILD_MESSAGE_END, false], + emptyMethod, + emptyMethod, + emptyMethod + ); + + // Schedule a force exit in case worker fails to exit gracefully so + // await worker.waitForExit() never takes longer than FORCE_EXIT_DELAY + let forceExited = false; + const forceExitTimeout = setTimeout(() => { + worker.forceExit(); + forceExited = true; + }, FORCE_EXIT_DELAY); + await worker.waitForExit(); + // Worker ideally exited gracefully, don't send force exit then + clearTimeout(forceExitTimeout); + return forceExited; + }); + const workerExits = await Promise.all(workerExitPromises); + return workerExits.reduce( + (result, forceExited) => ({ + forceExited: result.forceExited || forceExited + }), + { + forceExited: false + } + ); + } +} +exports.default = BaseWorkerPool; diff --git a/node_modules/jest-worker/build/index.d.ts b/node_modules/jest-worker/build/index.d.ts new file mode 100644 index 00000000..8f253768 --- /dev/null +++ b/node_modules/jest-worker/build/index.d.ts @@ -0,0 +1,355 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +/// + +import type {ForkOptions} from 'child_process'; +import type {ResourceLimits} from 'worker_threads'; + +declare const CHILD_MESSAGE_CALL = 1; + +declare const CHILD_MESSAGE_CALL_SETUP = 4; + +declare const CHILD_MESSAGE_END = 2; + +declare const CHILD_MESSAGE_INITIALIZE = 0; + +declare const CHILD_MESSAGE_MEM_USAGE = 3; + +declare type ChildMessage = + | ChildMessageInitialize + | ChildMessageCall + | ChildMessageEnd + | ChildMessageMemUsage + | ChildMessageCallSetup; + +declare type ChildMessageCall = [ + type: typeof CHILD_MESSAGE_CALL, + isProcessed: boolean, + methodName: string, + args: Array, +]; + +declare type ChildMessageCallSetup = [type: typeof CHILD_MESSAGE_CALL_SETUP]; + +declare type ChildMessageEnd = [ + type: typeof CHILD_MESSAGE_END, + isProcessed: boolean, +]; + +declare type ChildMessageInitialize = [ + type: typeof CHILD_MESSAGE_INITIALIZE, + isProcessed: boolean, + fileName: string, + setupArgs: Array, + workerId: string | undefined, +]; + +declare type ChildMessageMemUsage = [type: typeof CHILD_MESSAGE_MEM_USAGE]; + +declare type ComputeTaskPriorityCallback = ( + method: string, + ...args: Array +) => number; + +declare type ExcludeReservedKeys = Exclude; + +/** + * First-in, First-out task queue that manages a dedicated pool + * for each worker as well as a shared queue. The FIFO ordering is guaranteed + * across the worker specific and shared queue. + */ +export declare class FifoQueue implements TaskQueue { + private _workerQueues; + private readonly _sharedQueue; + enqueue(task: QueueChildMessage, workerId?: number): void; + dequeue(workerId: number): QueueChildMessage | null; +} + +declare type FunctionLike = (...args: any) => unknown; + +declare type HeapItem = { + priority: number; +}; + +export declare type JestWorkerFarm> = + Worker_2 & WorkerModule; + +export declare function messageParent( + message: unknown, + parentProcess?: NodeJS.Process, +): void; + +declare type MethodLikeKeys = { + [K in keyof T]: T[K] extends FunctionLike ? K : never; +}[keyof T]; + +declare class MinHeap { + private readonly _heap; + peek(): TItem | null; + add(item: TItem): void; + poll(): TItem | null; +} + +declare type OnCustomMessage = (message: Array | unknown) => void; + +declare type OnEnd = (err: Error | null, result: unknown) => void; + +declare type OnStart = (worker: WorkerInterface) => void; + +declare type OnStateChangeHandler = ( + state: WorkerStates, + oldState: WorkerStates, +) => void; + +declare type PoolExitResult = { + forceExited: boolean; +}; + +/** + * Priority queue that processes tasks in natural ordering (lower priority first) + * according to the priority computed by the function passed in the constructor. + * + * FIFO ordering isn't guaranteed for tasks with the same priority. + * + * Worker specific tasks with the same priority as a non-worker specific task + * are always processed first. + */ +export declare class PriorityQueue implements TaskQueue { + private readonly _computePriority; + private _queue; + private readonly _sharedQueue; + constructor(_computePriority: ComputeTaskPriorityCallback); + enqueue(task: QueueChildMessage, workerId?: number): void; + _enqueue(task: QueueChildMessage, queue: MinHeap): void; + dequeue(workerId: number): QueueChildMessage | null; + _getWorkerQueue(workerId: number): MinHeap; +} + +export declare interface PromiseWithCustomMessage extends Promise { + UNSTABLE_onCustomMessage?: (listener: OnCustomMessage) => () => void; +} + +declare type Promisify = ReturnType extends Promise< + infer R +> + ? (...args: Parameters) => Promise + : (...args: Parameters) => Promise>; + +declare type QueueChildMessage = { + request: ChildMessageCall; + onStart: OnStart; + onEnd: OnEnd; + onCustomMessage: OnCustomMessage; +}; + +declare type QueueItem = { + task: QueueChildMessage; + priority: number; +}; + +declare type ReservedKeys = + | 'end' + | 'getStderr' + | 'getStdout' + | 'setup' + | 'teardown'; + +export declare interface TaskQueue { + /** + * Enqueues the task in the queue for the specified worker or adds it to the + * queue shared by all workers + * @param task the task to queue + * @param workerId the id of the worker that should process this task or undefined + * if there's no preference. + */ + enqueue(task: QueueChildMessage, workerId?: number): void; + /** + * Dequeues the next item from the queue for the specified worker + * @param workerId the id of the worker for which the next task should be retrieved + */ + dequeue(workerId: number): QueueChildMessage | null; +} + +/** + * The Jest farm (publicly called "Worker") is a class that allows you to queue + * methods across multiple child processes, in order to parallelize work. This + * is done by providing an absolute path to a module that will be loaded on each + * of the child processes, and bridged to the main process. + * + * Bridged methods are specified by using the "exposedMethods" property of the + * "options" object. This is an array of strings, where each of them corresponds + * to the exported name in the loaded module. + * + * You can also control the amount of workers by using the "numWorkers" property + * of the "options" object, and the settings passed to fork the process through + * the "forkOptions" property. The amount of workers defaults to the amount of + * CPUS minus one. + * + * Queueing calls can be done in two ways: + * - Standard method: calls will be redirected to the first available worker, + * so they will get executed as soon as they can. + * + * - Sticky method: if a "computeWorkerKey" method is provided within the + * config, the resulting string of this method will be used as a key. + * Every time this key is returned, it is guaranteed that your job will be + * processed by the same worker. This is specially useful if your workers + * are caching results. + */ +declare class Worker_2 { + private _ending; + private readonly _farm; + private readonly _options; + private readonly _workerPool; + constructor(workerPath: string | URL, options?: WorkerFarmOptions); + private _bindExposedWorkerMethods; + private _callFunctionWithArgs; + getStderr(): NodeJS.ReadableStream; + getStdout(): NodeJS.ReadableStream; + start(): Promise; + end(): Promise; +} +export {Worker_2 as Worker}; + +declare type WorkerCallback = ( + workerId: number, + request: ChildMessage, + onStart: OnStart, + onEnd: OnEnd, + onCustomMessage: OnCustomMessage, +) => void; + +declare enum WorkerEvents { + STATE_CHANGE = 'state-change', +} + +export declare type WorkerFarmOptions = { + computeWorkerKey?: (method: string, ...args: Array) => string | null; + enableWorkerThreads?: boolean; + exposedMethods?: ReadonlyArray; + forkOptions?: ForkOptions; + maxRetries?: number; + numWorkers?: number; + resourceLimits?: ResourceLimits; + setupArgs?: Array; + taskQueue?: TaskQueue; + WorkerPool?: new ( + workerPath: string, + options?: WorkerPoolOptions, + ) => WorkerPoolInterface; + workerSchedulingPolicy?: WorkerSchedulingPolicy; + idleMemoryLimit?: number; +}; + +declare interface WorkerInterface { + get state(): WorkerStates; + send( + request: ChildMessage, + onProcessStart: OnStart, + onProcessEnd: OnEnd, + onCustomMessage: OnCustomMessage, + ): void; + waitForExit(): Promise; + forceExit(): void; + getWorkerId(): number; + getStderr(): NodeJS.ReadableStream | null; + getStdout(): NodeJS.ReadableStream | null; + /** + * Some system level identifier for the worker. IE, process id, thread id, etc. + */ + getWorkerSystemId(): number; + getMemoryUsage(): Promise; + /** + * Checks to see if the child worker is actually running. + */ + isWorkerRunning(): boolean; + /** + * When the worker child is started and ready to start handling requests. + * + * @remarks + * This mostly exists to help with testing so that you don't check the status + * of things like isWorkerRunning before it actually is. + */ + waitForWorkerReady(): Promise; +} + +declare type WorkerModule = { + [K in keyof T as Extract< + ExcludeReservedKeys, + MethodLikeKeys + >]: T[K] extends FunctionLike ? Promisify : never; +}; + +declare type WorkerOptions_2 = { + forkOptions: ForkOptions; + resourceLimits: ResourceLimits; + setupArgs: Array; + maxRetries: number; + workerId: number; + workerData?: unknown; + workerPath: string; + /** + * After a job has executed the memory usage it should return to. + * + * @remarks + * Note this is different from ResourceLimits in that it checks at idle, after + * a job is complete. So you could have a resource limit of 500MB but an idle + * limit of 50MB. The latter will only trigger if after a job has completed the + * memory usage hasn't returned back down under 50MB. + */ + idleMemoryLimit?: number; + /** + * This mainly exists so the path can be changed during testing. + * https://github.com/jestjs/jest/issues/9543 + */ + childWorkerPath?: string; + /** + * This is useful for debugging individual tests allowing you to see + * the raw output of the worker. + */ + silent?: boolean; + /** + * Used to immediately bind event handlers. + */ + on?: { + [WorkerEvents.STATE_CHANGE]: + | OnStateChangeHandler + | ReadonlyArray; + }; +}; + +export declare interface WorkerPoolInterface { + getStderr(): NodeJS.ReadableStream; + getStdout(): NodeJS.ReadableStream; + getWorkers(): Array; + createWorker(options: WorkerOptions_2): WorkerInterface; + send: WorkerCallback; + start(): Promise; + end(): Promise; +} + +export declare type WorkerPoolOptions = { + setupArgs: Array; + forkOptions: ForkOptions; + resourceLimits: ResourceLimits; + maxRetries: number; + numWorkers: number; + enableWorkerThreads: boolean; + idleMemoryLimit?: number; +}; + +declare type WorkerSchedulingPolicy = 'round-robin' | 'in-order'; + +declare enum WorkerStates { + STARTING = 'starting', + OK = 'ok', + OUT_OF_MEMORY = 'oom', + RESTARTING = 'restarting', + SHUTTING_DOWN = 'shutting-down', + SHUT_DOWN = 'shut-down', +} + +export {}; diff --git a/node_modules/jest-worker/build/index.js b/node_modules/jest-worker/build/index.js new file mode 100644 index 00000000..6e840cc2 --- /dev/null +++ b/node_modules/jest-worker/build/index.js @@ -0,0 +1,192 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +Object.defineProperty(exports, 'FifoQueue', { + enumerable: true, + get: function () { + return _FifoQueue.default; + } +}); +Object.defineProperty(exports, 'PriorityQueue', { + enumerable: true, + get: function () { + return _PriorityQueue.default; + } +}); +exports.Worker = void 0; +Object.defineProperty(exports, 'messageParent', { + enumerable: true, + get: function () { + return _messageParent.default; + } +}); +function _os() { + const data = require('os'); + _os = function () { + return data; + }; + return data; +} +function _path() { + const data = require('path'); + _path = function () { + return data; + }; + return data; +} +function _url() { + const data = require('url'); + _url = function () { + return data; + }; + return data; +} +var _Farm = _interopRequireDefault(require('./Farm')); +var _WorkerPool = _interopRequireDefault(require('./WorkerPool')); +var _PriorityQueue = _interopRequireDefault(require('./PriorityQueue')); +var _FifoQueue = _interopRequireDefault(require('./FifoQueue')); +var _messageParent = _interopRequireDefault(require('./workers/messageParent')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function getExposedMethods(workerPath, options) { + let exposedMethods = options.exposedMethods; + + // If no methods list is given, try getting it by auto-requiring the module. + if (!exposedMethods) { + const module = require(workerPath); + exposedMethods = Object.keys(module).filter( + name => typeof module[name] === 'function' + ); + if (typeof module === 'function') { + exposedMethods = [...exposedMethods, 'default']; + } + } + return exposedMethods; +} +function getNumberOfCpus() { + return typeof _os().availableParallelism === 'function' + ? (0, _os().availableParallelism)() + : (0, _os().cpus)().length; +} + +/** + * The Jest farm (publicly called "Worker") is a class that allows you to queue + * methods across multiple child processes, in order to parallelize work. This + * is done by providing an absolute path to a module that will be loaded on each + * of the child processes, and bridged to the main process. + * + * Bridged methods are specified by using the "exposedMethods" property of the + * "options" object. This is an array of strings, where each of them corresponds + * to the exported name in the loaded module. + * + * You can also control the amount of workers by using the "numWorkers" property + * of the "options" object, and the settings passed to fork the process through + * the "forkOptions" property. The amount of workers defaults to the amount of + * CPUS minus one. + * + * Queueing calls can be done in two ways: + * - Standard method: calls will be redirected to the first available worker, + * so they will get executed as soon as they can. + * + * - Sticky method: if a "computeWorkerKey" method is provided within the + * config, the resulting string of this method will be used as a key. + * Every time this key is returned, it is guaranteed that your job will be + * processed by the same worker. This is specially useful if your workers + * are caching results. + */ +class Worker { + _ending; + _farm; + _options; + _workerPool; + constructor(workerPath, options) { + this._options = { + ...options + }; + this._ending = false; + if (typeof workerPath !== 'string') { + workerPath = workerPath.href; + } + if (workerPath.startsWith('file:')) { + workerPath = (0, _url().fileURLToPath)(workerPath); + } else if (!(0, _path().isAbsolute)(workerPath)) { + throw new Error(`'workerPath' must be absolute, got '${workerPath}'`); + } + const workerPoolOptions = { + enableWorkerThreads: this._options.enableWorkerThreads ?? false, + forkOptions: this._options.forkOptions ?? {}, + idleMemoryLimit: this._options.idleMemoryLimit, + maxRetries: this._options.maxRetries ?? 3, + numWorkers: + this._options.numWorkers ?? Math.max(getNumberOfCpus() - 1, 1), + resourceLimits: this._options.resourceLimits ?? {}, + setupArgs: this._options.setupArgs ?? [] + }; + if (this._options.WorkerPool) { + this._workerPool = new this._options.WorkerPool( + workerPath, + workerPoolOptions + ); + } else { + this._workerPool = new _WorkerPool.default(workerPath, workerPoolOptions); + } + this._farm = new _Farm.default( + workerPoolOptions.numWorkers, + this._workerPool.send.bind(this._workerPool), + { + computeWorkerKey: this._options.computeWorkerKey, + taskQueue: this._options.taskQueue, + workerSchedulingPolicy: this._options.workerSchedulingPolicy + } + ); + this._bindExposedWorkerMethods(workerPath, this._options); + } + _bindExposedWorkerMethods(workerPath, options) { + getExposedMethods(workerPath, options).forEach(name => { + if (name.startsWith('_')) { + return; + } + + // eslint-disable-next-line no-prototype-builtins + if (this.constructor.prototype.hasOwnProperty(name)) { + throw new TypeError(`Cannot define a method called ${name}`); + } + + // @ts-expect-error: dynamic extension of the class instance is expected. + this[name] = this._callFunctionWithArgs.bind(this, name); + }); + } + _callFunctionWithArgs(method, ...args) { + if (this._ending) { + throw new Error('Farm is ended, no more calls can be done to it'); + } + return this._farm.doWork(method, ...args); + } + getStderr() { + return this._workerPool.getStderr(); + } + getStdout() { + return this._workerPool.getStdout(); + } + async start() { + await this._workerPool.start(); + } + async end() { + if (this._ending) { + throw new Error('Farm is ended, no more calls can be done to it'); + } + this._ending = true; + return this._workerPool.end(); + } +} +exports.Worker = Worker; diff --git a/node_modules/jest-worker/build/types.js b/node_modules/jest-worker/build/types.js new file mode 100644 index 00000000..feedb0b7 --- /dev/null +++ b/node_modules/jest-worker/build/types.js @@ -0,0 +1,72 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.WorkerStates = + exports.WorkerEvents = + exports.PARENT_MESSAGE_SETUP_ERROR = + exports.PARENT_MESSAGE_OK = + exports.PARENT_MESSAGE_MEM_USAGE = + exports.PARENT_MESSAGE_CUSTOM = + exports.PARENT_MESSAGE_CLIENT_ERROR = + exports.CHILD_MESSAGE_MEM_USAGE = + exports.CHILD_MESSAGE_INITIALIZE = + exports.CHILD_MESSAGE_END = + exports.CHILD_MESSAGE_CALL_SETUP = + exports.CHILD_MESSAGE_CALL = + void 0; +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// Because of the dynamic nature of a worker communication process, all messages +// coming from any of the other processes cannot be typed. Thus, many types +// include "unknown" as a TS type, which is (unfortunately) correct here. + +const CHILD_MESSAGE_INITIALIZE = 0; +exports.CHILD_MESSAGE_INITIALIZE = CHILD_MESSAGE_INITIALIZE; +const CHILD_MESSAGE_CALL = 1; +exports.CHILD_MESSAGE_CALL = CHILD_MESSAGE_CALL; +const CHILD_MESSAGE_END = 2; +exports.CHILD_MESSAGE_END = CHILD_MESSAGE_END; +const CHILD_MESSAGE_MEM_USAGE = 3; +exports.CHILD_MESSAGE_MEM_USAGE = CHILD_MESSAGE_MEM_USAGE; +const CHILD_MESSAGE_CALL_SETUP = 4; +exports.CHILD_MESSAGE_CALL_SETUP = CHILD_MESSAGE_CALL_SETUP; +const PARENT_MESSAGE_OK = 0; +exports.PARENT_MESSAGE_OK = PARENT_MESSAGE_OK; +const PARENT_MESSAGE_CLIENT_ERROR = 1; +exports.PARENT_MESSAGE_CLIENT_ERROR = PARENT_MESSAGE_CLIENT_ERROR; +const PARENT_MESSAGE_SETUP_ERROR = 2; +exports.PARENT_MESSAGE_SETUP_ERROR = PARENT_MESSAGE_SETUP_ERROR; +const PARENT_MESSAGE_CUSTOM = 3; +exports.PARENT_MESSAGE_CUSTOM = PARENT_MESSAGE_CUSTOM; +const PARENT_MESSAGE_MEM_USAGE = 4; + +// Option objects. + +// Messages passed from the parent to the children. + +// Messages passed from the children to the parent. + +// Queue types. +exports.PARENT_MESSAGE_MEM_USAGE = PARENT_MESSAGE_MEM_USAGE; +let WorkerStates = /*#__PURE__*/ (function (WorkerStates) { + WorkerStates['STARTING'] = 'starting'; + WorkerStates['OK'] = 'ok'; + WorkerStates['OUT_OF_MEMORY'] = 'oom'; + WorkerStates['RESTARTING'] = 'restarting'; + WorkerStates['SHUTTING_DOWN'] = 'shutting-down'; + WorkerStates['SHUT_DOWN'] = 'shut-down'; + return WorkerStates; +})({}); +exports.WorkerStates = WorkerStates; +let WorkerEvents = /*#__PURE__*/ (function (WorkerEvents) { + WorkerEvents['STATE_CHANGE'] = 'state-change'; + return WorkerEvents; +})({}); +exports.WorkerEvents = WorkerEvents; diff --git a/node_modules/jest-worker/build/workers/ChildProcessWorker.js b/node_modules/jest-worker/build/workers/ChildProcessWorker.js new file mode 100644 index 00000000..6a9d1f36 --- /dev/null +++ b/node_modules/jest-worker/build/workers/ChildProcessWorker.js @@ -0,0 +1,490 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = exports.SIGKILL_DELAY = void 0; +function _child_process() { + const data = require('child_process'); + _child_process = function () { + return data; + }; + return data; +} +function _os() { + const data = require('os'); + _os = function () { + return data; + }; + return data; +} +function _mergeStream() { + const data = _interopRequireDefault(require('merge-stream')); + _mergeStream = function () { + return data; + }; + return data; +} +function _supportsColor() { + const data = require('supports-color'); + _supportsColor = function () { + return data; + }; + return data; +} +var _types = require('../types'); +var _WorkerAbstract = _interopRequireDefault(require('./WorkerAbstract')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const SIGNAL_BASE_EXIT_CODE = 128; +const SIGKILL_EXIT_CODE = SIGNAL_BASE_EXIT_CODE + 9; +const SIGTERM_EXIT_CODE = SIGNAL_BASE_EXIT_CODE + 15; + +// How long to wait after SIGTERM before sending SIGKILL +const SIGKILL_DELAY = 500; + +/** + * This class wraps the child process and provides a nice interface to + * communicate with. It takes care of: + * + * - Re-spawning the process if it dies. + * - Queues calls while the worker is busy. + * - Re-sends the requests if the worker blew up. + * + * The reason for queueing them here (since childProcess.send also has an + * internal queue) is because the worker could be doing asynchronous work, and + * this would lead to the child process to read its receiving buffer and start a + * second call. By queueing calls here, we don't send the next call to the + * children until we receive the result of the previous one. + * + * As soon as a request starts to be processed by a worker, its "processed" + * field is changed to "true", so that other workers which might encounter the + * same call skip it. + */ +exports.SIGKILL_DELAY = SIGKILL_DELAY; +class ChildProcessWorker extends _WorkerAbstract.default { + _child; + _options; + _request; + _retries; + _onProcessEnd; + _onCustomMessage; + _stdout; + _stderr; + _stderrBuffer = []; + _memoryUsagePromise; + _resolveMemoryUsage; + _childIdleMemoryUsage; + _childIdleMemoryUsageLimit; + _memoryUsageCheck = false; + _childWorkerPath; + constructor(options) { + super(options); + this._options = options; + this._request = null; + this._stdout = null; + this._stderr = null; + this._childIdleMemoryUsage = null; + this._childIdleMemoryUsageLimit = options.idleMemoryLimit || null; + this._childWorkerPath = + options.childWorkerPath || require.resolve('./processChild'); + this.state = _types.WorkerStates.STARTING; + this.initialize(); + } + initialize() { + if ( + this.state === _types.WorkerStates.OUT_OF_MEMORY || + this.state === _types.WorkerStates.SHUTTING_DOWN || + this.state === _types.WorkerStates.SHUT_DOWN + ) { + return; + } + if (this._child && this._child.connected) { + this._child.kill('SIGKILL'); + } + this.state = _types.WorkerStates.STARTING; + const forceColor = _supportsColor().stdout + ? { + FORCE_COLOR: '1' + } + : {}; + const silent = this._options.silent ?? true; + if (!silent) { + // NOTE: Detecting an out of memory crash is independent of idle memory usage monitoring. We want to + // monitor for a crash occurring so that it can be handled as required and so we can tell the difference + // between an OOM crash and another kind of crash. We need to do this because if a worker crashes due to + // an OOM event sometimes it isn't seen by the worker pool and it just sits there waiting for the worker + // to respond and it never will. + console.warn('Unable to detect out of memory event if silent === false'); + } + this._stderrBuffer = []; + const options = { + cwd: process.cwd(), + env: { + ...process.env, + JEST_WORKER_ID: String(this._options.workerId + 1), + // 0-indexed workerId, 1-indexed JEST_WORKER_ID + ...forceColor + }, + // Suppress --debug / --inspect flags while preserving others (like --harmony). + execArgv: process.execArgv.filter(v => !/^--(debug|inspect)/.test(v)), + // default to advanced serialization in order to match worker threads + serialization: 'advanced', + silent, + ...this._options.forkOptions + }; + this._child = (0, _child_process().fork)( + this._childWorkerPath, + [], + options + ); + if (this._child.stdout) { + if (!this._stdout) { + // We need to add a permanent stream to the merged stream to prevent it + // from ending when the subprocess stream ends + this._stdout = (0, _mergeStream().default)(this._getFakeStream()); + } + this._stdout.add(this._child.stdout); + } + if (this._child.stderr) { + if (!this._stderr) { + // We need to add a permanent stream to the merged stream to prevent it + // from ending when the subprocess stream ends + this._stderr = (0, _mergeStream().default)(this._getFakeStream()); + } + this._stderr.add(this._child.stderr); + this._child.stderr.on('data', this.stderrDataHandler.bind(this)); + } + this._child.on('message', this._onMessage.bind(this)); + this._child.on('exit', this._onExit.bind(this)); + this._child.on('disconnect', this._onDisconnect.bind(this)); + this._child.send([ + _types.CHILD_MESSAGE_INITIALIZE, + false, + this._options.workerPath, + this._options.setupArgs + ]); + this._retries++; + + // If we exceeded the amount of retries, we will emulate an error reply + // coming from the child. This avoids code duplication related with cleaning + // the queue, and scheduling the next call. + if (this._retries > this._options.maxRetries) { + const error = new Error( + `Jest worker encountered ${this._retries} child process exceptions, exceeding retry limit` + ); + this._onMessage([ + _types.PARENT_MESSAGE_CLIENT_ERROR, + error.name, + error.message, + error.stack, + { + type: 'WorkerError' + } + ]); + + // Clear the request so we don't keep executing it. + this._request = null; + } + this.state = _types.WorkerStates.OK; + if (this._resolveWorkerReady) { + this._resolveWorkerReady(); + } + } + stderrDataHandler(chunk) { + if (chunk) { + this._stderrBuffer.push(Buffer.from(chunk)); + } + this._detectOutOfMemoryCrash(); + if (this.state === _types.WorkerStates.OUT_OF_MEMORY) { + this._workerReadyPromise = undefined; + this._resolveWorkerReady = undefined; + this.killChild(); + this._shutdown(); + } + } + _detectOutOfMemoryCrash() { + try { + const bufferStr = Buffer.concat(this._stderrBuffer).toString('utf8'); + if ( + bufferStr.includes('heap out of memory') || + bufferStr.includes('allocation failure;') || + bufferStr.includes('Last few GCs') + ) { + if ( + this.state === _types.WorkerStates.OK || + this.state === _types.WorkerStates.STARTING + ) { + this.state = _types.WorkerStates.OUT_OF_MEMORY; + } + } + } catch (err) { + console.error('Error looking for out of memory crash', err); + } + } + _onDisconnect() { + this._workerReadyPromise = undefined; + this._resolveWorkerReady = undefined; + this._detectOutOfMemoryCrash(); + if (this.state === _types.WorkerStates.OUT_OF_MEMORY) { + this.killChild(); + this._shutdown(); + } + } + _onMessage(response) { + // Ignore messages not intended for us + if (!Array.isArray(response)) return; + + // TODO: Add appropriate type check + let error; + switch (response[0]) { + case _types.PARENT_MESSAGE_OK: + this._onProcessEnd(null, response[1]); + break; + case _types.PARENT_MESSAGE_CLIENT_ERROR: + error = response[4]; + if (error != null && typeof error === 'object') { + const extra = error; + // @ts-expect-error: no index + const NativeCtor = globalThis[response[1]]; + const Ctor = typeof NativeCtor === 'function' ? NativeCtor : Error; + error = new Ctor(response[2]); + error.type = response[1]; + error.stack = response[3]; + for (const key in extra) { + error[key] = extra[key]; + } + } + this._onProcessEnd(error, null); + break; + case _types.PARENT_MESSAGE_SETUP_ERROR: + error = new Error(`Error when calling setup: ${response[2]}`); + error.type = response[1]; + error.stack = response[3]; + this._onProcessEnd(error, null); + break; + case _types.PARENT_MESSAGE_CUSTOM: + this._onCustomMessage(response[1]); + break; + case _types.PARENT_MESSAGE_MEM_USAGE: + this._childIdleMemoryUsage = response[1]; + if (this._resolveMemoryUsage) { + this._resolveMemoryUsage(response[1]); + this._resolveMemoryUsage = undefined; + this._memoryUsagePromise = undefined; + } + this._performRestartIfRequired(); + break; + default: + // Ignore messages not intended for us + break; + } + } + _performRestartIfRequired() { + if (this._memoryUsageCheck) { + this._memoryUsageCheck = false; + let limit = this._childIdleMemoryUsageLimit; + + // TODO: At some point it would make sense to make use of + // stringToBytes found in jest-config, however as this + // package does not have any dependencies on an other jest + // packages that can wait until some other time. + if (limit && limit > 0 && limit <= 1) { + limit = Math.floor((0, _os().totalmem)() * limit); + } else if (limit) { + limit = Math.floor(limit); + } + if ( + limit && + this._childIdleMemoryUsage && + this._childIdleMemoryUsage > limit + ) { + this.state = _types.WorkerStates.RESTARTING; + this.killChild(); + } + } + } + _onExit(exitCode, signal) { + this._workerReadyPromise = undefined; + this._resolveWorkerReady = undefined; + this._detectOutOfMemoryCrash(); + if (exitCode !== 0 && this.state === _types.WorkerStates.OUT_OF_MEMORY) { + this._onProcessEnd( + new Error('Jest worker ran out of memory and crashed'), + null + ); + this._shutdown(); + } else if ( + (exitCode !== 0 && + exitCode !== null && + exitCode !== SIGTERM_EXIT_CODE && + exitCode !== SIGKILL_EXIT_CODE && + this.state !== _types.WorkerStates.SHUTTING_DOWN) || + this.state === _types.WorkerStates.RESTARTING + ) { + this.state = _types.WorkerStates.RESTARTING; + this.initialize(); + if (this._request) { + this._child.send(this._request); + } + } else { + // At this point, it's not clear why the child process exited. There could + // be several reasons: + // + // 1. The child process exited successfully after finishing its work. + // This is the most likely case. + // 2. The child process crashed in a manner that wasn't caught through + // any of the heuristic-based checks above. + // 3. The child process was killed by another process or daemon unrelated + // to Jest. For example, oom-killer on Linux may have picked the child + // process to kill because overall system memory is constrained. + // + // If there's a pending request to the child process in any of those + // situations, the request still needs to be handled in some manner before + // entering the shutdown phase. Otherwise the caller expecting a response + // from the worker will never receive indication that something unexpected + // happened and hang forever. + // + // In normal operation, the request is handled and cleared before the + // child process exits. If it's still present, it's not clear what + // happened and probably best to throw an error. In practice, this usually + // happens when the child process is killed externally. + // + // There's a reasonable argument that the child process should be retried + // with request re-sent in this scenario. However, if the problem was due + // to situations such as oom-killer attempting to free up system + // resources, retrying would exacerbate the problem. + const isRequestStillPending = !!this._request; + if (isRequestStillPending) { + // If a signal is present, we can be reasonably confident the process + // was killed externally. Log this fact so it's more clear to users that + // something went wrong externally, rather than a bug in Jest itself. + const error = new Error( + signal != null + ? `A jest worker process (pid=${this._child.pid}) was terminated by another process: signal=${signal}, exitCode=${exitCode}. Operating system logs may contain more information on why this occurred.` + : `A jest worker process (pid=${this._child.pid}) crashed for an unknown reason: exitCode=${exitCode}` + ); + this._onProcessEnd(error, null); + } + this._shutdown(); + } + } + send(request, onProcessStart, onProcessEnd, onCustomMessage) { + this._stderrBuffer = []; + onProcessStart(this); + this._onProcessEnd = (...args) => { + const hasRequest = !!this._request; + + // Clean the request to avoid sending past requests to workers that fail + // while waiting for a new request (timers, unhandled rejections...) + this._request = null; + if ( + this._childIdleMemoryUsageLimit && + this._child.connected && + hasRequest + ) { + this.checkMemoryUsage(); + } + return onProcessEnd(...args); + }; + this._onCustomMessage = (...arg) => onCustomMessage(...arg); + this._request = request; + this._retries = 0; + // eslint-disable-next-line @typescript-eslint/no-empty-function + this._child.send(request, () => {}); + } + waitForExit() { + return this._exitPromise; + } + killChild() { + // We store a reference so that there's no way we can accidentally + // kill a new worker that has been spawned. + const childToKill = this._child; + childToKill.kill('SIGTERM'); + return setTimeout(() => childToKill.kill('SIGKILL'), SIGKILL_DELAY); + } + forceExit() { + this.state = _types.WorkerStates.SHUTTING_DOWN; + const sigkillTimeout = this.killChild(); + this._exitPromise.then(() => clearTimeout(sigkillTimeout)); + } + getWorkerId() { + return this._options.workerId; + } + + /** + * Gets the process id of the worker. + * + * @returns Process id. + */ + getWorkerSystemId() { + return this._child.pid; + } + getStdout() { + return this._stdout; + } + getStderr() { + return this._stderr; + } + + /** + * Gets the last reported memory usage. + * + * @returns Memory usage in bytes. + */ + getMemoryUsage() { + if (!this._memoryUsagePromise) { + let rejectCallback; + const promise = new Promise((resolve, reject) => { + this._resolveMemoryUsage = resolve; + rejectCallback = reject; + }); + this._memoryUsagePromise = promise; + if (!this._child.connected && rejectCallback) { + rejectCallback(new Error('Child process is not running.')); + this._memoryUsagePromise = undefined; + this._resolveMemoryUsage = undefined; + return promise; + } + this._child.send([_types.CHILD_MESSAGE_MEM_USAGE], err => { + if (err && rejectCallback) { + this._memoryUsagePromise = undefined; + this._resolveMemoryUsage = undefined; + rejectCallback(err); + } + }); + return promise; + } + return this._memoryUsagePromise; + } + + /** + * Gets updated memory usage and restarts if required + */ + checkMemoryUsage() { + if (this._childIdleMemoryUsageLimit) { + this._memoryUsageCheck = true; + this._child.send([_types.CHILD_MESSAGE_MEM_USAGE], err => { + if (err) { + console.error('Unable to check memory usage', err); + } + }); + } else { + console.warn( + 'Memory usage of workers can only be checked if a limit is set' + ); + } + } + isWorkerRunning() { + return this._child.connected && !this._child.killed; + } +} +exports.default = ChildProcessWorker; diff --git a/node_modules/jest-worker/build/workers/NodeThreadsWorker.js b/node_modules/jest-worker/build/workers/NodeThreadsWorker.js new file mode 100644 index 00000000..e25247a6 --- /dev/null +++ b/node_modules/jest-worker/build/workers/NodeThreadsWorker.js @@ -0,0 +1,359 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _os() { + const data = require('os'); + _os = function () { + return data; + }; + return data; +} +function _worker_threads() { + const data = require('worker_threads'); + _worker_threads = function () { + return data; + }; + return data; +} +function _mergeStream() { + const data = _interopRequireDefault(require('merge-stream')); + _mergeStream = function () { + return data; + }; + return data; +} +var _types = require('../types'); +var _WorkerAbstract = _interopRequireDefault(require('./WorkerAbstract')); +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class ExperimentalWorker extends _WorkerAbstract.default { + _worker; + _options; + _request; + _retries; + _onProcessEnd; + _onCustomMessage; + _stdout; + _stderr; + _memoryUsagePromise; + _resolveMemoryUsage; + _childWorkerPath; + _childIdleMemoryUsage; + _childIdleMemoryUsageLimit; + _memoryUsageCheck = false; + constructor(options) { + super(options); + this._options = options; + this._request = null; + this._stdout = null; + this._stderr = null; + this._childWorkerPath = + options.childWorkerPath || require.resolve('./threadChild'); + this._childIdleMemoryUsage = null; + this._childIdleMemoryUsageLimit = options.idleMemoryLimit || null; + this.initialize(); + } + initialize() { + if ( + this.state === _types.WorkerStates.OUT_OF_MEMORY || + this.state === _types.WorkerStates.SHUTTING_DOWN || + this.state === _types.WorkerStates.SHUT_DOWN + ) { + return; + } + if (this._worker) { + this._worker.terminate(); + } + this.state = _types.WorkerStates.STARTING; + this._worker = new (_worker_threads().Worker)(this._childWorkerPath, { + eval: false, + resourceLimits: this._options.resourceLimits, + stderr: true, + stdout: true, + workerData: this._options.workerData, + ...this._options.forkOptions + }); + if (this._worker.stdout) { + if (!this._stdout) { + // We need to add a permanent stream to the merged stream to prevent it + // from ending when the subprocess stream ends + this._stdout = (0, _mergeStream().default)(this._getFakeStream()); + } + this._stdout.add(this._worker.stdout); + } + if (this._worker.stderr) { + if (!this._stderr) { + // We need to add a permanent stream to the merged stream to prevent it + // from ending when the subprocess stream ends + this._stderr = (0, _mergeStream().default)(this._getFakeStream()); + } + this._stderr.add(this._worker.stderr); + } + + // This can be useful for debugging. + if (!(this._options.silent ?? true)) { + this._worker.stdout.setEncoding('utf8'); + // eslint-disable-next-line no-console + this._worker.stdout.on('data', console.log); + this._worker.stderr.setEncoding('utf8'); + this._worker.stderr.on('data', console.error); + } + this._worker.on('message', this._onMessage.bind(this)); + this._worker.on('exit', this._onExit.bind(this)); + this._worker.on('error', this._onError.bind(this)); + this._worker.postMessage([ + _types.CHILD_MESSAGE_INITIALIZE, + false, + this._options.workerPath, + this._options.setupArgs, + String(this._options.workerId + 1) // 0-indexed workerId, 1-indexed JEST_WORKER_ID + ]); + + this._retries++; + + // If we exceeded the amount of retries, we will emulate an error reply + // coming from the child. This avoids code duplication related with cleaning + // the queue, and scheduling the next call. + if (this._retries > this._options.maxRetries) { + const error = new Error('Call retries were exceeded'); + this._onMessage([ + _types.PARENT_MESSAGE_CLIENT_ERROR, + error.name, + error.message, + error.stack, + { + type: 'WorkerError' + } + ]); + } + this.state = _types.WorkerStates.OK; + if (this._resolveWorkerReady) { + this._resolveWorkerReady(); + } + } + _onError(error) { + if (error.message.includes('heap out of memory')) { + this.state = _types.WorkerStates.OUT_OF_MEMORY; + + // Threads don't behave like processes, they don't crash when they run out of + // memory. But for consistency we want them to behave like processes so we call + // terminate to simulate a crash happening that was not planned + this._worker.terminate(); + } + } + _onMessage(response) { + // Ignore messages not intended for us + if (!Array.isArray(response)) return; + let error; + switch (response[0]) { + case _types.PARENT_MESSAGE_OK: + this._onProcessEnd(null, response[1]); + break; + case _types.PARENT_MESSAGE_CLIENT_ERROR: + error = response[4]; + if (error != null && typeof error === 'object') { + const extra = error; + // @ts-expect-error: no index + const NativeCtor = globalThis[response[1]]; + const Ctor = typeof NativeCtor === 'function' ? NativeCtor : Error; + error = new Ctor(response[2]); + error.type = response[1]; + error.stack = response[3]; + for (const key in extra) { + // @ts-expect-error: no index + error[key] = extra[key]; + } + } + this._onProcessEnd(error, null); + break; + case _types.PARENT_MESSAGE_SETUP_ERROR: + error = new Error(`Error when calling setup: ${response[2]}`); + + // @ts-expect-error: adding custom properties to errors. + error.type = response[1]; + error.stack = response[3]; + this._onProcessEnd(error, null); + break; + case _types.PARENT_MESSAGE_CUSTOM: + this._onCustomMessage(response[1]); + break; + case _types.PARENT_MESSAGE_MEM_USAGE: + this._childIdleMemoryUsage = response[1]; + if (this._resolveMemoryUsage) { + this._resolveMemoryUsage(response[1]); + this._resolveMemoryUsage = undefined; + this._memoryUsagePromise = undefined; + } + this._performRestartIfRequired(); + break; + default: + // Ignore messages not intended for us + break; + } + } + _onExit(exitCode) { + this._workerReadyPromise = undefined; + this._resolveWorkerReady = undefined; + if (exitCode !== 0 && this.state === _types.WorkerStates.OUT_OF_MEMORY) { + this._onProcessEnd( + new Error('Jest worker ran out of memory and crashed'), + null + ); + this._shutdown(); + } else if ( + (exitCode !== 0 && + this.state !== _types.WorkerStates.SHUTTING_DOWN && + this.state !== _types.WorkerStates.SHUT_DOWN) || + this.state === _types.WorkerStates.RESTARTING + ) { + this.initialize(); + if (this._request) { + this._worker.postMessage(this._request); + } + } else { + // If the worker thread exits while a request is still pending, throw an + // error. This is unexpected and tests may not have run to completion. + const isRequestStillPending = !!this._request; + if (isRequestStillPending) { + this._onProcessEnd( + new Error( + 'A Jest worker thread exited unexpectedly before finishing tests for an unknown reason. One of the ways this can happen is if process.exit() was called in testing code.' + ), + null + ); + } + this._shutdown(); + } + } + waitForExit() { + return this._exitPromise; + } + forceExit() { + this.state = _types.WorkerStates.SHUTTING_DOWN; + this._worker.terminate(); + } + send(request, onProcessStart, onProcessEnd, onCustomMessage) { + onProcessStart(this); + this._onProcessEnd = (...args) => { + const hasRequest = !!this._request; + + // Clean the request to avoid sending past requests to workers that fail + // while waiting for a new request (timers, unhandled rejections...) + this._request = null; + if (this._childIdleMemoryUsageLimit && hasRequest) { + this.checkMemoryUsage(); + } + const res = onProcessEnd?.(...args); + + // Clean up the reference so related closures can be garbage collected. + onProcessEnd = null; + return res; + }; + this._onCustomMessage = (...arg) => onCustomMessage(...arg); + this._request = request; + this._retries = 0; + this._worker.postMessage(request); + } + getWorkerId() { + return this._options.workerId; + } + getStdout() { + return this._stdout; + } + getStderr() { + return this._stderr; + } + _performRestartIfRequired() { + if (this._memoryUsageCheck) { + this._memoryUsageCheck = false; + let limit = this._childIdleMemoryUsageLimit; + + // TODO: At some point it would make sense to make use of + // stringToBytes found in jest-config, however as this + // package does not have any dependencies on an other jest + // packages that can wait until some other time. + if (limit && limit > 0 && limit <= 1) { + limit = Math.floor((0, _os().totalmem)() * limit); + } else if (limit) { + limit = Math.floor(limit); + } + if ( + limit && + this._childIdleMemoryUsage && + this._childIdleMemoryUsage > limit + ) { + this.state = _types.WorkerStates.RESTARTING; + this._worker.terminate(); + } + } + } + + /** + * Gets the last reported memory usage. + * + * @returns Memory usage in bytes. + */ + getMemoryUsage() { + if (!this._memoryUsagePromise) { + let rejectCallback; + const promise = new Promise((resolve, reject) => { + this._resolveMemoryUsage = resolve; + rejectCallback = reject; + }); + this._memoryUsagePromise = promise; + if (!this._worker.threadId) { + rejectCallback(new Error('Child process is not running.')); + this._memoryUsagePromise = undefined; + this._resolveMemoryUsage = undefined; + return promise; + } + try { + this._worker.postMessage([_types.CHILD_MESSAGE_MEM_USAGE]); + } catch (err) { + this._memoryUsagePromise = undefined; + this._resolveMemoryUsage = undefined; + rejectCallback(err); + } + return promise; + } + return this._memoryUsagePromise; + } + + /** + * Gets updated memory usage and restarts if required + */ + checkMemoryUsage() { + if (this._childIdleMemoryUsageLimit) { + this._memoryUsageCheck = true; + this._worker.postMessage([_types.CHILD_MESSAGE_MEM_USAGE]); + } else { + console.warn( + 'Memory usage of workers can only be checked if a limit is set' + ); + } + } + + /** + * Gets the thread id of the worker. + * + * @returns Thread id. + */ + getWorkerSystemId() { + return this._worker.threadId; + } + isWorkerRunning() { + return this._worker.threadId >= 0; + } +} +exports.default = ExperimentalWorker; diff --git a/node_modules/jest-worker/build/workers/WorkerAbstract.js b/node_modules/jest-worker/build/workers/WorkerAbstract.js new file mode 100644 index 00000000..1bd32f52 --- /dev/null +++ b/node_modules/jest-worker/build/workers/WorkerAbstract.js @@ -0,0 +1,135 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; +function _stream() { + const data = require('stream'); + _stream = function () { + return data; + }; + return data; +} +var _types = require('../types'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +class WorkerAbstract extends _stream().EventEmitter { + /** + * DO NOT WRITE TO THIS DIRECTLY. + * Use this.state getter/setters so events are emitted correctly. + */ + #state = _types.WorkerStates.STARTING; + _fakeStream = null; + _exitPromise; + _resolveExitPromise; + _workerReadyPromise; + _resolveWorkerReady; + get state() { + return this.#state; + } + set state(value) { + if (this.#state !== value) { + const oldState = this.#state; + this.#state = value; + this.emit(_types.WorkerEvents.STATE_CHANGE, value, oldState); + } + } + constructor(options) { + super(); + if (typeof options.on === 'object') { + for (const [event, handlers] of Object.entries(options.on)) { + // Can't do Array.isArray on a ReadonlyArray. + // https://github.com/microsoft/TypeScript/issues/17002 + if (typeof handlers === 'function') { + super.on(event, handlers); + } else { + for (const handler of handlers) { + super.on(event, handler); + } + } + } + } + this._exitPromise = new Promise(resolve => { + this._resolveExitPromise = resolve; + }); + this._exitPromise.then(() => { + this.state = _types.WorkerStates.SHUT_DOWN; + }); + } + + /** + * Wait for the worker child process to be ready to handle requests. + * + * @returns Promise which resolves when ready. + */ + waitForWorkerReady() { + if (!this._workerReadyPromise) { + this._workerReadyPromise = new Promise((resolve, reject) => { + let settled = false; + let to; + switch (this.state) { + case _types.WorkerStates.OUT_OF_MEMORY: + case _types.WorkerStates.SHUTTING_DOWN: + case _types.WorkerStates.SHUT_DOWN: + settled = true; + reject( + new Error( + `Worker state means it will never be ready: ${this.state}` + ) + ); + break; + case _types.WorkerStates.STARTING: + case _types.WorkerStates.RESTARTING: + this._resolveWorkerReady = () => { + settled = true; + resolve(); + if (to) { + clearTimeout(to); + } + }; + break; + case _types.WorkerStates.OK: + settled = true; + resolve(); + break; + } + if (!settled) { + to = setTimeout(() => { + if (!settled) { + reject(new Error('Timeout starting worker')); + } + }, 500); + } + }); + } + return this._workerReadyPromise; + } + + /** + * Used to shut down the current working instance once the children have been + * killed off. + */ + _shutdown() { + this.state === _types.WorkerStates.SHUT_DOWN; + + // End the permanent stream so the merged stream end too + if (this._fakeStream) { + this._fakeStream.end(); + this._fakeStream = null; + } + this._resolveExitPromise(); + } + _getFakeStream() { + if (!this._fakeStream) { + this._fakeStream = new (_stream().PassThrough)(); + } + return this._fakeStream; + } +} +exports.default = WorkerAbstract; diff --git a/node_modules/jest-worker/build/workers/messageParent.js b/node_modules/jest-worker/build/workers/messageParent.js new file mode 100644 index 00000000..62e2ccec --- /dev/null +++ b/node_modules/jest-worker/build/workers/messageParent.js @@ -0,0 +1,33 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = messageParent; +function _worker_threads() { + const data = require('worker_threads'); + _worker_threads = function () { + return data; + }; + return data; +} +var _types = require('../types'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +function messageParent(message, parentProcess = process) { + if (!_worker_threads().isMainThread && _worker_threads().parentPort != null) { + _worker_threads().parentPort.postMessage([ + _types.PARENT_MESSAGE_CUSTOM, + message + ]); + } else if (typeof parentProcess.send === 'function') { + parentProcess.send([_types.PARENT_MESSAGE_CUSTOM, message]); + } else { + throw new Error('"messageParent" can only be used inside a worker'); + } +} diff --git a/node_modules/jest-worker/build/workers/processChild.js b/node_modules/jest-worker/build/workers/processChild.js new file mode 100644 index 00000000..1a47f23c --- /dev/null +++ b/node_modules/jest-worker/build/workers/processChild.js @@ -0,0 +1,159 @@ +'use strict'; + +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +var _types = require('../types'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +let file = null; +let setupArgs = []; +let initialized = false; + +/** + * This file is a small bootstrapper for workers. It sets up the communication + * between the worker and the parent process, interpreting parent messages and + * sending results back. + * + * The file loaded will be lazily initialized the first time any of the workers + * is called. This is done for optimal performance: if the farm is initialized, + * but no call is made to it, child Node processes will be consuming the least + * possible amount of memory. + * + * If an invalid message is detected, the child will exit (by throwing) with a + * non-zero exit code. + */ +const messageListener = request => { + switch (request[0]) { + case _types.CHILD_MESSAGE_INITIALIZE: + const init = request; + file = init[2]; + setupArgs = init[3]; + break; + case _types.CHILD_MESSAGE_CALL: + const call = request; + execMethod(call[2], call[3]); + break; + case _types.CHILD_MESSAGE_END: + end(); + break; + case _types.CHILD_MESSAGE_MEM_USAGE: + reportMemoryUsage(); + break; + case _types.CHILD_MESSAGE_CALL_SETUP: + if (initialized) { + reportSuccess(void 0); + } else { + const main = require(file); + initialized = true; + if (main.setup) { + execFunction( + main.setup, + main, + setupArgs, + reportSuccess, + reportInitializeError + ); + } else { + reportSuccess(void 0); + } + } + break; + default: + throw new TypeError( + `Unexpected request from parent process: ${request[0]}` + ); + } +}; +process.on('message', messageListener); +function reportSuccess(result) { + if (!process || !process.send) { + throw new Error('Child can only be used on a forked process'); + } + process.send([_types.PARENT_MESSAGE_OK, result]); +} +function reportClientError(error) { + return reportError(error, _types.PARENT_MESSAGE_CLIENT_ERROR); +} +function reportInitializeError(error) { + return reportError(error, _types.PARENT_MESSAGE_SETUP_ERROR); +} +function reportMemoryUsage() { + if (!process || !process.send) { + throw new Error('Child can only be used on a forked process'); + } + const msg = [_types.PARENT_MESSAGE_MEM_USAGE, process.memoryUsage().heapUsed]; + process.send(msg); +} +function reportError(error, type) { + if (!process || !process.send) { + throw new Error('Child can only be used on a forked process'); + } + if (error == null) { + error = new Error('"null" or "undefined" thrown'); + } + process.send([ + type, + error.constructor && error.constructor.name, + error.message, + error.stack, + typeof error === 'object' + ? { + ...error + } + : error + ]); +} +function end() { + const main = require(file); + if (!main.teardown) { + exitProcess(); + return; + } + execFunction(main.teardown, main, [], exitProcess, exitProcess); +} +function exitProcess() { + // Clean up open handles so the process ideally exits gracefully + process.removeListener('message', messageListener); +} +function execMethod(method, args) { + const main = require(file); + let fn; + if (method === 'default') { + fn = main.__esModule ? main.default : main; + } else { + fn = main[method]; + } + function execHelper() { + execFunction(fn, main, args, reportSuccess, reportClientError); + } + if (initialized || !main.setup) { + execHelper(); + return; + } + initialized = true; + execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError); +} +function execFunction(fn, ctx, args, onResult, onError) { + let result; + try { + result = fn.apply(ctx, args); + } catch (err) { + onError(err); + return; + } + if ((0, _jestUtil().isPromise)(result)) { + result.then(onResult, onError); + } else { + onResult(result); + } +} diff --git a/node_modules/jest-worker/build/workers/threadChild.js b/node_modules/jest-worker/build/workers/threadChild.js new file mode 100644 index 00000000..16aca004 --- /dev/null +++ b/node_modules/jest-worker/build/workers/threadChild.js @@ -0,0 +1,177 @@ +'use strict'; + +function _worker_threads() { + const data = require('worker_threads'); + _worker_threads = function () { + return data; + }; + return data; +} +function _jestUtil() { + const data = require('jest-util'); + _jestUtil = function () { + return data; + }; + return data; +} +var _types = require('../types'); +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +let file = null; +let setupArgs = []; +let initialized = false; + +/** + * This file is a small bootstrapper for workers. It sets up the communication + * between the worker and the parent process, interpreting parent messages and + * sending results back. + * + * The file loaded will be lazily initialized the first time any of the workers + * is called. This is done for optimal performance: if the farm is initialized, + * but no call is made to it, child Node processes will be consuming the least + * possible amount of memory. + * + * If an invalid message is detected, the child will exit (by throwing) with a + * non-zero exit code. + */ +const messageListener = request => { + switch (request[0]) { + case _types.CHILD_MESSAGE_INITIALIZE: + const init = request; + file = init[2]; + setupArgs = init[3]; + process.env.JEST_WORKER_ID = init[4]; + break; + case _types.CHILD_MESSAGE_CALL: + const call = request; + execMethod(call[2], call[3]); + break; + case _types.CHILD_MESSAGE_END: + end(); + break; + case _types.CHILD_MESSAGE_MEM_USAGE: + reportMemoryUsage(); + break; + case _types.CHILD_MESSAGE_CALL_SETUP: + if (initialized) { + reportSuccess(void 0); + } else { + const main = require(file); + initialized = true; + if (main.setup) { + execFunction( + main.setup, + main, + setupArgs, + reportSuccess, + reportInitializeError + ); + } else { + reportSuccess(void 0); + } + } + break; + default: + throw new TypeError( + `Unexpected request from parent process: ${request[0]}` + ); + } +}; +_worker_threads().parentPort.on('message', messageListener); +function reportMemoryUsage() { + if (_worker_threads().isMainThread) { + throw new Error('Child can only be used on a forked process'); + } + const msg = [_types.PARENT_MESSAGE_MEM_USAGE, process.memoryUsage().heapUsed]; + _worker_threads().parentPort.postMessage(msg); +} +function reportSuccess(result) { + if (_worker_threads().isMainThread) { + throw new Error('Child can only be used on a forked process'); + } + try { + _worker_threads().parentPort.postMessage([ + _types.PARENT_MESSAGE_OK, + result + ]); + } catch (err) { + // Handling it here to avoid unhandled `DataCloneError` rejection + // which is hard to distinguish on the parent side + // (such error doesn't have any message or stack trace) + reportClientError(err); + } +} +function reportClientError(error) { + return reportError(error, _types.PARENT_MESSAGE_CLIENT_ERROR); +} +function reportInitializeError(error) { + return reportError(error, _types.PARENT_MESSAGE_SETUP_ERROR); +} +function reportError(error, type) { + if (_worker_threads().isMainThread) { + throw new Error('Child can only be used on a forked process'); + } + if (error == null) { + error = new Error('"null" or "undefined" thrown'); + } + _worker_threads().parentPort.postMessage([ + type, + error.constructor && error.constructor.name, + error.message, + error.stack, + typeof error === 'object' + ? { + ...error + } + : error + ]); +} +function end() { + const main = require(file); + if (!main.teardown) { + exitProcess(); + return; + } + execFunction(main.teardown, main, [], exitProcess, exitProcess); +} +function exitProcess() { + // Clean up open handles so the worker ideally exits gracefully + _worker_threads().parentPort.removeListener('message', messageListener); +} +function execMethod(method, args) { + const main = require(file); + let fn; + if (method === 'default') { + fn = main.__esModule ? main.default : main; + } else { + fn = main[method]; + } + function execHelper() { + execFunction(fn, main, args, reportSuccess, reportClientError); + } + if (initialized || !main.setup) { + execHelper(); + return; + } + initialized = true; + execFunction(main.setup, main, setupArgs, execHelper, reportInitializeError); +} +function execFunction(fn, ctx, args, onResult, onError) { + let result; + try { + result = fn.apply(ctx, args); + } catch (err) { + onError(err); + return; + } + if ((0, _jestUtil().isPromise)(result)) { + result.then(onResult, onError); + } else { + onResult(result); + } +} diff --git a/node_modules/jest-worker/node_modules/supports-color/browser.js b/node_modules/jest-worker/node_modules/supports-color/browser.js new file mode 100644 index 00000000..f097aecd --- /dev/null +++ b/node_modules/jest-worker/node_modules/supports-color/browser.js @@ -0,0 +1,24 @@ +/* eslint-env browser */ +'use strict'; + +function getChromeVersion() { + const matches = /(Chrome|Chromium)\/(?\d+)\./.exec(navigator.userAgent); + + if (!matches) { + return; + } + + return Number.parseInt(matches.groups.chromeVersion, 10); +} + +const colorSupport = getChromeVersion() >= 69 ? { + level: 1, + hasBasic: true, + has256: false, + has16m: false +} : false; + +module.exports = { + stdout: colorSupport, + stderr: colorSupport +}; diff --git a/node_modules/jest-worker/node_modules/supports-color/index.js b/node_modules/jest-worker/node_modules/supports-color/index.js new file mode 100644 index 00000000..2dd2fcb0 --- /dev/null +++ b/node_modules/jest-worker/node_modules/supports-color/index.js @@ -0,0 +1,152 @@ +'use strict'; +const os = require('os'); +const tty = require('tty'); +const hasFlag = require('has-flag'); + +const {env} = process; + +let flagForceColor; +if (hasFlag('no-color') || + hasFlag('no-colors') || + hasFlag('color=false') || + hasFlag('color=never')) { + flagForceColor = 0; +} else if (hasFlag('color') || + hasFlag('colors') || + hasFlag('color=true') || + hasFlag('color=always')) { + flagForceColor = 1; +} + +function envForceColor() { + if ('FORCE_COLOR' in env) { + if (env.FORCE_COLOR === 'true') { + return 1; + } + + if (env.FORCE_COLOR === 'false') { + return 0; + } + + return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); + } +} + +function translateLevel(level) { + if (level === 0) { + return false; + } + + return { + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 + }; +} + +function supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== undefined) { + flagForceColor = noFlagForceColor; + } + + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + + if (forceColor === 0) { + return 0; + } + + if (sniffFlags) { + if (hasFlag('color=16m') || + hasFlag('color=full') || + hasFlag('color=truecolor')) { + return 3; + } + + if (hasFlag('color=256')) { + return 2; + } + } + + if (haveStream && !streamIsTTY && forceColor === undefined) { + return 0; + } + + const min = forceColor || 0; + + if (env.TERM === 'dumb') { + return min; + } + + if (process.platform === 'win32') { + // Windows 10 build 10586 is the first Windows release that supports 256 colors. + // Windows 10 build 14931 is the first release that supports 16m/TrueColor. + const osRelease = os.release().split('.'); + if ( + Number(osRelease[0]) >= 10 && + Number(osRelease[2]) >= 10586 + ) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; + } + + return 1; + } + + if ('CI' in env) { + if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') { + return 1; + } + + return min; + } + + if ('TEAMCITY_VERSION' in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; + } + + if (env.COLORTERM === 'truecolor') { + return 3; + } + + if ('TERM_PROGRAM' in env) { + const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10); + + switch (env.TERM_PROGRAM) { + case 'iTerm.app': + return version >= 3 ? 3 : 2; + case 'Apple_Terminal': + return 2; + // No default + } + } + + if (/-256(color)?$/i.test(env.TERM)) { + return 2; + } + + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; + } + + if ('COLORTERM' in env) { + return 1; + } + + return min; +} + +function getSupportLevel(stream, options = {}) { + const level = supportsColor(stream, { + streamIsTTY: stream && stream.isTTY, + ...options + }); + + return translateLevel(level); +} + +module.exports = { + supportsColor: getSupportLevel, + stdout: getSupportLevel({isTTY: tty.isatty(1)}), + stderr: getSupportLevel({isTTY: tty.isatty(2)}) +}; diff --git a/node_modules/jest-worker/node_modules/supports-color/license b/node_modules/jest-worker/node_modules/supports-color/license new file mode 100644 index 00000000..fa7ceba3 --- /dev/null +++ b/node_modules/jest-worker/node_modules/supports-color/license @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/jest-worker/node_modules/supports-color/package.json b/node_modules/jest-worker/node_modules/supports-color/package.json new file mode 100644 index 00000000..a97bf2a1 --- /dev/null +++ b/node_modules/jest-worker/node_modules/supports-color/package.json @@ -0,0 +1,58 @@ +{ + "name": "supports-color", + "version": "8.1.1", + "description": "Detect whether a terminal supports color", + "license": "MIT", + "repository": "chalk/supports-color", + "funding": "https://github.com/chalk/supports-color?sponsor=1", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js", + "browser.js" + ], + "exports": { + "node": "./index.js", + "default": "./browser.js" + }, + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "supports", + "capability", + "detect", + "truecolor", + "16m" + ], + "dependencies": { + "has-flag": "^4.0.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "import-fresh": "^3.2.2", + "xo": "^0.35.0" + }, + "browser": "browser.js" +} diff --git a/node_modules/jest-worker/node_modules/supports-color/readme.md b/node_modules/jest-worker/node_modules/supports-color/readme.md new file mode 100644 index 00000000..3eedd1ca --- /dev/null +++ b/node_modules/jest-worker/node_modules/supports-color/readme.md @@ -0,0 +1,77 @@ +# supports-color + +> Detect whether a terminal supports color + +## Install + +``` +$ npm install supports-color +``` + +## Usage + +```js +const supportsColor = require('supports-color'); + +if (supportsColor.stdout) { + console.log('Terminal stdout supports color'); +} + +if (supportsColor.stdout.has256) { + console.log('Terminal stdout supports 256 colors'); +} + +if (supportsColor.stderr.has16m) { + console.log('Terminal stderr supports 16 million colors (truecolor)'); +} +``` + +## API + +Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported. + +The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag: + +- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) +- `.level = 2` and `.has256 = true`: 256 color support +- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) + +### `require('supports-color').supportsColor(stream, options?)` + +Additionally, `supports-color` exposes the `.supportsColor()` function that takes an arbitrary write stream (e.g. `process.stdout`) and an optional options object to (re-)evaluate color support for an arbitrary stream. + +For example, `require('supports-color').stdout` is the equivalent of `require('supports-color').supportsColor(process.stdout)`. + +The options object supports a single boolean property `sniffFlags`. By default it is `true`, which instructs `supportsColor()` to sniff `process.argv` for the multitude of `--color` flags (see _Info_ below). If `false`, then `process.argv` is not considered when determining color support. + +## Info + +It obeys the `--color` and `--no-color` CLI flags. + +For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. + +Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. + +## Related + +- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module +- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right + +## Maintainers + +- [Sindre Sorhus](https://github.com/sindresorhus) +- [Josh Junon](https://github.com/qix-) + +--- + +

+ + Get professional support for this package with a Tidelift subscription + +
+ + Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies. +
+
+ +--- diff --git a/node_modules/jest-worker/package.json b/node_modules/jest-worker/package.json new file mode 100644 index 00000000..6975f972 --- /dev/null +++ b/node_modules/jest-worker/package.json @@ -0,0 +1,42 @@ +{ + "name": "jest-worker", + "version": "29.7.0", + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest-worker" + }, + "license": "MIT", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "devDependencies": { + "@babel/core": "^7.11.6", + "@tsd/typescript": "^5.0.4", + "@types/merge-stream": "^1.1.2", + "@types/supports-color": "^8.1.0", + "get-stream": "^6.0.0", + "jest-leak-detector": "^29.7.0", + "tsd-lite": "^0.7.0", + "worker-farm": "^1.6.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/jest/LICENSE b/node_modules/jest/LICENSE new file mode 100644 index 00000000..b93be905 --- /dev/null +++ b/node_modules/jest/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/jest/README.md b/node_modules/jest/README.md new file mode 100644 index 00000000..9c3d31ef --- /dev/null +++ b/node_modules/jest/README.md @@ -0,0 +1,11 @@ +# Jest + +🃏 Delightful JavaScript Testing + +- **👩🏻‍💻 Developer Ready**: Complete and ready to set-up JavaScript testing solution. Works out of the box for any React project. + +- **🏃🏽 Instant Feedback**: Failed tests run first. Fast interactive mode can switch between running all tests or only test files related to changed files. + +- **📸 Snapshot Testing**: Jest can [capture snapshots](https://jestjs.io/docs/snapshot-testing) of React trees or other serializable values to simplify UI testing. + +Read More: https://jestjs.io/ diff --git a/node_modules/jest/bin/jest.js b/node_modules/jest/bin/jest.js new file mode 100644 index 00000000..f3be8f9d --- /dev/null +++ b/node_modules/jest/bin/jest.js @@ -0,0 +1,13 @@ +#!/usr/bin/env node +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +const importLocal = require('import-local'); + +if (!importLocal(__filename)) { + require('jest-cli/bin/jest'); +} diff --git a/node_modules/jest/build/index.d.ts b/node_modules/jest/build/index.d.ts new file mode 100644 index 00000000..05e21ab8 --- /dev/null +++ b/node_modules/jest/build/index.d.ts @@ -0,0 +1,26 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import type {Config as Config_2} from '@jest/types'; +import {createTestScheduler} from '@jest/core'; +import {getVersion} from '@jest/core'; +import {run} from 'jest-cli'; +import {runCLI} from '@jest/core'; +import {SearchSource} from '@jest/core'; + +export declare type Config = Config_2.InitialOptions; + +export {createTestScheduler}; + +export {getVersion}; + +export {run}; + +export {runCLI}; + +export {SearchSource}; + +export {}; diff --git a/node_modules/jest/build/index.js b/node_modules/jest/build/index.js new file mode 100644 index 00000000..7d529504 --- /dev/null +++ b/node_modules/jest/build/index.js @@ -0,0 +1,49 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +Object.defineProperty(exports, 'SearchSource', { + enumerable: true, + get: function () { + return _core().SearchSource; + } +}); +Object.defineProperty(exports, 'createTestScheduler', { + enumerable: true, + get: function () { + return _core().createTestScheduler; + } +}); +Object.defineProperty(exports, 'getVersion', { + enumerable: true, + get: function () { + return _core().getVersion; + } +}); +Object.defineProperty(exports, 'run', { + enumerable: true, + get: function () { + return _jestCli().run; + } +}); +Object.defineProperty(exports, 'runCLI', { + enumerable: true, + get: function () { + return _core().runCLI; + } +}); +function _core() { + const data = require('@jest/core'); + _core = function () { + return data; + }; + return data; +} +function _jestCli() { + const data = require('jest-cli'); + _jestCli = function () { + return data; + }; + return data; +} diff --git a/node_modules/jest/package.json b/node_modules/jest/package.json new file mode 100644 index 00000000..41e01c8d --- /dev/null +++ b/node_modules/jest/package.json @@ -0,0 +1,74 @@ +{ + "name": "jest", + "description": "Delightful JavaScript Testing.", + "version": "29.7.0", + "main": "./build/index.js", + "types": "./build/index.d.ts", + "exports": { + ".": { + "types": "./build/index.d.ts", + "default": "./build/index.js" + }, + "./package.json": "./package.json", + "./bin/jest": "./bin/jest.js" + }, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "devDependencies": { + "@tsd/typescript": "^5.0.4", + "tsd-lite": "^0.7.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + }, + "bin": "./bin/jest.js", + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "repository": { + "type": "git", + "url": "https://github.com/jestjs/jest.git", + "directory": "packages/jest" + }, + "homepage": "https://jestjs.io/", + "license": "MIT", + "keywords": [ + "ava", + "babel", + "coverage", + "easy", + "expect", + "facebook", + "immersive", + "instant", + "jasmine", + "jest", + "jsdom", + "mocha", + "mocking", + "painless", + "qunit", + "runner", + "sandboxed", + "snapshot", + "tap", + "tape", + "test", + "testing", + "typescript", + "watch" + ], + "publishConfig": { + "access": "public" + }, + "gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" +} diff --git a/node_modules/js-tokens/CHANGELOG.md b/node_modules/js-tokens/CHANGELOG.md new file mode 100644 index 00000000..755e6f6e --- /dev/null +++ b/node_modules/js-tokens/CHANGELOG.md @@ -0,0 +1,151 @@ +### Version 4.0.0 (2018-01-28) ### + +- Added: Support for ES2018. The only change needed was recognizing the `s` + regex flag. +- Changed: _All_ tokens returned by the `matchToToken` function now have a + `closed` property. It is set to `undefined` for the tokens where “closed” + doesn’t make sense. This means that all tokens objects have the same shape, + which might improve performance. + +These are the breaking changes: + +- `'/a/s'.match(jsTokens)` no longer returns `['/', 'a', '/', 's']`, but + `['/a/s']`. (There are of course other variations of this.) +- Code that rely on some token objects not having the `closed` property could + now behave differently. + + +### Version 3.0.2 (2017-06-28) ### + +- No code changes. Just updates to the readme. + + +### Version 3.0.1 (2017-01-30) ### + +- Fixed: ES2015 unicode escapes with more than 6 hex digits are now matched + correctly. + + +### Version 3.0.0 (2017-01-11) ### + +This release contains one breaking change, that should [improve performance in +V8][v8-perf]: + +> So how can you, as a JavaScript developer, ensure that your RegExps are fast? +> If you are not interested in hooking into RegExp internals, make sure that +> neither the RegExp instance, nor its prototype is modified in order to get the +> best performance: +> +> ```js +> var re = /./g; +> re.exec(''); // Fast path. +> re.new_property = 'slow'; +> ``` + +This module used to export a single regex, with `.matchToToken` bolted +on, just like in the above example. This release changes the exports of +the module to avoid this issue. + +Before: + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens") +var matchToToken = jsTokens.matchToToken +``` + +After: + +```js +import jsTokens, {matchToToken} from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +var matchToToken = require("js-tokens").matchToToken +``` + +[v8-perf]: http://v8project.blogspot.se/2017/01/speeding-up-v8-regular-expressions.html + + +### Version 2.0.0 (2016-06-19) ### + +- Added: Support for ES2016. In other words, support for the `**` exponentiation + operator. + +These are the breaking changes: + +- `'**'.match(jsTokens)` no longer returns `['*', '*']`, but `['**']`. +- `'**='.match(jsTokens)` no longer returns `['*', '*=']`, but `['**=']`. + + +### Version 1.0.3 (2016-03-27) ### + +- Improved: Made the regex ever so slightly smaller. +- Updated: The readme. + + +### Version 1.0.2 (2015-10-18) ### + +- Improved: Limited npm package contents for a smaller download. Thanks to + @zertosh! + + +### Version 1.0.1 (2015-06-20) ### + +- Fixed: Declared an undeclared variable. + + +### Version 1.0.0 (2015-02-26) ### + +- Changed: Merged the 'operator' and 'punctuation' types into 'punctuator'. That + type is now equivalent to the Punctuator token in the ECMAScript + specification. (Backwards-incompatible change.) +- Fixed: A `-` followed by a number is now correctly matched as a punctuator + followed by a number. It used to be matched as just a number, but there is no + such thing as negative number literals. (Possibly backwards-incompatible + change.) + + +### Version 0.4.1 (2015-02-21) ### + +- Added: Support for the regex `u` flag. + + +### Version 0.4.0 (2015-02-21) ### + +- Improved: `jsTokens.matchToToken` performance. +- Added: Support for octal and binary number literals. +- Added: Support for template strings. + + +### Version 0.3.1 (2015-01-06) ### + +- Fixed: Support for unicode spaces. They used to be allowed in names (which is + very confusing), and some unicode newlines were wrongly allowed in strings and + regexes. + + +### Version 0.3.0 (2014-12-19) ### + +- Changed: The `jsTokens.names` array has been replaced with the + `jsTokens.matchToToken` function. The capturing groups of `jsTokens` are no + longer part of the public API; instead use said function. See this [gist] for + an example. (Backwards-incompatible change.) +- Changed: The empty string is now considered an “invalid” token, instead an + “empty” token (its own group). (Backwards-incompatible change.) +- Removed: component support. (Backwards-incompatible change.) + +[gist]: https://gist.github.com/lydell/be49dbf80c382c473004 + + +### Version 0.2.0 (2014-06-19) ### + +- Changed: Match ES6 function arrows (`=>`) as an operator, instead of its own + category (“functionArrow”), for simplicity. (Backwards-incompatible change.) +- Added: ES6 splats (`...`) are now matched as an operator (instead of three + punctuations). (Backwards-incompatible change.) + + +### Version 0.1.0 (2014-03-08) ### + +- Initial release. diff --git a/node_modules/js-tokens/LICENSE b/node_modules/js-tokens/LICENSE new file mode 100644 index 00000000..54aef52f --- /dev/null +++ b/node_modules/js-tokens/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell + +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/js-tokens/README.md b/node_modules/js-tokens/README.md new file mode 100644 index 00000000..00cdf163 --- /dev/null +++ b/node_modules/js-tokens/README.md @@ -0,0 +1,240 @@ +Overview [![Build Status](https://travis-ci.org/lydell/js-tokens.svg?branch=master)](https://travis-ci.org/lydell/js-tokens) +======== + +A regex that tokenizes JavaScript. + +```js +var jsTokens = require("js-tokens").default + +var jsString = "var foo=opts.foo;\n..." + +jsString.match(jsTokens) +// ["var", " ", "foo", "=", "opts", ".", "foo", ";", "\n", ...] +``` + + +Installation +============ + +`npm install js-tokens` + +```js +import jsTokens from "js-tokens" +// or: +var jsTokens = require("js-tokens").default +``` + + +Usage +===== + +### `jsTokens` ### + +A regex with the `g` flag that matches JavaScript tokens. + +The regex _always_ matches, even invalid JavaScript and the empty string. + +The next match is always directly after the previous. + +### `var token = matchToToken(match)` ### + +```js +import {matchToToken} from "js-tokens" +// or: +var matchToToken = require("js-tokens").matchToToken +``` + +Takes a `match` returned by `jsTokens.exec(string)`, and returns a `{type: +String, value: String}` object. The following types are available: + +- string +- comment +- regex +- number +- name +- punctuator +- whitespace +- invalid + +Multi-line comments and strings also have a `closed` property indicating if the +token was closed or not (see below). + +Comments and strings both come in several flavors. To distinguish them, check if +the token starts with `//`, `/*`, `'`, `"` or `` ` ``. + +Names are ECMAScript IdentifierNames, that is, including both identifiers and +keywords. You may use [is-keyword-js] to tell them apart. + +Whitespace includes both line terminators and other whitespace. + +[is-keyword-js]: https://github.com/crissdev/is-keyword-js + + +ECMAScript support +================== + +The intention is to always support the latest ECMAScript version whose feature +set has been finalized. + +If adding support for a newer version requires changes, a new version with a +major verion bump will be released. + +Currently, ECMAScript 2018 is supported. + + +Invalid code handling +===================== + +Unterminated strings are still matched as strings. JavaScript strings cannot +contain (unescaped) newlines, so unterminated strings simply end at the end of +the line. Unterminated template strings can contain unescaped newlines, though, +so they go on to the end of input. + +Unterminated multi-line comments are also still matched as comments. They +simply go on to the end of the input. + +Unterminated regex literals are likely matched as division and whatever is +inside the regex. + +Invalid ASCII characters have their own capturing group. + +Invalid non-ASCII characters are treated as names, to simplify the matching of +names (except unicode spaces which are treated as whitespace). Note: See also +the [ES2018](#es2018) section. + +Regex literals may contain invalid regex syntax. They are still matched as +regex literals. They may also contain repeated regex flags, to keep the regex +simple. + +Strings may contain invalid escape sequences. + + +Limitations +=========== + +Tokenizing JavaScript using regexes—in fact, _one single regex_—won’t be +perfect. But that’s not the point either. + +You may compare jsTokens with [esprima] by using `esprima-compare.js`. +See `npm run esprima-compare`! + +[esprima]: http://esprima.org/ + +### Template string interpolation ### + +Template strings are matched as single tokens, from the starting `` ` `` to the +ending `` ` ``, including interpolations (whose tokens are not matched +individually). + +Matching template string interpolations requires recursive balancing of `{` and +`}`—something that JavaScript regexes cannot do. Only one level of nesting is +supported. + +### Division and regex literals collision ### + +Consider this example: + +```js +var g = 9.82 +var number = bar / 2/g + +var regex = / 2/g +``` + +A human can easily understand that in the `number` line we’re dealing with +division, and in the `regex` line we’re dealing with a regex literal. How come? +Because humans can look at the whole code to put the `/` characters in context. +A JavaScript regex cannot. It only sees forwards. (Well, ES2018 regexes can also +look backwards. See the [ES2018](#es2018) section). + +When the `jsTokens` regex scans throught the above, it will see the following +at the end of both the `number` and `regex` rows: + +```js +/ 2/g +``` + +It is then impossible to know if that is a regex literal, or part of an +expression dealing with division. + +Here is a similar case: + +```js +foo /= 2/g +foo(/= 2/g) +``` + +The first line divides the `foo` variable with `2/g`. The second line calls the +`foo` function with the regex literal `/= 2/g`. Again, since `jsTokens` only +sees forwards, it cannot tell the two cases apart. + +There are some cases where we _can_ tell division and regex literals apart, +though. + +First off, we have the simple cases where there’s only one slash in the line: + +```js +var foo = 2/g +foo /= 2 +``` + +Regex literals cannot contain newlines, so the above cases are correctly +identified as division. Things are only problematic when there are more than +one non-comment slash in a single line. + +Secondly, not every character is a valid regex flag. + +```js +var number = bar / 2/e +``` + +The above example is also correctly identified as division, because `e` is not a +valid regex flag. I initially wanted to future-proof by allowing `[a-zA-Z]*` +(any letter) as flags, but it is not worth it since it increases the amount of +ambigous cases. So only the standard `g`, `m`, `i`, `y` and `u` flags are +allowed. This means that the above example will be identified as division as +long as you don’t rename the `e` variable to some permutation of `gmiyus` 1 to 6 +characters long. + +Lastly, we can look _forward_ for information. + +- If the token following what looks like a regex literal is not valid after a + regex literal, but is valid in a division expression, then the regex literal + is treated as division instead. For example, a flagless regex cannot be + followed by a string, number or name, but all of those three can be the + denominator of a division. +- Generally, if what looks like a regex literal is followed by an operator, the + regex literal is treated as division instead. This is because regexes are + seldomly used with operators (such as `+`, `*`, `&&` and `==`), but division + could likely be part of such an expression. + +Please consult the regex source and the test cases for precise information on +when regex or division is matched (should you need to know). In short, you +could sum it up as: + +If the end of a statement looks like a regex literal (even if it isn’t), it +will be treated as one. Otherwise it should work as expected (if you write sane +code). + +### ES2018 ### + +ES2018 added some nice regex improvements to the language. + +- [Unicode property escapes] should allow telling names and invalid non-ASCII + characters apart without blowing up the regex size. +- [Lookbehind assertions] should allow matching telling division and regex + literals apart in more cases. +- [Named capture groups] might simplify some things. + +These things would be nice to do, but are not critical. They probably have to +wait until the oldest maintained Node.js LTS release supports those features. + +[Unicode property escapes]: http://2ality.com/2017/07/regexp-unicode-property-escapes.html +[Lookbehind assertions]: http://2ality.com/2017/05/regexp-lookbehind-assertions.html +[Named capture groups]: http://2ality.com/2017/05/regexp-named-capture-groups.html + + +License +======= + +[MIT](LICENSE). diff --git a/node_modules/js-tokens/index.js b/node_modules/js-tokens/index.js new file mode 100644 index 00000000..b23a4a0e --- /dev/null +++ b/node_modules/js-tokens/index.js @@ -0,0 +1,23 @@ +// Copyright 2014, 2015, 2016, 2017, 2018 Simon Lydell +// License: MIT. (See LICENSE.) + +Object.defineProperty(exports, "__esModule", { + value: true +}) + +// This regex comes from regex.coffee, and is inserted here by generate-index.js +// (run `npm run build`). +exports.default = /((['"])(?:(?!\2|\\).|\\(?:\r\n|[\s\S]))*(\2)?|`(?:[^`\\$]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{[^}]*\}?)*\}?)*(`)?)|(\/\/.*)|(\/\*(?:[^*]|\*(?!\/))*(\*\/)?)|(\/(?!\*)(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\]\\]).|\\.)+\/(?:(?!\s*(?:\b|[\u0080-\uFFFF$\\'"~({]|[+\-!](?!=)|\.?\d))|[gmiyus]{1,6}\b(?![\u0080-\uFFFF$\\]|\s*(?:[+\-*%&|^<>!=?({]|\/(?![\/*])))))|(0[xX][\da-fA-F]+|0[oO][0-7]+|0[bB][01]+|(?:\d*\.\d+|\d+\.?)(?:[eE][+-]?\d+)?)|((?!\d)(?:(?!\s)[$\w\u0080-\uFFFF]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+)|(--|\+\+|&&|\|\||=>|\.{3}|(?:[+\-\/%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2})=?|[?~.,:;[\](){}])|(\s+)|(^$|[\s\S])/g + +exports.matchToToken = function(match) { + var token = {type: "invalid", value: match[0], closed: undefined} + if (match[ 1]) token.type = "string" , token.closed = !!(match[3] || match[4]) + else if (match[ 5]) token.type = "comment" + else if (match[ 6]) token.type = "comment", token.closed = !!match[7] + else if (match[ 8]) token.type = "regex" + else if (match[ 9]) token.type = "number" + else if (match[10]) token.type = "name" + else if (match[11]) token.type = "punctuator" + else if (match[12]) token.type = "whitespace" + return token +} diff --git a/node_modules/js-tokens/package.json b/node_modules/js-tokens/package.json new file mode 100644 index 00000000..66752fab --- /dev/null +++ b/node_modules/js-tokens/package.json @@ -0,0 +1,30 @@ +{ + "name": "js-tokens", + "version": "4.0.0", + "author": "Simon Lydell", + "license": "MIT", + "description": "A regex that tokenizes JavaScript.", + "keywords": [ + "JavaScript", + "js", + "token", + "tokenize", + "regex" + ], + "files": [ + "index.js" + ], + "repository": "lydell/js-tokens", + "scripts": { + "test": "mocha --ui tdd", + "esprima-compare": "node esprima-compare ./index.js everything.js/es5.js", + "build": "node generate-index.js", + "dev": "npm run build && npm test" + }, + "devDependencies": { + "coffeescript": "2.1.1", + "esprima": "4.0.0", + "everything.js": "1.0.3", + "mocha": "5.0.0" + } +} diff --git a/node_modules/js-yaml/CHANGELOG.md b/node_modules/js-yaml/CHANGELOG.md new file mode 100644 index 00000000..b4baa4ea --- /dev/null +++ b/node_modules/js-yaml/CHANGELOG.md @@ -0,0 +1,557 @@ +# 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). + + +## [3.14.1] - 2020-12-07 +### Security +- Fix possible code execution in (already unsafe) `.load()` (in &anchor). + + +## [3.14.0] - 2020-05-22 +### Changed +- Support `safe/loadAll(input, options)` variant of call. +- CI: drop outdated nodejs versions. +- Dev deps bump. + +### Fixed +- Quote `=` in plain scalars #519. +- Check the node type for `!` tag in case user manually specifies it. +- Verify that there are no null-bytes in input. +- Fix wrong quote position when writing condensed flow, #526. + + +## [3.13.1] - 2019-04-05 +### Security +- Fix possible code execution in (already unsafe) `.load()`, #480. + + +## [3.13.0] - 2019-03-20 +### Security +- Security fix: `safeLoad()` can hang when arrays with nested refs + used as key. Now throws exception for nested arrays. #475. + + +## [3.12.2] - 2019-02-26 +### Fixed +- Fix `noArrayIndent` option for root level, #468. + + +## [3.12.1] - 2019-01-05 +### Added +- Added `noArrayIndent` option, #432. + + +## [3.12.0] - 2018-06-02 +### Changed +- Support arrow functions without a block statement, #421. + + +## [3.11.0] - 2018-03-05 +### Added +- Add arrow functions suport for `!!js/function`. + +### Fixed +- Fix dump in bin/octal/hex formats for negative integers, #399. + + +## [3.10.0] - 2017-09-10 +### Fixed +- Fix `condenseFlow` output (quote keys for sure, instead of spaces), #371, #370. +- Dump astrals as codepoints instead of surrogate pair, #368. + + +## [3.9.1] - 2017-07-08 +### Fixed +- Ensure stack is present for custom errors in node 7.+, #351. + + +## [3.9.0] - 2017-07-08 +### Added +- Add `condenseFlow` option (to create pretty URL query params), #346. + +### Fixed +- Support array return from safeLoadAll/loadAll, #350. + + +## [3.8.4] - 2017-05-08 +### Fixed +- Dumper: prevent space after dash for arrays that wrap, #343. + + +## [3.8.3] - 2017-04-05 +### Fixed +- Should not allow numbers to begin and end with underscore, #335. + + +## [3.8.2] - 2017-03-02 +### Fixed +- Fix `!!float 123` (integers) parse, #333. +- Don't allow leading zeros in floats (except 0, 0.xxx). +- Allow positive exponent without sign in floats. + + +## [3.8.1] - 2017-02-07 +### Changed +- Maintenance: update browserified build. + + +## [3.8.0] - 2017-02-07 +### Fixed +- Fix reported position for `duplicated mapping key` errors. + Now points to block start instead of block end. + (#243, thanks to @shockey). + + +## [3.7.0] - 2016-11-12 +### Added +- Support polymorphism for tags (#300, thanks to @monken). + +### Fixed +- Fix parsing of quotes followed by newlines (#304, thanks to @dplepage). + + +## [3.6.1] - 2016-05-11 +### Fixed +- Fix output cut on a pipe, #286. + + +## [3.6.0] - 2016-04-16 +### Fixed +- Dumper rewrite, fix multiple bugs with trailing `\n`. + Big thanks to @aepsilon! +- Loader: fix leading/trailing newlines in block scalars, @aepsilon. + + +## [3.5.5] - 2016-03-17 +### Fixed +- Date parse fix: don't allow dates with on digit in month and day, #268. + + +## [3.5.4] - 2016-03-09 +### Added +- `noCompatMode` for dumper, to disable quoting YAML 1.1 values. + + +## [3.5.3] - 2016-02-11 +### Changed +- Maintenance release. + + +## [3.5.2] - 2016-01-11 +### Changed +- Maintenance: missed comma in bower config. + + +## [3.5.1] - 2016-01-11 +### Changed +- Removed `inherit` dependency, #239. +- Better browserify workaround for esprima load. +- Demo rewrite. + + +## [3.5.0] - 2016-01-10 +### Fixed +- Dumper. Fold strings only, #217. +- Dumper. `norefs` option, to clone linked objects, #229. +- Loader. Throw a warning for duplicate keys, #166. +- Improved browserify support (mark `esprima` & `Buffer` excluded). + + +## [3.4.6] - 2015-11-26 +### Changed +- Use standalone `inherit` to keep browserified files clear. + + +## [3.4.5] - 2015-11-23 +### Added +- Added `lineWidth` option to dumper. + + +## [3.4.4] - 2015-11-21 +### Fixed +- Fixed floats dump (missed dot for scientific format), #220. +- Allow non-printable characters inside quoted scalars, #192. + + +## [3.4.3] - 2015-10-10 +### Changed +- Maintenance release - deps bump (esprima, argparse). + + +## [3.4.2] - 2015-09-09 +### Fixed +- Fixed serialization of duplicated entries in sequences, #205. + Thanks to @vogelsgesang. + + +## [3.4.1] - 2015-09-05 +### Fixed +- Fixed stacktrace handling in generated errors, for browsers (FF/IE). + + +## [3.4.0] - 2015-08-23 +### Changed +- Don't throw on warnings anymore. Use `onWarning` option to catch. +- Throw error on unknown tags (was warning before). +- Reworked internals of error class. + +### Fixed +- Fixed multiline keys dump, #197. Thanks to @tcr. +- Fixed heading line breaks in some scalars (regression). + + +## [3.3.1] - 2015-05-13 +### Added +- Added `.sortKeys` dumper option, thanks to @rjmunro. + +### Fixed +- Fixed astral characters support, #191. + + +## [3.3.0] - 2015-04-26 +### Changed +- Significantly improved long strings formatting in dumper, thanks to @isaacs. +- Strip BOM if exists. + + +## [3.2.7] - 2015-02-19 +### Changed +- Maintenance release. +- Updated dependencies. +- HISTORY.md -> CHANGELOG.md + + +## [3.2.6] - 2015-02-07 +### Fixed +- Fixed encoding of UTF-16 surrogate pairs. (e.g. "\U0001F431" CAT FACE). +- Fixed demo dates dump (#113, thanks to @Hypercubed). + + +## [3.2.5] - 2014-12-28 +### Fixed +- Fixed resolving of all built-in types on empty nodes. +- Fixed invalid warning on empty lines within quoted scalars and flow collections. +- Fixed bug: Tag on an empty node didn't resolve in some cases. + + +## [3.2.4] - 2014-12-19 +### Fixed +- Fixed resolving of !!null tag on an empty node. + + +## [3.2.3] - 2014-11-08 +### Fixed +- Implemented dumping of objects with circular and cross references. +- Partially fixed aliasing of constructed objects. (see issue #141 for details) + + +## [3.2.2] - 2014-09-07 +### Fixed +- Fixed infinite loop on unindented block scalars. +- Rewritten base64 encode/decode in binary type, to keep code licence clear. + + +## [3.2.1] - 2014-08-24 +### Fixed +- Nothig new. Just fix npm publish error. + + +## [3.2.0] - 2014-08-24 +### Added +- Added input piping support to CLI. + +### Fixed +- Fixed typo, that could cause hand on initial indent (#139). + + +## [3.1.0] - 2014-07-07 +### Changed +- 1.5x-2x speed boost. +- Removed deprecated `require('xxx.yml')` support. +- Significant code cleanup and refactoring. +- Internal API changed. If you used custom types - see updated examples. + Others are not affected. +- Even if the input string has no trailing line break character, + it will be parsed as if it has one. +- Added benchmark scripts. +- Moved bower files to /dist folder +- Bugfixes. + + +## [3.0.2] - 2014-02-27 +### Fixed +- Fixed bug: "constructor" string parsed as `null`. + + +## [3.0.1] - 2013-12-22 +### Fixed +- Fixed parsing of literal scalars. (issue #108) +- Prevented adding unnecessary spaces in object dumps. (issue #68) +- Fixed dumping of objects with very long (> 1024 in length) keys. + + +## [3.0.0] - 2013-12-16 +### Changed +- Refactored code. Changed API for custom types. +- Removed output colors in CLI, dump json by default. +- Removed big dependencies from browser version (esprima, buffer). Load `esprima` manually, if `!!js/function` needed. `!!bin` now returns Array in browser +- AMD support. +- Don't quote dumped strings because of `-` & `?` (if not first char). +- __Deprecated__ loading yaml files via `require()`, as not recommended + behaviour for node. + + +## [2.1.3] - 2013-10-16 +### Fixed +- Fix wrong loading of empty block scalars. + + +## [2.1.2] - 2013-10-07 +### Fixed +- Fix unwanted line breaks in folded scalars. + + +## [2.1.1] - 2013-10-02 +### Fixed +- Dumper now respects deprecated booleans syntax from YAML 1.0/1.1 +- Fixed reader bug in JSON-like sequences/mappings. + + +## [2.1.0] - 2013-06-05 +### Added +- Add standard YAML schemas: Failsafe (`FAILSAFE_SCHEMA`), + JSON (`JSON_SCHEMA`) and Core (`CORE_SCHEMA`). +- Add `skipInvalid` dumper option. + +### Changed +- Rename `DEFAULT_SCHEMA` to `DEFAULT_FULL_SCHEMA` + and `SAFE_SCHEMA` to `DEFAULT_SAFE_SCHEMA`. +- Use `safeLoad` for `require` extension. + +### Fixed +- Bug fix: export `NIL` constant from the public interface. + + +## [2.0.5] - 2013-04-26 +### Security +- Close security issue in !!js/function constructor. + Big thanks to @nealpoole for security audit. + + +## [2.0.4] - 2013-04-08 +### Changed +- Updated .npmignore to reduce package size + + +## [2.0.3] - 2013-02-26 +### Fixed +- Fixed dumping of empty arrays ans objects. ([] and {} instead of null) + + +## [2.0.2] - 2013-02-15 +### Fixed +- Fixed input validation: tabs are printable characters. + + +## [2.0.1] - 2013-02-09 +### Fixed +- Fixed error, when options not passed to function cass + + +## [2.0.0] - 2013-02-09 +### Changed +- Full rewrite. New architecture. Fast one-stage parsing. +- Changed custom types API. +- Added YAML dumper. + + +## [1.0.3] - 2012-11-05 +### Fixed +- Fixed utf-8 files loading. + + +## [1.0.2] - 2012-08-02 +### Fixed +- Pull out hand-written shims. Use ES5-Shims for old browsers support. See #44. +- Fix timstamps incorectly parsed in local time when no time part specified. + + +## [1.0.1] - 2012-07-07 +### Fixed +- Fixes `TypeError: 'undefined' is not an object` under Safari. Thanks Phuong. +- Fix timestamps incorrectly parsed in local time. Thanks @caolan. Closes #46. + + +## [1.0.0] - 2012-07-01 +### Changed +- `y`, `yes`, `n`, `no`, `on`, `off` are not converted to Booleans anymore. + Fixes #42. +- `require(filename)` now returns a single document and throws an Error if + file contains more than one document. +- CLI was merged back from js-yaml.bin + + +## [0.3.7] - 2012-02-28 +### Fixed +- Fix export of `addConstructor()`. Closes #39. + + +## [0.3.6] - 2012-02-22 +### Changed +- Removed AMD parts - too buggy to use. Need help to rewrite from scratch + +### Fixed +- Removed YUI compressor warning (renamed `double` variable). Closes #40. + + +## [0.3.5] - 2012-01-10 +### Fixed +- Workagound for .npmignore fuckup under windows. Thanks to airportyh. + + +## [0.3.4] - 2011-12-24 +### Fixed +- Fixes str[] for oldIEs support. +- Adds better has change support for browserified demo. +- improves compact output of Error. Closes #33. + + +## [0.3.3] - 2011-12-20 +### Added +- adds `compact` stringification of Errors. + +### Changed +- jsyaml executable moved to separate module. + + +## [0.3.2] - 2011-12-16 +### Added +- Added jsyaml executable. +- Added !!js/function support. Closes #12. + +### Fixed +- Fixes ug with block style scalars. Closes #26. +- All sources are passing JSLint now. +- Fixes bug in Safari. Closes #28. +- Fixes bug in Opers. Closes #29. +- Improves browser support. Closes #20. + + +## [0.3.1] - 2011-11-18 +### Added +- Added AMD support for browserified version. +- Added permalinks for online demo YAML snippets. Now we have YPaste service, lol. +- Added !!js/regexp and !!js/undefined types. Partially solves #12. + +### Changed +- Wrapped browserified js-yaml into closure. + +### Fixed +- Fixed the resolvement of non-specific tags. Closes #17. +- Fixed !!set mapping. +- Fixed month parse in dates. Closes #19. + + +## [0.3.0] - 2011-11-09 +### Added +- Added browserified version. Closes #13. +- Added live demo of browserified version. +- Ported some of the PyYAML tests. See #14. + +### Fixed +- Removed JS.Class dependency. Closes #3. +- Fixed timestamp bug when fraction was given. + + +## [0.2.2] - 2011-11-06 +### Fixed +- Fixed crash on docs without ---. Closes #8. +- Fixed multiline string parse +- Fixed tests/comments for using array as key + + +## [0.2.1] - 2011-11-02 +### Fixed +- Fixed short file read (<4k). Closes #9. + + +## [0.2.0] - 2011-11-02 +### Changed +- First public release + + +[3.14.1]: https://github.com/nodeca/js-yaml/compare/3.14.0...3.14.1 +[3.14.0]: https://github.com/nodeca/js-yaml/compare/3.13.1...3.14.0 +[3.13.1]: https://github.com/nodeca/js-yaml/compare/3.13.0...3.13.1 +[3.13.0]: https://github.com/nodeca/js-yaml/compare/3.12.2...3.13.0 +[3.12.2]: https://github.com/nodeca/js-yaml/compare/3.12.1...3.12.2 +[3.12.1]: https://github.com/nodeca/js-yaml/compare/3.12.0...3.12.1 +[3.12.0]: https://github.com/nodeca/js-yaml/compare/3.11.0...3.12.0 +[3.11.0]: https://github.com/nodeca/js-yaml/compare/3.10.0...3.11.0 +[3.10.0]: https://github.com/nodeca/js-yaml/compare/3.9.1...3.10.0 +[3.9.1]: https://github.com/nodeca/js-yaml/compare/3.9.0...3.9.1 +[3.9.0]: https://github.com/nodeca/js-yaml/compare/3.8.4...3.9.0 +[3.8.4]: https://github.com/nodeca/js-yaml/compare/3.8.3...3.8.4 +[3.8.3]: https://github.com/nodeca/js-yaml/compare/3.8.2...3.8.3 +[3.8.2]: https://github.com/nodeca/js-yaml/compare/3.8.1...3.8.2 +[3.8.1]: https://github.com/nodeca/js-yaml/compare/3.8.0...3.8.1 +[3.8.0]: https://github.com/nodeca/js-yaml/compare/3.7.0...3.8.0 +[3.7.0]: https://github.com/nodeca/js-yaml/compare/3.6.1...3.7.0 +[3.6.1]: https://github.com/nodeca/js-yaml/compare/3.6.0...3.6.1 +[3.6.0]: https://github.com/nodeca/js-yaml/compare/3.5.5...3.6.0 +[3.5.5]: https://github.com/nodeca/js-yaml/compare/3.5.4...3.5.5 +[3.5.4]: https://github.com/nodeca/js-yaml/compare/3.5.3...3.5.4 +[3.5.3]: https://github.com/nodeca/js-yaml/compare/3.5.2...3.5.3 +[3.5.2]: https://github.com/nodeca/js-yaml/compare/3.5.1...3.5.2 +[3.5.1]: https://github.com/nodeca/js-yaml/compare/3.5.0...3.5.1 +[3.5.0]: https://github.com/nodeca/js-yaml/compare/3.4.6...3.5.0 +[3.4.6]: https://github.com/nodeca/js-yaml/compare/3.4.5...3.4.6 +[3.4.5]: https://github.com/nodeca/js-yaml/compare/3.4.4...3.4.5 +[3.4.4]: https://github.com/nodeca/js-yaml/compare/3.4.3...3.4.4 +[3.4.3]: https://github.com/nodeca/js-yaml/compare/3.4.2...3.4.3 +[3.4.2]: https://github.com/nodeca/js-yaml/compare/3.4.1...3.4.2 +[3.4.1]: https://github.com/nodeca/js-yaml/compare/3.4.0...3.4.1 +[3.4.0]: https://github.com/nodeca/js-yaml/compare/3.3.1...3.4.0 +[3.3.1]: https://github.com/nodeca/js-yaml/compare/3.3.0...3.3.1 +[3.3.0]: https://github.com/nodeca/js-yaml/compare/3.2.7...3.3.0 +[3.2.7]: https://github.com/nodeca/js-yaml/compare/3.2.6...3.2.7 +[3.2.6]: https://github.com/nodeca/js-yaml/compare/3.2.5...3.2.6 +[3.2.5]: https://github.com/nodeca/js-yaml/compare/3.2.4...3.2.5 +[3.2.4]: https://github.com/nodeca/js-yaml/compare/3.2.3...3.2.4 +[3.2.3]: https://github.com/nodeca/js-yaml/compare/3.2.2...3.2.3 +[3.2.2]: https://github.com/nodeca/js-yaml/compare/3.2.1...3.2.2 +[3.2.1]: https://github.com/nodeca/js-yaml/compare/3.2.0...3.2.1 +[3.2.0]: https://github.com/nodeca/js-yaml/compare/3.1.0...3.2.0 +[3.1.0]: https://github.com/nodeca/js-yaml/compare/3.0.2...3.1.0 +[3.0.2]: https://github.com/nodeca/js-yaml/compare/3.0.1...3.0.2 +[3.0.1]: https://github.com/nodeca/js-yaml/compare/3.0.0...3.0.1 +[3.0.0]: https://github.com/nodeca/js-yaml/compare/2.1.3...3.0.0 +[2.1.3]: https://github.com/nodeca/js-yaml/compare/2.1.2...2.1.3 +[2.1.2]: https://github.com/nodeca/js-yaml/compare/2.1.1...2.1.2 +[2.1.1]: https://github.com/nodeca/js-yaml/compare/2.1.0...2.1.1 +[2.1.0]: https://github.com/nodeca/js-yaml/compare/2.0.5...2.1.0 +[2.0.5]: https://github.com/nodeca/js-yaml/compare/2.0.4...2.0.5 +[2.0.4]: https://github.com/nodeca/js-yaml/compare/2.0.3...2.0.4 +[2.0.3]: https://github.com/nodeca/js-yaml/compare/2.0.2...2.0.3 +[2.0.2]: https://github.com/nodeca/js-yaml/compare/2.0.1...2.0.2 +[2.0.1]: https://github.com/nodeca/js-yaml/compare/2.0.0...2.0.1 +[2.0.0]: https://github.com/nodeca/js-yaml/compare/1.0.3...2.0.0 +[1.0.3]: https://github.com/nodeca/js-yaml/compare/1.0.2...1.0.3 +[1.0.2]: https://github.com/nodeca/js-yaml/compare/1.0.1...1.0.2 +[1.0.1]: https://github.com/nodeca/js-yaml/compare/1.0.0...1.0.1 +[1.0.0]: https://github.com/nodeca/js-yaml/compare/0.3.7...1.0.0 +[0.3.7]: https://github.com/nodeca/js-yaml/compare/0.3.6...0.3.7 +[0.3.6]: https://github.com/nodeca/js-yaml/compare/0.3.5...0.3.6 +[0.3.5]: https://github.com/nodeca/js-yaml/compare/0.3.4...0.3.5 +[0.3.4]: https://github.com/nodeca/js-yaml/compare/0.3.3...0.3.4 +[0.3.3]: https://github.com/nodeca/js-yaml/compare/0.3.2...0.3.3 +[0.3.2]: https://github.com/nodeca/js-yaml/compare/0.3.1...0.3.2 +[0.3.1]: https://github.com/nodeca/js-yaml/compare/0.3.0...0.3.1 +[0.3.0]: https://github.com/nodeca/js-yaml/compare/0.2.2...0.3.0 +[0.2.2]: https://github.com/nodeca/js-yaml/compare/0.2.1...0.2.2 +[0.2.1]: https://github.com/nodeca/js-yaml/compare/0.2.0...0.2.1 +[0.2.0]: https://github.com/nodeca/js-yaml/releases/tag/0.2.0 diff --git a/node_modules/js-yaml/LICENSE b/node_modules/js-yaml/LICENSE new file mode 100644 index 00000000..09d3a29e --- /dev/null +++ b/node_modules/js-yaml/LICENSE @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (C) 2011-2015 by Vitaly Puzrin + +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/js-yaml/README.md b/node_modules/js-yaml/README.md new file mode 100644 index 00000000..246e5635 --- /dev/null +++ b/node_modules/js-yaml/README.md @@ -0,0 +1,299 @@ +JS-YAML - YAML 1.2 parser / writer for JavaScript +================================================= + +[![Build Status](https://travis-ci.org/nodeca/js-yaml.svg?branch=master)](https://travis-ci.org/nodeca/js-yaml) +[![NPM version](https://img.shields.io/npm/v/js-yaml.svg)](https://www.npmjs.org/package/js-yaml) + +__[Online Demo](http://nodeca.github.com/js-yaml/)__ + + +This is an implementation of [YAML](http://yaml.org/), a human-friendly data +serialization language. Started as [PyYAML](http://pyyaml.org/) port, it was +completely rewritten from scratch. Now it's very fast, and supports 1.2 spec. + + +Installation +------------ + +### YAML module for node.js + +``` +npm install js-yaml +``` + + +### CLI executable + +If you want to inspect your YAML files from CLI, install js-yaml globally: + +``` +npm install -g js-yaml +``` + +#### Usage + +``` +usage: js-yaml [-h] [-v] [-c] [-t] file + +Positional arguments: + file File with YAML document(s) + +Optional arguments: + -h, --help Show this help message and exit. + -v, --version Show program's version number and exit. + -c, --compact Display errors in compact mode + -t, --trace Show stack trace on error +``` + + +### Bundled YAML library for browsers + +``` html + + + + +``` + +Browser support was done mostly for the online demo. If you find any errors - feel +free to send pull requests with fixes. Also note, that IE and other old browsers +needs [es5-shims](https://github.com/kriskowal/es5-shim) to operate. + +Notes: + +1. We have no resources to support browserified version. Don't expect it to be + well tested. Don't expect fast fixes if something goes wrong there. +2. `!!js/function` in browser bundle will not work by default. If you really need + it - load `esprima` parser first (via amd or directly). +3. `!!bin` in browser will return `Array`, because browsers do not support + node.js `Buffer` and adding Buffer shims is completely useless on practice. + + +API +--- + +Here we cover the most 'useful' methods. If you need advanced details (creating +your own tags), see [wiki](https://github.com/nodeca/js-yaml/wiki) and +[examples](https://github.com/nodeca/js-yaml/tree/master/examples) for more +info. + +``` javascript +const yaml = require('js-yaml'); +const fs = require('fs'); + +// Get document, or throw exception on error +try { + const doc = yaml.safeLoad(fs.readFileSync('/home/ixti/example.yml', 'utf8')); + console.log(doc); +} catch (e) { + console.log(e); +} +``` + + +### safeLoad (string [ , options ]) + +**Recommended loading way.** Parses `string` as single YAML document. Returns either a +plain object, a string or `undefined`, or throws `YAMLException` on error. By default, does +not support regexps, functions and undefined. This method is safe for untrusted data. + +options: + +- `filename` _(default: null)_ - string to be used as a file path in + error/warning messages. +- `onWarning` _(default: null)_ - function to call on warning messages. + Loader will call this function with an instance of `YAMLException` for each warning. +- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ - specifies a schema to use. + - `FAILSAFE_SCHEMA` - only strings, arrays and plain objects: + http://www.yaml.org/spec/1.2/spec.html#id2802346 + - `JSON_SCHEMA` - all JSON-supported types: + http://www.yaml.org/spec/1.2/spec.html#id2803231 + - `CORE_SCHEMA` - same as `JSON_SCHEMA`: + http://www.yaml.org/spec/1.2/spec.html#id2804923 + - `DEFAULT_SAFE_SCHEMA` - all supported YAML types, without unsafe ones + (`!!js/undefined`, `!!js/regexp` and `!!js/function`): + http://yaml.org/type/ + - `DEFAULT_FULL_SCHEMA` - all supported YAML types. +- `json` _(default: false)_ - compatibility with JSON.parse behaviour. If true, then duplicate keys in a mapping will override values rather than throwing an error. + +NOTE: This function **does not** understand multi-document sources, it throws +exception on those. + +NOTE: JS-YAML **does not** support schema-specific tag resolution restrictions. +So, the JSON schema is not as strictly defined in the YAML specification. +It allows numbers in any notation, use `Null` and `NULL` as `null`, etc. +The core schema also has no such restrictions. It allows binary notation for integers. + + +### load (string [ , options ]) + +**Use with care with untrusted sources**. The same as `safeLoad()` but uses +`DEFAULT_FULL_SCHEMA` by default - adds some JavaScript-specific types: +`!!js/function`, `!!js/regexp` and `!!js/undefined`. For untrusted sources, you +must additionally validate object structure to avoid injections: + +``` javascript +const untrusted_code = '"toString": ! "function (){very_evil_thing();}"'; + +// I'm just converting that string, what could possibly go wrong? +require('js-yaml').load(untrusted_code) + '' +``` + + +### safeLoadAll (string [, iterator] [, options ]) + +Same as `safeLoad()`, but understands multi-document sources. Applies +`iterator` to each document if specified, or returns array of documents. + +``` javascript +const yaml = require('js-yaml'); + +yaml.safeLoadAll(data, function (doc) { + console.log(doc); +}); +``` + + +### loadAll (string [, iterator] [ , options ]) + +Same as `safeLoadAll()` but uses `DEFAULT_FULL_SCHEMA` by default. + + +### safeDump (object [ , options ]) + +Serializes `object` as a YAML document. Uses `DEFAULT_SAFE_SCHEMA`, so it will +throw an exception if you try to dump regexps or functions. However, you can +disable exceptions by setting the `skipInvalid` option to `true`. + +options: + +- `indent` _(default: 2)_ - indentation width to use (in spaces). +- `noArrayIndent` _(default: false)_ - when true, will not add an indentation level to array elements +- `skipInvalid` _(default: false)_ - do not throw on invalid types (like function + in the safe schema) and skip pairs and single values with such types. +- `flowLevel` (default: -1) - specifies level of nesting, when to switch from + block to flow style for collections. -1 means block style everwhere +- `styles` - "tag" => "style" map. Each tag may have own set of styles. +- `schema` _(default: `DEFAULT_SAFE_SCHEMA`)_ specifies a schema to use. +- `sortKeys` _(default: `false`)_ - if `true`, sort keys when dumping YAML. If a + function, use the function to sort the keys. +- `lineWidth` _(default: `80`)_ - set max line width. +- `noRefs` _(default: `false`)_ - if `true`, don't convert duplicate objects into references +- `noCompatMode` _(default: `false`)_ - if `true` don't try to be compatible with older + yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 +- `condenseFlow` _(default: `false`)_ - if `true` flow sequences will be condensed, omitting the space between `a, b`. Eg. `'[a,b]'`, and omitting the space between `key: value` and quoting the key. Eg. `'{"a":b}'` Can be useful when using yaml for pretty URL query params as spaces are %-encoded. + +The following table show availlable styles (e.g. "canonical", +"binary"...) available for each tag (.e.g. !!null, !!int ...). Yaml +output is shown on the right side after `=>` (default setting) or `->`: + +``` none +!!null + "canonical" -> "~" + "lowercase" => "null" + "uppercase" -> "NULL" + "camelcase" -> "Null" + +!!int + "binary" -> "0b1", "0b101010", "0b1110001111010" + "octal" -> "01", "052", "016172" + "decimal" => "1", "42", "7290" + "hexadecimal" -> "0x1", "0x2A", "0x1C7A" + +!!bool + "lowercase" => "true", "false" + "uppercase" -> "TRUE", "FALSE" + "camelcase" -> "True", "False" + +!!float + "lowercase" => ".nan", '.inf' + "uppercase" -> ".NAN", '.INF' + "camelcase" -> ".NaN", '.Inf' +``` + +Example: + +``` javascript +safeDump (object, { + 'styles': { + '!!null': 'canonical' // dump null as ~ + }, + 'sortKeys': true // sort object keys +}); +``` + +### dump (object [ , options ]) + +Same as `safeDump()` but without limits (uses `DEFAULT_FULL_SCHEMA` by default). + + +Supported YAML types +-------------------- + +The list of standard YAML tags and corresponding JavaScipt types. See also +[YAML tag discussion](http://pyyaml.org/wiki/YAMLTagDiscussion) and +[YAML types repository](http://yaml.org/type/). + +``` +!!null '' # null +!!bool 'yes' # bool +!!int '3...' # number +!!float '3.14...' # number +!!binary '...base64...' # buffer +!!timestamp 'YYYY-...' # date +!!omap [ ... ] # array of key-value pairs +!!pairs [ ... ] # array or array pairs +!!set { ... } # array of objects with given keys and null values +!!str '...' # string +!!seq [ ... ] # array +!!map { ... } # object +``` + +**JavaScript-specific tags** + +``` +!!js/regexp /pattern/gim # RegExp +!!js/undefined '' # Undefined +!!js/function 'function () {...}' # Function +``` + +Caveats +------- + +Note, that you use arrays or objects as key in JS-YAML. JS does not allow objects +or arrays as keys, and stringifies (by calling `toString()` method) them at the +moment of adding them. + +``` yaml +--- +? [ foo, bar ] +: - baz +? { foo: bar } +: - baz + - baz +``` + +``` javascript +{ "foo,bar": ["baz"], "[object Object]": ["baz", "baz"] } +``` + +Also, reading of properties on implicit block mapping keys is not supported yet. +So, the following YAML document cannot be loaded. + +``` yaml +&anchor foo: + foo: bar + *anchor: duplicate key + baz: bat + *anchor: duplicate key +``` + + +js-yaml for enterprise +---------------------- + +Available as part of the Tidelift Subscription + +The maintainers of js-yaml 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-js-yaml?utm_source=npm-js-yaml&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) diff --git a/node_modules/js-yaml/bin/js-yaml.js b/node_modules/js-yaml/bin/js-yaml.js new file mode 100644 index 00000000..e79186be --- /dev/null +++ b/node_modules/js-yaml/bin/js-yaml.js @@ -0,0 +1,132 @@ +#!/usr/bin/env node + + +'use strict'; + +/*eslint-disable no-console*/ + + +// stdlib +var fs = require('fs'); + + +// 3rd-party +var argparse = require('argparse'); + + +// internal +var yaml = require('..'); + + +//////////////////////////////////////////////////////////////////////////////// + + +var cli = new argparse.ArgumentParser({ + prog: 'js-yaml', + version: require('../package.json').version, + addHelp: true +}); + + +cli.addArgument([ '-c', '--compact' ], { + help: 'Display errors in compact mode', + action: 'storeTrue' +}); + + +// deprecated (not needed after we removed output colors) +// option suppressed, but not completely removed for compatibility +cli.addArgument([ '-j', '--to-json' ], { + help: argparse.Const.SUPPRESS, + dest: 'json', + action: 'storeTrue' +}); + + +cli.addArgument([ '-t', '--trace' ], { + help: 'Show stack trace on error', + action: 'storeTrue' +}); + +cli.addArgument([ 'file' ], { + help: 'File to read, utf-8 encoded without BOM', + nargs: '?', + defaultValue: '-' +}); + + +//////////////////////////////////////////////////////////////////////////////// + + +var options = cli.parseArgs(); + + +//////////////////////////////////////////////////////////////////////////////// + +function readFile(filename, encoding, callback) { + if (options.file === '-') { + // read from stdin + + var chunks = []; + + process.stdin.on('data', function (chunk) { + chunks.push(chunk); + }); + + process.stdin.on('end', function () { + return callback(null, Buffer.concat(chunks).toString(encoding)); + }); + } else { + fs.readFile(filename, encoding, callback); + } +} + +readFile(options.file, 'utf8', function (error, input) { + var output, isYaml; + + if (error) { + if (error.code === 'ENOENT') { + console.error('File not found: ' + options.file); + process.exit(2); + } + + console.error( + options.trace && error.stack || + error.message || + String(error)); + + process.exit(1); + } + + try { + output = JSON.parse(input); + isYaml = false; + } catch (err) { + if (err instanceof SyntaxError) { + try { + output = []; + yaml.loadAll(input, function (doc) { output.push(doc); }, {}); + isYaml = true; + + if (output.length === 0) output = null; + else if (output.length === 1) output = output[0]; + + } catch (e) { + if (options.trace && err.stack) console.error(e.stack); + else console.error(e.toString(options.compact)); + + process.exit(1); + } + } else { + console.error( + options.trace && err.stack || + err.message || + String(err)); + + process.exit(1); + } + } + + if (isYaml) console.log(JSON.stringify(output, null, ' ')); + else console.log(yaml.dump(output)); +}); diff --git a/node_modules/js-yaml/dist/js-yaml.js b/node_modules/js-yaml/dist/js-yaml.js new file mode 100644 index 00000000..78783207 --- /dev/null +++ b/node_modules/js-yaml/dist/js-yaml.js @@ -0,0 +1,3989 @@ +/*! js-yaml 3.14.1 https://github.com/nodeca/js-yaml */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.jsyaml = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + +function State(options) { + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// [24] b-line-feed ::= #xA /* LF */ +// [25] b-carriage-return ::= #xD /* CR */ +// [3] c-byte-order-mark ::= #xFEFF +function isNsChar(c) { + return isPrintable(c) && !isWhitespace(c) + // byte-order-mark + && c !== 0xFEFF + // b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c, prev) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + // /* An ns-char preceding */ "#" + && c !== CHAR_COLON + && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char, nextChar; + var escapeSeq; + + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). + if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { + nextChar = string.charCodeAt(i + 1); + if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { + // Combine the surrogate pair and store it escaped. + result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); + // Advance index one extra since we already used that char here. + i++; continue; + } + } + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level, object[index], false, false)) { + if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level + 1, object[index], true, true)) { + if (!compact || index !== 0) { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (index !== 0) pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || index !== 0) { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + state.tag = explicit ? type.tag : '?'; + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; + if (block && (state.dump.length !== 0)) { + writeBlockSequence(state, arrayLevel, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, arrayLevel, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); + } + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + state.dump = '!<' + state.tag + '> ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; + + return ''; +} + +function safeDump(input, options) { + return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + +module.exports.dump = dump; +module.exports.safeDump = safeDump; + +},{"./common":2,"./exception":4,"./schema/default_full":9,"./schema/default_safe":10}],4:[function(require,module,exports){ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; + + result += this.reason || '(unknown reason)'; + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; + +},{}],5:[function(require,module,exports){ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Mark = require('./mark'); +var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); +var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.onWarning = options['onWarning'] || null; + this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + return new YAMLException( + message, + new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + _result[keyNode] = valueNode; + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = {}, + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _pos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = {}, + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + _pos = state.position; + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else { + break; // Reading is done. Go to the epilogue. + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if (state.lineIndent > nodeIndent && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +function safeLoadAll(input, iterator, options) { + if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +function safeLoad(input, options) { + return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; +module.exports.safeLoadAll = safeLoadAll; +module.exports.safeLoad = safeLoad; + +},{"./common":2,"./exception":4,"./mark":6,"./schema/default_full":9,"./schema/default_safe":10}],6:[function(require,module,exports){ +'use strict'; + + +var common = require('./common'); + + +function Mark(name, buffer, position, line, column) { + this.name = name; + this.buffer = buffer; + this.position = position; + this.line = line; + this.column = column; +} + + +Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head, start, tail, end, snippet; + + if (!this.buffer) return null; + + indent = indent || 4; + maxLength = maxLength || 75; + + head = ''; + start = this.position; + + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { + start -= 1; + if (this.position - start > (maxLength / 2 - 1)) { + head = ' ... '; + start += 5; + break; + } + } + + tail = ''; + end = this.position; + + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { + end += 1; + if (end - this.position > (maxLength / 2 - 1)) { + tail = ' ... '; + end -= 5; + break; + } + } + + snippet = this.buffer.slice(start, end); + + return common.repeat(' ', indent) + head + snippet + tail + '\n' + + common.repeat(' ', indent + this.position - start + head.length) + '^'; +}; + + +Mark.prototype.toString = function toString(compact) { + var snippet, where = ''; + + if (this.name) { + where += 'in "' + this.name + '" '; + } + + where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); + + if (!compact) { + snippet = this.getSnippet(); + + if (snippet) { + where += ':\n' + snippet; + } + } + + return where; +}; + + +module.exports = Mark; + +},{"./common":2}],7:[function(require,module,exports){ +'use strict'; + +/*eslint-disable max-len*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; + + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; + +},{"./common":2,"./exception":4,"./type":13}],8:[function(require,module,exports){ +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./json') + ] +}); + +},{"../schema":7,"./json":12}],9:[function(require,module,exports){ +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + require('./default_safe') + ], + explicit: [ + require('../type/js/undefined'), + require('../type/js/regexp'), + require('../type/js/function') + ] +}); + +},{"../schema":7,"../type/js/function":18,"../type/js/regexp":19,"../type/js/undefined":20,"./default_safe":10}],10:[function(require,module,exports){ +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./core') + ], + implicit: [ + require('../type/timestamp'), + require('../type/merge') + ], + explicit: [ + require('../type/binary'), + require('../type/omap'), + require('../type/pairs'), + require('../type/set') + ] +}); + +},{"../schema":7,"../type/binary":14,"../type/merge":22,"../type/omap":24,"../type/pairs":25,"../type/set":27,"../type/timestamp":29,"./core":8}],11:[function(require,module,exports){ +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + explicit: [ + require('../type/str'), + require('../type/seq'), + require('../type/map') + ] +}); + +},{"../schema":7,"../type/map":21,"../type/seq":26,"../type/str":28}],12:[function(require,module,exports){ +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./failsafe') + ], + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); + +},{"../schema":7,"../type/bool":15,"../type/float":16,"../type/int":17,"../type/null":23,"./failsafe":11}],13:[function(require,module,exports){ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; + +},{"./exception":4}],14:[function(require,module,exports){ +'use strict'; + +/*eslint-disable no-bitwise*/ + +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + +var Type = require('../type'); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + // Wrap into Buffer for NodeJS and leave Array for browser + if (NodeBuffer) { + // Support node 6.+ Buffer API when available + return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); + } + + return result; +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); + +},{"../type":13}],15:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); + +},{"../type":13}],16:[function(require,module,exports){ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // 20:59 + '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign, base, digits; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + digits = []; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + + } else if (value.indexOf(':') >= 0) { + value.split(':').forEach(function (v) { + digits.unshift(parseFloat(v, 10)); + }); + + value = 0.0; + base = 1; + + digits.forEach(function (d) { + value += d * base; + base *= 60; + }); + + return sign * value; + + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); + +},{"../common":2,"../type":13}],17:[function(require,module,exports){ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 8 + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 10 (except 0) or base 60 + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch === ':') break; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + // if !base60 - done; + if (ch !== ':') return true; + + // base60 almost not used, no needs to optimize + return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch, base, digits = []; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); + return sign * parseInt(value, 8); + } + + if (value.indexOf(':') !== -1) { + value.split(':').forEach(function (v) { + digits.unshift(parseInt(v, 10)); + }); + + value = 0; + base = 1; + + digits.forEach(function (d) { + value += (d * base); + base *= 60; + }); + + return sign * value; + + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); + +},{"../common":2,"../type":13}],18:[function(require,module,exports){ +'use strict'; + +var esprima; + +// Browserified version does not have esprima +// +// 1. For node.js just require module as deps +// 2. For browser try to require mudule via external AMD system. +// If not found - try to fallback to window.esprima. If not +// found too - then fail to parse. +// +try { + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); +} catch (_) { + /* eslint-disable no-redeclare */ + /* global window */ + if (typeof window !== 'undefined') esprima = window.esprima; +} + +var Type = require('../../type'); + +function resolveJavascriptFunction(data) { + if (data === null) return false; + + try { + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + return false; + } + + return true; + } catch (err) { + return false; + } +} + +function constructJavascriptFunction(data) { + /*jslint evil:true*/ + + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }), + params = [], + body; + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + throw new Error('Failed to resolve function'); + } + + ast.body[0].expression.params.forEach(function (param) { + params.push(param.name); + }); + + body = ast.body[0].expression.body.range; + + // Esprima's ranges include the first '{' and the last '}' characters on + // function expressions. So cut them out. + if (ast.body[0].expression.body.type === 'BlockStatement') { + /*eslint-disable no-new-func*/ + return new Function(params, source.slice(body[0] + 1, body[1] - 1)); + } + // ES6 arrow functions can omit the BlockStatement. In that case, just return + // the body. + /*eslint-disable no-new-func*/ + return new Function(params, 'return ' + source.slice(body[0], body[1])); +} + +function representJavascriptFunction(object /*, style*/) { + return object.toString(); +} + +function isFunction(object) { + return Object.prototype.toString.call(object) === '[object Function]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/function', { + kind: 'scalar', + resolve: resolveJavascriptFunction, + construct: constructJavascriptFunction, + predicate: isFunction, + represent: representJavascriptFunction +}); + +},{"../../type":13}],19:[function(require,module,exports){ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptRegExp(data) { + if (data === null) return false; + if (data.length === 0) return false; + + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // if regexp starts with '/' it can have modifiers and must be properly closed + // `/foo/gim` - modifiers tail can be maximum 3 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + + if (modifiers.length > 3) return false; + // if expression starts with /, is should be properly terminated + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; + } + + return true; +} + +function constructJavascriptRegExp(data) { + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // `/foo/gim` - tail can be maximum 4 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + + return new RegExp(regexp, modifiers); +} + +function representJavascriptRegExp(object /*, style*/) { + var result = '/' + object.source + '/'; + + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; + + return result; +} + +function isRegExp(object) { + return Object.prototype.toString.call(object) === '[object RegExp]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/regexp', { + kind: 'scalar', + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp, + represent: representJavascriptRegExp +}); + +},{"../../type":13}],20:[function(require,module,exports){ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptUndefined() { + return true; +} + +function constructJavascriptUndefined() { + /*eslint-disable no-undefined*/ + return undefined; +} + +function representJavascriptUndefined() { + return ''; +} + +function isUndefined(object) { + return typeof object === 'undefined'; +} + +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + kind: 'scalar', + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined, + represent: representJavascriptUndefined +}); + +},{"../../type":13}],21:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); + +},{"../type":13}],22:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); + +},{"../type":13}],23:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; } + }, + defaultStyle: 'lowercase' +}); + +},{"../type":13}],24:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); + +},{"../type":13}],25:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); + +},{"../type":13}],26:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); + +},{"../type":13}],27:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); + +},{"../type":13}],28:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); + +},{"../type":13}],29:[function(require,module,exports){ +'use strict'; + +var Type = require('../type'); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); + +},{"../type":13}],"/":[function(require,module,exports){ +'use strict'; + + +var yaml = require('./lib/js-yaml.js'); + + +module.exports = yaml; + +},{"./lib/js-yaml.js":1}]},{},[])("/") +}); diff --git a/node_modules/js-yaml/dist/js-yaml.min.js b/node_modules/js-yaml/dist/js-yaml.min.js new file mode 100644 index 00000000..1b6ecc16 --- /dev/null +++ b/node_modules/js-yaml/dist/js-yaml.min.js @@ -0,0 +1 @@ +/*! js-yaml 3.14.1 https://github.com/nodeca/js-yaml */!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsyaml=e()}(function(){return function i(r,o,a){function s(t,e){if(!o[t]){if(!r[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=o[t]={exports:{}},r[t][0].call(n.exports,function(e){return s(r[t][1][e]||e)},n,n.exports,i,r,o,a)}return o[t].exports}for(var c="function"==typeof require&&require,e=0;e=i.flowLevel;switch(V(r,n,i.indent,t,function(e){return function(e,t){for(var n=0,i=e.implicitTypes.length;n"+z(r,i.indent)+J(U(function(t,n){var e,i=/(\n+)([^\n]*)/g,r=function(){var e=-1!==(e=t.indexOf("\n"))?e:t.length;return i.lastIndex=e,Q(t.slice(0,e),n)}(),o="\n"===t[0]||" "===t[0];for(;e=i.exec(t);){var a=e[1],s=e[2];e=" "===s[0],r+=a+(o||e||""===s?"":"\n")+Q(s,n),o=e}return r}(r,t),e));case G:return'"'+function(e){for(var t,n,i,r="",o=0;ot&&o tag resolver accepts not "'+o+'" style');i=r.represent[o](t,o)}e.dump=i}return 1}}function ee(e,t,n,i,r,o){e.tag=null,e.dump=n,X(e,n,!1)||X(e,n,!0);var a=l.call(e.dump);i=i&&(e.flowLevel<0||e.flowLevel>t);var s,c,u="[object Object]"===a||"[object Array]"===a;if(u&&(c=-1!==(s=e.duplicates.indexOf(n))),(null!==e.tag&&"?"!==e.tag||c||2!==e.indent&&0 "+e.dump)}return 1}function te(e,t){var n,i,r=[],o=[];for(!function e(t,n,i){var r,o,a;if(null!==t&&"object"==typeof t)if(-1!==(o=n.indexOf(t)))-1===i.indexOf(o)&&i.push(o);else if(n.push(t),Array.isArray(t))for(o=0,a=t.length;o>10),56320+(c-65536&1023)),e.position++}else N(e,"unknown escape sequence");n=i=e.position}else S(u)?(L(e,n,i,!0),B(e,Y(e,!1,t)),n=i=e.position):e.position===e.lineStart&&R(e)?N(e,"unexpected end of the document within a double quoted scalar"):(e.position++,i=e.position)}N(e,"unexpected end of the stream within a double quoted scalar")}}function K(e,t){var n,i,r=e.tag,o=e.anchor,a=[],s=!1;for(null!==e.anchor&&(e.anchorMap[e.anchor]=a),i=e.input.charCodeAt(e.position);0!==i&&45===i&&O(e.input.charCodeAt(e.position+1));)if(s=!0,e.position++,Y(e,!0,-1)&&e.lineIndent<=t)a.push(null),i=e.input.charCodeAt(e.position);else if(n=e.line,P(e,t,x,!1,!0),a.push(e.result),Y(e,!0,-1),i=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&0!==i)N(e,"bad indentation of a sequence entry");else if(e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndentt?p=1:e.lineIndent===t?p=0:e.lineIndentt)&&(P(e,t,A,!0,r)&&(m?d=e.result:h=e.result),m||(U(e,l,p,f,d,h,o,a),f=d=h=null),Y(e,!0,-1),s=e.input.charCodeAt(e.position)),e.lineIndent>t&&0!==s)N(e,"bad indentation of a mapping entry");else if(e.lineIndentc&&(c=e.lineIndent),S(p))u++;else{if(e.lineIndent=t){a=!0,f=e.input.charCodeAt(e.position);continue}e.position=o,e.line=s,e.lineStart=c,e.lineIndent=u;break}}a&&(L(e,r,o,!1),B(e,e.line-s),r=o=e.position,a=!1),I(f)||(o=e.position+1),f=e.input.charCodeAt(++e.position)}if(L(e,r,o,!1),e.result)return 1;e.kind=l,e.result=p}}(e,i,g===n)&&(d=!0,null===e.tag&&(e.tag="?")):(d=!0,null===e.tag&&null===e.anchor||N(e,"alias node should not have any properties")),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):0===p&&(d=s&&K(e,r))),null!==e.tag&&"!"!==e.tag)if("?"===e.tag){for(null!==e.result&&"scalar"!==e.kind&&N(e,'unacceptable node kind for ! tag; it should be "scalar", not "'+e.kind+'"'),c=0,u=e.implicitTypes.length;c tag; it should be "'+l.kind+'", not "'+e.kind+'"'),l.resolve(e.result)?(e.result=l.construct(e.result),null!==e.anchor&&(e.anchorMap[e.anchor]=e.result)):N(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):N(e,"unknown tag !<"+e.tag+">");return null!==e.listener&&e.listener("close",e),null!==e.tag||null!==e.anchor||d}function $(e,t){t=t||{},0!==(e=String(e)).length&&(10!==e.charCodeAt(e.length-1)&&13!==e.charCodeAt(e.length-1)&&(e+="\n"),65279===e.charCodeAt(0)&&(e=e.slice(1)));var n=new F(e,t),e=e.indexOf("\0");for(-1!==e&&(n.position=e,N(n,"null byte is not allowed in input")),n.input+="\0";32===n.input.charCodeAt(n.position);)n.lineIndent+=1,n.position+=1;for(;n.positiont/2-1){n=" ... ",i+=5;break}for(r="",o=this.position;ot/2-1){r=" ... ",o-=5;break}return a=this.buffer.slice(i,o),s.repeat(" ",e)+n+a+r+"\n"+s.repeat(" ",e+this.position-i+n.length)+"^"},i.prototype.toString=function(e){var t="";return this.name&&(t+='in "'+this.name+'" '),t+="at line "+(this.line+1)+", column "+(this.column+1),e||(e=this.getSnippet())&&(t+=":\n"+e),t},t.exports=i},{"./common":2}],7:[function(e,t,n){"use strict";var r=e("./common"),o=e("./exception"),a=e("./type");function s(e,t,i){var r=[];return e.include.forEach(function(e){i=s(e,t,i)}),e[t].forEach(function(n){i.forEach(function(e,t){e.tag===n.tag&&e.kind===n.kind&&r.push(t)}),i.push(n)}),i.filter(function(e,t){return-1===r.indexOf(t)})}function c(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(e){if(e.loadKind&&"scalar"!==e.loadKind)throw new o("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=s(this,"implicit",[]),this.compiledExplicit=s(this,"explicit",[]),this.compiledTypeMap=function(){var e,t,n={scalar:{},sequence:{},mapping:{},fallback:{}};function i(e){n[e.kind][e.tag]=n.fallback[e.tag]=e}for(e=0,t=arguments.length;e>16&255),o.push(r>>8&255),o.push(255&r)),r=r<<6|i.indexOf(t.charAt(a));return 0==(e=n%4*6)?(o.push(r>>16&255),o.push(r>>8&255),o.push(255&r)):18==e?(o.push(r>>10&255),o.push(r>>2&255)):12==e&&o.push(r>>4&255),s?s.from?s.from(o):new s(o):o},predicate:function(e){return s&&s.isBuffer(e)},represent:function(e){for(var t,n="",i=0,r=e.length,o=c,a=0;a>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]),i=(i<<8)+e[a];return 0==(t=r%3)?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[63&i]):2==t?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):1==t&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}})},{"../type":13}],15:[function(e,t,n){"use strict";e=e("../type");t.exports=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t=e.length;return 4===t&&("true"===e||"True"===e||"TRUE"===e)||5===t&&("false"===e||"False"===e||"FALSE"===e)},construct:function(e){return"true"===e||"True"===e||"TRUE"===e},predicate:function(e){return"[object Boolean]"===Object.prototype.toString.call(e)},represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"})},{"../type":13}],16:[function(e,t,n){"use strict";var i=e("../common"),e=e("../type"),r=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");var o=/^[-+]?[0-9]+e/;t.exports=new e("tag:yaml.org,2002:float",{kind:"scalar",resolve:function(e){return null!==e&&!(!r.test(e)||"_"===e[e.length-1])},construct:function(e){var t,n=e.replace(/_/g,"").toLowerCase(),e="-"===n[0]?-1:1,i=[];return 0<="+-".indexOf(n[0])&&(n=n.slice(1)),".inf"===n?1==e?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:".nan"===n?NaN:0<=n.indexOf(":")?(n.split(":").forEach(function(e){i.unshift(parseFloat(e,10))}),n=0,t=1,i.forEach(function(e){n+=e*t,t*=60}),e*n):e*parseFloat(n,10)},predicate:function(e){return"[object Number]"===Object.prototype.toString.call(e)&&(e%1!=0||i.isNegativeZero(e))},represent:function(e,t){if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(i.isNegativeZero(e))return"-0.0";return e=e.toString(10),o.test(e)?e.replace("e",".e"):e},defaultStyle:"lowercase"})},{"../common":2,"../type":13}],17:[function(e,t,n){"use strict";var i=e("../common"),e=e("../type");t.exports=new e("tag:yaml.org,2002:int",{kind:"scalar",resolve:function(e){if(null===e)return!1;var t,n,i,r,o=e.length,a=0,s=!1;if(!o)return!1;if("-"!==(t=e[a])&&"+"!==t||(t=e[++a]),"0"===t){if(a+1===o)return!0;if("b"===(t=e[++a])){for(a++;a */ +var CHAR_QUESTION = 0x3F; /* ? */ +var CHAR_COMMERCIAL_AT = 0x40; /* @ */ +var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */ +var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */ +var CHAR_GRAVE_ACCENT = 0x60; /* ` */ +var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */ +var CHAR_VERTICAL_LINE = 0x7C; /* | */ +var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */ + +var ESCAPE_SEQUENCES = {}; + +ESCAPE_SEQUENCES[0x00] = '\\0'; +ESCAPE_SEQUENCES[0x07] = '\\a'; +ESCAPE_SEQUENCES[0x08] = '\\b'; +ESCAPE_SEQUENCES[0x09] = '\\t'; +ESCAPE_SEQUENCES[0x0A] = '\\n'; +ESCAPE_SEQUENCES[0x0B] = '\\v'; +ESCAPE_SEQUENCES[0x0C] = '\\f'; +ESCAPE_SEQUENCES[0x0D] = '\\r'; +ESCAPE_SEQUENCES[0x1B] = '\\e'; +ESCAPE_SEQUENCES[0x22] = '\\"'; +ESCAPE_SEQUENCES[0x5C] = '\\\\'; +ESCAPE_SEQUENCES[0x85] = '\\N'; +ESCAPE_SEQUENCES[0xA0] = '\\_'; +ESCAPE_SEQUENCES[0x2028] = '\\L'; +ESCAPE_SEQUENCES[0x2029] = '\\P'; + +var DEPRECATED_BOOLEANS_SYNTAX = [ + 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON', + 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF' +]; + +function compileStyleMap(schema, map) { + var result, keys, index, length, tag, style, type; + + if (map === null) return {}; + + result = {}; + keys = Object.keys(map); + + for (index = 0, length = keys.length; index < length; index += 1) { + tag = keys[index]; + style = String(map[tag]); + + if (tag.slice(0, 2) === '!!') { + tag = 'tag:yaml.org,2002:' + tag.slice(2); + } + type = schema.compiledTypeMap['fallback'][tag]; + + if (type && _hasOwnProperty.call(type.styleAliases, style)) { + style = type.styleAliases[style]; + } + + result[tag] = style; + } + + return result; +} + +function encodeHex(character) { + var string, handle, length; + + string = character.toString(16).toUpperCase(); + + if (character <= 0xFF) { + handle = 'x'; + length = 2; + } else if (character <= 0xFFFF) { + handle = 'u'; + length = 4; + } else if (character <= 0xFFFFFFFF) { + handle = 'U'; + length = 8; + } else { + throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF'); + } + + return '\\' + handle + common.repeat('0', length - string.length) + string; +} + +function State(options) { + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.indent = Math.max(1, (options['indent'] || 2)); + this.noArrayIndent = options['noArrayIndent'] || false; + this.skipInvalid = options['skipInvalid'] || false; + this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']); + this.styleMap = compileStyleMap(this.schema, options['styles'] || null); + this.sortKeys = options['sortKeys'] || false; + this.lineWidth = options['lineWidth'] || 80; + this.noRefs = options['noRefs'] || false; + this.noCompatMode = options['noCompatMode'] || false; + this.condenseFlow = options['condenseFlow'] || false; + + this.implicitTypes = this.schema.compiledImplicit; + this.explicitTypes = this.schema.compiledExplicit; + + this.tag = null; + this.result = ''; + + this.duplicates = []; + this.usedDuplicates = null; +} + +// Indents every line in a string. Empty lines (\n only) are not indented. +function indentString(string, spaces) { + var ind = common.repeat(' ', spaces), + position = 0, + next = -1, + result = '', + line, + length = string.length; + + while (position < length) { + next = string.indexOf('\n', position); + if (next === -1) { + line = string.slice(position); + position = length; + } else { + line = string.slice(position, next + 1); + position = next + 1; + } + + if (line.length && line !== '\n') result += ind; + + result += line; + } + + return result; +} + +function generateNextLine(state, level) { + return '\n' + common.repeat(' ', state.indent * level); +} + +function testImplicitResolving(state, str) { + var index, length, type; + + for (index = 0, length = state.implicitTypes.length; index < length; index += 1) { + type = state.implicitTypes[index]; + + if (type.resolve(str)) { + return true; + } + } + + return false; +} + +// [33] s-white ::= s-space | s-tab +function isWhitespace(c) { + return c === CHAR_SPACE || c === CHAR_TAB; +} + +// Returns true if the character can be printed without escaping. +// From YAML 1.2: "any allowed characters known to be non-printable +// should also be escaped. [However,] This isn’t mandatory" +// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029. +function isPrintable(c) { + return (0x00020 <= c && c <= 0x00007E) + || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029) + || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */) + || (0x10000 <= c && c <= 0x10FFFF); +} + +// [34] ns-char ::= nb-char - s-white +// [27] nb-char ::= c-printable - b-char - c-byte-order-mark +// [26] b-char ::= b-line-feed | b-carriage-return +// [24] b-line-feed ::= #xA /* LF */ +// [25] b-carriage-return ::= #xD /* CR */ +// [3] c-byte-order-mark ::= #xFEFF +function isNsChar(c) { + return isPrintable(c) && !isWhitespace(c) + // byte-order-mark + && c !== 0xFEFF + // b-char + && c !== CHAR_CARRIAGE_RETURN + && c !== CHAR_LINE_FEED; +} + +// Simplified test for values allowed after the first character in plain style. +function isPlainSafe(c, prev) { + // Uses a subset of nb-char - c-flow-indicator - ":" - "#" + // where nb-char ::= c-printable - b-char - c-byte-order-mark. + return isPrintable(c) && c !== 0xFEFF + // - c-flow-indicator + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // - ":" - "#" + // /* An ns-char preceding */ "#" + && c !== CHAR_COLON + && ((c !== CHAR_SHARP) || (prev && isNsChar(prev))); +} + +// Simplified test for values allowed as the first character in plain style. +function isPlainSafeFirst(c) { + // Uses a subset of ns-char - c-indicator + // where ns-char = nb-char - s-white. + return isPrintable(c) && c !== 0xFEFF + && !isWhitespace(c) // - s-white + // - (c-indicator ::= + // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}” + && c !== CHAR_MINUS + && c !== CHAR_QUESTION + && c !== CHAR_COLON + && c !== CHAR_COMMA + && c !== CHAR_LEFT_SQUARE_BRACKET + && c !== CHAR_RIGHT_SQUARE_BRACKET + && c !== CHAR_LEFT_CURLY_BRACKET + && c !== CHAR_RIGHT_CURLY_BRACKET + // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “"” + && c !== CHAR_SHARP + && c !== CHAR_AMPERSAND + && c !== CHAR_ASTERISK + && c !== CHAR_EXCLAMATION + && c !== CHAR_VERTICAL_LINE + && c !== CHAR_EQUALS + && c !== CHAR_GREATER_THAN + && c !== CHAR_SINGLE_QUOTE + && c !== CHAR_DOUBLE_QUOTE + // | “%” | “@” | “`”) + && c !== CHAR_PERCENT + && c !== CHAR_COMMERCIAL_AT + && c !== CHAR_GRAVE_ACCENT; +} + +// Determines whether block indentation indicator is required. +function needIndentIndicator(string) { + var leadingSpaceRe = /^\n* /; + return leadingSpaceRe.test(string); +} + +var STYLE_PLAIN = 1, + STYLE_SINGLE = 2, + STYLE_LITERAL = 3, + STYLE_FOLDED = 4, + STYLE_DOUBLE = 5; + +// Determines which scalar styles are possible and returns the preferred style. +// lineWidth = -1 => no limit. +// Pre-conditions: str.length > 0. +// Post-conditions: +// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string. +// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1). +// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1). +function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) { + var i; + var char, prev_char; + var hasLineBreak = false; + var hasFoldableLine = false; // only checked if shouldTrackWidth + var shouldTrackWidth = lineWidth !== -1; + var previousLineBreak = -1; // count the first line correctly + var plain = isPlainSafeFirst(string.charCodeAt(0)) + && !isWhitespace(string.charCodeAt(string.length - 1)); + + if (singleLineOnly) { + // Case: no block styles. + // Check for disallowed characters to rule out plain and single. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + } else { + // Case: block styles permitted. + for (i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + if (char === CHAR_LINE_FEED) { + hasLineBreak = true; + // Check if any line can be folded. + if (shouldTrackWidth) { + hasFoldableLine = hasFoldableLine || + // Foldable line = too long, and not more-indented. + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' '); + previousLineBreak = i; + } + } else if (!isPrintable(char)) { + return STYLE_DOUBLE; + } + prev_char = i > 0 ? string.charCodeAt(i - 1) : null; + plain = plain && isPlainSafe(char, prev_char); + } + // in case the end is missing a \n + hasFoldableLine = hasFoldableLine || (shouldTrackWidth && + (i - previousLineBreak - 1 > lineWidth && + string[previousLineBreak + 1] !== ' ')); + } + // Although every style can represent \n without escaping, prefer block styles + // for multiline, since they're more readable and they don't add empty lines. + // Also prefer folding a super-long line. + if (!hasLineBreak && !hasFoldableLine) { + // Strings interpretable as another type have to be quoted; + // e.g. the string 'true' vs. the boolean true. + return plain && !testAmbiguousType(string) + ? STYLE_PLAIN : STYLE_SINGLE; + } + // Edge case: block indentation indicator can only have one digit. + if (indentPerLevel > 9 && needIndentIndicator(string)) { + return STYLE_DOUBLE; + } + // At this point we know block styles are valid. + // Prefer literal style unless we want to fold. + return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL; +} + +// Note: line breaking/folding is implemented for only the folded style. +// NB. We drop the last trailing newline (if any) of a returned block scalar +// since the dumper adds its own newline. This always works: +// • No ending newline => unaffected; already using strip "-" chomping. +// • Ending newline => removed then restored. +// Importantly, this keeps the "+" chomp indicator from gaining an extra line. +function writeScalar(state, string, level, iskey) { + state.dump = (function () { + if (string.length === 0) { + return "''"; + } + if (!state.noCompatMode && + DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) { + return "'" + string + "'"; + } + + var indent = state.indent * Math.max(1, level); // no 0-indent scalars + // As indentation gets deeper, let the width decrease monotonically + // to the lower bound min(state.lineWidth, 40). + // Note that this implies + // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound. + // state.lineWidth > 40 + state.indent: width decreases until the lower bound. + // This behaves better than a constant minimum width which disallows narrower options, + // or an indent threshold which causes the width to suddenly increase. + var lineWidth = state.lineWidth === -1 + ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent); + + // Without knowing if keys are implicit/explicit, assume implicit for safety. + var singleLineOnly = iskey + // No block styles in flow mode. + || (state.flowLevel > -1 && level >= state.flowLevel); + function testAmbiguity(string) { + return testImplicitResolving(state, string); + } + + switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) { + case STYLE_PLAIN: + return string; + case STYLE_SINGLE: + return "'" + string.replace(/'/g, "''") + "'"; + case STYLE_LITERAL: + return '|' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(string, indent)); + case STYLE_FOLDED: + return '>' + blockHeader(string, state.indent) + + dropEndingNewline(indentString(foldString(string, lineWidth), indent)); + case STYLE_DOUBLE: + return '"' + escapeString(string, lineWidth) + '"'; + default: + throw new YAMLException('impossible error: invalid scalar style'); + } + }()); +} + +// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9. +function blockHeader(string, indentPerLevel) { + var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : ''; + + // note the special case: the string '\n' counts as a "trailing" empty line. + var clip = string[string.length - 1] === '\n'; + var keep = clip && (string[string.length - 2] === '\n' || string === '\n'); + var chomp = keep ? '+' : (clip ? '' : '-'); + + return indentIndicator + chomp + '\n'; +} + +// (See the note for writeScalar.) +function dropEndingNewline(string) { + return string[string.length - 1] === '\n' ? string.slice(0, -1) : string; +} + +// Note: a long line without a suitable break point will exceed the width limit. +// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0. +function foldString(string, width) { + // In folded style, $k$ consecutive newlines output as $k+1$ newlines— + // unless they're before or after a more-indented line, or at the very + // beginning or end, in which case $k$ maps to $k$. + // Therefore, parse each chunk as newline(s) followed by a content line. + var lineRe = /(\n+)([^\n]*)/g; + + // first line (possibly an empty line) + var result = (function () { + var nextLF = string.indexOf('\n'); + nextLF = nextLF !== -1 ? nextLF : string.length; + lineRe.lastIndex = nextLF; + return foldLine(string.slice(0, nextLF), width); + }()); + // If we haven't reached the first content line yet, don't add an extra \n. + var prevMoreIndented = string[0] === '\n' || string[0] === ' '; + var moreIndented; + + // rest of the lines + var match; + while ((match = lineRe.exec(string))) { + var prefix = match[1], line = match[2]; + moreIndented = (line[0] === ' '); + result += prefix + + (!prevMoreIndented && !moreIndented && line !== '' + ? '\n' : '') + + foldLine(line, width); + prevMoreIndented = moreIndented; + } + + return result; +} + +// Greedy line breaking. +// Picks the longest line under the limit each time, +// otherwise settles for the shortest line over the limit. +// NB. More-indented lines *cannot* be folded, as that would add an extra \n. +function foldLine(line, width) { + if (line === '' || line[0] === ' ') return line; + + // Since a more-indented line adds a \n, breaks can't be followed by a space. + var breakRe = / [^ ]/g; // note: the match index will always be <= length-2. + var match; + // start is an inclusive index. end, curr, and next are exclusive. + var start = 0, end, curr = 0, next = 0; + var result = ''; + + // Invariants: 0 <= start <= length-1. + // 0 <= curr <= next <= max(0, length-2). curr - start <= width. + // Inside the loop: + // A match implies length >= 2, so curr and next are <= length-2. + while ((match = breakRe.exec(line))) { + next = match.index; + // maintain invariant: curr - start <= width + if (next - start > width) { + end = (curr > start) ? curr : next; // derive end <= length-2 + result += '\n' + line.slice(start, end); + // skip the space that was output as \n + start = end + 1; // derive start <= length-1 + } + curr = next; + } + + // By the invariants, start <= length-1, so there is something left over. + // It is either the whole string or a part starting from non-whitespace. + result += '\n'; + // Insert a break if the remainder is too long and there is a break available. + if (line.length - start > width && curr > start) { + result += line.slice(start, curr) + '\n' + line.slice(curr + 1); + } else { + result += line.slice(start); + } + + return result.slice(1); // drop extra \n joiner +} + +// Escapes a double-quoted string. +function escapeString(string) { + var result = ''; + var char, nextChar; + var escapeSeq; + + for (var i = 0; i < string.length; i++) { + char = string.charCodeAt(i); + // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates"). + if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) { + nextChar = string.charCodeAt(i + 1); + if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) { + // Combine the surrogate pair and store it escaped. + result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000); + // Advance index one extra since we already used that char here. + i++; continue; + } + } + escapeSeq = ESCAPE_SEQUENCES[char]; + result += !escapeSeq && isPrintable(char) + ? string[i] + : escapeSeq || encodeHex(char); + } + + return result; +} + +function writeFlowSequence(state, level, object) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level, object[index], false, false)) { + if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : ''); + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = '[' + _result + ']'; +} + +function writeBlockSequence(state, level, object, compact) { + var _result = '', + _tag = state.tag, + index, + length; + + for (index = 0, length = object.length; index < length; index += 1) { + // Write only valid elements. + if (writeNode(state, level + 1, object[index], true, true)) { + if (!compact || index !== 0) { + _result += generateNextLine(state, level); + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + _result += '-'; + } else { + _result += '- '; + } + + _result += state.dump; + } + } + + state.tag = _tag; + state.dump = _result || '[]'; // Empty sequence if no valid values. +} + +function writeFlowMapping(state, level, object) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + pairBuffer; + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + + pairBuffer = ''; + if (index !== 0) pairBuffer += ', '; + + if (state.condenseFlow) pairBuffer += '"'; + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level, objectKey, false, false)) { + continue; // Skip this pair because of invalid key; + } + + if (state.dump.length > 1024) pairBuffer += '? '; + + pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' '); + + if (!writeNode(state, level, objectValue, false, false)) { + continue; // Skip this pair because of invalid value. + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = '{' + _result + '}'; +} + +function writeBlockMapping(state, level, object, compact) { + var _result = '', + _tag = state.tag, + objectKeyList = Object.keys(object), + index, + length, + objectKey, + objectValue, + explicitPair, + pairBuffer; + + // Allow sorting keys so that the output file is deterministic + if (state.sortKeys === true) { + // Default sorting + objectKeyList.sort(); + } else if (typeof state.sortKeys === 'function') { + // Custom sort function + objectKeyList.sort(state.sortKeys); + } else if (state.sortKeys) { + // Something is wrong + throw new YAMLException('sortKeys must be a boolean or a function'); + } + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + pairBuffer = ''; + + if (!compact || index !== 0) { + pairBuffer += generateNextLine(state, level); + } + + objectKey = objectKeyList[index]; + objectValue = object[objectKey]; + + if (!writeNode(state, level + 1, objectKey, true, true, true)) { + continue; // Skip this pair because of invalid key. + } + + explicitPair = (state.tag !== null && state.tag !== '?') || + (state.dump && state.dump.length > 1024); + + if (explicitPair) { + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += '?'; + } else { + pairBuffer += '? '; + } + } + + pairBuffer += state.dump; + + if (explicitPair) { + pairBuffer += generateNextLine(state, level); + } + + if (!writeNode(state, level + 1, objectValue, true, explicitPair)) { + continue; // Skip this pair because of invalid value. + } + + if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) { + pairBuffer += ':'; + } else { + pairBuffer += ': '; + } + + pairBuffer += state.dump; + + // Both key and value are valid. + _result += pairBuffer; + } + + state.tag = _tag; + state.dump = _result || '{}'; // Empty mapping if no valid pairs. +} + +function detectType(state, object, explicit) { + var _result, typeList, index, length, type, style; + + typeList = explicit ? state.explicitTypes : state.implicitTypes; + + for (index = 0, length = typeList.length; index < length; index += 1) { + type = typeList[index]; + + if ((type.instanceOf || type.predicate) && + (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) && + (!type.predicate || type.predicate(object))) { + + state.tag = explicit ? type.tag : '?'; + + if (type.represent) { + style = state.styleMap[type.tag] || type.defaultStyle; + + if (_toString.call(type.represent) === '[object Function]') { + _result = type.represent(object, style); + } else if (_hasOwnProperty.call(type.represent, style)) { + _result = type.represent[style](object, style); + } else { + throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style'); + } + + state.dump = _result; + } + + return true; + } + } + + return false; +} + +// Serializes `object` and writes it to global `result`. +// Returns true on success, or false on invalid object. +// +function writeNode(state, level, object, block, compact, iskey) { + state.tag = null; + state.dump = object; + + if (!detectType(state, object, false)) { + detectType(state, object, true); + } + + var type = _toString.call(state.dump); + + if (block) { + block = (state.flowLevel < 0 || state.flowLevel > level); + } + + var objectOrArray = type === '[object Object]' || type === '[object Array]', + duplicateIndex, + duplicate; + + if (objectOrArray) { + duplicateIndex = state.duplicates.indexOf(object); + duplicate = duplicateIndex !== -1; + } + + if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) { + compact = false; + } + + if (duplicate && state.usedDuplicates[duplicateIndex]) { + state.dump = '*ref_' + duplicateIndex; + } else { + if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) { + state.usedDuplicates[duplicateIndex] = true; + } + if (type === '[object Object]') { + if (block && (Object.keys(state.dump).length !== 0)) { + writeBlockMapping(state, level, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowMapping(state, level, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object Array]') { + var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level; + if (block && (state.dump.length !== 0)) { + writeBlockSequence(state, arrayLevel, state.dump, compact); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + state.dump; + } + } else { + writeFlowSequence(state, arrayLevel, state.dump); + if (duplicate) { + state.dump = '&ref_' + duplicateIndex + ' ' + state.dump; + } + } + } else if (type === '[object String]') { + if (state.tag !== '?') { + writeScalar(state, state.dump, level, iskey); + } + } else { + if (state.skipInvalid) return false; + throw new YAMLException('unacceptable kind of an object to dump ' + type); + } + + if (state.tag !== null && state.tag !== '?') { + state.dump = '!<' + state.tag + '> ' + state.dump; + } + } + + return true; +} + +function getDuplicateReferences(object, state) { + var objects = [], + duplicatesIndexes = [], + index, + length; + + inspectNode(object, objects, duplicatesIndexes); + + for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) { + state.duplicates.push(objects[duplicatesIndexes[index]]); + } + state.usedDuplicates = new Array(length); +} + +function inspectNode(object, objects, duplicatesIndexes) { + var objectKeyList, + index, + length; + + if (object !== null && typeof object === 'object') { + index = objects.indexOf(object); + if (index !== -1) { + if (duplicatesIndexes.indexOf(index) === -1) { + duplicatesIndexes.push(index); + } + } else { + objects.push(object); + + if (Array.isArray(object)) { + for (index = 0, length = object.length; index < length; index += 1) { + inspectNode(object[index], objects, duplicatesIndexes); + } + } else { + objectKeyList = Object.keys(object); + + for (index = 0, length = objectKeyList.length; index < length; index += 1) { + inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes); + } + } + } + } +} + +function dump(input, options) { + options = options || {}; + + var state = new State(options); + + if (!state.noRefs) getDuplicateReferences(input, state); + + if (writeNode(state, 0, input, true, true)) return state.dump + '\n'; + + return ''; +} + +function safeDump(input, options) { + return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + +module.exports.dump = dump; +module.exports.safeDump = safeDump; diff --git a/node_modules/js-yaml/lib/js-yaml/exception.js b/node_modules/js-yaml/lib/js-yaml/exception.js new file mode 100644 index 00000000..b744a1ee --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/exception.js @@ -0,0 +1,43 @@ +// YAML error class. http://stackoverflow.com/questions/8458984 +// +'use strict'; + +function YAMLException(reason, mark) { + // Super constructor + Error.call(this); + + this.name = 'YAMLException'; + this.reason = reason; + this.mark = mark; + this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : ''); + + // Include stack trace in error object + if (Error.captureStackTrace) { + // Chrome and NodeJS + Error.captureStackTrace(this, this.constructor); + } else { + // FF, IE 10+ and Safari 6+. Fallback for others + this.stack = (new Error()).stack || ''; + } +} + + +// Inherit from Error +YAMLException.prototype = Object.create(Error.prototype); +YAMLException.prototype.constructor = YAMLException; + + +YAMLException.prototype.toString = function toString(compact) { + var result = this.name + ': '; + + result += this.reason || '(unknown reason)'; + + if (!compact && this.mark) { + result += ' ' + this.mark.toString(); + } + + return result; +}; + + +module.exports = YAMLException; diff --git a/node_modules/js-yaml/lib/js-yaml/loader.js b/node_modules/js-yaml/lib/js-yaml/loader.js new file mode 100644 index 00000000..d7484a59 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/loader.js @@ -0,0 +1,1644 @@ +'use strict'; + +/*eslint-disable max-len,no-use-before-define*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Mark = require('./mark'); +var DEFAULT_SAFE_SCHEMA = require('./schema/default_safe'); +var DEFAULT_FULL_SCHEMA = require('./schema/default_full'); + + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + + +var CONTEXT_FLOW_IN = 1; +var CONTEXT_FLOW_OUT = 2; +var CONTEXT_BLOCK_IN = 3; +var CONTEXT_BLOCK_OUT = 4; + + +var CHOMPING_CLIP = 1; +var CHOMPING_STRIP = 2; +var CHOMPING_KEEP = 3; + + +var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; +var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/; +var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/; +var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i; +var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i; + + +function _class(obj) { return Object.prototype.toString.call(obj); } + +function is_EOL(c) { + return (c === 0x0A/* LF */) || (c === 0x0D/* CR */); +} + +function is_WHITE_SPACE(c) { + return (c === 0x09/* Tab */) || (c === 0x20/* Space */); +} + +function is_WS_OR_EOL(c) { + return (c === 0x09/* Tab */) || + (c === 0x20/* Space */) || + (c === 0x0A/* LF */) || + (c === 0x0D/* CR */); +} + +function is_FLOW_INDICATOR(c) { + return c === 0x2C/* , */ || + c === 0x5B/* [ */ || + c === 0x5D/* ] */ || + c === 0x7B/* { */ || + c === 0x7D/* } */; +} + +function fromHexCode(c) { + var lc; + + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + /*eslint-disable no-bitwise*/ + lc = c | 0x20; + + if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) { + return lc - 0x61 + 10; + } + + return -1; +} + +function escapedHexLen(c) { + if (c === 0x78/* x */) { return 2; } + if (c === 0x75/* u */) { return 4; } + if (c === 0x55/* U */) { return 8; } + return 0; +} + +function fromDecimalCode(c) { + if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) { + return c - 0x30; + } + + return -1; +} + +function simpleEscapeSequence(c) { + /* eslint-disable indent */ + return (c === 0x30/* 0 */) ? '\x00' : + (c === 0x61/* a */) ? '\x07' : + (c === 0x62/* b */) ? '\x08' : + (c === 0x74/* t */) ? '\x09' : + (c === 0x09/* Tab */) ? '\x09' : + (c === 0x6E/* n */) ? '\x0A' : + (c === 0x76/* v */) ? '\x0B' : + (c === 0x66/* f */) ? '\x0C' : + (c === 0x72/* r */) ? '\x0D' : + (c === 0x65/* e */) ? '\x1B' : + (c === 0x20/* Space */) ? ' ' : + (c === 0x22/* " */) ? '\x22' : + (c === 0x2F/* / */) ? '/' : + (c === 0x5C/* \ */) ? '\x5C' : + (c === 0x4E/* N */) ? '\x85' : + (c === 0x5F/* _ */) ? '\xA0' : + (c === 0x4C/* L */) ? '\u2028' : + (c === 0x50/* P */) ? '\u2029' : ''; +} + +function charFromCodepoint(c) { + if (c <= 0xFFFF) { + return String.fromCharCode(c); + } + // Encode UTF-16 surrogate pair + // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF + return String.fromCharCode( + ((c - 0x010000) >> 10) + 0xD800, + ((c - 0x010000) & 0x03FF) + 0xDC00 + ); +} + +var simpleEscapeCheck = new Array(256); // integer, for fast access +var simpleEscapeMap = new Array(256); +for (var i = 0; i < 256; i++) { + simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0; + simpleEscapeMap[i] = simpleEscapeSequence(i); +} + + +function State(input, options) { + this.input = input; + + this.filename = options['filename'] || null; + this.schema = options['schema'] || DEFAULT_FULL_SCHEMA; + this.onWarning = options['onWarning'] || null; + this.legacy = options['legacy'] || false; + this.json = options['json'] || false; + this.listener = options['listener'] || null; + + this.implicitTypes = this.schema.compiledImplicit; + this.typeMap = this.schema.compiledTypeMap; + + this.length = input.length; + this.position = 0; + this.line = 0; + this.lineStart = 0; + this.lineIndent = 0; + + this.documents = []; + + /* + this.version; + this.checkLineBreaks; + this.tagMap; + this.anchorMap; + this.tag; + this.anchor; + this.kind; + this.result;*/ + +} + + +function generateError(state, message) { + return new YAMLException( + message, + new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart))); +} + +function throwError(state, message) { + throw generateError(state, message); +} + +function throwWarning(state, message) { + if (state.onWarning) { + state.onWarning.call(null, generateError(state, message)); + } +} + + +var directiveHandlers = { + + YAML: function handleYamlDirective(state, name, args) { + + var match, major, minor; + + if (state.version !== null) { + throwError(state, 'duplication of %YAML directive'); + } + + if (args.length !== 1) { + throwError(state, 'YAML directive accepts exactly one argument'); + } + + match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]); + + if (match === null) { + throwError(state, 'ill-formed argument of the YAML directive'); + } + + major = parseInt(match[1], 10); + minor = parseInt(match[2], 10); + + if (major !== 1) { + throwError(state, 'unacceptable YAML version of the document'); + } + + state.version = args[0]; + state.checkLineBreaks = (minor < 2); + + if (minor !== 1 && minor !== 2) { + throwWarning(state, 'unsupported YAML version of the document'); + } + }, + + TAG: function handleTagDirective(state, name, args) { + + var handle, prefix; + + if (args.length !== 2) { + throwError(state, 'TAG directive accepts exactly two arguments'); + } + + handle = args[0]; + prefix = args[1]; + + if (!PATTERN_TAG_HANDLE.test(handle)) { + throwError(state, 'ill-formed tag handle (first argument) of the TAG directive'); + } + + if (_hasOwnProperty.call(state.tagMap, handle)) { + throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle'); + } + + if (!PATTERN_TAG_URI.test(prefix)) { + throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive'); + } + + state.tagMap[handle] = prefix; + } +}; + + +function captureSegment(state, start, end, checkJson) { + var _position, _length, _character, _result; + + if (start < end) { + _result = state.input.slice(start, end); + + if (checkJson) { + for (_position = 0, _length = _result.length; _position < _length; _position += 1) { + _character = _result.charCodeAt(_position); + if (!(_character === 0x09 || + (0x20 <= _character && _character <= 0x10FFFF))) { + throwError(state, 'expected valid JSON character'); + } + } + } else if (PATTERN_NON_PRINTABLE.test(_result)) { + throwError(state, 'the stream contains non-printable characters'); + } + + state.result += _result; + } +} + +function mergeMappings(state, destination, source, overridableKeys) { + var sourceKeys, key, index, quantity; + + if (!common.isObject(source)) { + throwError(state, 'cannot merge mappings; the provided source object is unacceptable'); + } + + sourceKeys = Object.keys(source); + + for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) { + key = sourceKeys[index]; + + if (!_hasOwnProperty.call(destination, key)) { + destination[key] = source[key]; + overridableKeys[key] = true; + } + } +} + +function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) { + var index, quantity; + + // The output is a plain object here, so keys can only be strings. + // We need to convert keyNode to a string, but doing so can hang the process + // (deeply nested arrays that explode exponentially using aliases). + if (Array.isArray(keyNode)) { + keyNode = Array.prototype.slice.call(keyNode); + + for (index = 0, quantity = keyNode.length; index < quantity; index += 1) { + if (Array.isArray(keyNode[index])) { + throwError(state, 'nested arrays are not supported inside keys'); + } + + if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') { + keyNode[index] = '[object Object]'; + } + } + } + + // Avoid code execution in load() via toString property + // (still use its own toString for arrays, timestamps, + // and whatever user schema extensions happen to have @@toStringTag) + if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') { + keyNode = '[object Object]'; + } + + + keyNode = String(keyNode); + + if (_result === null) { + _result = {}; + } + + if (keyTag === 'tag:yaml.org,2002:merge') { + if (Array.isArray(valueNode)) { + for (index = 0, quantity = valueNode.length; index < quantity; index += 1) { + mergeMappings(state, _result, valueNode[index], overridableKeys); + } + } else { + mergeMappings(state, _result, valueNode, overridableKeys); + } + } else { + if (!state.json && + !_hasOwnProperty.call(overridableKeys, keyNode) && + _hasOwnProperty.call(_result, keyNode)) { + state.line = startLine || state.line; + state.position = startPos || state.position; + throwError(state, 'duplicated mapping key'); + } + _result[keyNode] = valueNode; + delete overridableKeys[keyNode]; + } + + return _result; +} + +function readLineBreak(state) { + var ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x0A/* LF */) { + state.position++; + } else if (ch === 0x0D/* CR */) { + state.position++; + if (state.input.charCodeAt(state.position) === 0x0A/* LF */) { + state.position++; + } + } else { + throwError(state, 'a line break is expected'); + } + + state.line += 1; + state.lineStart = state.position; +} + +function skipSeparationSpace(state, allowComments, checkIndent) { + var lineBreaks = 0, + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (allowComments && ch === 0x23/* # */) { + do { + ch = state.input.charCodeAt(++state.position); + } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0); + } + + if (is_EOL(ch)) { + readLineBreak(state); + + ch = state.input.charCodeAt(state.position); + lineBreaks++; + state.lineIndent = 0; + + while (ch === 0x20/* Space */) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + } else { + break; + } + } + + if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) { + throwWarning(state, 'deficient indentation'); + } + + return lineBreaks; +} + +function testDocumentSeparator(state) { + var _position = state.position, + ch; + + ch = state.input.charCodeAt(_position); + + // Condition state.position === state.lineStart is tested + // in parent on each call, for efficiency. No needs to test here again. + if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) && + ch === state.input.charCodeAt(_position + 1) && + ch === state.input.charCodeAt(_position + 2)) { + + _position += 3; + + ch = state.input.charCodeAt(_position); + + if (ch === 0 || is_WS_OR_EOL(ch)) { + return true; + } + } + + return false; +} + +function writeFoldedLines(state, count) { + if (count === 1) { + state.result += ' '; + } else if (count > 1) { + state.result += common.repeat('\n', count - 1); + } +} + + +function readPlainScalar(state, nodeIndent, withinFlowCollection) { + var preceding, + following, + captureStart, + captureEnd, + hasPendingContent, + _line, + _lineStart, + _lineIndent, + _kind = state.kind, + _result = state.result, + ch; + + ch = state.input.charCodeAt(state.position); + + if (is_WS_OR_EOL(ch) || + is_FLOW_INDICATOR(ch) || + ch === 0x23/* # */ || + ch === 0x26/* & */ || + ch === 0x2A/* * */ || + ch === 0x21/* ! */ || + ch === 0x7C/* | */ || + ch === 0x3E/* > */ || + ch === 0x27/* ' */ || + ch === 0x22/* " */ || + ch === 0x25/* % */ || + ch === 0x40/* @ */ || + ch === 0x60/* ` */) { + return false; + } + + if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + return false; + } + } + + state.kind = 'scalar'; + state.result = ''; + captureStart = captureEnd = state.position; + hasPendingContent = false; + + while (ch !== 0) { + if (ch === 0x3A/* : */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following) || + withinFlowCollection && is_FLOW_INDICATOR(following)) { + break; + } + + } else if (ch === 0x23/* # */) { + preceding = state.input.charCodeAt(state.position - 1); + + if (is_WS_OR_EOL(preceding)) { + break; + } + + } else if ((state.position === state.lineStart && testDocumentSeparator(state)) || + withinFlowCollection && is_FLOW_INDICATOR(ch)) { + break; + + } else if (is_EOL(ch)) { + _line = state.line; + _lineStart = state.lineStart; + _lineIndent = state.lineIndent; + skipSeparationSpace(state, false, -1); + + if (state.lineIndent >= nodeIndent) { + hasPendingContent = true; + ch = state.input.charCodeAt(state.position); + continue; + } else { + state.position = captureEnd; + state.line = _line; + state.lineStart = _lineStart; + state.lineIndent = _lineIndent; + break; + } + } + + if (hasPendingContent) { + captureSegment(state, captureStart, captureEnd, false); + writeFoldedLines(state, state.line - _line); + captureStart = captureEnd = state.position; + hasPendingContent = false; + } + + if (!is_WHITE_SPACE(ch)) { + captureEnd = state.position + 1; + } + + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, captureEnd, false); + + if (state.result) { + return true; + } + + state.kind = _kind; + state.result = _result; + return false; +} + +function readSingleQuotedScalar(state, nodeIndent) { + var ch, + captureStart, captureEnd; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x27/* ' */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x27/* ' */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x27/* ' */) { + captureStart = state.position; + state.position++; + captureEnd = state.position; + } else { + return true; + } + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a single quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a single quoted scalar'); +} + +function readDoubleQuotedScalar(state, nodeIndent) { + var captureStart, + captureEnd, + hexLength, + hexResult, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x22/* " */) { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + state.position++; + captureStart = captureEnd = state.position; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + if (ch === 0x22/* " */) { + captureSegment(state, captureStart, state.position, true); + state.position++; + return true; + + } else if (ch === 0x5C/* \ */) { + captureSegment(state, captureStart, state.position, true); + ch = state.input.charCodeAt(++state.position); + + if (is_EOL(ch)) { + skipSeparationSpace(state, false, nodeIndent); + + // TODO: rework to inline fn with no type cast? + } else if (ch < 256 && simpleEscapeCheck[ch]) { + state.result += simpleEscapeMap[ch]; + state.position++; + + } else if ((tmp = escapedHexLen(ch)) > 0) { + hexLength = tmp; + hexResult = 0; + + for (; hexLength > 0; hexLength--) { + ch = state.input.charCodeAt(++state.position); + + if ((tmp = fromHexCode(ch)) >= 0) { + hexResult = (hexResult << 4) + tmp; + + } else { + throwError(state, 'expected hexadecimal character'); + } + } + + state.result += charFromCodepoint(hexResult); + + state.position++; + + } else { + throwError(state, 'unknown escape sequence'); + } + + captureStart = captureEnd = state.position; + + } else if (is_EOL(ch)) { + captureSegment(state, captureStart, captureEnd, true); + writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent)); + captureStart = captureEnd = state.position; + + } else if (state.position === state.lineStart && testDocumentSeparator(state)) { + throwError(state, 'unexpected end of the document within a double quoted scalar'); + + } else { + state.position++; + captureEnd = state.position; + } + } + + throwError(state, 'unexpected end of the stream within a double quoted scalar'); +} + +function readFlowCollection(state, nodeIndent) { + var readNext = true, + _line, + _tag = state.tag, + _result, + _anchor = state.anchor, + following, + terminator, + isPair, + isExplicitPair, + isMapping, + overridableKeys = {}, + keyNode, + keyTag, + valueNode, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x5B/* [ */) { + terminator = 0x5D;/* ] */ + isMapping = false; + _result = []; + } else if (ch === 0x7B/* { */) { + terminator = 0x7D;/* } */ + isMapping = true; + _result = {}; + } else { + return false; + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(++state.position); + + while (ch !== 0) { + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === terminator) { + state.position++; + state.tag = _tag; + state.anchor = _anchor; + state.kind = isMapping ? 'mapping' : 'sequence'; + state.result = _result; + return true; + } else if (!readNext) { + throwError(state, 'missed comma between flow collection entries'); + } + + keyTag = keyNode = valueNode = null; + isPair = isExplicitPair = false; + + if (ch === 0x3F/* ? */) { + following = state.input.charCodeAt(state.position + 1); + + if (is_WS_OR_EOL(following)) { + isPair = isExplicitPair = true; + state.position++; + skipSeparationSpace(state, true, nodeIndent); + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + keyTag = state.tag; + keyNode = state.result; + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) { + isPair = true; + ch = state.input.charCodeAt(++state.position); + skipSeparationSpace(state, true, nodeIndent); + composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true); + valueNode = state.result; + } + + if (isMapping) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode); + } else if (isPair) { + _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode)); + } else { + _result.push(keyNode); + } + + skipSeparationSpace(state, true, nodeIndent); + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x2C/* , */) { + readNext = true; + ch = state.input.charCodeAt(++state.position); + } else { + readNext = false; + } + } + + throwError(state, 'unexpected end of the stream within a flow collection'); +} + +function readBlockScalar(state, nodeIndent) { + var captureStart, + folding, + chomping = CHOMPING_CLIP, + didReadContent = false, + detectedIndent = false, + textIndent = nodeIndent, + emptyLines = 0, + atMoreIndented = false, + tmp, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch === 0x7C/* | */) { + folding = false; + } else if (ch === 0x3E/* > */) { + folding = true; + } else { + return false; + } + + state.kind = 'scalar'; + state.result = ''; + + while (ch !== 0) { + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x2B/* + */ || ch === 0x2D/* - */) { + if (CHOMPING_CLIP === chomping) { + chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP; + } else { + throwError(state, 'repeat of a chomping mode identifier'); + } + + } else if ((tmp = fromDecimalCode(ch)) >= 0) { + if (tmp === 0) { + throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one'); + } else if (!detectedIndent) { + textIndent = nodeIndent + tmp - 1; + detectedIndent = true; + } else { + throwError(state, 'repeat of an indentation width identifier'); + } + + } else { + break; + } + } + + if (is_WHITE_SPACE(ch)) { + do { ch = state.input.charCodeAt(++state.position); } + while (is_WHITE_SPACE(ch)); + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (!is_EOL(ch) && (ch !== 0)); + } + } + + while (ch !== 0) { + readLineBreak(state); + state.lineIndent = 0; + + ch = state.input.charCodeAt(state.position); + + while ((!detectedIndent || state.lineIndent < textIndent) && + (ch === 0x20/* Space */)) { + state.lineIndent++; + ch = state.input.charCodeAt(++state.position); + } + + if (!detectedIndent && state.lineIndent > textIndent) { + textIndent = state.lineIndent; + } + + if (is_EOL(ch)) { + emptyLines++; + continue; + } + + // End of the scalar. + if (state.lineIndent < textIndent) { + + // Perform the chomping. + if (chomping === CHOMPING_KEEP) { + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } else if (chomping === CHOMPING_CLIP) { + if (didReadContent) { // i.e. only if the scalar is not empty. + state.result += '\n'; + } + } + + // Break this `while` cycle and go to the funciton's epilogue. + break; + } + + // Folded style: use fancy rules to handle line breaks. + if (folding) { + + // Lines starting with white space characters (more-indented lines) are not folded. + if (is_WHITE_SPACE(ch)) { + atMoreIndented = true; + // except for the first content line (cf. Example 8.1) + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + + // End of more-indented block. + } else if (atMoreIndented) { + atMoreIndented = false; + state.result += common.repeat('\n', emptyLines + 1); + + // Just one line break - perceive as the same line. + } else if (emptyLines === 0) { + if (didReadContent) { // i.e. only if we have already read some scalar content. + state.result += ' '; + } + + // Several line breaks - perceive as different lines. + } else { + state.result += common.repeat('\n', emptyLines); + } + + // Literal style: just add exact number of line breaks between content lines. + } else { + // Keep all line breaks except the header line break. + state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines); + } + + didReadContent = true; + detectedIndent = true; + emptyLines = 0; + captureStart = state.position; + + while (!is_EOL(ch) && (ch !== 0)) { + ch = state.input.charCodeAt(++state.position); + } + + captureSegment(state, captureStart, state.position, false); + } + + return true; +} + +function readBlockSequence(state, nodeIndent) { + var _line, + _tag = state.tag, + _anchor = state.anchor, + _result = [], + following, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + + if (ch !== 0x2D/* - */) { + break; + } + + following = state.input.charCodeAt(state.position + 1); + + if (!is_WS_OR_EOL(following)) { + break; + } + + detected = true; + state.position++; + + if (skipSeparationSpace(state, true, -1)) { + if (state.lineIndent <= nodeIndent) { + _result.push(null); + ch = state.input.charCodeAt(state.position); + continue; + } + } + + _line = state.line; + composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true); + _result.push(state.result); + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) { + throwError(state, 'bad indentation of a sequence entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'sequence'; + state.result = _result; + return true; + } + return false; +} + +function readBlockMapping(state, nodeIndent, flowIndent) { + var following, + allowCompact, + _line, + _pos, + _tag = state.tag, + _anchor = state.anchor, + _result = {}, + overridableKeys = {}, + keyTag = null, + keyNode = null, + valueNode = null, + atExplicitKey = false, + detected = false, + ch; + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = _result; + } + + ch = state.input.charCodeAt(state.position); + + while (ch !== 0) { + following = state.input.charCodeAt(state.position + 1); + _line = state.line; // Save the current line. + _pos = state.position; + + // + // Explicit notation case. There are two separate blocks: + // first for the key (denoted by "?") and second for the value (denoted by ":") + // + if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) { + + if (ch === 0x3F/* ? */) { + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = true; + allowCompact = true; + + } else if (atExplicitKey) { + // i.e. 0x3A/* : */ === character after the explicit key. + atExplicitKey = false; + allowCompact = true; + + } else { + throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line'); + } + + state.position += 1; + ch = following; + + // + // Implicit notation case. Flow-style node as the key first, then ":", and the value. + // + } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) { + + if (state.line === _line) { + ch = state.input.charCodeAt(state.position); + + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x3A/* : */) { + ch = state.input.charCodeAt(++state.position); + + if (!is_WS_OR_EOL(ch)) { + throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping'); + } + + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + keyTag = keyNode = valueNode = null; + } + + detected = true; + atExplicitKey = false; + allowCompact = false; + keyTag = state.tag; + keyNode = state.result; + + } else if (detected) { + throwError(state, 'can not read an implicit mapping pair; a colon is missed'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else if (detected) { + throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key'); + + } else { + state.tag = _tag; + state.anchor = _anchor; + return true; // Keep the result of `composeNode`. + } + + } else { + break; // Reading is done. Go to the epilogue. + } + + // + // Common reading code for both explicit and implicit notations. + // + if (state.line === _line || state.lineIndent > nodeIndent) { + if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) { + if (atExplicitKey) { + keyNode = state.result; + } else { + valueNode = state.result; + } + } + + if (!atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos); + keyTag = keyNode = valueNode = null; + } + + skipSeparationSpace(state, true, -1); + ch = state.input.charCodeAt(state.position); + } + + if (state.lineIndent > nodeIndent && (ch !== 0)) { + throwError(state, 'bad indentation of a mapping entry'); + } else if (state.lineIndent < nodeIndent) { + break; + } + } + + // + // Epilogue. + // + + // Special case: last mapping's node contains only the key in explicit notation. + if (atExplicitKey) { + storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null); + } + + // Expose the resulting mapping. + if (detected) { + state.tag = _tag; + state.anchor = _anchor; + state.kind = 'mapping'; + state.result = _result; + } + + return detected; +} + +function readTagProperty(state) { + var _position, + isVerbatim = false, + isNamed = false, + tagHandle, + tagName, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x21/* ! */) return false; + + if (state.tag !== null) { + throwError(state, 'duplication of a tag property'); + } + + ch = state.input.charCodeAt(++state.position); + + if (ch === 0x3C/* < */) { + isVerbatim = true; + ch = state.input.charCodeAt(++state.position); + + } else if (ch === 0x21/* ! */) { + isNamed = true; + tagHandle = '!!'; + ch = state.input.charCodeAt(++state.position); + + } else { + tagHandle = '!'; + } + + _position = state.position; + + if (isVerbatim) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && ch !== 0x3E/* > */); + + if (state.position < state.length) { + tagName = state.input.slice(_position, state.position); + ch = state.input.charCodeAt(++state.position); + } else { + throwError(state, 'unexpected end of the stream within a verbatim tag'); + } + } else { + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + + if (ch === 0x21/* ! */) { + if (!isNamed) { + tagHandle = state.input.slice(_position - 1, state.position + 1); + + if (!PATTERN_TAG_HANDLE.test(tagHandle)) { + throwError(state, 'named tag handle cannot contain such characters'); + } + + isNamed = true; + _position = state.position + 1; + } else { + throwError(state, 'tag suffix cannot contain exclamation marks'); + } + } + + ch = state.input.charCodeAt(++state.position); + } + + tagName = state.input.slice(_position, state.position); + + if (PATTERN_FLOW_INDICATORS.test(tagName)) { + throwError(state, 'tag suffix cannot contain flow indicator characters'); + } + } + + if (tagName && !PATTERN_TAG_URI.test(tagName)) { + throwError(state, 'tag name cannot contain such characters: ' + tagName); + } + + if (isVerbatim) { + state.tag = tagName; + + } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) { + state.tag = state.tagMap[tagHandle] + tagName; + + } else if (tagHandle === '!') { + state.tag = '!' + tagName; + + } else if (tagHandle === '!!') { + state.tag = 'tag:yaml.org,2002:' + tagName; + + } else { + throwError(state, 'undeclared tag handle "' + tagHandle + '"'); + } + + return true; +} + +function readAnchorProperty(state) { + var _position, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x26/* & */) return false; + + if (state.anchor !== null) { + throwError(state, 'duplication of an anchor property'); + } + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an anchor node must contain at least one character'); + } + + state.anchor = state.input.slice(_position, state.position); + return true; +} + +function readAlias(state) { + var _position, alias, + ch; + + ch = state.input.charCodeAt(state.position); + + if (ch !== 0x2A/* * */) return false; + + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (state.position === _position) { + throwError(state, 'name of an alias node must contain at least one character'); + } + + alias = state.input.slice(_position, state.position); + + if (!_hasOwnProperty.call(state.anchorMap, alias)) { + throwError(state, 'unidentified alias "' + alias + '"'); + } + + state.result = state.anchorMap[alias]; + skipSeparationSpace(state, true, -1); + return true; +} + +function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) { + var allowBlockStyles, + allowBlockScalars, + allowBlockCollections, + indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } + } + + if (indentStatus === 1) { + while (readTagProperty(state) || readAnchorProperty(state)) { + if (skipSeparationSpace(state, true, -1)) { + atNewLine = true; + allowBlockCollections = allowBlockStyles; + + if (state.lineIndent > parentIndent) { + indentStatus = 1; + } else if (state.lineIndent === parentIndent) { + indentStatus = 0; + } else if (state.lineIndent < parentIndent) { + indentStatus = -1; + } + } else { + allowBlockCollections = false; + } + } + } + + if (allowBlockCollections) { + allowBlockCollections = atNewLine || allowCompact; + } + + if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) { + if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) { + flowIndent = parentIndent; + } else { + flowIndent = parentIndent + 1; + } + + blockIndent = state.position - state.lineStart; + + if (indentStatus === 1) { + if (allowBlockCollections && + (readBlockSequence(state, blockIndent) || + readBlockMapping(state, blockIndent, flowIndent)) || + readFlowCollection(state, flowIndent)) { + hasContent = true; + } else { + if ((allowBlockScalars && readBlockScalar(state, flowIndent)) || + readSingleQuotedScalar(state, flowIndent) || + readDoubleQuotedScalar(state, flowIndent)) { + hasContent = true; + + } else if (readAlias(state)) { + hasContent = true; + + if (state.tag !== null || state.anchor !== null) { + throwError(state, 'alias node should not have any properties'); + } + + } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) { + hasContent = true; + + if (state.tag === null) { + state.tag = '?'; + } + } + + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else if (indentStatus === 0) { + // Special case: block sequences are allowed to have same indentation level as the parent. + // http://www.yaml.org/spec/1.2/spec.html#id2799784 + hasContent = allowBlockCollections && readBlockSequence(state, blockIndent); + } + } + + if (state.tag !== null && state.tag !== '!') { + if (state.tag === '?') { + // Implicit resolving is not allowed for non-scalar types, and '?' + // non-specific tag is only automatically assigned to plain scalars. + // + // We only need to check kind conformity in case user explicitly assigns '?' + // tag, for example like this: "! [0]" + // + if (state.result !== null && state.kind !== 'scalar') { + throwError(state, 'unacceptable node kind for ! tag; it should be "scalar", not "' + state.kind + '"'); + } + + for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) { + type = state.implicitTypes[typeIndex]; + + if (type.resolve(state.result)) { // `state.result` updated in resolver if matched + state.result = type.construct(state.result); + state.tag = type.tag; + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + break; + } + } + } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) { + type = state.typeMap[state.kind || 'fallback'][state.tag]; + + if (state.result !== null && type.kind !== state.kind) { + throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"'); + } + + if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched + throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag'); + } else { + state.result = type.construct(state.result); + if (state.anchor !== null) { + state.anchorMap[state.anchor] = state.result; + } + } + } else { + throwError(state, 'unknown tag !<' + state.tag + '>'); + } + } + + if (state.listener !== null) { + state.listener('close', state); + } + return state.tag !== null || state.anchor !== null || hasContent; +} + +function readDocument(state) { + var documentStart = state.position, + _position, + directiveName, + directiveArgs, + hasDirectives = false, + ch; + + state.version = null; + state.checkLineBreaks = state.legacy; + state.tagMap = {}; + state.anchorMap = {}; + + while ((ch = state.input.charCodeAt(state.position)) !== 0) { + skipSeparationSpace(state, true, -1); + + ch = state.input.charCodeAt(state.position); + + if (state.lineIndent > 0 || ch !== 0x25/* % */) { + break; + } + + hasDirectives = true; + ch = state.input.charCodeAt(++state.position); + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveName = state.input.slice(_position, state.position); + directiveArgs = []; + + if (directiveName.length < 1) { + throwError(state, 'directive name must not be less than one character in length'); + } + + while (ch !== 0) { + while (is_WHITE_SPACE(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + if (ch === 0x23/* # */) { + do { ch = state.input.charCodeAt(++state.position); } + while (ch !== 0 && !is_EOL(ch)); + break; + } + + if (is_EOL(ch)) break; + + _position = state.position; + + while (ch !== 0 && !is_WS_OR_EOL(ch)) { + ch = state.input.charCodeAt(++state.position); + } + + directiveArgs.push(state.input.slice(_position, state.position)); + } + + if (ch !== 0) readLineBreak(state); + + if (_hasOwnProperty.call(directiveHandlers, directiveName)) { + directiveHandlers[directiveName](state, directiveName, directiveArgs); + } else { + throwWarning(state, 'unknown document directive "' + directiveName + '"'); + } + } + + skipSeparationSpace(state, true, -1); + + if (state.lineIndent === 0 && + state.input.charCodeAt(state.position) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 1) === 0x2D/* - */ && + state.input.charCodeAt(state.position + 2) === 0x2D/* - */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + + } else if (hasDirectives) { + throwError(state, 'directives end mark is expected'); + } + + composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true); + skipSeparationSpace(state, true, -1); + + if (state.checkLineBreaks && + PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) { + throwWarning(state, 'non-ASCII line breaks are interpreted as content'); + } + + state.documents.push(state.result); + + if (state.position === state.lineStart && testDocumentSeparator(state)) { + + if (state.input.charCodeAt(state.position) === 0x2E/* . */) { + state.position += 3; + skipSeparationSpace(state, true, -1); + } + return; + } + + if (state.position < (state.length - 1)) { + throwError(state, 'end of the stream or a document separator is expected'); + } else { + return; + } +} + + +function loadDocuments(input, options) { + input = String(input); + options = options || {}; + + if (input.length !== 0) { + + // Add tailing `\n` if not exists + if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ && + input.charCodeAt(input.length - 1) !== 0x0D/* CR */) { + input += '\n'; + } + + // Strip BOM + if (input.charCodeAt(0) === 0xFEFF) { + input = input.slice(1); + } + } + + var state = new State(input, options); + + var nullpos = input.indexOf('\0'); + + if (nullpos !== -1) { + state.position = nullpos; + throwError(state, 'null byte is not allowed in input'); + } + + // Use 0 as string terminator. That significantly simplifies bounds check. + state.input += '\0'; + + while (state.input.charCodeAt(state.position) === 0x20/* Space */) { + state.lineIndent += 1; + state.position += 1; + } + + while (state.position < (state.length - 1)) { + readDocument(state); + } + + return state.documents; +} + + +function loadAll(input, iterator, options) { + if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + var documents = loadDocuments(input, options); + + if (typeof iterator !== 'function') { + return documents; + } + + for (var index = 0, length = documents.length; index < length; index += 1) { + iterator(documents[index]); + } +} + + +function load(input, options) { + var documents = loadDocuments(input, options); + + if (documents.length === 0) { + /*eslint-disable no-undefined*/ + return undefined; + } else if (documents.length === 1) { + return documents[0]; + } + throw new YAMLException('expected a single document in the stream, but found more'); +} + + +function safeLoadAll(input, iterator, options) { + if (typeof iterator === 'object' && iterator !== null && typeof options === 'undefined') { + options = iterator; + iterator = null; + } + + return loadAll(input, iterator, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +function safeLoad(input, options) { + return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options)); +} + + +module.exports.loadAll = loadAll; +module.exports.load = load; +module.exports.safeLoadAll = safeLoadAll; +module.exports.safeLoad = safeLoad; diff --git a/node_modules/js-yaml/lib/js-yaml/mark.js b/node_modules/js-yaml/lib/js-yaml/mark.js new file mode 100644 index 00000000..47b265c2 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/mark.js @@ -0,0 +1,76 @@ +'use strict'; + + +var common = require('./common'); + + +function Mark(name, buffer, position, line, column) { + this.name = name; + this.buffer = buffer; + this.position = position; + this.line = line; + this.column = column; +} + + +Mark.prototype.getSnippet = function getSnippet(indent, maxLength) { + var head, start, tail, end, snippet; + + if (!this.buffer) return null; + + indent = indent || 4; + maxLength = maxLength || 75; + + head = ''; + start = this.position; + + while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) { + start -= 1; + if (this.position - start > (maxLength / 2 - 1)) { + head = ' ... '; + start += 5; + break; + } + } + + tail = ''; + end = this.position; + + while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) { + end += 1; + if (end - this.position > (maxLength / 2 - 1)) { + tail = ' ... '; + end -= 5; + break; + } + } + + snippet = this.buffer.slice(start, end); + + return common.repeat(' ', indent) + head + snippet + tail + '\n' + + common.repeat(' ', indent + this.position - start + head.length) + '^'; +}; + + +Mark.prototype.toString = function toString(compact) { + var snippet, where = ''; + + if (this.name) { + where += 'in "' + this.name + '" '; + } + + where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1); + + if (!compact) { + snippet = this.getSnippet(); + + if (snippet) { + where += ':\n' + snippet; + } + } + + return where; +}; + + +module.exports = Mark; diff --git a/node_modules/js-yaml/lib/js-yaml/schema.js b/node_modules/js-yaml/lib/js-yaml/schema.js new file mode 100644 index 00000000..ca7cf47e --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema.js @@ -0,0 +1,108 @@ +'use strict'; + +/*eslint-disable max-len*/ + +var common = require('./common'); +var YAMLException = require('./exception'); +var Type = require('./type'); + + +function compileList(schema, name, result) { + var exclude = []; + + schema.include.forEach(function (includedSchema) { + result = compileList(includedSchema, name, result); + }); + + schema[name].forEach(function (currentType) { + result.forEach(function (previousType, previousIndex) { + if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) { + exclude.push(previousIndex); + } + }); + + result.push(currentType); + }); + + return result.filter(function (type, index) { + return exclude.indexOf(index) === -1; + }); +} + + +function compileMap(/* lists... */) { + var result = { + scalar: {}, + sequence: {}, + mapping: {}, + fallback: {} + }, index, length; + + function collectType(type) { + result[type.kind][type.tag] = result['fallback'][type.tag] = type; + } + + for (index = 0, length = arguments.length; index < length; index += 1) { + arguments[index].forEach(collectType); + } + return result; +} + + +function Schema(definition) { + this.include = definition.include || []; + this.implicit = definition.implicit || []; + this.explicit = definition.explicit || []; + + this.implicit.forEach(function (type) { + if (type.loadKind && type.loadKind !== 'scalar') { + throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.'); + } + }); + + this.compiledImplicit = compileList(this, 'implicit', []); + this.compiledExplicit = compileList(this, 'explicit', []); + this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit); +} + + +Schema.DEFAULT = null; + + +Schema.create = function createSchema() { + var schemas, types; + + switch (arguments.length) { + case 1: + schemas = Schema.DEFAULT; + types = arguments[0]; + break; + + case 2: + schemas = arguments[0]; + types = arguments[1]; + break; + + default: + throw new YAMLException('Wrong number of arguments for Schema.create function'); + } + + schemas = common.toArray(schemas); + types = common.toArray(types); + + if (!schemas.every(function (schema) { return schema instanceof Schema; })) { + throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.'); + } + + if (!types.every(function (type) { return type instanceof Type; })) { + throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.'); + } + + return new Schema({ + include: schemas, + explicit: types + }); +}; + + +module.exports = Schema; diff --git a/node_modules/js-yaml/lib/js-yaml/schema/core.js b/node_modules/js-yaml/lib/js-yaml/schema/core.js new file mode 100644 index 00000000..206daab5 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/core.js @@ -0,0 +1,18 @@ +// Standard YAML's Core schema. +// http://www.yaml.org/spec/1.2/spec.html#id2804923 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, Core schema has no distinctions from JSON schema is JS-YAML. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./json') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/default_full.js b/node_modules/js-yaml/lib/js-yaml/schema/default_full.js new file mode 100644 index 00000000..a55ef42a --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/default_full.js @@ -0,0 +1,25 @@ +// JS-YAML's default schema for `load` function. +// It is not described in the YAML specification. +// +// This schema is based on JS-YAML's default safe schema and includes +// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function. +// +// Also this schema is used as default base schema at `Schema.create` function. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = Schema.DEFAULT = new Schema({ + include: [ + require('./default_safe') + ], + explicit: [ + require('../type/js/undefined'), + require('../type/js/regexp'), + require('../type/js/function') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js b/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js new file mode 100644 index 00000000..11d89bbf --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js @@ -0,0 +1,28 @@ +// JS-YAML's default schema for `safeLoad` function. +// It is not described in the YAML specification. +// +// This schema is based on standard YAML's Core schema and includes most of +// extra types described at YAML tag repository. (http://yaml.org/type/) + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./core') + ], + implicit: [ + require('../type/timestamp'), + require('../type/merge') + ], + explicit: [ + require('../type/binary'), + require('../type/omap'), + require('../type/pairs'), + require('../type/set') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js b/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js new file mode 100644 index 00000000..b7a33eb7 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js @@ -0,0 +1,17 @@ +// Standard YAML's Failsafe schema. +// http://www.yaml.org/spec/1.2/spec.html#id2802346 + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + explicit: [ + require('../type/str'), + require('../type/seq'), + require('../type/map') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/schema/json.js b/node_modules/js-yaml/lib/js-yaml/schema/json.js new file mode 100644 index 00000000..5be3dbf8 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/schema/json.js @@ -0,0 +1,25 @@ +// Standard YAML's JSON schema. +// http://www.yaml.org/spec/1.2/spec.html#id2803231 +// +// NOTE: JS-YAML does not support schema-specific tag resolution restrictions. +// So, this schema is not such strict as defined in the YAML specification. +// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc. + + +'use strict'; + + +var Schema = require('../schema'); + + +module.exports = new Schema({ + include: [ + require('./failsafe') + ], + implicit: [ + require('../type/null'), + require('../type/bool'), + require('../type/int'), + require('../type/float') + ] +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type.js b/node_modules/js-yaml/lib/js-yaml/type.js new file mode 100644 index 00000000..90b702ac --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type.js @@ -0,0 +1,61 @@ +'use strict'; + +var YAMLException = require('./exception'); + +var TYPE_CONSTRUCTOR_OPTIONS = [ + 'kind', + 'resolve', + 'construct', + 'instanceOf', + 'predicate', + 'represent', + 'defaultStyle', + 'styleAliases' +]; + +var YAML_NODE_KINDS = [ + 'scalar', + 'sequence', + 'mapping' +]; + +function compileStyleAliases(map) { + var result = {}; + + if (map !== null) { + Object.keys(map).forEach(function (style) { + map[style].forEach(function (alias) { + result[String(alias)] = style; + }); + }); + } + + return result; +} + +function Type(tag, options) { + options = options || {}; + + Object.keys(options).forEach(function (name) { + if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) { + throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.'); + } + }); + + // TODO: Add tag format check. + this.tag = tag; + this.kind = options['kind'] || null; + this.resolve = options['resolve'] || function () { return true; }; + this.construct = options['construct'] || function (data) { return data; }; + this.instanceOf = options['instanceOf'] || null; + this.predicate = options['predicate'] || null; + this.represent = options['represent'] || null; + this.defaultStyle = options['defaultStyle'] || null; + this.styleAliases = compileStyleAliases(options['styleAliases'] || null); + + if (YAML_NODE_KINDS.indexOf(this.kind) === -1) { + throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.'); + } +} + +module.exports = Type; diff --git a/node_modules/js-yaml/lib/js-yaml/type/binary.js b/node_modules/js-yaml/lib/js-yaml/type/binary.js new file mode 100644 index 00000000..10b18755 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/binary.js @@ -0,0 +1,138 @@ +'use strict'; + +/*eslint-disable no-bitwise*/ + +var NodeBuffer; + +try { + // A trick for browserified version, to not include `Buffer` shim + var _require = require; + NodeBuffer = _require('buffer').Buffer; +} catch (__) {} + +var Type = require('../type'); + + +// [ 64, 65, 66 ] -> [ padding, CR, LF ] +var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r'; + + +function resolveYamlBinary(data) { + if (data === null) return false; + + var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP; + + // Convert one by one. + for (idx = 0; idx < max; idx++) { + code = map.indexOf(data.charAt(idx)); + + // Skip CR/LF + if (code > 64) continue; + + // Fail on illegal characters + if (code < 0) return false; + + bitlen += 6; + } + + // If there are any bits left, source was corrupted + return (bitlen % 8) === 0; +} + +function constructYamlBinary(data) { + var idx, tailbits, + input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan + max = input.length, + map = BASE64_MAP, + bits = 0, + result = []; + + // Collect by 6*4 bits (3 bytes) + + for (idx = 0; idx < max; idx++) { + if ((idx % 4 === 0) && idx) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } + + bits = (bits << 6) | map.indexOf(input.charAt(idx)); + } + + // Dump tail + + tailbits = (max % 4) * 6; + + if (tailbits === 0) { + result.push((bits >> 16) & 0xFF); + result.push((bits >> 8) & 0xFF); + result.push(bits & 0xFF); + } else if (tailbits === 18) { + result.push((bits >> 10) & 0xFF); + result.push((bits >> 2) & 0xFF); + } else if (tailbits === 12) { + result.push((bits >> 4) & 0xFF); + } + + // Wrap into Buffer for NodeJS and leave Array for browser + if (NodeBuffer) { + // Support node 6.+ Buffer API when available + return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result); + } + + return result; +} + +function representYamlBinary(object /*, style*/) { + var result = '', bits = 0, idx, tail, + max = object.length, + map = BASE64_MAP; + + // Convert every three bytes to 4 ASCII characters. + + for (idx = 0; idx < max; idx++) { + if ((idx % 3 === 0) && idx) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } + + bits = (bits << 8) + object[idx]; + } + + // Dump tail + + tail = max % 3; + + if (tail === 0) { + result += map[(bits >> 18) & 0x3F]; + result += map[(bits >> 12) & 0x3F]; + result += map[(bits >> 6) & 0x3F]; + result += map[bits & 0x3F]; + } else if (tail === 2) { + result += map[(bits >> 10) & 0x3F]; + result += map[(bits >> 4) & 0x3F]; + result += map[(bits << 2) & 0x3F]; + result += map[64]; + } else if (tail === 1) { + result += map[(bits >> 2) & 0x3F]; + result += map[(bits << 4) & 0x3F]; + result += map[64]; + result += map[64]; + } + + return result; +} + +function isBinary(object) { + return NodeBuffer && NodeBuffer.isBuffer(object); +} + +module.exports = new Type('tag:yaml.org,2002:binary', { + kind: 'scalar', + resolve: resolveYamlBinary, + construct: constructYamlBinary, + predicate: isBinary, + represent: representYamlBinary +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/bool.js b/node_modules/js-yaml/lib/js-yaml/type/bool.js new file mode 100644 index 00000000..cb774593 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/bool.js @@ -0,0 +1,35 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlBoolean(data) { + if (data === null) return false; + + var max = data.length; + + return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) || + (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE')); +} + +function constructYamlBoolean(data) { + return data === 'true' || + data === 'True' || + data === 'TRUE'; +} + +function isBoolean(object) { + return Object.prototype.toString.call(object) === '[object Boolean]'; +} + +module.exports = new Type('tag:yaml.org,2002:bool', { + kind: 'scalar', + resolve: resolveYamlBoolean, + construct: constructYamlBoolean, + predicate: isBoolean, + represent: { + lowercase: function (object) { return object ? 'true' : 'false'; }, + uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; }, + camelcase: function (object) { return object ? 'True' : 'False'; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/float.js b/node_modules/js-yaml/lib/js-yaml/type/float.js new file mode 100644 index 00000000..127671b2 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/float.js @@ -0,0 +1,116 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +var YAML_FLOAT_PATTERN = new RegExp( + // 2.5e4, 2.5 and integers + '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' + + // .2e4, .2 + // special case, seems not from spec + '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' + + // 20:59 + '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' + + // .inf + '|[-+]?\\.(?:inf|Inf|INF)' + + // .nan + '|\\.(?:nan|NaN|NAN))$'); + +function resolveYamlFloat(data) { + if (data === null) return false; + + if (!YAML_FLOAT_PATTERN.test(data) || + // Quick hack to not allow integers end with `_` + // Probably should update regexp & check speed + data[data.length - 1] === '_') { + return false; + } + + return true; +} + +function constructYamlFloat(data) { + var value, sign, base, digits; + + value = data.replace(/_/g, '').toLowerCase(); + sign = value[0] === '-' ? -1 : 1; + digits = []; + + if ('+-'.indexOf(value[0]) >= 0) { + value = value.slice(1); + } + + if (value === '.inf') { + return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY; + + } else if (value === '.nan') { + return NaN; + + } else if (value.indexOf(':') >= 0) { + value.split(':').forEach(function (v) { + digits.unshift(parseFloat(v, 10)); + }); + + value = 0.0; + base = 1; + + digits.forEach(function (d) { + value += d * base; + base *= 60; + }); + + return sign * value; + + } + return sign * parseFloat(value, 10); +} + + +var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/; + +function representYamlFloat(object, style) { + var res; + + if (isNaN(object)) { + switch (style) { + case 'lowercase': return '.nan'; + case 'uppercase': return '.NAN'; + case 'camelcase': return '.NaN'; + } + } else if (Number.POSITIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '.inf'; + case 'uppercase': return '.INF'; + case 'camelcase': return '.Inf'; + } + } else if (Number.NEGATIVE_INFINITY === object) { + switch (style) { + case 'lowercase': return '-.inf'; + case 'uppercase': return '-.INF'; + case 'camelcase': return '-.Inf'; + } + } else if (common.isNegativeZero(object)) { + return '-0.0'; + } + + res = object.toString(10); + + // JS stringifier can build scientific format without dots: 5e-100, + // while YAML requres dot: 5.e-100. Fix it with simple hack + + return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res; +} + +function isFloat(object) { + return (Object.prototype.toString.call(object) === '[object Number]') && + (object % 1 !== 0 || common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:float', { + kind: 'scalar', + resolve: resolveYamlFloat, + construct: constructYamlFloat, + predicate: isFloat, + represent: representYamlFloat, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/int.js b/node_modules/js-yaml/lib/js-yaml/type/int.js new file mode 100644 index 00000000..ba61c5f9 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/int.js @@ -0,0 +1,173 @@ +'use strict'; + +var common = require('../common'); +var Type = require('../type'); + +function isHexCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) || + ((0x41/* A */ <= c) && (c <= 0x46/* F */)) || + ((0x61/* a */ <= c) && (c <= 0x66/* f */)); +} + +function isOctCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */)); +} + +function isDecCode(c) { + return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)); +} + +function resolveYamlInteger(data) { + if (data === null) return false; + + var max = data.length, + index = 0, + hasDigits = false, + ch; + + if (!max) return false; + + ch = data[index]; + + // sign + if (ch === '-' || ch === '+') { + ch = data[++index]; + } + + if (ch === '0') { + // 0 + if (index + 1 === max) return true; + ch = data[++index]; + + // base 2, base 8, base 16 + + if (ch === 'b') { + // base 2 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch !== '0' && ch !== '1') return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + + if (ch === 'x') { + // base 16 + index++; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isHexCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 8 + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (!isOctCode(data.charCodeAt(index))) return false; + hasDigits = true; + } + return hasDigits && ch !== '_'; + } + + // base 10 (except 0) or base 60 + + // value should not start with `_`; + if (ch === '_') return false; + + for (; index < max; index++) { + ch = data[index]; + if (ch === '_') continue; + if (ch === ':') break; + if (!isDecCode(data.charCodeAt(index))) { + return false; + } + hasDigits = true; + } + + // Should have digits and should not end with `_` + if (!hasDigits || ch === '_') return false; + + // if !base60 - done; + if (ch !== ':') return true; + + // base60 almost not used, no needs to optimize + return /^(:[0-5]?[0-9])+$/.test(data.slice(index)); +} + +function constructYamlInteger(data) { + var value = data, sign = 1, ch, base, digits = []; + + if (value.indexOf('_') !== -1) { + value = value.replace(/_/g, ''); + } + + ch = value[0]; + + if (ch === '-' || ch === '+') { + if (ch === '-') sign = -1; + value = value.slice(1); + ch = value[0]; + } + + if (value === '0') return 0; + + if (ch === '0') { + if (value[1] === 'b') return sign * parseInt(value.slice(2), 2); + if (value[1] === 'x') return sign * parseInt(value, 16); + return sign * parseInt(value, 8); + } + + if (value.indexOf(':') !== -1) { + value.split(':').forEach(function (v) { + digits.unshift(parseInt(v, 10)); + }); + + value = 0; + base = 1; + + digits.forEach(function (d) { + value += (d * base); + base *= 60; + }); + + return sign * value; + + } + + return sign * parseInt(value, 10); +} + +function isInteger(object) { + return (Object.prototype.toString.call(object)) === '[object Number]' && + (object % 1 === 0 && !common.isNegativeZero(object)); +} + +module.exports = new Type('tag:yaml.org,2002:int', { + kind: 'scalar', + resolve: resolveYamlInteger, + construct: constructYamlInteger, + predicate: isInteger, + represent: { + binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); }, + octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); }, + decimal: function (obj) { return obj.toString(10); }, + /* eslint-disable max-len */ + hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); } + }, + defaultStyle: 'decimal', + styleAliases: { + binary: [ 2, 'bin' ], + octal: [ 8, 'oct' ], + decimal: [ 10, 'dec' ], + hexadecimal: [ 16, 'hex' ] + } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/function.js b/node_modules/js-yaml/lib/js-yaml/type/js/function.js new file mode 100644 index 00000000..8fab8c43 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/js/function.js @@ -0,0 +1,93 @@ +'use strict'; + +var esprima; + +// Browserified version does not have esprima +// +// 1. For node.js just require module as deps +// 2. For browser try to require mudule via external AMD system. +// If not found - try to fallback to window.esprima. If not +// found too - then fail to parse. +// +try { + // workaround to exclude package from browserify list. + var _require = require; + esprima = _require('esprima'); +} catch (_) { + /* eslint-disable no-redeclare */ + /* global window */ + if (typeof window !== 'undefined') esprima = window.esprima; +} + +var Type = require('../../type'); + +function resolveJavascriptFunction(data) { + if (data === null) return false; + + try { + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }); + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + return false; + } + + return true; + } catch (err) { + return false; + } +} + +function constructJavascriptFunction(data) { + /*jslint evil:true*/ + + var source = '(' + data + ')', + ast = esprima.parse(source, { range: true }), + params = [], + body; + + if (ast.type !== 'Program' || + ast.body.length !== 1 || + ast.body[0].type !== 'ExpressionStatement' || + (ast.body[0].expression.type !== 'ArrowFunctionExpression' && + ast.body[0].expression.type !== 'FunctionExpression')) { + throw new Error('Failed to resolve function'); + } + + ast.body[0].expression.params.forEach(function (param) { + params.push(param.name); + }); + + body = ast.body[0].expression.body.range; + + // Esprima's ranges include the first '{' and the last '}' characters on + // function expressions. So cut them out. + if (ast.body[0].expression.body.type === 'BlockStatement') { + /*eslint-disable no-new-func*/ + return new Function(params, source.slice(body[0] + 1, body[1] - 1)); + } + // ES6 arrow functions can omit the BlockStatement. In that case, just return + // the body. + /*eslint-disable no-new-func*/ + return new Function(params, 'return ' + source.slice(body[0], body[1])); +} + +function representJavascriptFunction(object /*, style*/) { + return object.toString(); +} + +function isFunction(object) { + return Object.prototype.toString.call(object) === '[object Function]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/function', { + kind: 'scalar', + resolve: resolveJavascriptFunction, + construct: constructJavascriptFunction, + predicate: isFunction, + represent: representJavascriptFunction +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js b/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js new file mode 100644 index 00000000..43fa4701 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js @@ -0,0 +1,60 @@ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptRegExp(data) { + if (data === null) return false; + if (data.length === 0) return false; + + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // if regexp starts with '/' it can have modifiers and must be properly closed + // `/foo/gim` - modifiers tail can be maximum 3 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + + if (modifiers.length > 3) return false; + // if expression starts with /, is should be properly terminated + if (regexp[regexp.length - modifiers.length - 1] !== '/') return false; + } + + return true; +} + +function constructJavascriptRegExp(data) { + var regexp = data, + tail = /\/([gim]*)$/.exec(data), + modifiers = ''; + + // `/foo/gim` - tail can be maximum 4 chars + if (regexp[0] === '/') { + if (tail) modifiers = tail[1]; + regexp = regexp.slice(1, regexp.length - modifiers.length - 1); + } + + return new RegExp(regexp, modifiers); +} + +function representJavascriptRegExp(object /*, style*/) { + var result = '/' + object.source + '/'; + + if (object.global) result += 'g'; + if (object.multiline) result += 'm'; + if (object.ignoreCase) result += 'i'; + + return result; +} + +function isRegExp(object) { + return Object.prototype.toString.call(object) === '[object RegExp]'; +} + +module.exports = new Type('tag:yaml.org,2002:js/regexp', { + kind: 'scalar', + resolve: resolveJavascriptRegExp, + construct: constructJavascriptRegExp, + predicate: isRegExp, + represent: representJavascriptRegExp +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js b/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js new file mode 100644 index 00000000..95b5569f --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js @@ -0,0 +1,28 @@ +'use strict'; + +var Type = require('../../type'); + +function resolveJavascriptUndefined() { + return true; +} + +function constructJavascriptUndefined() { + /*eslint-disable no-undefined*/ + return undefined; +} + +function representJavascriptUndefined() { + return ''; +} + +function isUndefined(object) { + return typeof object === 'undefined'; +} + +module.exports = new Type('tag:yaml.org,2002:js/undefined', { + kind: 'scalar', + resolve: resolveJavascriptUndefined, + construct: constructJavascriptUndefined, + predicate: isUndefined, + represent: representJavascriptUndefined +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/map.js b/node_modules/js-yaml/lib/js-yaml/type/map.js new file mode 100644 index 00000000..f327beeb --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/map.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:map', { + kind: 'mapping', + construct: function (data) { return data !== null ? data : {}; } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/merge.js b/node_modules/js-yaml/lib/js-yaml/type/merge.js new file mode 100644 index 00000000..ae08a864 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/merge.js @@ -0,0 +1,12 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlMerge(data) { + return data === '<<' || data === null; +} + +module.exports = new Type('tag:yaml.org,2002:merge', { + kind: 'scalar', + resolve: resolveYamlMerge +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/null.js b/node_modules/js-yaml/lib/js-yaml/type/null.js new file mode 100644 index 00000000..6874daa6 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/null.js @@ -0,0 +1,34 @@ +'use strict'; + +var Type = require('../type'); + +function resolveYamlNull(data) { + if (data === null) return true; + + var max = data.length; + + return (max === 1 && data === '~') || + (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL')); +} + +function constructYamlNull() { + return null; +} + +function isNull(object) { + return object === null; +} + +module.exports = new Type('tag:yaml.org,2002:null', { + kind: 'scalar', + resolve: resolveYamlNull, + construct: constructYamlNull, + predicate: isNull, + represent: { + canonical: function () { return '~'; }, + lowercase: function () { return 'null'; }, + uppercase: function () { return 'NULL'; }, + camelcase: function () { return 'Null'; } + }, + defaultStyle: 'lowercase' +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/omap.js b/node_modules/js-yaml/lib/js-yaml/type/omap.js new file mode 100644 index 00000000..b2b5323b --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/omap.js @@ -0,0 +1,44 @@ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; +var _toString = Object.prototype.toString; + +function resolveYamlOmap(data) { + if (data === null) return true; + + var objectKeys = [], index, length, pair, pairKey, pairHasKey, + object = data; + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + pairHasKey = false; + + if (_toString.call(pair) !== '[object Object]') return false; + + for (pairKey in pair) { + if (_hasOwnProperty.call(pair, pairKey)) { + if (!pairHasKey) pairHasKey = true; + else return false; + } + } + + if (!pairHasKey) return false; + + if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey); + else return false; + } + + return true; +} + +function constructYamlOmap(data) { + return data !== null ? data : []; +} + +module.exports = new Type('tag:yaml.org,2002:omap', { + kind: 'sequence', + resolve: resolveYamlOmap, + construct: constructYamlOmap +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/pairs.js b/node_modules/js-yaml/lib/js-yaml/type/pairs.js new file mode 100644 index 00000000..74b52403 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/pairs.js @@ -0,0 +1,53 @@ +'use strict'; + +var Type = require('../type'); + +var _toString = Object.prototype.toString; + +function resolveYamlPairs(data) { + if (data === null) return true; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + if (_toString.call(pair) !== '[object Object]') return false; + + keys = Object.keys(pair); + + if (keys.length !== 1) return false; + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return true; +} + +function constructYamlPairs(data) { + if (data === null) return []; + + var index, length, pair, keys, result, + object = data; + + result = new Array(object.length); + + for (index = 0, length = object.length; index < length; index += 1) { + pair = object[index]; + + keys = Object.keys(pair); + + result[index] = [ keys[0], pair[keys[0]] ]; + } + + return result; +} + +module.exports = new Type('tag:yaml.org,2002:pairs', { + kind: 'sequence', + resolve: resolveYamlPairs, + construct: constructYamlPairs +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/seq.js b/node_modules/js-yaml/lib/js-yaml/type/seq.js new file mode 100644 index 00000000..be8f77f2 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/seq.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:seq', { + kind: 'sequence', + construct: function (data) { return data !== null ? data : []; } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/set.js b/node_modules/js-yaml/lib/js-yaml/type/set.js new file mode 100644 index 00000000..f885a329 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/set.js @@ -0,0 +1,29 @@ +'use strict'; + +var Type = require('../type'); + +var _hasOwnProperty = Object.prototype.hasOwnProperty; + +function resolveYamlSet(data) { + if (data === null) return true; + + var key, object = data; + + for (key in object) { + if (_hasOwnProperty.call(object, key)) { + if (object[key] !== null) return false; + } + } + + return true; +} + +function constructYamlSet(data) { + return data !== null ? data : {}; +} + +module.exports = new Type('tag:yaml.org,2002:set', { + kind: 'mapping', + resolve: resolveYamlSet, + construct: constructYamlSet +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/str.js b/node_modules/js-yaml/lib/js-yaml/type/str.js new file mode 100644 index 00000000..27acc106 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/str.js @@ -0,0 +1,8 @@ +'use strict'; + +var Type = require('../type'); + +module.exports = new Type('tag:yaml.org,2002:str', { + kind: 'scalar', + construct: function (data) { return data !== null ? data : ''; } +}); diff --git a/node_modules/js-yaml/lib/js-yaml/type/timestamp.js b/node_modules/js-yaml/lib/js-yaml/type/timestamp.js new file mode 100644 index 00000000..8fa9c586 --- /dev/null +++ b/node_modules/js-yaml/lib/js-yaml/type/timestamp.js @@ -0,0 +1,88 @@ +'use strict'; + +var Type = require('../type'); + +var YAML_DATE_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9])' + // [2] month + '-([0-9][0-9])$'); // [3] day + +var YAML_TIMESTAMP_REGEXP = new RegExp( + '^([0-9][0-9][0-9][0-9])' + // [1] year + '-([0-9][0-9]?)' + // [2] month + '-([0-9][0-9]?)' + // [3] day + '(?:[Tt]|[ \\t]+)' + // ... + '([0-9][0-9]?)' + // [4] hour + ':([0-9][0-9])' + // [5] minute + ':([0-9][0-9])' + // [6] second + '(?:\\.([0-9]*))?' + // [7] fraction + '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour + '(?::([0-9][0-9]))?))?$'); // [11] tz_minute + +function resolveYamlTimestamp(data) { + if (data === null) return false; + if (YAML_DATE_REGEXP.exec(data) !== null) return true; + if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true; + return false; +} + +function constructYamlTimestamp(data) { + var match, year, month, day, hour, minute, second, fraction = 0, + delta = null, tz_hour, tz_minute, date; + + match = YAML_DATE_REGEXP.exec(data); + if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data); + + if (match === null) throw new Error('Date resolve error'); + + // match: [1] year [2] month [3] day + + year = +(match[1]); + month = +(match[2]) - 1; // JS month starts with 0 + day = +(match[3]); + + if (!match[4]) { // no hour + return new Date(Date.UTC(year, month, day)); + } + + // match: [4] hour [5] minute [6] second [7] fraction + + hour = +(match[4]); + minute = +(match[5]); + second = +(match[6]); + + if (match[7]) { + fraction = match[7].slice(0, 3); + while (fraction.length < 3) { // milli-seconds + fraction += '0'; + } + fraction = +fraction; + } + + // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute + + if (match[9]) { + tz_hour = +(match[10]); + tz_minute = +(match[11] || 0); + delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds + if (match[9] === '-') delta = -delta; + } + + date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction)); + + if (delta) date.setTime(date.getTime() - delta); + + return date; +} + +function representYamlTimestamp(object /*, style*/) { + return object.toISOString(); +} + +module.exports = new Type('tag:yaml.org,2002:timestamp', { + kind: 'scalar', + resolve: resolveYamlTimestamp, + construct: constructYamlTimestamp, + instanceOf: Date, + represent: representYamlTimestamp +}); diff --git a/node_modules/js-yaml/package.json b/node_modules/js-yaml/package.json new file mode 100644 index 00000000..0d236676 --- /dev/null +++ b/node_modules/js-yaml/package.json @@ -0,0 +1,49 @@ +{ + "name": "js-yaml", + "version": "3.14.1", + "description": "YAML 1.2 parser and serializer", + "keywords": [ + "yaml", + "parser", + "serializer", + "pyyaml" + ], + "homepage": "https://github.com/nodeca/js-yaml", + "author": "Vladimir Zapparov ", + "contributors": [ + "Aleksey V Zapparov (http://www.ixti.net/)", + "Vitaly Puzrin (https://github.com/puzrin)", + "Martin Grenfell (http://got-ravings.blogspot.com)" + ], + "license": "MIT", + "repository": "nodeca/js-yaml", + "files": [ + "index.js", + "lib/", + "bin/", + "dist/" + ], + "bin": { + "js-yaml": "bin/js-yaml.js" + }, + "unpkg": "dist/js-yaml.min.js", + "jsdelivr": "dist/js-yaml.min.js", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "devDependencies": { + "ansi": "^0.3.1", + "benchmark": "^2.1.4", + "browserify": "^16.2.2", + "codemirror": "^5.13.4", + "eslint": "^7.0.0", + "fast-check": "^1.24.2", + "istanbul": "^0.4.5", + "mocha": "^7.1.2", + "uglify-js": "^3.0.1" + }, + "scripts": { + "test": "make test" + } +} diff --git a/node_modules/jsesc/LICENSE-MIT.txt b/node_modules/jsesc/LICENSE-MIT.txt new file mode 100644 index 00000000..a41e0a7e --- /dev/null +++ b/node_modules/jsesc/LICENSE-MIT.txt @@ -0,0 +1,20 @@ +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/jsesc/README.md b/node_modules/jsesc/README.md new file mode 100644 index 00000000..aae2b13a --- /dev/null +++ b/node_modules/jsesc/README.md @@ -0,0 +1,421 @@ +# jsesc [![Build status](https://travis-ci.org/mathiasbynens/jsesc.svg?branch=master)](https://travis-ci.org/mathiasbynens/jsesc) [![Code coverage status](https://coveralls.io/repos/mathiasbynens/jsesc/badge.svg)](https://coveralls.io/r/mathiasbynens/jsesc) [![Dependency status](https://gemnasium.com/mathiasbynens/jsesc.svg)](https://gemnasium.com/mathiasbynens/jsesc) + +Given some data, _jsesc_ returns a stringified representation of that data. jsesc is similar to `JSON.stringify()` except: + +1. it outputs JavaScript instead of JSON [by default](#json), enabling support for data structures like ES6 maps and sets; +2. it offers [many options](#api) to customize the output; +3. its output is ASCII-safe [by default](#minimal), thanks to its use of [escape sequences](https://mathiasbynens.be/notes/javascript-escapes) where needed. + +For any input, jsesc generates the shortest possible valid printable-ASCII-only output. [Here’s an online demo.](https://mothereff.in/js-escapes) + +jsesc’s output can be used instead of `JSON.stringify`’s to avoid [mojibake](https://en.wikipedia.org/wiki/Mojibake) and other encoding issues, or even to [avoid errors](https://twitter.com/annevk/status/380000829643571200) when passing JSON-formatted data (which may contain U+2028 LINE SEPARATOR, U+2029 PARAGRAPH SEPARATOR, or [lone surrogates](https://esdiscuss.org/topic/code-points-vs-unicode-scalar-values#content-14)) to a JavaScript parser or an UTF-8 encoder. + +## Installation + +Via [npm](https://www.npmjs.com/): + +```bash +npm install jsesc +``` + +In [Node.js](https://nodejs.org/): + +```js +const jsesc = require('jsesc'); +``` + +## API + +### `jsesc(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 JavaScript strings](https://mathiasbynens.be/notes/javascript-escapes). The first supported value type is strings: + +```js +jsesc('Ich ♥ Bücher'); +// → 'Ich \\u2665 B\\xFCcher' + +jsesc('foo 𝌆 bar'); +// → 'foo \\uD834\\uDF06 bar' +``` + +Instead of a string, the `value` can also be an array, an object, a map, a set, or a buffer. In such cases, `jsesc` returns a stringified version of the value where any characters that are not printable ASCII symbols are escaped in the same way. + +```js +// Escaping an array +jsesc([ + 'Ich ♥ Bücher', 'foo 𝌆 bar' +]); +// → '[\'Ich \\u2665 B\\xFCcher\',\'foo \\uD834\\uDF06 bar\']' + +// Escaping an object +jsesc({ + 'Ich ♥ Bücher': 'foo 𝌆 bar' +}); +// → '{\'Ich \\u2665 B\\xFCcher\':\'foo \\uD834\\uDF06 bar\'}' +``` + +The optional `options` argument accepts an object with the following options: + +#### `quotes` + +The default value for the `quotes` option is `'single'`. This means that any occurrences of `'` in the input string are escaped as `\'`, so that the output can be used in a string literal wrapped in single quotes. + +```js +jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.'); +// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.' + +jsesc('`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 string literal wrapped in double quotes, set the `quotes` option to `'double'`. + +```js +jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'double' +}); +// → '`Lorem` ipsum \\"dolor\\" sit \'amet\' etc.' +// → "`Lorem` ipsum \\\"dolor\\\" sit 'amet' etc." +``` + +If you want to use the output as part of a template literal (i.e. wrapped in backticks), set the `quotes` option to `'backtick'`. + +```js +jsesc('`Lorem` ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'backtick' +}); +// → '\\`Lorem\\` ipsum "dolor" sit \'amet\' etc.' +// → "\\`Lorem\\` ipsum \"dolor\" sit 'amet' etc." +// → `\\\`Lorem\\\` ipsum "dolor" sit 'amet' etc.` +``` + +This setting also affects the output for arrays and objects: + +```js +jsesc({ 'Ich ♥ Bücher': 'foo 𝌆 bar' }, { + 'quotes': 'double' +}); +// → '{"Ich \\u2665 B\\xFCcher":"foo \\uD834\\uDF06 bar"}' + +jsesc([ 'Ich ♥ Bücher', 'foo 𝌆 bar' ], { + 'quotes': 'double' +}); +// → '["Ich \\u2665 B\\xFCcher","foo \\uD834\\uDF06 bar"]' +``` + +#### `numbers` + +The default value for the `numbers` option is `'decimal'`. This means that any numeric values are represented using decimal integer literals. Other valid options are `binary`, `octal`, and `hexadecimal`, which result in binary integer literals, octal integer literals, and hexadecimal integer literals, respectively. + +```js +jsesc(42, { + 'numbers': 'binary' +}); +// → '0b101010' + +jsesc(42, { + 'numbers': 'octal' +}); +// → '0o52' + +jsesc(42, { + 'numbers': 'decimal' +}); +// → '42' + +jsesc(42, { + 'numbers': 'hexadecimal' +}); +// → '0x2A' +``` + +#### `wrap` + +The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting. + +```js +jsesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'single', + 'wrap': true +}); +// → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\'' +// → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'" + +jsesc('Lorem ipsum "dolor" sit \'amet\' etc.', { + 'quotes': 'double', + 'wrap': true +}); +// → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."' +// → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\"" +``` + +#### `es6` + +The `es6` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, any astral Unicode symbols in the input are escaped using [ECMAScript 6 Unicode code point escape sequences](https://mathiasbynens.be/notes/javascript-escapes#unicode-code-point) instead of using separate escape sequences for each surrogate half. If backwards compatibility with ES5 environments is a concern, don’t enable this setting. If the `json` setting is enabled, the value for the `es6` setting is ignored (as if it was `false`). + +```js +// By default, the `es6` option is disabled: +jsesc('foo 𝌆 bar 💩 baz'); +// → 'foo \\uD834\\uDF06 bar \\uD83D\\uDCA9 baz' + +// To explicitly disable it: +jsesc('foo 𝌆 bar 💩 baz', { + 'es6': false +}); +// → 'foo \\uD834\\uDF06 bar \\uD83D\\uDCA9 baz' + +// To enable it: +jsesc('foo 𝌆 bar 💩 baz', { + 'es6': true +}); +// → 'foo \\u{1D306} bar \\u{1F4A9} baz' +``` + +#### `escapeEverything` + +The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output are escaped — even printable ASCII symbols. + +```js +jsesc('lolwat"foo\'bar', { + 'escapeEverything': true +}); +// → '\\x6C\\x6F\\x6C\\x77\\x61\\x74\\"\\x66\\x6F\\x6F\\\'\\x62\\x61\\x72' +// → "\\x6C\\x6F\\x6C\\x77\\x61\\x74\\\"\\x66\\x6F\\x6F\\'\\x62\\x61\\x72" +``` + +This setting also affects the output for string literals within arrays and objects. + +#### `minimal` + +The `minimal` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, only a limited set of symbols in the output are escaped: + +* U+0000 `\0` +* U+0008 `\b` +* U+0009 `\t` +* U+000A `\n` +* U+000C `\f` +* U+000D `\r` +* U+005C `\\` +* U+2028 `\u2028` +* U+2029 `\u2029` +* whatever symbol is being used for wrapping string literals (based on [the `quotes` option](#quotes)) + +Note: with this option enabled, jsesc output is no longer guaranteed to be ASCII-safe. + +```js +jsesc('foo\u2029bar\nbaz©qux𝌆flops', { + 'minimal': false +}); +// → 'foo\\u2029bar\\nbaz©qux𝌆flops' +``` + +#### `isScriptContext` + +The `isScriptContext` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, occurrences of [`` or `